Sha256: ab17bd7dc603347c69fd004312feb28cfe4150dd10b6d1bca296d927b36c54c2

Contents?: true

Size: 1.48 KB

Versions: 11

Compression:

Stored size: 1.48 KB

Contents

<%#
  # Renders a single file field for a given attachment.
  # method - The field name
  #
  # This loops over the attachments array for a given block in order to create a nested_hash. This allows multiple attachments to be created at once
  # However, since content_types can have multiple attachments, we only want to render once for eatch attachment, regardless of how many times
  # cms_file_field gets called.
%>
<%= f.fields_for :attachments do |a| %>
    <% if a.object.attachment_name == method.to_s %>
        <%= a.hidden_field :attachment_name, :value => method.to_s %>
        <div class="fields file_fields">
            <%= a.cms_label :data, cms_options[:label] %>
            <div id="<%= object_name %>_<%= method %>_div" class="file_inputs">
                <%= a.file_field :data, options.merge('data-purpose'=>"cms_file_field") %>
            </div>
            <%= a.cms_instructions cms_options[:instructions] %>
        </div>
        <% if options[:edit_section] %>
            <%= render :partial=>'cms/file_blocks/section_selector' %>
            <%= a.cms_drop_down :section_id, @sections.map {|s| [s.full_path, s.id]}, {:label => "Section"}, {'data-purpose'=>"section_selector"} %>
        <% end %>
        <% if options[:edit_path] %>
            <% suggest_file_path =  model_object.new_record? ? "suggest_file_path" : "keep_existing_path" %>
            <%= a.cms_text_field :data_file_path, :label => "Path", :class=>suggest_file_path  %>
        <% end %>
    <% end %>
<% end %>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
browsercms-3.5.7 app/views/cms/form_builder/_cms_file_field.html.erb
browsercms-3.5.6 app/views/cms/form_builder/_cms_file_field.html.erb
browsercms-3.5.5 app/views/cms/form_builder/_cms_file_field.html.erb
browsercms-3.5.4 app/views/cms/form_builder/_cms_file_field.html.erb
browsercms-3.5.3 app/views/cms/form_builder/_cms_file_field.html.erb
browsercms-3.5.2 app/views/cms/form_builder/_cms_file_field.html.erb
browsercms-3.5.1 app/views/cms/form_builder/_cms_file_field.html.erb
browsercms-3.5.0 app/views/cms/form_builder/_cms_file_field.html.erb
browsercms-3.5.0.rc3 app/views/cms/form_builder/_cms_file_field.html.erb
browsercms-3.5.0.rc2 app/views/cms/form_builder/_cms_file_field.html.erb
browsercms-3.5.0.rc1 app/views/cms/form_builder/_cms_file_field.html.erb