denny/ShinyCMS-ruby

View on GitHub
plugins/ShinyBlog/app/views/shiny_blog/admin/blog_posts/edit.html.erb

Summary

Maintainability
Test Coverage
<%= form_for @post, url: shiny_blog.blog_post_path( @post ), method: :put do |f| %>
  <p>
    <%= f.label :title %><br>
    <%= f.text_field :title %>
  </p>
  <p>
    <%= f.label :slug %><br>
    <%= f.text_field :slug %>
  </p>
  <p>
    <%= f.label :tag_list, 'Tags' %><br>
    <%= f.text_field :tag_list, value: admin_tag_list( @post ) %>
  </p>
  <% if current_user.can? :change_author, :blog_posts %>
  <p>
    <%= f.label :user_id, 'Author' %><br>
    <%= f.select :user_id, users_that_can_for_menu( :edit, :blog_posts ) %>
  </p>
  <% else %>
  <%= f.hidden_field :user_id, value: current_user.id %>
  <% end %>
  <p>
    <%= f.label :posted_at %><br>
    <%= f.date_field :posted_at %> <%= f.time_field :posted_at_time %>
  </p>
  <p>
    <%= f.label :body %><br>
    <%= f.cktext_area :body, ckeditor: { customConfig: '/js/ckeditor/config.js' } %>
  </p>

  <p>
    <%= f.label :show_on_site, 'Published' %><br>
    <%= f.check_box :show_on_site %>
  </p>
  <p>
    <% if @post.discussion.blank? %>
    <%= f.label :discussion_show_on_site, t( 'shinycms.admin.discussion.enable_comments' ) %><br>
    <% else %>
    <%= f.label :discussion_show_on_site, t( 'shinycms.admin.discussion.show_comments' ) %><br>
    <% end %>
    <%= f.check_box :discussion_show_on_site %>
  </p>
  <p>
    <%= f.label :discussion_locked, t( 'shinycms.admin.discussion.lock_comments' ) %><br>
    <%= f.check_box :discussion_locked %>
  </p>

  <p>
    <%= f.submit t( 'update' ) %>
  </p>
<% end %>