changeset 367:8da54f33a17b cannam-pre-20110113-merge

Merge
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 01 Apr 2011 12:14:07 +0100
parents 3e8c33cbb8e0 (diff) 9b25cd1b459b (current diff)
children 4188c6eaadf7 bb5e1ca422f8
files config/locales/en.yml
diffstat 10 files changed, 43 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/application_controller.rb	Fri Apr 01 09:58:26 2011 +0100
+++ b/app/controllers/application_controller.rb	Fri Apr 01 12:14:07 2011 +0100
@@ -263,12 +263,17 @@
         uri = URI.parse(back_url)
         # do not redirect user to another host or to the login or register page
         if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)})
+          # soundsoftware: if back_url is the home page,
+          # change it to My Page (#125)
+          if (uri.path == home_path)
+            uri.path = uri.path + "/my"
+          end
           # soundsoftware: if login page is https but back_url http,
           # switch back_url to https to ensure cookie validity (#83)
           if (uri.scheme == "http") && (URI.parse(request.url).scheme == "https")
             uri.scheme = "https"
-            back_url = uri.to_s
           end
+          back_url = uri.to_s
           redirect_to(back_url)
           return
         end
--- a/app/controllers/my_controller.rb	Fri Apr 01 09:58:26 2011 +0100
+++ b/app/controllers/my_controller.rb	Fri Apr 01 12:14:07 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
 
--- a/app/controllers/welcome_controller.rb	Fri Apr 01 09:58:26 2011 +0100
+++ b/app/controllers/welcome_controller.rb	Fri Apr 01 12:14:07 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
--- a/app/views/activities/_recent.rhtml	Fri Apr 01 09:58:26 2011 +0100
+++ b/app/views/activities/_recent.rhtml	Fri Apr 01 12:14:07 2011 +0100
@@ -2,6 +2,12 @@
 <% max = 5 %>
 <% if (events.nil?) 
      activity = Redmine::Activity::Fetcher.new(User.current, :project => @project)
+     if @project
+        # Don't show news (duplicated with News box) or wiki edits (too
+	# tedious) in project front page
+        activity.scope = [ "changesets", "files", "issues", "documents" ]
+     end
+
      events = activity.events(Date.today - 28, Date.today + 1).first(max)
    end
 %>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/views/my/blocks/_tipoftheday.rhtml	Fri Apr 01 12:14:07 2011 +0100
@@ -0,0 +1,4 @@
+    <h3><%=l(:label_tipoftheday)%></h3>
+    <div class="tipoftheday box">
+          <div class="tip"><%= textilizable Setting.tipoftheday_text %></div>
+    </div>
--- a/app/views/news/_news.rhtml	Fri Apr 01 09:58:26 2011 +0100
+++ b/app/views/news/_news.rhtml	Fri Apr 01 12:14:07 2011 +0100
@@ -1,6 +1,12 @@
-<p><%= link_to_project(news.project) + ': ' unless @project %>
-<%= link_to h(news.title), news_path(news) %>
-<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %>
-<br />
+<div id="news">
+<dt>
+<span class="time"><%= format_time(news.created_on) %></span>
+<% if !@project %>
+<span class="project"><%= link_to_project(news.project) %></span>
+<% end %>
+<span class="headline"><%= link_to h(news.title), news_path(news) %></span>
+<span class="comments"><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></span>
+</dt><dd>
 <% unless news.summary.blank? %><span class="summary"><%=h news.summary %></span><br /><% end %>
-<span class="author"><%= authoring news.created_on, news.author %></span></p>
+</dd>
+</div>
--- a/app/views/welcome/index.rhtml	Fri Apr 01 09:58:26 2011 +0100
+++ b/app/views/welcome/index.rhtml	Fri Apr 01 12:14:07 2011 +0100
@@ -34,7 +34,8 @@
 		<% for project in @projects %>
 		  <% @project = project %>
 			<li class="latest">
-			<%= link_to_project project %> (<%= format_time(project.created_on) %>)
+			<span class="title"><%= link_to_project project %></span>
+			<span class="time"><%= format_time(project.created_on)%></span>
 			<%= render_project_short_description project %>
 			</li>
 		<% end %>
--- a/config/locales/en.yml	Fri Apr 01 09:58:26 2011 +0100
+++ b/config/locales/en.yml	Fri Apr 01 12:14:07 2011 +0100
@@ -753,6 +753,7 @@
   label_added_time_by: "Added by {{author}} {{age}} ago"
   label_updated_time_by: "Updated by {{author}} {{age}} ago"
   label_updated_time: "Updated {{value}} ago"
+  label_time_ago: "{{age}} ago"
   label_jump_to_a_project: Jump to a project...
   label_file_plural: Downloads
   label_changeset_plural: Changesets
--- a/lib/redmine.rb	Fri Apr 01 09:58:26 2011 +0100
+++ b/lib/redmine.rb	Fri Apr 01 12:14:07 2011 +0100
@@ -185,6 +185,7 @@
 
 Redmine::MenuManager.map :project_menu do |menu|
   menu.push :overview, { :controller => 'projects', :action => 'show' }
+  menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural
   menu.push :activity, { :controller => 'activities', :action => 'index' }
   menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id,
               :if => Proc.new { |p| p.shared_versions.any? }
@@ -193,7 +194,6 @@
               :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }
   menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt
   menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar
-  menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural
   menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural
   menu.push :wiki, { :controller => 'wiki', :action => 'show', :id => nil }, :param => :project_id,
               :if => Proc.new { |p| p.wiki && !p.wiki.new_record? }
--- a/public/stylesheets/application.css	Fri Apr 01 09:58:26 2011 +0100
+++ b/public/stylesheets/application.css	Fri Apr 01 12:14:07 2011 +0100
@@ -294,16 +294,19 @@
 div#issue-changesets div.changeset { border-bottom: 1px solid #ddd; }
 div#issue-changesets p { margin-top: 0; margin-bottom: 1em;}
 
-div#activity dl, #search-results { margin-left: 2em; }
+div#activity dl, div#news dl, #search-results { margin-left: 2em; }
 div#activity .box dl { margin-left: 0; }
-div#activity dd, #search-results dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; }
-div#activity dt, #search-results dt { margin-bottom: 0px; padding-left: 20px; line-height: 18px; background-position: 0 50%; background-repeat: no-repeat; }
-div#activity dt.me .time { border-bottom: 1px solid #999; }
-div#activity dt .time { color: #777; font-size: 80%; }
+div#activity dd, div#news dd, #search-results dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; }
+div#activity dt, div#news dt, #search-results dt { margin-bottom: 0px; padding-left: 20px; line-height: 18px; background-position: 0 50%; background-repeat: no-repeat; }
+div#activity dt.me .time, div#news dt.me .time { border-bottom: 1px solid #999; }
+div#activity dt .time, div#news dt .time, .projects .latest .time { color: #777; font-size: 80%; }
 div#activity dd .description, #search-results dd .description { font-style: italic; }
-div#activity span.project:after, #search-results span.project:after { content: " -"; }
+div#activity span.project:after, div#news span.project:after, #search-results span.project:after { content: " -"; }
 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; }
 
 div#search-results-counts { display: block; padding-left: 0; margin-left: 0; }