Mercurial > hg > soundsoftware-site
changeset 1101:5392783ea417 bibplugin_bibtex
creates radio buttons for the suggested authors/users.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 30 Nov 2012 17:39:34 +0000 |
parents | 0a4e71b11bd6 |
children | e5b80648aaa5 |
files | vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb vendor/plugins/redmine_bibliography/app/views/publications/_suggest_author.html.erb |
diffstat | 2 files changed, 33 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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 << '<br />' + s + end + + + def display_suggested_user(user) + s = radio_button_tag("suggested", user.id, false) + s << user.name + s << '<br />' + s + end + + + + end
--- 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 @@ - <p> Author: <%= h(author[0]) -%> +<br /> + Authors: +<br /> + <%- author[1][:authors].each do |auth| -%> + <%= display_suggested_author(auth) %> + <%- end -%> - #authors -- <%= h author[1][:authors].count %> - #users -- <%= h author[1][:users].count %> - + <br /> + Users: +<br /> + <%- author[1][:users].each do |usr| -%> + <%= display_suggested_user(usr) %> + <%- end -%> +<br /> </p>