Sha256: c57b1265024cf9746c1268c628b178988be7d4c33b4894b424a6d2a51a806844

Contents?: true

Size: 1.84 KB

Versions: 11

Compression:

Stored size: 1.84 KB

Contents

<%% content_for :body do %>
  <div class='<%= plural_name %>'>
    <%%=raw @page.content_for(Refinery::Pages.default_parts.first.to_sym) %>

    <%%= form_for [refinery, :<%= namespacing.underscore %>, @<%= singular_name %>] do |f| %>
      <%%= render '/refinery/admin/error_messages',
                 :object => @<%= singular_name %>,
                 :include_object_name => true  %>
<% string_fields = string_attributes.map(&:name) -%>
<% attributes.each do |attribute| %>
      <div class='field <%= attribute.name %>_field <%= attribute.type %>_field'>
        <%%= f.<%= 'required_' if string_fields.any? && attribute.name == string_fields.first %>label :<%= attribute.name %> %>
<% case attribute.type
   when :string -%>
        <%%= f.text_field :<%= attribute.name %> %>
<% when :text -%>
        <%%= f.text_area :<%= attribute.name %>, :rows => 8 %>
<% when :radio -%>
        <%% Refinery::<%= namespacing %>::<%= class_name %>::<%= attribute.name.pluralize.upcase %>.each do |value, name| %>
          <%%= f.radio_button :<%= attribute.name %>, (name || value), :value => value %>
          <%%= f.label :"<%= attribute.name %>_#{(name || value)}", value.humanize %>
        <%% end %>
<% when :checkbox -%>
        <%%= f.check_box :<%= attribute.name %> %>
<% when :select -%>
        <%%= f.select :<%= attribute.name %>, Refinery::<%= namespacing %>::<%= class_name %>::<%= attribute.name.pluralize.upcase %>,
                      :include_blank => true %>
<% when :datetime -%>
        <%%= f.datetime_select :<%= attribute.name %> %>
<% when :date -%>
        <%%= f.date_select :<%= attribute.name %> %>
<% when :time -%>
        <%%= f.time_select :<%= attribute.name %> %>
<% end -%>
      </div>
<% end %>
      <div class='actions'>
        <%%= f.submit t('.send') %>
      </div>
    <%% end %>
  </div>
<%% end %>
<%%= render '/refinery/content_page' %>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
refinerycms-core-2.1.5 lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb
refinerycms-core-2.1.4 lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb
refinerycms-core-2.1.3 lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb
refinerycms-core-2.1.2 lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb
refinerycms-core-2.1.1 lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb
refinerycms-core-2.1.0 lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb
refinerycms-core-2.0.10 lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb
refinerycms-core-2.0.9 lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb
refinerycms-core-2.0.8 lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb
refinerycms-core-2.0.7 lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb
refinerycms-core-2.0.6 lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb