# HG changeset patch # User luisf # Date 1354297174 0 # Node ID 5392783ea417b71a2b061ab85ba57ee14fdd2043 # Parent 0a4e71b11bd680caf5c80ca9be8ad69a1ffe6ff7 creates radio buttons for the suggested authors/users. diff -r 0a4e71b11bd6 -r 5392783ea417 vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb --- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Thu Nov 29 17:32:54 2012 +0000 +++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Fri Nov 30 17:39:34 2012 +0000 @@ -151,5 +151,25 @@ end s end + + def display_suggested_author(author) + s = radio_button_tag("suggested", author.id, false) + # todo. maybe not a safe assumption? + s << author.authorships.first.name_on_paper + s << '
' + s + end + + + def display_suggested_user(user) + s = radio_button_tag("suggested", user.id, false) + s << user.name + s << '
' + s + end + + + + end diff -r 0a4e71b11bd6 -r 5392783ea417 vendor/plugins/redmine_bibliography/app/views/publications/_suggest_author.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/_suggest_author.html.erb Thu Nov 29 17:32:54 2012 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/_suggest_author.html.erb Fri Nov 30 17:39:34 2012 +0000 @@ -1,9 +1,18 @@ -

Author: <%= h(author[0]) -%> +
+ Authors: +
+ <%- author[1][:authors].each do |auth| -%> + <%= display_suggested_author(auth) %> + <%- end -%> - #authors -- <%= h author[1][:authors].count %> - #users -- <%= h author[1][:users].count %> - +
+ Users: +
+ <%- author[1][:users].each do |usr| -%> + <%= display_suggested_user(usr) %> + <%- end -%> +