Skip to content

Commit

Permalink
Improve cpanel table style.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Mar 16, 2012
1 parent 6bbf6aa commit 9d5795a
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 32 deletions.
6 changes: 3 additions & 3 deletions app/views/cpanel/comments/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<th>Able ID</th>
<th>User</th>
<th>Body</th>
<td>At</td>
<td></td>
<td style="width:120px;">At</td>
<td style="width:40px;"></td>
</tr>

<% @comments.each do |item| %>
Expand All @@ -16,7 +16,7 @@
<td><%= item.commentable_id %></td>
<td><%= item.user.login if !item.user.blank? %></td>
<td><%= item.body %></td>
<td><%= l item.created_at, :format => :long %></td>
<td><%= l item.created_at, :format => :short %></td>
<td><%= link_to '', edit_cpanel_comment_path(item), :class => "icon small_edit" %>
<%= link_to '', cpanel_comment_path(item), confirm: 'Are you sure?', method: :delete, remote: true, :class => "icon small_delete" %></td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions app/views/cpanel/nodes/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<td><%= node.section.name %></td>
<td><%= node.sort %></td>
<td><%= node.topics_count %></td>
<td><%= link_to 'Edit', edit_cpanel_node_path(node) %>
<%= link_to 'Destroy', cpanel_node_path(node), :confirm => 'Are you sure?', :method => :delete %></td>
<td><%= link_to '', edit_cpanel_node_path(node), :class => "icon small_edit" %>
<%= link_to '', cpanel_node_path(node), :confirm => 'Are you sure?', :method => :delete, :class => "icon small_delete" %></td>
</tr>
<% end %>
</table>
Expand Down
8 changes: 4 additions & 4 deletions app/views/cpanel/pages/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<td>at</td>
<td>lock</td>
<td>Version</td>
<td style="width:140px;"></td>
<td style="width:80px;"></td>
</tr>

<% @pages.each do |page| %>
Expand All @@ -23,9 +23,9 @@
<td><%= page.locked %></td>
<td><%= page.version %></td>
<td>
<%= link_to '版本历史', cpanel_page_versions_path(page.id) %>
<%= link_to t("common.edit"), edit_cpanel_page_path(page) %>
<%= link_to t("common.delete"), cpanel_page_path(page), :confirm => 'Are you sure?', :method => :delete %></td>
<%= link_to '历史', cpanel_page_versions_path(page.id) %>
<%= link_to '', edit_cpanel_page_path(page), :class => "icon small_edit" %>
<%= link_to '', cpanel_page_path(page), :confirm => 'Are you sure?', :method => :delete, :class => "icon small_delete" %></td>
</tr>
<% end %>
</table>
Expand Down
12 changes: 5 additions & 7 deletions app/views/cpanel/photos/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@

<table>
<tr>
<th>ID</th>
<th>Image</th>
<th>User</th>
<th></th>
<th></th>
<th></th>
<td>ID</td>
<td>Image</td>
<td>User</td>
<td></td>
</tr>

