Sha256: 3ad313753ca3d41c799c613f0dfe8b461ec283232a1b9799efabee7b3f534d77

Contents?: true

Size: 1.9 KB

Versions: 1

Compression:

Stored size: 1.9 KB

Contents

<% boolean_fieds = [] %>
<%= simple_form_for Settings, url: settings_path, html: {method: :put, multipart: true} do |f| -%>
  <div class="post-edit-holder">
    <div class="wysiwyg-holder">
      <% Hash[@settings.sort].each do |key, value| -%>
        <div class="padder">
          <% if key.to_s == "ga_script" %>
            <%= f.input key, as: :text, input_html: { rows: 8 } %>
          <% elsif key.to_s == "ga_file" %>
            <%= uploader_field_tag :structure, :attachment_file, object: Structure.first %>
          <% elsif key.to_s =~ /country_codes/ %>
            <%= f.input key, as: :select, collection: TranslationCms::Country.all.map { |c| [c.title, c.alpha2.downcase] }, input_html: { multiple: true, style: 'width: 100%;' }, required: false %>
          <% elsif key.to_s == "discount_offer_content" %>
            <%= f.input key, as: :text, input_html: { rows: 2 } %>
          <% elsif key.to_s =~ /_page_id/ %>
            <%= f.label key, style: 'display:inline-block;' %>
            <%#= f.select key, options_from_collection_for_select(Structure.with_position(PositionType.bottom), :id, :title, value.to_i) %>
            <%= f.input key, value: value, required: false, label: false %>
          <% elsif (key.to_s =~ /^(is_|enable_)/) || boolean_fieds.include?(key.to_s) %>
            <%= f.label key, style: 'display:inline-block;' %>
            <%= f.select key, options_for_select({Disabled: 'false', Enabled: 'true'}, (value || false).to_s) %>
          <% elsif key.to_s == "robots_txt" %>
            <%= f.input key, as: :text, input_html: { rows: 8 } %>
          <% else %>
            <%= f.input key, value: value, required: false %>
          <% end %>
        </div>
      <% end -%>
    </div>
  </div>
  <%= f.button :submit, style: "display:none;", id: "submit-button-hidden" %>
<% end -%>
<script type="text/javascript">
  $('label + select').select2({minimumResultsForSearch: -1})
</script>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
translation_cms-0.1.5 app/views/sunrise/settings/_form.html.erb