Revision 1316:b189ccd72882 plugins/redmine_bibliography

View differences:

plugins/redmine_bibliography/app/helpers/publications_helper.rb
123 123

  
124 124
  def print_ieee_format(publication)
125 125
    Rails.cache.fetch("publication-#{publication.id}-ieee") do
126
      publication.print_entry(:ieee)
126
      publication.print_entry(:ieee).html_safe
127 127
    end
128 128
  end
129 129

  
plugins/redmine_bibliography/app/models/publication.rb
101 101
    end
102 102

  
103 103
    if style == :ieee
104
      CiteProc.process bib.to_citeproc, :style => :ieee, :format => :html
104
      CiteProc.process(bib.to_citeproc, :style => :ieee, :format => :html)
105 105
    else
106 106
      bibtex = bib.to_s :include => :meta_content
107 107
      bibtex.strip!
108
      logger.error { bibtex }
109 108
    end
110 109
  end
111 110
end
plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb
15 15
          <%= print_ieee_format(publication) %>
16 16
       </dt>
17 17
       <dd>
18
         <%= link_to("[More Details]", {:controller => :publications, :action => :show, :id => publication.id, :project_id => @project.id}) -%>
18
         <%= link_to(l("more_details_link"), {:controller => :publications, :action => :show, :id => publication.id, :project_id => @project.id}) -%>
19 19

  
20
         <%= link_to_function "[B<small>IB</small>T<sub>E</sub>X]", onclick="toggleBibtex(this)" -%>
20
         <%= link_to l(:bibtex_link).html_safe, "javascript:void(0)", :class => "bibtex-link"-%>
21 21
       </dd>
22 22
       <dd class="bibtex-textarea collapsed" style="display: none;">
23 23
         <textarea readonly> <%= print_bibtex_format(publication) %> </textarea>
plugins/redmine_bibliography/assets/javascripts/bibtex.js
1
function toggleBibtex(el) {
2
  var dd = Element.up(el).next('dd');
3 1

  
4
  dd.toggleClassName('collapsed');
5
  Effect.toggle(dd, 'slide', {duration:0.2});
6
}
2
$('.bibtex-link').live("click", function() {
3
  $this = $(this);
4
  $this.closest('dd').next('dd').toggle();
5
});
plugins/redmine_bibliography/config/locales/en.yml
148 148
  mail_subject_publication_added: "You have been added as an author to a new publication"
149 149
  mail_body_publication_added: "A new publication (%{publication}) has been added to the project '%{project}.'"
150 150

  
151
  bibtex_link: "[B<small>IB</small>T<sub>E</sub>X]"
152
  more_details_link: "[More Details]"
151 153

  
152

  

Also available in: Unified diff