Revision 1053:80cf86be1611 vendor/plugins/redmine_bibliography/app
| vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb | ||
|---|---|---|
| 43 | 43 |
format.html{}
|
| 44 | 44 |
|
| 45 | 45 |
if @bibtex_parse_success |
| 46 |
# todo: should this code be here? |
|
| 46 | 47 |
@ieee_prev = CiteProc.process bib.to_citeproc, :style => :ieee, :format => :html |
| 48 |
@bibtex_parsed_authors = bib[0].authors |
|
| 49 |
logger.error { "Authors: #{@bibtex_parsed_authors}" }
|
|
| 47 | 50 |
end |
| 48 | 51 |
|
| 49 | 52 |
format.js |
| ... | ... | |
| 82 | 85 |
# rescue BibtexParsingError => e |
| 83 | 86 |
# logger.error { "Bibtex Parsing Error #{bib.errors}" }
|
| 84 | 87 |
|
| 85 |
# todo: not showing... should be inside render? |
|
| 86 |
# flash[:error] = e.message |
|
| 87 |
|
|
| 88 |
# respond_to do |format| |
|
| 89 |
# format.js{
|
|
| 90 |
# render(:update) {|page|
|
|
| 91 |
# } |
|
| 92 |
# } |
|
| 93 |
# end |
|
| 94 |
|
|
| 95 | 88 |
# end |
| 96 | 89 |
|
| 97 | 90 |
|
| vendor/plugins/redmine_bibliography/app/views/publications/_suggest_author.html.erb | ||
|---|---|---|
| 1 |
|
|
| 2 |
<p> |
|
| 3 |
Author <%= h author %> |
|
| 4 |
</p> |
|
| 5 |
|
|
| vendor/plugins/redmine_bibliography/app/views/publications/new/_bibtex.html.erb | ||
|---|---|---|
| 1 |
|
|
| 2 |
|
|
| 3 | 1 |
<div class="box"> |
| 4 | 2 |
<%= text_area_tag :bibtex_paste, "Please paste your bibtex entry here" , :class => "wiki", :style => 'width:90%' -%> |
| 5 | 3 |
|
| ... | ... | |
| 10 | 8 |
|
| 11 | 9 |
<div class="box" id="ieee_prev"><h3>Preview</h3></div> |
| 12 | 10 |
|
| 11 |
<div class="box" id="suggest_bibtex_authors"><h3>Authors</h3></div> |
|
| vendor/plugins/redmine_bibliography/app/views/publications/parse_bibtex.rjs | ||
|---|---|---|
| 1 | 1 |
if @bibtex_parse_success |
| 2 | 2 |
page.insert_html :bottom, :ieee_prev, @ieee_prev |
| 3 | 3 |
page.insert_html :top, :content, '<div class="flash notice">Successfully Parsed BibTeX</div>' |
| 4 |
|
|
| 5 |
@bibtex_parsed_authors.each do |auth| |
|
| 6 |
page.insert_html :bottom, :suggest_bibtex_authors, :partial => "suggest_author" , :locals => {:author => auth}
|
|
| 7 |
end |
|
| 8 |
|
|
| 4 | 9 |
else |
| 5 | 10 |
page.insert_html :top, :content, '<div class="flash error">Error parsing BibTeX.</div>' |
| 6 | 11 |
end |
| 7 | 12 |
|
| 13 |
|
|
| 8 | 14 |
flash.discard |
Also available in: Unified diff