changeset 617:c1866eed921e feature_36

Merge from 616:c4ddb9531f4c
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 24 Aug 2011 11:56:41 +0100
parents 156bd1153f47 (current diff) c4ddb9531f4c (diff)
children 18e0709fd0d9
files vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb
diffstat 6 files changed, 50 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/public/themes/soundsoftware/stylesheets/application.css	Tue Aug 23 17:16:15 2011 +0100
+++ b/public/themes/soundsoftware/stylesheets/application.css	Wed Aug 24 11:56:41 2011 +0100
@@ -102,6 +102,14 @@
 table.files .file .active { font-weight: bold; }
 table.files .file .description { font-weight: normal; color: #3e442c; }
 
+.tabular .identify_author label {
+    font-weight: normal;
+    float: inherit;
+    text-align: inherit;
+    margin-left: 0;
+    width: computed;
+}
+
 #top-menu { position: absolute; top: 0; z-index: 1; left: 0px; width: 100%; font-size: 90%; /* height: 2em; */ margin: 0; padding: 0; padding-top: 0.5em; background-color: #3e442c; }
 #top-menu ul { margin-left: 10px; }
 #top-menu a { font-weight: bold; }
--- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Tue Aug 23 17:16:15 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Wed Aug 24 11:56:41 2011 +0100
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 require 'bibtex'
 
 module PublicationsHelper
@@ -75,7 +76,7 @@
 
     publication.projects.each do |proj|
       if @project == proj
-        confirm_msg = "Are you sure you want to remove the current project from this publication's projects list?"
+        confirm_msg = 'Are you sure you want to remove the current project from this publication\'s projects list?'
       else
         confirm_msg = false
       end 
@@ -88,17 +89,17 @@
   
   def show_bibtex_fields(bibtex_entry)
     s = ""
-
-    bibtex_entry.attributes.each do |field|
-      if field[1] != nil
-        s << "<h4>" + l("field_#{field[0]}") + "</h4>" 
-
-        if field[0] == "entry_type"
-          s << bibtex_entry.entry_type_label
-        else
-          s << bibtex_entry.attributes[field[0]].to_s
-        end
+    bibtex_entry.attributes.keys.sort.each do |key|
+      value = bibtex_entry.attributes[key].to_s
+      next if key == 'id' or key == 'publication_id' or value == ""
+      s << "<h4>" + l("field_#{key}") + "</h4>" 
+      s << "<p>"
+      if key == "entry_type"
+        s << bibtex_entry.entry_type_label
+      else
+        s << value
       end
+      s << "</p>"
     end
     s
   end 
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml	Tue Aug 23 17:16:15 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml	Wed Aug 24 11:56:41 2011 +0100
@@ -11,16 +11,18 @@
       </p>
       <%# link_to_function l(:label_author_is_me), "update_author_info(this," + User.current.get_author_info.to_json + ")", :id => "add_me_as_author" %>
 
+      <p>   
+      <%= f.select :search_results, options_for_select(@author_options), {}, {:size => 5, 
+        :onChange => remote_function( :url => { :controller => :publications, :action => :get_user_info, :object_id => form_object_id(f.object_name) }, :with => "'value=' + 
+        value" )} %>
+	</p>  
+
       <h5>Is it this author?</h5>
-      <p>
+      <p class='identify_author'>
         <%= f.radio_button :identify_author, "yes", :onClick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });" %><%= f.label :identify_author_yes %><br />
         <%= f.radio_button :identify_author, "correct", :onClick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });" %><%= f.label :identify_author_correct %><br />
         <%= f.radio_button :identify_author, "no", :onClick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });", :checked => "checked" %><%= f.label :identify_author_no %>
       </p>
