changeset 149:e7c03e1738fb cannam-pre-20110113-merge

Merge from branch "live"
author Chris Cannam
date Mon, 24 Jan 2011 14:12:44 +0000
parents 4272e09f4b5f (current diff) e47742d68d2d (diff)
children 317821dd92c9 4e485928a26b
files
diffstat 9 files changed, 61 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/issues_controller.rb	Thu Jan 20 10:01:33 2011 +0000
+++ b/app/controllers/issues_controller.rb	Mon Jan 24 14:12:44 2011 +0000
@@ -135,15 +135,12 @@
       
       call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
 
-      # Adds user to watcher's list
-      # @issue.add_watcher(User.current)
-
       # Also adds the assignee to the watcher's list
-      # if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?:
-      #  unless @issue.watcher_ids.include?(params[:issue][:assigned_to_id]):
-      #    @issue.add_watcher(User.find(params[:issue][:assigned_to_id]))
-      #  end
-      # end
+      if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?:
+       unless @issue.watcher_ids.include?(params[:issue][:assigned_to_id]):
+         @issue.add_watcher(User.find(params[:issue][:assigned_to_id]))
+       end
+      end
 
       respond_to do |format|
         format.html {
@@ -291,11 +288,11 @@
     # is in this issues watcher's list
     # if not, adds it.
 
-    # if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?:
-    #  unless @issue.watcher_ids.include?(params[:issue][:assigned_to_id]):
-    #    @issue.add_watcher(User.find(params[:issue][:assigned_to_id]))
-    #  end
-    # end
+    if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?:
+     unless @issue.watched_by?(User.find(params[:issue][:assigned_to_id])):
+       @issue.add_watcher(User.find(params[:issue][:assigned_to_id]))
+     end
+    end
 
 
   end
--- a/app/helpers/application_helper.rb	Thu Jan 20 10:01:33 2011 +0000
+++ b/app/helpers/application_helper.rb	Mon Jan 24 14:12:44 2011 +0000
@@ -381,21 +381,28 @@
   
   def page_header_title
     if @project.nil? || @project.new_record?
-      h(Setting.app_title)
+      a = [h(Setting.app_title), '']
+
     else
+      pname = []
       b = []
       ancestors = (@project.root? ? [] : @project.ancestors.visible)
       if ancestors.any?
         root = ancestors.shift
         b << link_to_project(root, {:jump => current_menu_item}, :class => 'root')
         if ancestors.size > 2
-          b << '&#8230;'
+          b << '&#8230;' 
           ancestors = ancestors[-2, 2]
         end
         b += ancestors.collect {|p| link_to_project(p, {:jump => current_menu_item}, :class => 'ancestor') }
+        b = b.join(' &#187; ')
+        b << (' &#187;')
       end
-      b << h(@project)
-      b.join(' &#187; ')
+
+      pname << h(@project)
+
+      a = [pname, b]
+
     end
   end
 
--- a/app/models/issue.rb	Thu Jan 20 10:01:33 2011 +0000
+++ b/app/models/issue.rb	Mon Jan 24 14:12:44 2011 +0000
@@ -90,7 +90,7 @@
   after_save :reschedule_following_issues, :update_nested_set_attributes, :update_parent_attributes, :create_journal
   after_destroy :destroy_children
   after_destroy :update_parent_attributes
-  
+
   # Returns true if usr or current user is allowed to view the issue
   def visible?(usr=nil)
     (usr || User.current).allowed_to?(:view_issues, self.project)
--- a/app/views/issues/_attributes.rhtml	Thu Jan 20 10:01:33 2011 +0000
+++ b/app/views/issues/_attributes.rhtml	Mon Jan 24 14:12:44 2011 +0000
@@ -8,7 +8,7 @@
 <% end %>
 
 <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), {:required => true}, :disabled => !@issue.leaf? %></p>
