changeset 575:724c97fc03dc feature_36

Merge from 573:aed210f6095b. Fixing small issue when adding new authors.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 10 Aug 2011 14:40:05 +0100
parents f463be9d101a (current diff) aed210f6095b (diff)
children e98a5b2fe3b8 2ada25d4b0a8
files vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb vendor/plugins/redmine_bibliography/assets/javascripts/authors.js
diffstat 8 files changed, 73 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/public/stylesheets/application.css	Wed Aug 10 14:30:40 2011 +0100
+++ b/public/stylesheets/application.css	Wed Aug 10 14:40:05 2011 +0100
@@ -251,6 +251,11 @@
 border: 1px solid #e4e4e4;
 }
 
+.box h4 {
+margin-top: 0;
+padding-top: 0;
+}
+
 div.square {
  border: 1px solid #999;
  float: left;
@@ -419,6 +424,15 @@
 margin*/
 }
 
+.tabular .splitcontentleft .box p, .tabular .splitcontentright .box p, .splitcontentleft .tabular p, .splitcontentright .tabular p {
+padding-left: 120px;
+}
+
+.tabular .splitcontentleft .box label, .tabular .splitcontentright .box label, .splitcontentleft .tabular label, .splitcontentright .tabular label {
+margin-left: -120px;
+width: 115px;
+}
+
 .tabular label.floating{
 font-weight: normal;
 margin-left: 0px;
--- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Wed Aug 10 14:30:40 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Wed Aug 10 14:40:05 2011 +0100
@@ -51,7 +51,7 @@
   end
 
   def link_to_remove_fields(name, f)
-    f.hidden_field(:_destroy) + link_to_function(name, "remove_fields(this)")
+    f.hidden_field(:_destroy) + link_to_function(name, "remove_fields(this)", :class => 'icon icon-del')
   end
     
   def link_to_add_fields(name, f, association)
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml	Wed Aug 10 14:30:40 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml	Wed Aug 10 14:40:05 2011 +0100
@@ -1,29 +1,33 @@
 <div id="authors" class="fields">
+
+  <h4><%= l("label_author_1") %></h4>
+
   <p>        
-    <%= f.text_field :name_on_paper %><br />
+    <%= f.text_field :name_on_paper, :size => 25 %> 
+    <%= link_to_function l(:label_author_is_me), "update_author_info(this," + User.current.get_author_info.to_json + ")", :id => "add_me_as_author" %><br />
     <em><%= h l("text_author_name_on_paper") %></em><br />
-                                                
-    <%= link_to_function "Add Me as Author", "update_author_info(this," + User.current.get_author_info.to_json + ")", :class => 'icon icon-add', :id => "add_me_as_author" %>
 
     <%= observe_field( form_tag_id(f.object_name, :name_on_paper), :frequency => 0.5, :update => form_tag_id(f.object_name, :identify_author), :url => { :controller => 'publications', :action => 'autocomplete_for_author' }, :with => 'q')
     %>
-    
+
     <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>
       
-    <%= f.text_field :institution, :size => 60 %><br />
+    <p>
+    <%= f.text_field :institution, :size => 35 %><br />
     <em><%= h l("text_author_institution") %></em><br />
 
-    <%= f.text_field :email, :size => 60  %><br />
+    <%= f.text_field :email, :size => 35  %><br />
     <em><%= h l("text_author_email") %></em><br />
     
     <%= f.hidden_field :is_user %>
-    <%= f.text_field :author_user_id %>
+    <%= f.text_field :author_user_id, :size => 35 %><br/>
     
     <%= link_to_remove_fields l("remove_author"), f %>    
+    </p>
     
   </p>
-</div>
\ No newline at end of file
+</div>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb	Wed Aug 10 14:30:40 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb	Wed Aug 10 14:40:05 2011 +0100
@@ -1,26 +1,21 @@
-<div class="box">
-
 
 <p><label for="bibtex_entry_type"><%=l("field_entry_type")%> <span class="required">*</span></label>
 	<%= f.collection_select(:entry_type, BibtexEntryType.find(:all), :id, :name,  {:selected => @selected_bibtex_entry_type_id, :prompt => true})  %>
     </p>
     <p> 
-      <%= f.text_field :year, :size => 60 %>  
+      <%= f.text_field :year, :size => 4 %> 
+    </p><p> 
+      <%= f.text_field :chapter, :size => 15 %>  
     </p>  
     <p>   
-      <%= f.text_field :chapter, :size => 60 %>  
+      <%= f.text_field :editor, :size => 33  %>  
     </p>  
     <p>   
-      <%= f.text_field :editor, :size => 60  %>  
+      <%= f.text_field :booktitle,:size => 33  %>  
     </p>  
     <p>   
-      <%= f.text_field :booktitle,:size => 60  %>  
+      <%= f.text_field :publisher,:size => 33  %>  
     </p>  
     <p>   
-      <%= f.text_field :publisher,:size => 60  %>  
-    </p>  
-    <p>   
-      <%= f.text_field :pages, :size => 60  %>  
+      <%= f.text_field :pages, :size => 12  %>  
     </p>
-
-</div>
\ No newline at end of file
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb	Wed Aug 10 14:30:40 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb	Wed Aug 10 14:40:05 2011 +0100
@@ -1,30 +1,29 @@
+<%= f.error_messages %>  
+<p>
+  <b><%= f.text_field :title, :required => true, :size => 60 %></b>
+</p>
 
 <div class="splitcontentleft">
-    <%= f.error_messages %>  
-    <p>
-      <%= f.text_field :title, :required => true, :size => 60 %>
-    </p>
 
     <h3><%= l(:authors) %></h3>    
-    <% f.fields_for :authorships do |builder| %>
-      <%= render "authorship_fields", :f => builder %>
-    <% end %>
+    <div class="box tabular">
 
-    <p><%= link_to_add_fields l(:label_add_another_author), f, :authorships %></p>
+      <% 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="box tabular">
   <% f.fields_for :bibtex_entry do |builder| -%>
     <%= render :partial => 'bibtex_fields', :locals => { :f => builder}  %>
   <%- end -%>
 </div>
+</div>
 
-<% content_for :sidebar do %>
 
-  placeholder
-
-<% end %>
-
-
--- a/vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb	Wed Aug 10 14:30:40 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb	Wed Aug 10 14:40:05 2011 +0100
@@ -6,7 +6,7 @@
 
 <% form_for @publication, :url => { :project_id  => @project_id, :action => :update }, :builder => TabularFormBuilder do |f| -%>
   <%= render :partial => 'form', :locals => { :f => f }  %>
-  
+  <div style="clear:both"></div>
   <%= f.submit %>
 <% end %>
 <p>
--- a/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js	Wed Aug 10 14:30:40 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js	Wed Aug 10 14:40:05 2011 +0100
@@ -6,7 +6,7 @@
 function add_fields(link, association, content) {
   var new_id = new Date().getTime();
   var regexp = new RegExp("new_" + association, "g")
-  $(link).up().insert({
+  $(link).insert({
     before: content.replace(regexp, new_id)
   });
 }
--- a/vendor/plugins/redmine_bibliography/config/locales/en.yml	Wed Aug 10 14:30:40 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml	Wed Aug 10 14:40:05 2011 +0100
@@ -11,12 +11,14 @@
   field_publication_authors: Authors
   field_publication_projects: "Associated Projects"
   field_author_name: Author
+  field_author_user: User Name
   field_author_username: "Associated User"
   field_author_publications: "Publications by this Author" 
   
   bibtex_entry:
     entry_type: "Bibtex Entry Type"
   
+  label_author_is_me: "(I am this author)"
   label_add_me_as_author: "Add me as an author"
   label_add_another_author: "Add another author"
 
@@ -43,10 +45,9 @@
   field_email: "Email Address"
       
   # bibtex_entries model
-  field_entry_type: "Entry Type"
+  field_entry_type: "Publication Type"
   field_id: "id" 
   field_publication_id: "Publication_id"
-  field_entry_type: "Entry Type"
   field_address: "Address"
   field_annote: "Annote"
   field_booktitle: "Book Title"
@@ -71,7 +72,27 @@
   field_volume: "Volume"
   field_year: "Year"
   
+  label_author_1: First author
+  label_author_2: Second author
+  label_author_3: Third author
+  label_author_4: Fourth author
+  label_author_5: Fifth author
+  label_author_6: Sixth author
+  label_author_7: Seventh author
+  label_author_8: Eighth author
+  label_author_9: Ninth author
+  label_author_10: Tenth author
+  label_author_11: Eleventh author
+  label_author_12: Twelfth author
+  label_author_13: Thirteenth author
+  label_author_14: Fourteenth author
+  label_author_15: Fifteenth author
+  label_author_16: Sixteenth author
+  label_author_17: Seventeenth author
+  label_author_18: Eighteenth author
+  label_author_19: Nineteenth author
+  label_author_20: Twentieth author
+
   
   
   
-