changeset 1017:63f8c4f2cf67 bibplugin_bibtex_display

Shows the publication list as IEEE formatted entries; Adds 2 links, one for the publication details and another for to show the publication details as bibtex.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Mon, 12 Nov 2012 20:16:35 +0000
parents be5cf488993e
children 3d924264419a
files vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb vendor/plugins/redmine_bibliography/assets/javascripts/bibtex.js vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css
diffstat 4 files changed, 40 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb	Mon Nov 12 20:12:58 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb	Mon Nov 12 20:16:35 2012 +0000
@@ -1,24 +1,31 @@
+<% content_for :header_tags do %>
+    <%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %>
+    <%= javascript_include_tag 'bibtex', :plugin => 'redmine_bibliography' -%>
+<% end %>
+
 <% if @project.publications.any? %>
 <%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %>
   <div id="bibliography">
     <div class="box">
     <h3><%=l(:label_related_publication_plural)%></h3>
 
-   <dl>
-     <% @project.publications.each do |publication| %>
-     <dt>
-     <span class="authors">
-       <%= publication.authorships.map { |a| h a.name_on_paper }.join(', ') %><% if !publication.authorships.empty? %>.<% end %>
-     </span>
-     <span class="title"><%= link_to publication.title, :controller => 'publications', :action => 'show', :id => publication, :project_id => @project %></span>
-     <% if publication.bibtex_entry.year.to_s != "" %>
-     <span class="year">
-       &nbsp;(<%= publication.bibtex_entry.year %>)
-     </span>
-     <% end %>
-     </dt><dd></dd>
+     <dl>       
+     <% @project.publications.each do |publication| %>       
+       <dt>
+          <%= publication.print_entry(:ieee) -%>
+       </dt>
+       <dd>
+         <%= link_to("[More Details]", {:controller => :publications, :action => :show, :id => publication.id, :project_id => @project.id}) -%> 
+         
+         <%= link_to_function "[Bibtex]", onclick="toggleBibtex(this)" -%> 
+       </dd>
+       <dd class="bibtex-textarea collapsed" style="display: none;">
+         <textarea> 
+           <%= publication.print_entry(:bibtex) -%>         
+         </textarea>         
+       </dd>
    <% end -%>
-   </dl>
+     </dl>
   </div>
 </div>
-<% end %>
+<% end -%>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb	Mon Nov 12 20:12:58 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb	Mon Nov 12 20:16:35 2012 +0000
@@ -1,10 +1,8 @@
-<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %>
-
 <h2><%=l(:label_publication_show)%></h2>
 
 <div class="box">
   <h3>Publication Info</h3>
-  <%=h show_cite_proc_entry(@publication)%>
+  <%= show_cite_proc_entry(@publication)%>
   
   <h3>Bibtex Format</h3>
     <%=h print_bibtex_entry(@publication) %>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/assets/javascripts/bibtex.js	Mon Nov 12 20:16:35 2012 +0000
@@ -0,0 +1,6 @@
+function toggleBibtex(el) {
+  var dd = Element.up(el).next('dd')
+
+  dd.toggleClassName('collapsed');
+  Effect.toggle(dd, 'slide', {duration:0.2});
+}
\ No newline at end of file
--- a/vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css	Mon Nov 12 20:12:58 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css	Mon Nov 12 20:16:35 2012 +0000
@@ -32,15 +32,20 @@
     min-width: 150px;
 }
 
-div#bibliography dl { margin-left: 2em; }
-div#bibliography .box dl { margin-left: 0; }
-div#bibliography dt { margin-bottom: 0px; padding-left: 20px }
-div#bibliography .box dt { margin-bottom: 0px; padding-left: 10px }
+
 div#bibliography dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; }
-div#bibliography .box dd { margin-bottom: 0.6em; padding-left: 0; }
+
 div#bibliography dd .authors { font-style: italic; }
-div#bibliography dt .title { font-style: italic; }
 div#bibliography dd span.authors { color: #808080; }
 div#bibliography dd span.year { padding-left: 0.6em; }
 
+div#bibliography .box dt { 
+  background: url(../../../images/document.png) no-repeat 0% 50%; padding-left: 20px;
+  margin-left: 2em;
+}
+div#bibliography .box dd { 
+  margin-left: 25px;
+}
+
+
 div#bibliography h3 { background: url(../../../images/table_multiple.png) no-repeat 0% 50%; padding-left: 20px; }