To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / vendor / plugins / redmine_bibliography / app / controllers / publications_controller.rb @ 405:8a105a53b8f4
History | View | Annotate | Download (1.18 KB)
| 1 | 385:a6f8c0584a92 | luis | # vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
|
|---|---|---|---|
| 2 | |||
| 3 | 328:aed18b463206 | luis | class PublicationsController < ApplicationController |
| 4 | |||
| 5 | 393:9595ab4cac6b | luis | |
| 6 | 404:216a61338322 | luis | def new |
| 7 | # we always try to create at least one publication
|
||
| 8 | @publication = Publication.new |
||
| 9 | |||
| 10 | # the step we're at in the form
|
||
| 11 | @publication.current_step = session[:publication_step] |
||
| 12 | 393:9595ab4cac6b | luis | end
|
| 13 | 384:4be6b16bc6f9 | luis | |
| 14 | 404:216a61338322 | luis | def create |
| 15 | 390:5562a95edbf7 | luis | @publication = Publication.new(params[:publication]) |
| 16 | 391:fecd4b2f4b77 | luis | @publication.current_step = session[:publication_step] |
| 17 | 384:4be6b16bc6f9 | luis | |
| 18 | 404:216a61338322 | luis | # contents of the paste text area
|
| 19 | bibtex_entry = params[:bibtex_entry]
|
||
| 20 | 384:4be6b16bc6f9 | luis | |
| 21 | 404:216a61338322 | luis | # debug message
|
| 22 | logger.error bibtex_entry |
||
| 23 | 403:b15397a5341c | luis | |
| 24 | 404:216a61338322 | luis | # method for creating "pasted" bibtex entries
|
| 25 | if bibtex_entry
|
||
| 26 | 405:8a105a53b8f4 | luis | parse_bibtex_text bibtex_entry |
| 27 | 404:216a61338322 | luis | end
|
| 28 | 393:9595ab4cac6b | luis | |
| 29 | 404:216a61338322 | luis | # form's flow control
|
| 30 | 390:5562a95edbf7 | luis | if params[:back_button] |
| 31 | @publication.previous_step
|
||
| 32 | else
|
||
| 33 | @publication.next_step
|
||
| 34 | end
|
||
| 35 | 393:9595ab4cac6b | luis | |
| 36 | 390:5562a95edbf7 | luis | session[:publication_step] = @publication.current_step |
| 37 | 393:9595ab4cac6b | luis | |
| 38 | 390:5562a95edbf7 | luis | render "new"
|
| 39 | 329:4575b631f6ce | luis | end
|
| 40 | |||
| 41 | 405:8a105a53b8f4 | luis | |
| 42 | 329:4575b631f6ce | luis | def index |
| 43 | @publications = Publication.find(:all) |
||
| 44 | 328:aed18b463206 | luis | end
|
| 45 | |||
| 46 | def edit |
||
| 47 | 384:4be6b16bc6f9 | luis | logger.error "AAAA edit"
|
| 48 | 376:ad71d0604ac2 | luis | |
| 49 | 328:aed18b463206 | luis | end
|
| 50 | |||
| 51 | def update |
||
| 52 | 384:4be6b16bc6f9 | luis | |
| 53 | logger.error "AAAA update"
|
||
| 54 | 376:ad71d0604ac2 | luis | |
| 55 | |||
| 56 | 328:aed18b463206 | luis | end
|
| 57 | 329:4575b631f6ce | luis | |
| 58 | def show |
||
| 59 | @publication = Publication.find(params[id]) |
||
| 60 | @authors = @publication.authors |
||
| 61 | end
|
||
| 62 | |||
| 63 | 328:aed18b463206 | luis | end |