diff options
author | Philip Arndt <parndt@gmail.com> | 2012-01-09 10:38:26 +1300 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2012-01-17 16:56:23 +1300 |
commit | b3a25c1b686d205fc6b8b409a8f90059ae6b934d (patch) | |
tree | b0590a4c85422d000a22423114849fd1679392dd /app/views/refinery/blog/admin/comments | |
parent | 2a2fcca64972bc2fb6a3530395366fb2ade42303 (diff) | |
download | refinerycms-blog-b3a25c1b686d205fc6b8b409a8f90059ae6b934d.tar.gz refinerycms-blog-b3a25c1b686d205fc6b8b409a8f90059ae6b934d.tar.bz2 refinerycms-blog-b3a25c1b686d205fc6b8b409a8f90059ae6b934d.zip |
Restructured part of the project to Refinery::Blog::Admin not Refinery::Admin::Blog
Diffstat (limited to 'app/views/refinery/blog/admin/comments')
4 files changed, 121 insertions, 0 deletions
diff --git a/app/views/refinery/blog/admin/comments/_comment.html.erb b/app/views/refinery/blog/admin/comments/_comment.html.erb new file mode 100644 index 0000000..51f2996 --- /dev/null +++ b/app/views/refinery/blog/admin/comments/_comment.html.erb @@ -0,0 +1,20 @@ +<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= "comment-#{comment.to_param}" -%>"> + <span class='title'> + <%= comment.name %> + <span class="preview"> - <%= truncate(comment.message, :length => 75) %></span> + </span> + <span class='actions'> + <%= link_to refinery_icon_tag("application_go.png"), + main_app.blog_post_path(comment.post, :anchor => "comment-#{comment.to_param}"), + :title => t('.view_live_html'), + :target => "_blank" unless comment.unmoderated? %> + <%= link_to refinery_icon_tag('zoom.png'), main_app.refinery_blog_admin_comment_path(comment), + :title => t('.read') %> + <%= link_to refinery_icon_tag("cross.png"), + main_app.rejected_refinery_blog_admin_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), + :title => t('.reject') unless comment.rejected? %> + <%= link_to refinery_icon_tag("tick.png"), + main_app.approved_refinery_blog_admin_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), + :title => t('.approve') unless comment.approved? %> + </span> +</li> diff --git a/app/views/refinery/blog/admin/comments/_sortable_list.html.erb b/app/views/refinery/blog/admin/comments/_sortable_list.html.erb new file mode 100644 index 0000000..f781ba1 --- /dev/null +++ b/app/views/refinery/blog/admin/comments/_sortable_list.html.erb @@ -0,0 +1,7 @@ +<ul id='sortable_list'> + <%= render :partial => 'comment', :collection => @blog_comments %> +</ul> +<%= render :partial => "/refinery/admin/sortable_list", + :locals => { + :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true) + } %> diff --git a/app/views/refinery/blog/admin/comments/index.html.erb b/app/views/refinery/blog/admin/comments/index.html.erb new file mode 100644 index 0000000..059ef59 --- /dev/null +++ b/app/views/refinery/blog/admin/comments/index.html.erb @@ -0,0 +1,31 @@ +<%= render :partial => '/refinery/admin/blog/submenu' %> +<div id='records'> + <% if searching? %> + <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2> + <% if @blog_comments.any? %> + <%= will_paginate @blog_comments %> + + <ul> + <%= render :partial => "blog_comments", + :collection => @blog_comments %> + </ul> + + <%= will_paginate @blog_comments %> + <% else %> + <p><%= t('search_no_results', :scope => 'admin') %></p> + <% end %> + <% else %> + <% if @blog_comments.any? %> + <%= will_paginate @blog_comments %> + + <%= render :partial => "sortable_list" %> + + <%= will_paginate @blog_comments %> + <% else %> + <h3> + <%= t('.no_items_yet', + :type => action_name.gsub('index', 'new')).downcase %> + </h3> + <% end %> + <% end %> +</div> diff --git a/app/views/refinery/blog/admin/comments/show.html.erb b/app/views/refinery/blog/admin/comments/show.html.erb new file mode 100644 index 0000000..2aa75f1 --- /dev/null +++ b/app/views/refinery/blog/admin/comments/show.html.erb @@ -0,0 +1,63 @@ +<div id='actions'> + <h2><%= t('.details')%></h2> + <p> + <strong><%= t('.age') %>:</strong> <%= time_ago_in_words(@blog_comment.created_at) %> + </p> + <h2><%= t('.actions') %></h2> + <ul> + <li> + <%= link_to t('.back'), main_app.refinery_blog_admin_comments_path, :class => "back_icon" %> + </li> + <li> + <%= link_to t('.reject'), main_app.rejected_refinery_blog_admin_comment_path(@blog_comment, :return_to => 'rejected'), + :class => 'comment_cross_icon' unless @blog_comment.rejected? %> + </li> + <li> + <%= link_to t('.approve'), main_app.approved_refinery_blog_admin_comment_path(@blog_comment, :return_to => 'approved'), + :class => 'comment_tick_icon' unless @blog_comment.approved? %> + </li> + </ul> +</div> +<div id='records'> + <h2><%= t('.comment') %></h2> + <table id='inquiry'> + <tr> + <td> + <strong><%= t('.blog_post') %></strong> + </td> + <td> + <%= link_to @blog_comment.post.title, + main_app.blog_post_path(@blog_comment.post, :anchor => "comment-#{@blog_comment.to_param}"), + :target => '_blank' %> + </td> + </tr> + <tr> + <td> + <strong><%= t('.from') %></strong> + </td> + <td> + <%= @blog_comment.name %> [<%= mail_to @blog_comment.email, @blog_comment.email, {:title => t('.click_to_email')} %>] + </td> + </tr> + <tr> + <td> + <strong><%= t('.date') %></strong> + </td> + <td> + <%= l(Date.parse(@blog_comment.created_at.to_s), :format => :long) %> + </td> + </tr> + <tr> + <td valign='top'> + <strong><%= t('.message') %></strong> + </td> + <td> + <p style='margin-top: 0px'> + <%= @blog_comment.message.gsub("\r\n\r\n", "\r\n").gsub("\r\n", "</p><p>") %> + </p> + </td> + </tr> + </table> +</div> + +<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/backend') %> |