changeset 616:156bd1153f47 feature_36

Fix for Feature #235. This view is no longer a priority.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 23 Aug 2011 17:16:15 +0100
parents 712324fee0c0
children c1866eed921e
files vendor/plugins/redmine_bibliography/app/controllers/authors_controller.rb vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb vendor/plugins/redmine_bibliography/app/views/authors/show.html.erb
diffstat 3 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/controllers/authors_controller.rb	Tue Aug 23 15:47:15 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/controllers/authors_controller.rb	Tue Aug 23 17:16:15 2011 +0100
@@ -1,12 +1,13 @@
 class AuthorsController < ApplicationController
+  helper :publications
+  include PublicationsHelper
   
   def index
     @authors = Author.find(:all)
   end
 
   def show
-    @author = Author.find(params[:id])  
-
+    @author = Author.find(params[:id])
   end
 
 end
--- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Tue Aug 23 15:47:15 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Tue Aug 23 17:16:15 2011 +0100
@@ -1,6 +1,12 @@
 require 'bibtex'
 
 module PublicationsHelper
+
+  def link_to_publication(publication, options={}, html_options = nil)
+    url = {:controller => 'publications', :action => 'show', :id => publication}.merge(options)
+    link_to(h(publication.title), url, html_options)
+  end
+
   def projects_check_box_tags(name, projects)
     s = ''
     projects.sort.each do |project|
--- a/vendor/plugins/redmine_bibliography/app/views/authors/show.html.erb	Tue Aug 23 15:47:15 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/authors/show.html.erb	Tue Aug 23 17:16:15 2011 +0100
@@ -13,7 +13,7 @@
   
      <% @author.authorships.each do |authorship| %>
        <tr id="authorship-<%= authorship.id %>" class="<%= cycle('odd', 'even') %>">
-         <td class="title"><%= h authorship.publication.title %></td>
+         <td class="title"><%= link_to_publication(authorship.publication) %></td>
          <td class="name"><%= h authorship.name_on_paper %></td>
          <td class="email"><%= h authorship.email %></td>
          <td class="institution"><%= h authorship.institution %></td>