-   
-      <%= f.select :search_results, options_for_select(@author_options), {}, {:size => 5, 
-        :onChange => remote_function( :url => { :controller => :publications, :action => :get_user_info, :object_id => form_object_id(f.object_name) }, :with => "'value=' + 
-        value" )} %>
     </div>	
   
   <div id="<%= form_tag_id( f.object_name, :edit_author_info ) %>">
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb	Tue Aug 23 17:16:15 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb	Wed Aug 24 11:56:41 2011 +0100
@@ -1,21 +1,9 @@
 <%= f.error_messages %>  
 
-<h3><%= f.text_field :title, :required => true, :size => 60 %></h3>
+<h3><%= f.text_field :title, :required => true, :size => 70 %></h3>
 
-<div class="splitcontentleft">
-  <h3><%= l(:authors) %></h3>    
-  <div class="box tabular">
-    <% f.fields_for :authorships do |builder| -%>
-      <%= render "authorship_fields", :f => builder %>
-    <%- end -%>
-
-    <%= link_to_add_fields l(:label_add_another_author), f, :authorships %>
-  </div>
-</div>
-
-<div class="splitcontentright">      
-  <h3>Other Details</h3>
-  
+<div class="splitcontentleft">      
+  <h3><%= l(:label_publication_other_details) %></h3>
   <div class="box tabular">
     <% f.fields_for :bibtex_entry do |builder| -%>
       <%= render :partial => 'bibtex_fields', :locals => { :f => builder}  %>
@@ -23,4 +11,14 @@
   </div>
 </div>
 
+<div class="splitcontentright">
+  <h3><%= l(:authors) %></h3>    
+  <div class="box tabular">
+    <% f.fields_for :authorships do |builder| -%>
+      <%= render "authorship_fields", :f => builder %>
+    <%- end -%>
+    <%= link_to_add_fields l(:label_add_an_author), f, :authorships %>
+  </div>
+</div>
 
+
--- a/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb	Tue Aug 23 17:16:15 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb	Wed Aug 24 11:56:41 2011 +0100
@@ -2,9 +2,10 @@
 
 <h2><%=l(:label_publication_show)%></h2>
 
-<div class="splitcontentleft">
-<h4>Title</h4>
+<div class="box">
+<h3>
 <%= h @publication.title %>
+</h3>
 
 <h4><%= l(:authors) %></h4>
 <ul id="authorships">
@@ -17,28 +18,24 @@
 </ul>
 <%= sortable_element("authorships", :url => { :controller => :publications, :action => :sort_author_order }, :handle => "handle") %>
 
-<br />
-
 <%- if @publication.bibtex_entry != nil -%>
   <%= show_bibtex_fields(@publication.bibtex_entry) %>
 <%- end -%>
 
-<p>
+<br>
   <%= link_to l(:label_publication_edit), { :controller => "publications", :action => "edit", :id => @publication, :project_id => @project } %> |
   <%= link_to "Delete", {:controller => 'publications', :action => 'destroy', :id => @publication, :project_id => @project },
                                                      :confirm => l(:text_are_you_sure), :method => :delete, :title => l(:button_delete) %> |
   <%= link_to "View All", publications_path %>
-</p>
 </div>
 
 
 <% projects = Project.active.find(:all, :limit => 100, :order => 'name ASC') - @publication.projects %>
 
-<div class="splitcontentright">
-  
-  <h4><%=l(:label_publication_project_index)%></h4>
+<% content_for :sidebar do %>
+  <h3><%=l(:label_publication_project_index)%></h3>
   <p id="list_projects">
     <%= render :partial => 'list_projects' %>
   </p>
     <%= render :partial => 'add_project_form' %>    
-</div>
+<% end %>
--- a/vendor/plugins/redmine_bibliography/config/locales/en.yml	Tue Aug 23 17:16:15 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml	Wed Aug 24 11:56:41 2011 +0100
@@ -34,8 +34,8 @@
   label_add_me_as_author: "Add me as an author"
   label_add_an_author: "Add an author"
   label_add_another_author: "Add another author"
-  field_search_name: "Search author"
-  field_search_results: "Authors"
+  field_search_name: "Search by name"
+  field_search_results: ""
   label_save_author: "Save Author"
   label_author_information: "Author Information"
 
@@ -51,6 +51,7 @@
   label_project_search: "Find project by name: "
   label_publication_project_index: "Projects associated with this publication"
   label_publication_index: "View all publications"
+  label_publication_other_details: "Details"
   
   text_author_email: "Author's email address as on the paper."
   text_author_institution: "Author's institution name as on paper."