Mercurial > hg > soundsoftware-site
diff vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb @ 945:75351d69e2ba bibplugin_bibtex
Now using bibtex-ruby and citeproc-ruby gems to format bibtex entries.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Wed, 11 Jul 2012 18:03:03 +0100 |
parents | ebca856bd627 |
children | a0c9cc95bcf3 |
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Wed Jul 11 14:43:58 2012 +0100 +++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Wed Jul 11 18:03:03 2012 +0100 @@ -89,7 +89,6 @@ s end - def render_projects_list(publication, show_delete_icon) s= "" @@ -99,6 +98,7 @@ if show_delete_icon if User.current.allowed_to?(:edit_publication, @project) if @project == proj + # todo: move this message to yml file confirm_msg = 'Are you sure you want to remove the current project from this publication\'s projects list?' else confirm_msg = false @@ -114,6 +114,29 @@ s end + def show_cite_proc_entry(publication) + s = "" + + # code that should be moved either to the model or to the controller + + book = BibTeX::Entry.new + + publication.bibtex_entry.attributes.keys.sort.each do |key| + value = publication.bibtex_entry.attributes[key].to_s + next if key == 'id' or key == 'publication_id' or value == "" + + if key == "entry_type" + book[key.to_sym] = publication.bibtex_entry.entry_type_label + else + book[key.to_sym] = value + end + + end + + s << CiteProc.process(book.to_citeproc) + end + + def show_bibtex_fields(bibtex_entry) s = "" bibtex_entry.attributes.keys.sort.each do |key|