# HG changeset patch # User Chris Cannam # Date 1312988225 -3600 # Node ID c8552c08687fb87159548e1552459dad35af7caf # Parent e98a5b2fe3b8e2d752a31ca3c10a435f57d83e19 Tidy up layout of author suggestions list, etc diff -r e98a5b2fe3b8 -r c8552c08687f public/stylesheets/application.css --- a/public/stylesheets/application.css Wed Aug 10 14:49:45 2011 +0100 +++ b/public/stylesheets/application.css Wed Aug 10 15:57:05 2011 +0100 @@ -405,13 +405,16 @@ p.pagination {margin-top:8px;} /***** Tabular forms ******/ -.tabular p{ +.tabular p, .tabular ul{ margin: 0; padding: 5px 0 8px 0; padding-left: 180px; /*width of left column containing the label elements*/ height: 1%; clear:left; } +.tabular ul{ +margin-top: -4px; +} html>body .tabular p {overflow:hidden;} @@ -424,7 +427,7 @@ margin*/ } -.tabular .splitcontentleft .box p, .tabular .splitcontentright .box p, .splitcontentleft .tabular p, .splitcontentright .tabular p { +.tabular .splitcontentleft .box p, .tabular .splitcontentright .box p, .splitcontentleft .tabular p, .splitcontentright .tabular p, .tabular .splitcontentleft .box ul, .tabular .splitcontentright .box ul, .splitcontentleft .tabular ul, .splitcontentright .tabular ul { padding-left: 120px; } diff -r e98a5b2fe3b8 -r c8552c08687f vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb --- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Wed Aug 10 14:49:45 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Wed Aug 10 15:57:05 2011 +0100 @@ -10,42 +10,59 @@ end def identify_author(author) + + link_text = '' + suffix = '' + user = nil + if author.class == User Rails.logger.debug { "Identify Author: USER" } author_info = { :name_on_paper => author.name, - :email => author.mail, :user_id => author.id, :institution => "", :is_user => "1" } + + link_text = h(author.name) + + user = author - unless author.ssamr_user_detail.nil? - author_info[:institution] = author.ssamr_user_detail.institution_name - end - - else - if author.class == Author - Rails.logger.debug { "Identify Author: AUTHOR" } + elsif author.class == Author - author_info = { - :name_on_paper => author.name, - :user_id => author.user_id, - :id => author.id, - :is_user => "0" - } + Rails.logger.debug { "Identify Author: AUTHOR" } + + author_info = { + :name_on_paper => author.name, + :user_id => author.user_id, + :id => author.id, + :is_user => "0" + } + + link_text = h(author.name) + + user = author.user + end + + unless user.nil? + author_info[:email] = user.mail + unless user.ssamr_user_detail.nil? + author_info[:institution] = user.ssamr_user_detail.institution_name + suffix = '' + h(author_info[:institution]) + '' end end - - link_to_function(author.name, "update_author_info(this," + author_info.to_json + ")") + + unless link_text.empty? + link_to_function(link_text, "update_author_info(this," + author_info.to_json + ")") + ' ' + suffix + end end def choose_author_link(name, authors_users) s = '' authors_users.sort.each do |author_user| - s << "#{identify_author author_user}\n" + s << "
  • #{identify_author author_user}
  • " end s end diff -r e98a5b2fe3b8 -r c8552c08687f vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml --- a/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml Wed Aug 10 14:49:45 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml Wed Aug 10 15:57:05 2011 +0100 @@ -11,9 +11,6 @@ %>
    - <% if params[:q] && params[:q].length > 1 %> - <%= select_author_links 'author[author_ids][]', @authors %> - <% end %>

    diff -r e98a5b2fe3b8 -r c8552c08687f vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.rhtml --- a/vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.rhtml Wed Aug 10 14:49:45 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.rhtml Wed Aug 10 15:57:05 2011 +0100 @@ -1,3 +1,5 @@ +

    diff -r e98a5b2fe3b8 -r c8552c08687f vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Wed Aug 10 14:49:45 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Wed Aug 10 15:57:05 2011 +0100 @@ -6,5 +6,6 @@ <% form_for @publication, :url => { :project_id => @project_id, :action => :create }, :builder => TabularFormBuilder do |f| -%> <%= render :partial => 'form', :locals => { :f => f } %> +
    <%= f.submit %> -<% end %> \ No newline at end of file +<% end %> diff -r e98a5b2fe3b8 -r c8552c08687f vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb Wed Aug 10 14:49:45 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb Wed Aug 10 15:57:05 2011 +0100 @@ -11,8 +11,7 @@ <% for authorship in @publication.authorships.find(:all, :order => :auth_order) %> <% content_tag_for :li, authorship do %> [drag to reorder] - <%= h authorship.name_on_paper %>
    - <%= h authorship.institution %>
    + <%= h authorship.name_on_paper %> <%= h authorship.institution %>
    <% end %> <% end %> @@ -42,4 +41,4 @@ <%= render :partial => 'list_projects' %>

    <%= render :partial => 'add_project_form' %> - \ No newline at end of file + diff -r e98a5b2fe3b8 -r c8552c08687f vendor/plugins/redmine_bibliography/config/locales/en.yml --- a/vendor/plugins/redmine_bibliography/config/locales/en.yml Wed Aug 10 14:49:45 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml Wed Aug 10 15:57:05 2011 +0100 @@ -23,6 +23,7 @@ label_author_is_me: "(I am this author)" label_add_me_as_author: "Add me as an author" + label_add_an_author: "Add an author" label_add_another_author: "Add another author" remove_author: "Remove this author"