# HG changeset patch # User Chris Cannam # Date 1301655409 -3600 # Node ID ce85aa9933846533f623bd94bf04c68ef59d626d # Parent d1eb5d381a77aac28ca1b039bca3aa9858b6d4cf Add Tip of the Day as a block for My Page (on by default) diff -r d1eb5d381a77 -r ce85aa993384 app/controllers/my_controller.rb --- a/app/controllers/my_controller.rb Fri Apr 01 11:41:45 2011 +0100 +++ b/app/controllers/my_controller.rb Fri Apr 01 11:56:49 2011 +0100 @@ -26,12 +26,13 @@ 'issueswatched' => :label_watched_issues, 'activitymyprojects' => :label_activity_my_recent, 'news' => :label_news_latest, + 'tipoftheday' => :label_tipoftheday, 'calendar' => :label_calendar, 'documents' => :label_document_plural, 'timelog' => :label_spent_time }.merge(Redmine::Views::MyPage::Block.additional_blocks).freeze - DEFAULT_LAYOUT = { 'left' => ['activitymyprojects'], + DEFAULT_LAYOUT = { 'left' => ['tipoftheday', 'activitymyprojects'], 'right' => ['issueswatched','calendar'] }.freeze diff -r d1eb5d381a77 -r ce85aa993384 app/controllers/welcome_controller.rb --- a/app/controllers/welcome_controller.rb Fri Apr 01 11:41:45 2011 +0100 +++ b/app/controllers/welcome_controller.rb Fri Apr 01 11:56:49 2011 +0100 @@ -25,7 +25,7 @@ @news = News.latest User.current @projects = Project.latest User.current - # tests if user is logged in to gfenerate the tips of the day list + # tests if user is logged in to generate the tips of the day list if User.current.logged? @tipsoftheday = Setting.tipoftheday_text else diff -r d1eb5d381a77 -r ce85aa993384 app/views/my/blocks/_tipoftheday.rhtml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/views/my/blocks/_tipoftheday.rhtml Fri Apr 01 11:56:49 2011 +0100 @@ -0,0 +1,4 @@ +

<%=l(:label_tipoftheday)%>

+
+
<%= textilizable Setting.tipoftheday_text %>
+
diff -r d1eb5d381a77 -r ce85aa993384 public/stylesheets/application.css --- a/public/stylesheets/application.css Fri Apr 01 11:41:45 2011 +0100 +++ b/public/stylesheets/application.css Fri Apr 01 11:56:49 2011 +0100 @@ -305,6 +305,7 @@ div#activity dd span.description, #search-results dd span.description { display:block; color: #808080; } .projects .latest .title { margin-right: 0.5em; } +.tipoftheday .tip { margin-left: 2em; margin-top: 0.5em; } #search-results dd { margin-bottom: 1em; padding-left: 20px; margin-left:0px; }