changeset 652:0c872fe77797 feature_36

Merge from 649:525f48af3f54
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Fri, 09 Sep 2011 14:19:25 +0100
parents f029431de4dd (current diff) 525f48af3f54 (diff)
children 1ee95265342f 6fe283d584cf
files
diffstat 6 files changed, 52 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb	Fri Sep 09 14:19:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb	Fri Sep 09 14:19:25 2011 +0100
@@ -17,7 +17,7 @@
     
     # and at least one author
     # @publication.authorships.build.build_author        
-    @author_options = [["#{User.current.name} (#{User.current.mail})", "#{User.current.class.to_s}_#{User.current.id.to_s}"]]
+    @author_options = [["#{User.current.name} (@#{User.current.mail.partition('@')[2]})", "#{User.current.class.to_s}_#{User.current.id.to_s}"]]
 
 
   end
@@ -79,8 +79,7 @@
     @publication = Publication.find(params[:id])
     @selected_bibtex_entry_type_id = @publication.bibtex_entry.entry_type
 
-    # todo: should be removed? 
-    @author_options = [["#{User.current.name} (#{User.current.mail})", "#{User.current.class.to_s}_#{User.current.id.to_s}"]]  
+    @author_options = []  
   end
 
   def update    
--- a/vendor/plugins/redmine_bibliography/app/helpers/my_helper.rb	Fri Sep 09 14:19:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/helpers/my_helper.rb	Fri Sep 09 14:19:25 2011 +0100
@@ -13,14 +13,10 @@
     projs = []
     
     publication.projects.each do |proj|
-      projs << link_to(proj.name, proj)               
+      projs << link_to(proj.name, proj)
     end
     
-    if projs.size < 3
-        s << '<nobr>' << projs.join(', ') << '</nobr>'
-      else
-        s << projs.join(', ')
-    end  
+    s << projs.join(', ')
     
     s
   end
@@ -33,11 +29,8 @@
       auths << h(auth.name_on_paper)
     end
     
-    if auths.size < 3
-        s << '<nobr>' << auths.join(', ') << '</nobr>'
-      else
-        s << auths.join(', ')
-    end
+    s << auths.join(', ')
+
     s
   end
 
--- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Fri Sep 09 14:19:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Fri Sep 09 14:19:25 2011 +0100
@@ -23,7 +23,11 @@
         
     @author_options = []
     @results.each do |result|
-      @author_options << ["#{result.name} (#{result.mail})", "#{result.class.to_s}_#{result.id.to_s}"]
+      email_bit = result.mail.partition('@')[2]
+      if email_bit != "":
+          email_bit = "(@#{email_bit})"
+      end
+      @author_options << ["#{result.name} #{email_bit}", "#{result.class.to_s}_#{result.id.to_s}"]
     end
     
    if @results.size > 0
--- a/vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb	Fri Sep 09 14:19:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb	Fri Sep 09 14:19:25 2011 +0100
@@ -1,11 +1,26 @@
 <% if @project.publications.any? %>
-  <div class="bibliography box">
-	  <h3><%=l(:label_related_publication_plural)%></h3>	
-	  <p><% @project.publications.each do |publication| %>
-	    <%= link_to publication.title, :controller => 'publications', :action => 'show', :id => publication, :project_id => @project %> - 
-	    <%= publication.authorships.map { |a| h a.name_on_paper }.join(', ') %>
-	    <% if publication.bibtex_entry.year.to_s != "" %>(<%= publication.bibtex_entry.year %>)<% end %>
-	    <br />
-	  <% end %></p>
+<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %>
+  <div id="bibliography">
+    <div class="box">
+    <h3><%=l(:label_related_publication_plural)%></h3>
+
+   <dl>
+     <% @project.publications.each do |publication| %>
+     <dt>
+       <%= link_to publication.title, :controller => 'publications', :action => 'show', :id => publication, :project_id => @project %>
+     </dt>
+     <dd>
+     <span class="authors">
+       <%= publication.authorships.map { |a| h a.name_on_paper }.join(', ') %>
+     </span>
+     <% if publication.bibtex_entry.year.to_s != "" %>
+     <span class="year">
+       <%= publication.bibtex_entry.year %>
+     </span>
+     <% end %>
+     </dd>
+   <% end -%>
+   </dl>
   </div>
+</div>
 <% end %>
--- a/vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css	Fri Sep 09 14:19:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css	Fri Sep 09 14:19:25 2011 +0100
@@ -27,3 +27,19 @@
 .publication_project {
     margin-right: 18px;
 }
+
+.edit_publication select {
+    min-width: 150px;
+}
+
+div#bibliography dl { margin-left: 2em; }
+div#bibliography .box dl { margin-left: 0; }
+div#bibliography dt { margin-bottom: 0px; padding-left: 20px }
+div#bibliography .box dt { margin-bottom: 0px; padding-left: 10px }
+div#bibliography dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; }
+div#bibliography .box dd { margin-bottom: 0.6em; padding-left: 0; }
+div#bibliography dd .authors { font-style: italic; }
+div#bibliography dd span.authors { color: #808080; }
+div#bibliography dd span.year { padding-left: 0.6em; }
+
+div#bibliography h3 { background: url(../../../images/table_multiple.png) no-repeat 0% 50%; padding-left: 20px; }
--- a/vendor/plugins/redmine_bibliography/config/locales/en.yml	Fri Sep 09 14:19:14 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml	Fri Sep 09 14:19:25 2011 +0100
@@ -26,10 +26,10 @@
   
   field_publication_title: Title
   field_publication_authors: Authors
-  field_publication_projects: "Associated Projects"
+  field_publication_projects: "Associated projects"
   field_author_name: Author
   field_author_user: User Name
-  field_author_username: "Associated User"
+  field_author_username: "Associated user"
   field_author_publications: "Publications by this Author" 
   field_identify_author_yes: "Yes"
   field_identify_author_correct: "Corrections"