forked from rubytaiwan/ruby-taiwan
/
index.html.erb
51 lines (48 loc) · 1.8 KB
/
index.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
<% content_for :sitemap do %>
<span class="current"><%= t("cpanel.menu.topics")%></span>
<% end %>
<h1><%= t("cpanel.topic_list")%></h1>
<table class="grid">
<tr class="head">
<td class="first">ID</td>
<td style="width:300px">Title</td>
<td>Node</td>
<td>User</td>
<td>Replies</td>
<td>at</td>
<td style="width:100px"></td>
</tr>
<% @topics.each do |topic| %>
<tr class="<%= 'deleted' if !topic.deleted_at.blank? %>">
<td class="first"><%= topic.id %></td>
<td>
<%= truncate(topic.title,:length => 30) %>
</td>
<td><%= topic.node.name if topic.node %></td>
<td><%= topic.user.login if topic.user %></td>
<td><%= topic.replies_count %></td>
<td>
<% if topic.deleted_at.blank? %>
<%= l topic.created_at,:format => :short %>
<% else %>
<%= link_to topic.who_deleted, user_path(topic.who_deleted) if not topic.who_deleted.blank? %> 删除于 <br />
<%= l topic.deleted_at,:format => :short %>
<% end %>
</td>
<td>
<% if !topic.suggested_at.blank? %>
<%= link_to t("common.un_top"), unsuggest_cpanel_topic_path(topic), :confirm => 'Are you sure?', :method => :post %>
<% else %>
<%= link_to t("common.place_top"), suggest_cpanel_topic_path(topic), :confirm => 'Are you sure?', :method => :post %>
<% end %>
<%= link_to "", edit_cpanel_topic_path(topic), :class => "icon small_edit" %>
<% if topic.deleted_at.blank? %>
<%= link_to "", cpanel_topic_path(topic), :confirm => 'Are you sure?', :method => :delete, :class => "icon small_delete" %>
<% else %>
<%= link_to t("common.undelete"), undestroy_cpanel_topic_path(topic), :confirm => 'Are you sure?', :method => :post %>
<% end %>
</td>
</tr>
<% end %>
</table>
<%= will_paginate @topics %>