app/views/manifest/content_blocks/_form.html.erb in manifest-rails-0.0.4 vs app/views/manifest/content_blocks/_form.html.erb in manifest-rails-0.1.0
- old
+ new
@@ -1,40 +1,38 @@
<% if @content_block.errors.any? %>
- <div class='errors'>
- <h6>This from could not be submitted:</h6>
+ <div class='form-errors'>
+ <h3>Whoops!</h3>
+
+ <p>Please correct the following errors:</p>
+
<ul>
<% @content_block.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
- </div>
+ </div><!-- form-errors -->
<% end %>
-<%= form_for [:manifest, @content_block] do |f| %>
+<%= form_for [:manifest, @content_block], builder: Manifest::LabelledFormBuilder do |f| %>
<% if current_editor.admin? %>
- <div class='field'>
- <%= f.label :title %>
- <%= f.text_field :title %>
- </div>
+ <%= f.text_field :title %>
+ <% else %>
+ <p><strong>Title:</strong> <%= @content_block.title %></p>
+ <% end %>
- <div class='field inline-label'>
- <%= f.label :page_id %>
- <%= f.select :page_id, Page.all.collect { |p| [p.title, p.id] }, :include_blank => true %>
- </div>
+ <% if current_editor.admin? %>
+ <%= f.collection_select :page_id, Page.all, :id, :title %>
+ <% else %>
+ <p><strong>Page:</strong> <%= @content_block.page ? @content_block.page.title : 'No page' %></p>
+ <% end %>
- <div class='field inline-label'>
- <%= f.label :allow_html, 'Allow HTML' %>
- <%= f.check_box :allow_html %>
- </div>
+ <% if current_editor.admin? %>
+ <%= f.check_box :allow_html %>
<% end %>
- <div class='field'>
- <%= f.label :content %>
- <% if @content_block.allow_html %>
- <%= f.text_area :content, :class => 'tinymce' %>
- <% else %>
- <%= f.text_area :content %>
- <% end %>
- </div>
-
- <div class='actions'><%= f.submit %></div>
+ <% if @content_block.allow_html? %>
+ <%= f.text_area :content, class: 'tinymce' %>
+ <% else %>
+ <%= f.text_area :content %>
+ <% end %>
+ <%= f.submit %>
<% end %>