changeset 623:a434a588f16c feature_36

More layout fixes
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Wed, 24 Aug 2011 15:44:55 +0100
parents e9cdf1e676a8
children 11c8e189f8fc e2663e0bd5a6
files vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml vendor/plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb vendor/plugins/redmine_bibliography/assets/javascripts/authors.js vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css vendor/plugins/redmine_bibliography/config/locales/en.yml
diffstat 5 files changed, 68 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml	Wed Aug 24 15:19:33 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml	Wed Aug 24 15:44:55 2011 +0100
@@ -18,23 +18,23 @@
 	</p>  
 
       <p style="margin-bottom: -2.5em; padding-bottom; 0"><label><%= l(:identify_author_question) %></label></p>
-      <p class="identify_author">
-        <label><%= radio_button_tag(:identify_author, "yes", false, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_yes ), :onclick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_yes) %> </label><br />
+      <p class="author_identify">
+        <label class='inline'><%= radio_button_tag(:identify_author, "yes", false, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_yes ), :onclick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_yes) %> </label><br />
        
-        <label><%= radio_button_tag(:identify_author, "correct", false, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_corrections ), :onclick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_correct) %> </label><br />
+        <label class='inline'><%= radio_button_tag(:identify_author, "correct", false, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_corrections ), :onclick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_correct) %> </label><br />
         
-        <label><%= radio_button_tag(:identify_author, "no", true, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_no ), :onclick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_no) %> </label><br />
+        <label class='inline'><%= radio_button_tag(:identify_author, "no", true, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_no ), :onclick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_no) %> </label><br />
       </p>
     </div>	
   
-  <div id="<%= form_tag_id( f.object_name, :edit_author_info ) %>">
+  <div class='author_edit' id="<%= form_tag_id( f.object_name, :edit_author_info ) %>">
     <p>
-      <%= f.text_field :name_on_paper, {:class => ("readonly" unless params[:action] == "new") } %><br />
-      <em style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_name_on_paper") %></em><br />
-      <%= f.text_field :institution, {:class => ("readonly" unless params[:action] == "new") }  %><br />
-      <em style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_institution") %></em><br />
-      <%= f.text_field :email, {:class => ("readonly" unless params[:action] == "new") }  %><br />
-      <em style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_email") %></em><br />
+      <%= f.text_field :name_on_paper, {:class => ("readonly" unless params[:action] == "new") } %></p>
+      <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_name_on_paper") %></p>
+      <p><%= f.text_field :institution, {:class => ("readonly" unless params[:action] == "new") }  %></p>
+      <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_institution") %></p>
+      <p><%= f.text_field :email, {:class => ("readonly" unless params[:action] == "new") }  %></p>
+      <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_email") %></p>
     </p>
   </div>
   
@@ -43,8 +43,10 @@
 	
   </div>
 
+  <p>
   <%= button_to_function l(:label_save_author), {}, { :onclick => "toggle_save_author(#{form_object_id(f.object_name)}); return false;", :id => form_tag_id( f.object_name, :edit_save_button )} %>
 
   <%= link_to_remove_fields l("remove_author"), f %>
+  </p>
 </div>
 <br/>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb	Wed Aug 24 15:19:33 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb	Wed Aug 24 15:44:55 2011 +0100
