public
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/halorgium/mephisto.git
Search Repo:
technoweenie (author)
Wed Feb 13 10:06:05 -0800 2008
commit  b9b07612fbb61a73530bd0920ef62ddbddfb2aa7
tree    9fbebcaa8cafa0f701e0374d354961c337e16877
parent  a1a2cf95d10710f87b6f1b60819dcca164cf96fa
mephisto / app / views / admin / articles / _page_nav.rhtml
100644 60 lines (59 sloc) 3.012 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
<% @filter = params[:filter].to_s.humanize.downcase %>
<% content_for :action_nav do %>
<div id="page-nav">
  <ul id="act-nav" class="clear">
    <% if controller.controller_name == 'comments' && controller.action_name == 'index' && @comments.size > 0 -%>
      <li><%= link_to_remote "Delete these #{@filter != 'all' ? @filter : ''} comments", :confirm => "Are you sure you wish to delete all #{@filter != 'all' ? @filter : ''} comments?",
          :url => { :controller => 'comments', :action => 'destroy', :id => @article }, :with => "ArticleForm.getAvailableComments().toQueryString('comment')"
        %></li>
    <% end -%>
  <% if @article && (admin? || @article.user_id == current_user.id) && @article.comment_age != -1 -%>
    <li id="close-article-comments"><%= link_to_remote 'Close comments for this article',
      :url => { :controller => 'admin/comments', :action => 'close', :id => @article } %></li>
  <% end -%>
  <% if controller.action_name == 'edit' -%>
    <li><%= link_to('Preview', {:action => 'show', :id => @article}, {:target => '_blank'}) %></li>
  <% end -%>
    <li id="select">
      <a class="trigger" id="cog" href="#">&nbsp;</a>
      <div id="optgroup" style="display: none">
        <ul id="options">
        <% unless @article.nil? || @article.new_record? -%>
          <li><%= link_to 'Edit this article', :controller => 'articles', :action => 'edit', :id => @article, :version => nil %></li>
        <% end -%>
        <% if @article && @article.comments.size > 0 && !(controller.controller_name == 'comments' && controller.action_name == 'index') -%>
          <li><%= link_to "View comments", :controller => 'comments', :action => 'index', :article_id => @article %></li>
        <% end %>
        <% if @article && (admin? || @article.user_id == current_user.id) -%>
          <li><%= link_to_remote 'Delete this article', :url => article_path(@article), :method => :delete, :confirm => 'Are you sure you want to delete this article?' %></li>
        <% end -%>
        </ul>
      </div>
    </li>
  </ul>
</div>
 
<div id="filter" class="manual">
  <ul class="clear">
    <li><a href="#">&nbsp;</a></li>
  </ul>
  <ul id="attributes">
    <% if @article && controller.controller_name == 'articles' && controller.action_name == 'edit' -%>
    <li><label for="search">Revision:</label></li>
    <li>
      <select name="filter" id="revisionnum">
        <option value="0">Newest</option>
        <%= options_from_collection_for_select @article.versions.reverse, :version, :version, params[:version].to_i %>
      </select>
    </li>
    <% end -%>
    <% if controller.controller_name == 'comments' && controller.action_name == 'index' -%>
    <li><label for="comments_view">Show comments:</label></li>
    <li>
      <select id="comments-view">
        <%= options_for_select ['All', 'Unapproved', 'Approved'], params[:filter].to_s.humanize %>
      </select>
    </li>
    <% end -%>
  </ul>
</div>
<% end unless @article && @article.new_record? && @article.comments.size == 0 -%>