Mercurial > hg > soundsoftware-site
changeset 578:c8552c08687f feature_36
Tidy up layout of author suggestions list, etc
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Wed, 10 Aug 2011 15:57:05 +0100 |
parents | e98a5b2fe3b8 |
children | 22262ff56e84 |
files | public/stylesheets/application.css vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.rhtml vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb vendor/plugins/redmine_bibliography/config/locales/en.yml |
diffstat | 7 files changed, 46 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- 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; }
--- 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 = '<em>' + h(author_info[:institution]) + '</em>' 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 << "<li>#{identify_author author_user}</li>" end s end
--- 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 @@ %> <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> <p>
--- 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 @@ +<ul> <% if params[:q] && params[:q].length > 1 %> <%= choose_author_link 'publication[author_ids][]', @results %> <% end %> +</ul>
--- 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 } %> + <div style="clear:both"></div> <%= f.submit %> -<% end %> \ No newline at end of file +<% end %>
--- 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 %> <span class="handle">[drag to reorder]</span> - <%= h authorship.name_on_paper %> <br /> - <%= h authorship.institution %> <br /> + <%= h authorship.name_on_paper %> <em><%= h authorship.institution %></em> <br /> <% end %> <% end %> </ul> @@ -42,4 +41,4 @@ <%= render :partial => 'list_projects' %> </p> <%= render :partial => 'add_project_form' %> -</div> \ No newline at end of file +</div>
--- 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"