# HG changeset patch # User luisf # Date 1315574365 -3600 # Node ID 0c872fe7779700fa0425723baf96fd8fd78ccab4 # Parent f029431de4ddaf60f5691a4978a122ce614652f8# Parent 525f48af3f54362f48d92081eb2f08af0ed76aed Merge from 649:525f48af3f54 diff -r f029431de4dd -r 0c872fe77797 vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- 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 diff -r f029431de4dd -r 0c872fe77797 vendor/plugins/redmine_bibliography/app/helpers/my_helper.rb --- 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 << '' << projs.join(', ') << '' - 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 << '' << auths.join(', ') << '' - else - s << auths.join(', ') - end + s << auths.join(', ') + s end diff -r f029431de4dd -r 0c872fe77797 vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb --- 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 diff -r f029431de4dd -r 0c872fe77797 vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb --- 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? %> -
-

<%=l(:label_related_publication_plural)%>

-

<% @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 %> -
- <% end %>

+<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> +
+
+

<%=l(:label_related_publication_plural)%>

+ +
+ <% @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 %> +
+ <% end -%> +
+
<% end %> diff -r f029431de4dd -r 0c872fe77797 vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css --- 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; } diff -r f029431de4dd -r 0c872fe77797 vendor/plugins/redmine_bibliography/config/locales/en.yml --- 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"