<% @photos.each do |photo| %>
<tr>
<td><%= photo.id %></td>
<td><%= image_tag(photo.image.url) if !photo.image.blank? %></td>
<td><%= photo.user.login if !photo.user.blank? %></td>
<td><%= link_to 'Destroy', cpanel_photo_path(photo), :confirm => 'Are you sure?', :method => :delete %></td>
<td><%= link_to '', cpanel_photo_path(photo), :confirm => 'Are you sure?', :method => :delete, :class => "icon small_delete" %></td>
</tr>
<% end %>
</table>
Expand Down
4 changes: 2 additions & 2 deletions app/views/cpanel/posts/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<td><%= post.user.login if post.user %></td>
<td><%= l post.created_at,:format => :short %></td>
<td><%= render_post_state_s(post) %></td>
<td><%= link_to t("common.edit"), edit_cpanel_post_path(post) %>
<%= link_to t("common.delete"), cpanel_post_path(post), :confirm => "Are you sure?", :method => :delete %></td>
<td><%= link_to '', edit_cpanel_post_path(post), :class => "icon small_edit" %>
<%= link_to '', cpanel_post_path(post), :confirm => "Are you sure?", :method => :delete , :class => "icon small_delete"%></td>
</tr>
<% end %>
</table>
Expand Down
4 changes: 2 additions & 2 deletions app/views/cpanel/replies/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<% end %>
<td><%= reply.user.login if reply.user %></td>
<td><%= l reply.created_at, :format => :short %></td>
<td><%= link_to t("common.edit"), edit_cpanel_reply_path(reply) %>
<%= link_to t("common.delete"), cpanel_reply_path(reply), :confirm => 'Are you sure?', :method => :delete %></td>
<td><%= link_to '', edit_cpanel_reply_path(reply), :class => "icon small_edit" %>
<%= link_to '', cpanel_reply_path(reply), :confirm => 'Are you sure?', :method => :delete, :class => "icon small_delete" %></td>
</tr>
<% end %>
</table>
Expand Down
4 changes: 2 additions & 2 deletions app/views/cpanel/sections/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<td class="first"><%= section.id %></td>
<td><%= section.name %></td>
<td><%= section.sort %></td>
<td><%= link_to 'Edit', edit_cpanel_section_path(section) %>
<%= link_to 'Destroy', cpanel_section_path(section), :confirm => 'Are you sure?', :method => :delete %></td>
<td><%= link_to '', edit_cpanel_section_path(section) , :class => "icon small_edit" %>
<%= link_to '', cpanel_section_path(section), :confirm => 'Are you sure?', :method => :delete, :class => "icon small_delete" %></td>
</tr>
<% end %>
</table>
Expand Down
2 changes: 1 addition & 1 deletion app/views/cpanel/site_configs/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<% @site_configs.each do |site_config| %>
<tr>
<td><%= site_config.key %></td>
<td><%= link_to 'Edit', edit_cpanel_site_config_path(site_config) %></td>
<td><%= link_to '', edit_cpanel_site_config_path(site_config), :class => "icon small_edit" %></td>
</tr>
<% end %>
</table>
8 changes: 4 additions & 4 deletions app/views/cpanel/sites/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<td><%= t("mongoid.attributes.site.name") %></td>
<td><%= t("mongoid.attributes.site.url") %></td>
<td><%= t("mongoid.attributes.site.desc") %></td>
<td><%= t("mongoid.attributes.site.site_node") %></td>
<td>创建时间</td>
<td class="opts"></td>
<td style="width:100px"><%= t("mongoid.attributes.site.site_node") %></td>
<td style="width:100px">At</td>
<td style="width:40px" class="opts"></td>
</tr>
<% @sites.each do |item| %>
<tr class="<%= cycle("","even") %><%= ' deleted' if !item.deleted_at.blank? %>">
Expand All @@ -18,7 +18,7 @@
<td><%= item.url %></td>
<td><%= item.desc %></td>
<td><%= item.site_node.name if !item.site_node.blank? %></td>
<td><%= l(item.created_at, :format => :long) %></td>
<td><%= l(item.created_at, :format => :short) %></td>
<td>
<%= link_to "", edit_cpanel_site_path(item.id), :class => "icon small_edit" %>
<%= link_to "", cpanel_site_path(item.id), :method => :delete, :confirm => '确定要删除吗?', :class => "icon small_delete" %>
Expand Down
19 changes: 14 additions & 5 deletions app/views/cpanel/topics/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,35 @@
<td>User</td>
<td>Replies</td>
<td>at</td>
<td style="width:140px"></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>
<%= 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><%= l topic.created_at,:format => :short %></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 t("common.edit"), edit_cpanel_topic_path(topic) %>
<%= link_to "", edit_cpanel_topic_path(topic), :class => "icon small_edit" %>
<% if topic.deleted_at.blank? %>
<%= link_to t("common.delete"), cpanel_topic_path(topic), :confirm => 'Are you sure?', :method => :delete %>
<%= 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 %>
Expand Down

0 comments on commit 9d5795a

Please sign in to comment.