%h1= t 'qbrick.cms.settings.index.title' - if @casted_settings && @casted_settings[:errors].any? .alert.alert-danger= t('settings.index.settings_include_errors') = form_tag qbrick.update_all_cms_settings_path, method: :put, class: 'form' do %table.table.table-striped %thead %tr %th= t('settings.index.description') %th= t('settings.index.value') %tbody - @settings.each do |name, value| - next if name == :errors %tr{ data: { name: name } } %td= I18n.t("settings.attributes.#{name}.name") %td.setting-value - setting_with_error = @casted_settings && @casted_settings[:errors].include?(name) %div{ class: "form-group #{ setting_with_error ? 'has-error' : ''}" } = setting_field(name, value, @settings) - if setting_with_error %span.help-block= @casted_settings[:errors][name] = submit_tag t('settings.index.save_all'), class: 'btn btn-primary btn-lg'