public
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/halorgium/mephisto.git
Search Repo:
commit  1cd5005248cd280b894971da122345a1616d280f
tree    65a98b098d64489c736a18ee1df971fc13d8b346
parent  d8038f72fecdeb573e8f0ced1892bc3f4c6ea489
mephisto / app / views / admin / articles / index.rhtml
100644 89 lines (83 sloc) 2.781 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<% content_for :action_nav do %>
<!-- begin action nav -->
<div id="page-nav">
  <ul id="act-nav" class="clear">
    <li><%= link_to "Create new article", :action => "new" %></li>
  </ul>
</div>
<!-- /end action nav -->
<div id="filter" class="manual">
  <ul class="clear">
    <li><a href="#">&nbsp;</a></li>
  </ul>
  <% form_tag({:action => 'index'}, :method => 'get', :id => 'article-search') do -%>
  <ul id="attributes">
    <li><label for="search">Show articles:</label></li>
    <li>
      <select name="filter" id="filterlist">
        <%= options_for_select [
          ['in section', 'section'],
          ['tagged with', 'tags'],
          ['whose title contains', 'title'],
          ['whose body contains', 'body'],
          ['not published', 'draft']
        ] %>
      </select>
      <select name="section" id="sectionlist">
        <option value="0">&mdash;All Sections&mdash;</option>
        <%= options_from_collection_for_select @sections, :id, :name, params[:section].to_i %>
      </select>
    </li>
    <li><%= text_field_tag 'q', params[:q], :id => 'manualsearch', :style => 'display:none' %></li>
    <li><input type="button" id="searchsubmit" value="Go" style="display:none" /></li>
  </ul>
    <div><%= hidden_field_tag :published, 1 %></div>
  <% end -%>
</div>
<% end %>
 
<% if @articles.size > 0 -%>
 
<% content_tag :p, :class => 'total' do %>
  Total: <%= content_tag :strong, @articles.total_entries %> articles.
<% end %>
 
<!-- begin article list -->
<table id="article-list" cellspacing="0" cellpadding="0">
  <thead>
    <tr>
      <th scope="col" class="small-col">Status</th>
      <th scope="col">Article</th>
      <th scope="col">Comments</th>
      <th scope="col">Published</th>
      <th scope="col">&nbsp;</th>
    </tr>
  </thead>
  <tbody id="articles">
      <%= render :partial => 'article', :collection => @articles %>
  </tbody>
</table>
<!-- /end article list -->
 
<!-- begin pagination -->
<% if @articles.page_count > 1 -%>
  <%= will_paginate @articles, :id => 'pagination' %>
<% end -%>
<!-- /end pagination -->
 
<% else %>
  <div class="empty" style="margin-bottom:20px">
    <% unless params[:filter] %>
      You have no articles. <%= link_to "Create one now &raquo;", :action => "new" %>
    <% else %>
      You don't seem to have any articles matching that criteria.
    <% end %>
  </div>
<% end %>
 
<% content_for :sidebar do %>
  <% if @comments.any? -%>
  <div class="sgroup">
    <h3>Comments awaiting your approval</h3>
    <ul class="slist">
    <% @comments.each do |article, count| -%>
      <li><%= link_to "<strong>(#{count})</strong> #{h(article.title)}", article_comments_path(article), :filter => :unapproved %></li>
    <% end -%>
    </ul>
  </div>
  <% end -%>
<% end %>