@@ -1,1 +1,1 @@
-<%= render_projects_list(@publication) %>
\ No newline at end of file
+<%= render_projects_list(@publication) %>
--- a/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js	Wed Aug 24 15:19:33 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js	Wed Aug 24 15:44:55 2011 +0100
@@ -1,58 +1,60 @@
 function remove_fields(link) {
-  $(link).previous("input[type=hidden]").value = "1";
-  $(link).up(".fields").hide();
+    $(link).previous("input[type=hidden]").value = "1";
+    $(link).up(".fields").hide();
 }
 
 function add_fields(link, association, content) {
-  var new_id = new Date().getTime();
-  var regexp = new RegExp("new_" + association, "g")
-  $(link).insert({
-    before: content.replace(regexp, new_id)
-  });
+    var new_id = new Date().getTime();
+    var regexp = new RegExp("new_" + association, "g")
+    $(link).insert({
+	before: content.replace(regexp, new_id)
+    });
 }
 
 function identify_author_status(status, object_id) {
-	$('publication_authorships_attributes_' + object_id + '_edit_author_info').select('input').each(function(s) {
-		if(status == "no"){
-			s.value = "";
-			s.readOnly = false;
-		};
-		
-		if(status == "correct"){s.readOnly = false;};
-		if(status == "yes"){s.readOnly = true;};
-	});
+    $('publication_authorships_attributes_' + object_id + '_edit_author_info').select('input').each(function(s) {
+	if(status == "no"){
+	    s.value = "";
+	    s.readOnly = false;
+	};
+	
+	if(status == "correct"){s.readOnly = false;};
+	if(status == "yes"){s.readOnly = true;};
+    });
 }
 
 function toggle_div(div_id){	
-	Effect.toggle(div_id, "appear", {duration:0.3});
+    Effect.toggle(div_id, "appear", {duration:0.3});
 }
 
 function toggle_input_field(field){	
-	if(field.classNames().inspect().include("readonly") == false){
-		field.readOnly = true;	
-		field.addClassName('readonly').next('em').hide();
-	} else {
-		field.readOnly = false;
-		field.removeClassName('readonly').next('em').show();
-	};	
+    if (field.classNames().inspect().include("readonly") == false){
+	field.readOnly = true;	
+	field.addClassName('readonly');
+    } else {
+	field.readOnly = false;
+	field.removeClassName('readonly');
+    };	
 }
 
 function toggle_edit_save_button(object_id){
-	$button = $('publication_authorships_attributes_' + object_id + '_edit_save_button');
-	if($button.value == "Save Author"){
-		$button.value = "Edit Author";	
-	} else {
-		$button.value = "Save Author";
-	};
+    $button = $('publication_authorships_attributes_' + object_id + '_edit_save_button');
+    if ($button.value == "Edit author"){
+	$button.value = "Save author";
+    } else {
+	$button.value = "Edit author";
+    };
 }
 
 function toggle_save_author(form_object_id, $this){
-	$('publication_authorships_attributes_' + form_object_id + '_edit_author_info').select('input').each(function(s) {
-	  toggle_input_field(s, $this);
-	});
-	
-	toggle_edit_save_button(form_object_id);
-	toggle_div("publication_authorships_attributes_" + form_object_id +"_search_author");
+    $('publication_authorships_attributes_' + form_object_id + '_edit_author_info').select('input').each(function(s) {
+	toggle_input_field(s, $this);
+    });
+    $$('p.description').each(function(s) {
+	s.toggle();
+    });
+    toggle_edit_save_button(form_object_id);
+    toggle_div("publication_authorships_attributes_" + form_object_id +"_search_author");
 }
 
 function edit_author(form_object_id){
--- a/vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css	Wed Aug 24 15:19:33 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css	Wed Aug 24 15:44:55 2011 +0100
@@ -6,13 +6,21 @@
 
 input.readonly {
     border: none;
+    padding: 0;
+    margin: 0;
     background-color: transparent;
 }
 
-.tabular .identify_author label {
+.tabular .author_identify label {
     font-weight: normal;
-    float: inherit;
-    text-align: inherit;
-    margin-left: 0;
-    width: computed;
 }
+
+.tabular .author_edit p {
+    padding-bottom: 0;
+}
+
+.tabular .author_edit .description {
+    padding-top: 0;
+    font-style: italic;
+}
+
--- a/vendor/plugins/redmine_bibliography/config/locales/en.yml	Wed Aug 24 15:19:33 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml	Wed Aug 24 15:44:55 2011 +0100
@@ -10,8 +10,8 @@
   
   identify_author_question: Is the right person selected above?
   identify_author_yes: "Yes"
-  identify_author_correct: "Yes, but I need to correct some details"
-  identify_author_no: "No"
+  identify_author_correct: "Yes, but I need to correct some details below"
+  identify_author_no: "No, the author was not found in the search"
 
   label_all_publications: All Publications
   label_all_publications_for_project: Publications associated with %{project}
@@ -41,7 +41,7 @@
   label_add_another_author: "Add another author"
   field_search_name: "Search by name"
   field_search_results: ""
-  label_save_author: "Save Author"
+  label_save_author: "Save author"
   label_author_information: "Author Information"
 
   remove_author: "Remove this author"