# HG changeset patch # User luisf # Date 1314103530 -3600 # Node ID 8fa35731c95990d5c9e58ae16b801734ff2cb251 # Parent e918338dedfca5dd27c3857e88204bee4cc54fde Created the show actions and view for Authors, addressing Features #234 and #235. diff -r e918338dedfc -r 8fa35731c959 vendor/plugins/redmine_bibliography/app/controllers/authors_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/authors_controller.rb Mon Aug 22 14:38:31 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/authors_controller.rb Tue Aug 23 13:45:30 2011 +0100 @@ -4,4 +4,9 @@ @authors = Author.find(:all) end + def show + @author = Author.find(params[:id]) + + end + end diff -r e918338dedfc -r 8fa35731c959 vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb --- a/vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb Mon Aug 22 14:38:31 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb Tue Aug 23 13:45:30 2011 +0100 @@ -17,4 +17,12 @@ s end + + # Generates a link to an author + # todo: test options + def link_to_author(author, options={}, html_options = nil) + url = {:controller => 'authors', :action => 'show', :id => author}.merge(options) + link_to(h(author.name), url, html_options) + end + end diff -r e918338dedfc -r 8fa35731c959 vendor/plugins/redmine_bibliography/app/views/authors/index.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/authors/index.html.erb Mon Aug 22 14:38:31 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/authors/index.html.erb Tue Aug 23 13:45:30 2011 +0100 @@ -1,4 +1,4 @@ -

Authors#index

+

<%=l(:label_authors_index)%>

@@ -11,7 +11,7 @@ <% @authors.each do |author|%>
- <%= h author.name %> + <%= link_to_author author %> <%= link_to author.user unless author.user.nil? %> diff -r e918338dedfc -r 8fa35731c959 vendor/plugins/redmine_bibliography/app/views/authors/show.html.erb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/authors/show.html.erb Tue Aug 23 13:45:30 2011 +0100 @@ -0,0 +1,24 @@ +

<%=l(:label_authors_show)%>

+ +
+ + + + + + + + + + + <% @author.authorships.each do |authorship| %> + + + + + + + <% end %> + +
<%=l(:field_authorship_publication_title)%><%=l(:field_authorship_name)%><%=l(:field_authorship_email)%><%=l(:field_authorship_institution)%>
<%= h authorship.publication.title %><%= h authorship.name_on_paper %><%= h authorship.institution %>
+
\ No newline at end of file diff -r e918338dedfc -r 8fa35731c959 vendor/plugins/redmine_bibliography/config/locales/en.yml --- a/vendor/plugins/redmine_bibliography/config/locales/en.yml Mon Aug 22 14:38:31 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml Tue Aug 23 13:45:30 2011 +0100 @@ -10,6 +10,13 @@ label_all_publications: All Publications label_all_publications_for_project: Publications associated with %{project} + label_authors_show: "Authorships by this author" + label_authors_show: "List of authors" + + field_authorship_publication_title: "Publication Title" + field_authorship_name: "Name" + field_authorship_email: "Email Address" + field_authorship_institution: "Institution" field_publication_title: Title field_publication_authors: Authors