Changeset 1684
- Timestamp:
- 04/07/08 22:22:21 (1 month ago)
- Files:
-
- trunk/app/controllers/admin/dashboard_controller.rb (modified) (1 diff)
- trunk/app/models/trackback.rb (modified) (1 diff)
- trunk/app/views/admin/dashboard/index.html.erb (modified) (1 diff)
- trunk/app/views/admin/dashboard/_comments.html.erb (added)
- trunk/app/views/admin/dashboard/_overview.html.erb (added)
- trunk/app/views/admin/dashboard/_popular.html.erb (added)
- trunk/app/views/admin/dashboard/_posts.html.erb (added)
- trunk/app/views/admin/dashboard/_sysinfo.html.erb (added)
- trunk/app/views/admin/dashboard/_welcome.html.erb (added)
- trunk/public/stylesheets/administration.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/controllers/admin/dashboard_controller.rb
r1543 r1684 4 4 lastposts 5 5 popular 6 statistics 6 7 end 7 8 8 9 private 10 11 def statistics 12 @statposts = Article.count_published_articles 13 @statuserposts = current_user.articles.size 14 @statcomments = Comment.count(:all, :conditions => "state != 'spam'") 15 @statspam = Comment.count(:all, :conditions => { :state => 'spam' }) 16 end 9 17 10 18 def comments trunk/app/models/trackback.rb
r1506 r1684 6 6 validates_presence_of :title, :excerpt, :url 7 7 8 attr_accessible : blog_id, :url, :blog_name, :title, :excerpt, :ip, :published, :article_id8 attr_accessible :url, :blog_name, :title, :excerpt, :ip, :published, :article_id 9 9 10 10 def initialize(*args, &block) trunk/app/views/admin/dashboard/index.html.erb
r1634 r1684 1 <div class="dashboard"> 2 <% content_for('tasks') do %> 3 <%= subtab _("Typo documentation"), "", "http://typosphere.org/main_page" %> 4 <% end %> 5 6 <h3><span><%= _("What can you do ?") %></span></h3> 7 <ul> 8 <%= content_tag :li, link_to(_('Write a post'), :controller => 'content', :action => 'new') -%> 9 <%= content_tag :li, link_to(_('Write a page'), :controller => 'page', :action => 'new') -%> 10 <%= content_tag :li, link_to(_("Update your profile or change your password"), 11 :controller => 'users', :action => 'edit', :id => session[:user_id]) -%> 12 <%= content_tag :li, link_to(_("Change your blog presentation"), :controller => 'themes') -%> 13 <%= content_tag :li, link_to(_("Enable plugins"), :controller => 'sidebar') -%> 14 </ul> 15 </div> 1 <% content_for('tasks') do %> 2 <%= subtab _("Typo documentation"), "", "http://typosphere.org/main_page" %> 3 <% end %> 16 4 17 <div class="dashboard"> 18 <h3><span><%= _("Last Comments") %></span></h3> 19 <ul> 20 <% if @comments.size == 0 %> 21 <li><%= _("No comments yet") %></li> 22 <% else %> 23 <% for comment in @comments -%> 24 <li> 25 <% title = ''; title << 'by ' + comment.author -%> 26 <% title << ' on ' + comment.article.title -%> 27 <%= link_to_permalink comment,h(title) %> 28 </li> 29 <% end %> 30 <% end %> 31 </ul> 32 </div> 5 <hr /> 33 6 34 <div class="dashboard"> 35 <h3><span><%= _("Last posts") %></span></h3> 36 <ul> 37 <% if @recent_posts.size == 0 %> 38 <li> <%= link_to _("No posts yet, why don't you start and write one"), :controller => 'content', :action => 'new' %> ?</li> 39 <% else %> 40 <% for post in @recent_posts -%> 41 <li> 42 <%= link_to_permalink post, post.title %> (<%= link_to_permalink(post, post.published_comments.size) %>) 43 </li> 44 <% end %> 45 <% end %> 46 </ul> 47 </div> 7 <%= render_partial "welcome" %> 8 <%= render_partial "overview" %> 48 9 49 <div class="dashboard"> 50 <h3><span><%= _("Most popular") %></span></h3> 51 <ul> 52 <% if @bestof.size == 0 %> 53 <li><%= _("Nothing to show yet") %> !</li> 54 <% else %> 55 <% for article in @bestof -%> 56 <li><%= link_to_permalink article, article.title %> (<%= link_to_permalink article, article.comment_count %>)</li> 57 <% end %> 58 <% end -%> 59 </ul> 60 </div> 10 <hr /> 61 11 62 <br style="clear: both" /> 12 <%= render_partial "sysinfo" %> 13 <%= render_partial "comments" %> 14 15 <hr /> 16 17 <%= render_partial "posts" %> 18 19 <hr /> 20 21 <%= render_partial "popular" %> 22 23 <hr /> trunk/public/stylesheets/administration.css
r1679 r1684 10 10 margin:0; 11 11 padding:0; 12 font: 12px Tahoma, Helvetica, sans-serif; 12 /* font: 12px Tahoma, Helvetica, sans-serif; */ 13 font: 0.75em "Helvetica Neue", Helvetica, Arial, sans-serif; 13 14 line-height: 1.8em; 14 color: # 585858;15 color: #000; 15 16 background: #fff; 16 17 } … … 867 868 /* Dashboard */ 868 869 869 /* OK */ 870 .dashboard { 871 width: 48%; 872 margin-right: 1%; 870 .dashboard-small { 871 width: 23%; 873 872 float: left; 874 873 margin-bottom: 10px; 875 } 876 877 /* OK */ 878 .dashboard h3 { 874 margin-left: 2%; 875 } 876 877 .dashboard { 878 width: 71%; 879 margin-left: 28%; 880 margin-bottom: 10px; 881 } 882 883 /* OK */ 884 .dashboard h3, 885 .dashboard-small h3 { 886 padding: 0 0 5px 0; 887 margin: 0; 888 /* background: url("../images/admin/table-header-first.png") #324e79 top left no-repeat; */ 889 background: none; 890 color: #324e79; 891 font-size: 16px; 892 font-weight: normal; 893 border-bottom: #324e79 1px solid; 894 } 895 896 /* OK */ 897 .dashboard ul, 898 .dashboard-small ul { 899 margin: 0; 879 900 padding: 0; 880 margin: 0;881 background: url("../images/admin/table-header-first.png") #324e79 top left no-repeat;882 font-size: 14px;883 font-weight: normal;884 }885 886 /* OK */887 .dashboard h3 span {888 background: url("../images/admin/table-header-last.png") top right no-repeat;889 display: block;890 padding: 0 3px;891 }892 893 /* OK */894 .dashboard ul {895 margin: 0;896 901 padding-top: 10px; 897 902 padding-bottom: 10px; 898 border: #ddd 1px solid; 899 } 903 } 904 905 .dashboard ul li, 906 .dashboard-small ul li { 907 margin-left: 0; 908 padding: 4px 10px 4px 2px; 909 list-style: none; 910 } 911 912 .dashboard ul li.shade, 913 .dashboard-small ul li.shade { 914 background : #d0d0d0; 915 } 916 917 hr { 918 clear: both; 919 border: medium none; 920 color: #ccc; 921 background: #ccc; 922 height: 1px; 923 margin-bottom: 1.4em; 924 } 925 900 926 /* @end */ 901 927
