changeset 580:22262ff56e84 feature_36

Merge from 579:c8552c08687f
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 10 Aug 2011 16:20:40 +0100
parents 2ada25d4b0a8 (current diff) c8552c08687f (diff)
children 7c06dde557ec
files vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb
diffstat 8 files changed, 58 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/public/stylesheets/application.css	Wed Aug 10 16:20:14 2011 +0100
+++ b/public/stylesheets/application.css	Wed Aug 10 16:20:40 2011 +0100
@@ -405,13 +405,16 @@
 p.pagination {margin-top:8px;}
 
 /***** Tabular forms ******/
-.tabular p{
+.tabular p, .tabular ul{
 margin: 0;
 padding: 5px 0 8px 0;
 padding-left: 180px; /*width of left column containing the label elements*/
 height: 1%;
 clear:left;
 }
+.tabular ul{
+margin-top: -4px;
+}
 
 html>body .tabular p {overflow:hidden;}
 
@@ -424,7 +427,7 @@
 margin*/
 }
 
-.tabular .splitcontentleft .box p, .tabular .splitcontentright .box p, .splitcontentleft .tabular p, .splitcontentright .tabular p {
+.tabular .splitcontentleft .box p, .tabular .splitcontentright .box p, .splitcontentleft .tabular p, .splitcontentright .tabular p, .tabular .splitcontentleft .box ul, .tabular .splitcontentright .box ul, .splitcontentleft .tabular ul, .splitcontentright .tabular ul {
 padding-left: 120px;
 }
 
--- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Wed Aug 10 16:20:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Wed Aug 10 16:20:40 2011 +0100
@@ -10,42 +10,59 @@
   end
   
   def identify_author(author)
+
+    link_text = ''
+    suffix = ''
+    user = nil
+
     if author.class == User
 
       Rails.logger.debug { "Identify Author: USER" }
 
       author_info = {
         :name_on_paper => author.name,
-        :email => author.mail,
         :user_id => author.id, 
         :institution  => "",
         :is_user  => "1"
       }
+
+      link_text = h(author.name)
+
+      user = author
       
-      unless author.ssamr_user_detail.nil?
-        author_info[:institution] = author.ssamr_user_detail.institution_name
-      end
-    
-    else 
-      if author.class == Author    
-        Rails.logger.debug { "Identify Author: AUTHOR" }
+    elsif author.class == Author    
 
-        author_info = { 
-          :name_on_paper => author.name, 
-          :user_id => author.user_id,
-          :id => author.id, 
-          :is_user  => "0"
-        }
+      Rails.logger.debug { "Identify Author: AUTHOR" }
+
+      author_info = { 
+        :name_on_paper => author.name, 
+        :user_id => author.user_id,
+        :id => author.id, 
+        :is_user  => "0"
+      }
+      
+      link_text = h(author.name)
+      
+      user = author.user
+    end
+
+    unless user.nil?
+      author_info[:email] = user.mail
+      unless user.ssamr_user_detail.nil?
+        author_info[:institution] = user.ssamr_user_detail.institution_name
+        suffix = '<em>' + h(author_info[:institution]) + '</em>'
       end
     end
-                
-    link_to_function(author.name, "update_author_info(this," + author_info.to_json + ")")
+    
+    unless link_text.empty?
+      link_to_function(link_text, "update_author_info(this," + author_info.to_json + ")") + ' ' + suffix
+    end
   end
   
   def choose_author_link(name, authors_users)
     s = ''
     authors_users.sort.each do |author_user|
-      s << "#{identify_author author_user}\n"
+      s << "<li>#{identify_author author_user}</li>"
     end
     s 
   end
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml	Wed Aug 10 16:20:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml	Wed Aug 10 16:20:40 2011 +0100
@@ -11,9 +11,6 @@
     %>
 
     <div id="<%= form_tag_id(f.object_name, :identify_author) %>">
-      <% if params[:q] && params[:q].length > 1 %>
-        <%= select_author_links 'author[author_ids][]', @authors %>
-      <% end %>
     </div>
       
     <p>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.rhtml	Wed Aug 10 16:20:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.rhtml	Wed Aug 10 16:20:40 2011 +0100
@@ -1,3 +1,5 @@
+<ul>
 <% if params[:q] && params[:q].length > 1 %>
 	<%= choose_author_link 'publication[author_ids][]', @results %>
 <% end %>
+</ul>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb	Wed Aug 10 16:20:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb	Wed Aug 10 16:20:40 2011 +0100
@@ -3,8 +3,11 @@
 </div>
 
 <div class="splitcontentleft">
-  <h3>Publications#index</h3>
-
+  <% if @project %>
+  <h3><%= l(:label_all_publications_for_project, :project => @project.name) %></h3>
+  <% else %>
+  <h3><%= l(:label_all_publications) %></h3>
+  <% end %>
 
   <table>
     <tr>
@@ -30,4 +33,4 @@
 <% content_for :sidebar do %>
   Sidebar
 <% end %>
-  
\ No newline at end of file
+  
--- a/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb	Wed Aug 10 16:20:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb	Wed Aug 10 16:20:40 2011 +0100
@@ -6,5 +6,6 @@
 
 <% form_for @publication, :url => { :project_id  => @project_id, :action => :create }, :builder => TabularFormBuilder do |f| -%>
   <%= render :partial => 'form', :locals => { :f => f }  %>
+  <div style="clear:both"></div>
   <%= f.submit %>
-<% end %>
\ No newline at end of file
+<% end %>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb	Wed Aug 10 16:20:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb	Wed Aug 10 16:20:40 2011 +0100
@@ -11,8 +11,7 @@
   <% for authorship in @publication.authorships.find(:all, :order => :auth_order) %>
     <% content_tag_for :li, authorship do %>
       <span class="handle">[drag to reorder]</span>
-      <%= h authorship.name_on_paper %> <br />
-      <%= h authorship.institution %> <br />
+      <%= h authorship.name_on_paper %> <em><%= h authorship.institution %></em> <br />
     <% end %>
   <% end %>
 </ul>
@@ -42,4 +41,4 @@
     <%= render :partial => 'list_projects' %>
   </p>
     <%= render :partial => 'add_project_form' %>    
-</div>
\ No newline at end of file
+</div>
--- a/vendor/plugins/redmine_bibliography/config/locales/en.yml	Wed Aug 10 16:20:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml	Wed Aug 10 16:20:40 2011 +0100
@@ -6,6 +6,9 @@
   name: "Name"
   publications_box: "My Publications"
   label_my_publications_box: "My Publications"
+
+  label_all_publications: All Publications
+  label_all_publications_for_project: Publications associated with %{project}
   
   field_publication_title: Title
   field_publication_authors: Authors
@@ -20,6 +23,7 @@
   
   label_author_is_me: "(I am this author)"
   label_add_me_as_author: "Add me as an author"
+  label_add_an_author: "Add an author"
   label_add_another_author: "Add another author"
 
   remove_author: "Remove this author"
@@ -27,11 +31,11 @@
   label_publications_plural: "Publications"
   label_publication_new: "Create New Publication"
   label_publication_index: "List of Publication"
-  label_add_publication_to_project: "Add Publication to this project"
+  label_add_publication_to_project: "Add publication to this project"
   label_publication_edit: "Edit Publication"
   label_publication_show: "Publication Details"
-  label_add_project_to_publication: "Add Project to Publication"
-  label_project_search: "Search by name: "
+  label_add_project_to_publication: "Add this publication to a project"
+  label_project_search: "Find project by name: "
   label_publication_project_index: "Projects associated with this publication"
   label_publication_index: "View all publications"