forked from technoweenie/mephisto
/
index.rhtml
87 lines (82 loc) · 2.7 KB
/
index.rhtml
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
<% 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="#"> </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">—All Sections—</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.any? %>
<!-- 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"> </th>
</tr>
</thead>
<tbody id="articles">
<%= render :partial => 'article', :collection => @articles %>
</tbody>
</table>
<!-- /end article list -->
<!-- begin pagination -->
<div id="pagination">
<% if @article_pages.page_count > 1 -%>
Pages: <strong><%= pagination_links @article_pages, :params => { :action => :index } %></strong>
<% end -%>
</div>
<!-- /end pagination -->
<% else %>
<div class="empty" style="margin-bottom:20px">
<% unless params[:filter] %>
You have no articles. <%= link_to "Create one now »", :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)}", :controller => 'articles', :action => 'comments', :id => article.id, :filter => :unapproved %></li>
<% end -%>
</ul>
</div>
<% end -%>
<% end %>