changeset 534:cdec3eeaef7e feature_36

changes in the Query to retreive list of My Publications
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 26 Jul 2011 14:35:11 +0100
parents b1c56157d64d
children dd9d9c0ff0f9
files vendor/plugins/redmine_bibliography/app/views/my/blocks/_publications_box.html.erb vendor/plugins/redmine_bibliography/config/locales/en.yml
diffstat 2 files changed, 35 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/views/my/blocks/_publications_box.html.erb	Tue Jul 26 11:35:08 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/my/blocks/_publications_box.html.erb	Tue Jul 26 14:35:11 2011 +0100
@@ -1,12 +1,34 @@
-<h3><%=l(:label_my_publications_box)%> <%= "(" + User.current.author.authorships.count.to_s + ")" unless User.current.author.nil? %></h3>
+<h3><%=l(:label_my_publications_box)%> <%= "(" + Publication.all(:include => :authors, :conditions => "authors.id = #{User.current.author.id}").count.to_s + ")" unless User.current.author.nil? %></h3>
 
-<% Publication.all(:include => :authors, :conditions => "id = #{User.current.author.id}").each do |pub|%>
-  <div class="wiki">
-    <h3><%= link_to pub.title, pub %></h3>   
-    <% pub.projects.each do |proj| %>
-      <%= link_to proj.name, proj %>
-    <% end %>  	
-  </div>
-<% end %>
+<table class="list publications">		
+	<thead><tr>
+	<th><%=l(:field_publication_title)%></th>
+	<th><%=l(:field_publication_authors)%></th>
+	<th><%=l(:field_publication_projects)%></th>
+	</tr></thead>
+	<tbody>	
+  <% Publication.all(:include => :authors, :conditions => "authors.id = #{User.current.author.id}").each do |publication|%>
+    
+	<tr id="publication-<%= publication.id %>" class="<%= cycle('odd', 'even') %>">
+		<td class="title">
+			<%= link_to publication.title, publication %>
+		</td>
+    <td class="authors">
+      <% publication.authorships.each do |authorship| %>
+        <%= h authorship.name_on_paper %>
+      <% end %>		
+    </td>
+    <td class="project">             
+      <% publication.projects.each do |proj| %>
+        
+        <%= link_to proj.name, proj %>
+        
+      <% end %>		
+    </td>
+	</tr>
+	<% end %>
+	</tbody>
+</table>
 
 
+
--- a/vendor/plugins/redmine_bibliography/config/locales/en.yml	Tue Jul 26 11:35:08 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml	Tue Jul 26 14:35:11 2011 +0100
@@ -7,6 +7,10 @@
   publications_box: "My Publications"
   label_my_publications_box: "My Publications"
   
+  field_publication_title: Title
+  field_publication_authors: Authors
+  field_publication_projects: "Associated Projects" 
+  
   label_add_me_as_author: "Add me as an author"
   label_add_another_author: "Add another author"