app/views/storytime/dashboard/posts/_form.html.erb in storytime-0.0.1 vs app/views/storytime/dashboard/posts/_form.html.erb in storytime-0.0.2
- old
+ new
@@ -1,20 +1,29 @@
<%= simple_form_for [:dashboard, @post] do |f| %>
<%= f.error_notification %>
<%= f.input :title, autofocus: true %>
+ <%= f.input :post_type_id, as: :hidden %>
<%= f.input :excerpt %>
<%= f.input :draft_content, as: :text, input_html: { rows: 20, class: "wysiwyg" }, label: "Content" %>
+
+ <%= f.input :featured_media_id, as: :hidden, input_html: { id: "featured_media_id" } %>
+ <%= link_to "Select Featured Image", "#", class: "btn btn-default", id: "featured_media_button" %>
+ <div id="featured_media_container">
+ <%= image_tag @post.featured_media.file_url(:thumb), id: "featured_media_image" if @post.featured_media %>
+ </div>
+
<%= f.input :tag_list %>
+
<% if Pundit.policy(current_user, @post).publish? %>
<div class="checkbox">
<label>
<%= f.check_box :published %> <strong>Published</strong>
</label>
</div>
<% end %>
<div class="actions">
- <%= f.submit class: "btn btn-primary" %>
+ <%= f.submit (@post.new_record? ? "Create #{current_post_type.name.humanize}" : "Update #{current_post_type.name.humanize}"), class: "btn btn-primary" %>
</div>
<% end %>
<%= render "storytime/dashboard/media/modal" %>
\ No newline at end of file