/
list.html.erb
56 lines (56 loc) · 2.05 KB
/
list.html.erb
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
<%- if flash[:deleted_id] -%>
<p class="message"><%= undo_delete_link(flash[:deleted_id], flash[:deleted_comment]) %></p>
<%- elsif flash[:added_comment] -%>
<p class="message"><%= undo_add_comment_link(flash[:added_id], flash[:added_comment]) %></p>
<%- elsif flash[:added_id] -%>
<p class="message"><%= undo_add_link(flash[:added_id]) %></p>
<%- end -%>
<%- if flash[:message] -%>
<p class="message"><%=h flash[:message] %></p>
<%- end -%>
<%- if ctx.query -%>
<%- form_tag({:action => 'list'}, {:name => 'post'}) do -%>
<p><%= search_form %></p>
<%- end -%>
<script type='text/javascript'><!--
post.query.focus();
//--></script>
<%- elsif ctx.list? -%>
<%- form_tag({:action => 'add'}, {:name => 'post'}) do -%>
<p><%= post_entry_form %></p>
<%- end -%>
<%- end -%>
<%- if ctx.list? -%>
<%- if ctx.user_for -%>
<%= render :partial => 'profile', :locals => {:user => ctx.user_for} %>
<%- end -%>
<%- if ctx.room_for -%>
<%= render :partial => 'room', :locals => {:room => ctx.room_for} %>
<%- end -%>
<%- if ctx.list -%>
<p><%= list_links %></p>
<%- end -%>
<%- if ctx.room == '*' -%>
<p><%= room_links(ctx.user) %></p>
<%- end -%>
<%- end -%>
<p><%= page_links(:with_bottom => true) %></p>
<div class="listings">
<%- @entries.each do |thread| -%>
<div class="<%= cycle('thread1', 'thread2') %>">
<p><%= render :partial => 'entry', :locals => {:entry => thread.root, :root_user => nil, :root_service => nil} %></p>
<%- if thread.chunked? -%>
<ul>
<li><%= icon_tag(:related) %> <%= thread.related_entries.size %> related entries</li>
<% fold_entries(thread.related_entries).each do |entry| -%>
<li><%= render :partial => 'entry', :locals => {:entry => entry, :root_user => thread.root.user_id, :root_service => thread.root.service_identity} %></li>
<%- end %>
</ul>
<%- end -%>
</div>
<%- end -%>
<%- if @entries.size == 0 -%>
<p>No feed is good feed.</p>
<%- end -%>
</div>
<p><a name="bottom"></a><%= page_links(:with_top => true) %></p>