Skip to content
Browse files

Improve cpanel table style.

  • Loading branch information...
1 parent 6bbf6aa commit 9d5795a928ec03bbb8a81fb0aeed74642494bf5e @huacnlee huacnlee committed
View
6 app/views/cpanel/comments/index.html.erb
@@ -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| %>
@@ -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>
View
4 app/views/cpanel/nodes/index.html.erb
@@ -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>
View
8 app/views/cpanel/pages/index.html.erb
@@ -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| %>
@@ -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>
View
12 app/views/cpanel/photos/index.html.erb
@@ -2,12 +2,10 @@
<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| %>
@@ -15,7 +13,7 @@
<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>
View
4 app/views/cpanel/posts/index.html.erb
@@ -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>
View
4 app/views/cpanel/replies/index.html.erb
@@ -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>
View
4 app/views/cpanel/sections/index.html.erb
@@ -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>
View
2 app/views/cpanel/site_configs/index.html.erb
@@ -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>
View
8 app/views/cpanel/sites/index.html.erb
@@ -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? %>">
@@ -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" %>
View
19 app/views/cpanel/topics/index.html.erb
@@ -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 %>

0 comments on commit 9d5795a

Please sign in to comment.
Something went wrong with that request. Please try again.