-<p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p>
+<p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), {:include_blank => true} %></p>
 <% unless @project.issue_categories.empty? %>
 <p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
 <%= prompt_to_remote(image_tag('add.png', :style => 'vertical-align: middle;'),
--- a/app/views/issues/_form.rhtml	Thu Jan 20 10:01:33 2011 +0000
+++ b/app/views/issues/_form.rhtml	Mon Jan 24 14:12:44 2011 +0000
@@ -35,7 +35,7 @@
 <% if @issue.new_record? && User.current.allowed_to?(:add_issue_watchers, @project) -%>
 <p id="watchers_form"><label><%= l(:label_issue_watchers) %></label>
 <% @issue.project.users.sort.each do |user| -%>
-<label class="floating"><%= check_box_tag 'issue[watcher_user_ids][]', user.id, @issue.watched_by?(user) %> <%=h user %></label>
+<label class="floating"><%= check_box_tag 'issue[watcher_user_ids][]', user.id, !!(@issue.watched_by?(user) or user == User.current) %> <%=h user %></label>
 <% end -%>
 </p>
 <% end %>
--- a/app/views/layouts/base.rhtml	Thu Jan 20 10:01:33 2011 +0000
+++ b/app/views/layouts/base.rhtml	Mon Jan 24 14:12:44 2011 +0000
@@ -32,17 +32,32 @@
 </div>
       
 <%= tag('div', {:id => 'header', :class => (display_main_menu?(@project) ? 'header-project' : 'header-general')}, true) %>
-    <div id="quick-search">
-        <% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
-        <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
-        <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
-        <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
-        <% end %>
+
+
+    <div id="project-search-jump">
+      <div id="quick-search">
+          <% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
+          <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
+          <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
+          <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
+          <% end %>
+      </div>
+
+      <div id="project-jump-box">
         <%= render_project_jump_box %>
+      </div>
     </div>
+
+    <% unless page_header_title[1].empty? %>
+      <h3 id="project-ancestors-title"><%= page_header_title[1] %></h3>
+    <% end %>  
+
+    <h1  id="project-title"
+      <% unless page_header_title[1].empty? %>
+        style="margin-top: 0px; "
+      <% end %>  
+    ><%= page_header_title[0] %></h1>
     
-    <h1><%= page_header_title %></h1>
-
     <% if display_main_menu?(@project) %>
     <div id="main-menu">
         <%= render_main_menu(@project) %>
--- a/public/stylesheets/application.css	Thu Jan 20 10:01:33 2011 +0000
+++ b/public/stylesheets/application.css	Mon Jan 24 14:12:44 2011 +0000
@@ -26,7 +26,9 @@
 #header {height:5.3em;margin:0;background-color:#507AAA;color:#f8f8f8; padding: 4px 8px 0px 6px; position:relative;}
 #header a {color:#f8f8f8;}
 #header h1 a.ancestor { font-size: 80%; }
-#quick-search {float:right;}
+
+#project-search-jump {float:right; }
+
 
 #main-menu {position: absolute;  bottom: 0px;  left:6px; margin-right: -500px;}
 #main-menu ul {margin: 0;  padding: 0;}
Binary file public/themes/soundsoftware/images/home.png has changed
--- a/public/themes/soundsoftware/stylesheets/application.css	Thu Jan 20 10:01:33 2011 +0000
+++ b/public/themes/soundsoftware/stylesheets/application.css	Mon Jan 24 14:12:44 2011 +0000
@@ -36,7 +36,7 @@
 }    
 
 body,p,h2,h3,h4,li,table,.wiki h1 { 
-  font-family: DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; */
+  font-family: DroidSans, 'Liberation Sans', tahoma, verdana, sans-serif; 
 }
 
 h2,h3,h4,.wiki h1 {
@@ -92,7 +92,17 @@
   width: 500px;
   height: 34px;
  }
+ 
 #quick-search { margin-right: 6px; margin-top: 1em; color: #000; }
+#project-jump-box { float: right;  margin-right: 6px; margin-top: 5px; color: #000; }
+#project-ancestors-title {
+    margin-bottom: 0px;
+    margin-left: 10px;
+    margin-top: 6px;
+    font-family: GilliusADFNo2, 'Gill Sans', Tahoma, sans-serif;
+    font-weight: normal;
+}
+
 #main-menu { position: absolute; top: 100px; /* background-color: #be5700; */ left: 0; border-top: 0; width: 100%;/* height: 1.82em; */ padding: 0; margin: 0; border: 0; }
 #main-menu li { margin: 0; padding: 0; }
 #main-menu li a { background-color: #fdfbf5; color: #be5700; border-right: 1px solid #a9b680; font-size: 97%; padding: 0em 8px 0.2em 10px; font-weight: normal; }