danielweinmann/unlock

View on GitHub
app/views/initiatives/gateways/edit.html.slim

Summary

Maintainability
Test Coverage
- content_for :title do
  = "#{@gateway.name} ยท #{Gateway.human_attribute_name(:settings)}"
= form_for @gateway, url: initiative_gateway_path(@initiative.id, @gateway), method: :put, html: { autocomplete: 'off' } do |form|
  = render partial: 'error_explanation', locals: { resource: @gateway }
  = flag_list 32 do
      = flag(locale_country(I18n.locale, true), :title => t("languages.#{I18n.locale}"))
  = form.label :title
  = form.text_field :title, value: @gateway.title, class: "has_em"
  em= t('.title', gateway: @gateway.name)
  = flag_list 32 do
      = flag(locale_country(I18n.locale, true), :title => t("languages.#{I18n.locale}"))
  = form.label :ordering
  = form.text_field :ordering, value: @gateway.ordering, class: "has_em"
  em= t('.ordering')
  = form.fields_for :settings do |settings|
    - @gateway.available_settings.each do |setting|
      = settings.label setting.key, setting.title
      = settings.text_field setting.key, value: (@gateway.settings[setting.key.to_s] if @gateway.settings), class: "has_em"
      em== setting.description
  .submit= form.submit t('helpers.submit.submit', model: nil)