GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
francois (author)
Tue Mar 04 10:37:54 -0800 2008
commit  96cdc957653159c24ebf59a5096bcde6554ba58f
tree    d9c59c8f7caeba2d4f0503e424f3763252b67878
parent  628cbde5cdced976670e81a55a71f8d25f123b2d
mephisto / app / views / admin / comments / index.rhtml
100644 66 lines (56 sloc) 2.721 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<%= render :partial => "admin/articles/page_nav" %>
 
<h3 style="border-bottom:1px solid #ccc;padding:5px">
<% if @article -%>
Comments on <%= link_to @article.title, edit_article_path(@article), :style => 'border:none' %> <span class="right"><%= @article.published? ? link_to(image_tag('/images/mephisto/icons/24-zoom-in.png', :style => 'vertical-align: middle'), @site.permalink_for(@article), :style => 'border:none;') : '&nbsp;' %></span>
<% else -%>
Comments for all articles
<% end -%>
</h3>
 
<% if @article -%>
  <%= link_to_function "New comment", "$('new-comment-form').toggle()" %>
  <div id="new-comment-form" style="display:none"><%= render :partial => "new_comment" %></div>
<% end -%>
 
<ul class="pagelist commentlist" id="comment-list">
  <% if @comments.any? %>
  <% @comments.reverse.each_with_index do |comment, i| -%>
  <li class="event-comment<%= " shade" if (i % 2 > 0) %>" id="comment-<%= comment.id %>">
    <a name="comment-<%= comment.id %>"></a>
    <% unless comment.body.blank? -%>
    <blockquote><p>"<%= strip_tags(comment.body) %>"</p></blockquote>
    <% end -%>
    <span class="meta">
      <cite>&mdash; <%= author_link_for comment %><%= %( (#{comment.author_email})) unless comment.author_email.blank? %> said <%= time_ago_in_words comment.created_at %> ago</cite>
    
    <%= link_to_remote 'Edit', :url => edit_article_comment_path(comment.article, comment), :method => :get %> |
    <% if comment.approved? -%>
      <%= link_to_remote 'Unapprove', :url => unapprove_article_comment_path(comment.article, comment) %> |
    <% else -%>
      <%= link_to_remote 'Approve', :url => approve_article_comment_path(comment.article, comment) %> |
    <% end -%>
    <%= link_to_remote 'Delete', :url => article_comment_path(comment.article, comment), :method => :delete %>
    </span>
  </li>
  <% end -%>
  <% else %>
    <li class="event-none shade">This article has no <%= params[:filter].to_s.humanize.downcase %> comments.</li>
  <% end %>
</ul>
 
 
<% content_for :sidebar do %>
  <% if @articles.size > 1 -%>
  <div class="sgroup">
    <h3>Comments awaiting your approval</h3>
    <ul class="slist">
    <% @articles.each do |article, count| -%>
    <% if @article.nil? || article.title != @article.title -%>
      <li><%= link_to "<strong>(#{count})</strong> #{h(article.title)}", :controller => 'comments', :action => 'index', :article_id => article.id, :filter => :unapproved %></li>
    <% end -%>
    <% end -%>
    </ul>
  </div>
  <% end -%>
<% end %>
 
 
<script type="text/javascript" language="javascript" charset="utf-8">
// <![CDATA[
  var comment = $(document.location.hash.substring(1));
  if(comment) Element.addClassName(comment, 'focused');
  
// ]]>
</script>