Revision 391:fecd4b2f4b77
| vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb | ||
|---|---|---|
| 23 | 23 |
result = '' |
| 24 | 24 |
if d.class == BibTeX::Entry |
| 25 | 25 |
# d.replace!(bib.strings) |
| 26 |
result = [d.author, '. ', d.title].join |
|
| 26 |
|
|
| 27 |
result = [author, '. ', d.title].join |
|
| 27 | 28 |
end |
| 29 |
end |
|
| 28 | 30 |
|
| 29 |
logger.error result |
|
| 30 |
end |
|
| 31 | 31 |
end |
| 32 | 32 |
end |
| 33 | 33 |
|
| 34 | 34 |
def new |
| 35 | 35 |
@publication = Publication.new |
| 36 | 36 |
@publication.current_step = session[:publication_step] |
| 37 |
|
|
| 38 |
logger.error @publication.current_step |
|
| 39 |
|
|
| 40 |
|
|
| 37 |
|
|
| 41 | 38 |
end |
| 42 | 39 |
|
| 43 | 40 |
def create |
| 44 | 41 |
@publication = Publication.new(params[:publication]) |
| 42 |
@publication.current_step = session[:publication_step] |
|
| 45 | 43 |
|
| 46 |
@publication.current_step = session[:publication_step]
|
|
| 44 |
parse_bibtex_text
|
|
| 47 | 45 |
|
| 48 | 46 |
if params[:back_button] |
| 49 | 47 |
@publication.previous_step |
| ... | ... | |
| 53 | 51 |
|
| 54 | 52 |
session[:publication_step] = @publication.current_step |
| 55 | 53 |
|
| 56 |
logger.error "AAAA" |
|
| 57 |
logger.error session[:publication_step] |
|
| 58 |
|
|
| 59 |
|
|
| 60 | 54 |
render "new" |
| 61 | 55 |
end |
| 62 | 56 |
|
| vendor/plugins/redmine_bibliography/app/models/publication.rb | ||
|---|---|---|
| 17 | 17 |
end |
| 18 | 18 |
|
| 19 | 19 |
def next_step |
| 20 |
self.current_step = step[steps.index(current_step)+1] |
|
| 20 |
self.current_step = steps[steps.index(current_step)+1]
|
|
| 21 | 21 |
end |
| 22 | 22 |
|
| 23 | 23 |
def previous_step |
| 24 |
self.current_step = step[steps.index(current_step)-1] |
|
| 24 |
self.current_step = steps[steps.index(current_step)-1]
|
|
| 25 | 25 |
end |
| 26 | 26 |
|
| 27 | 27 |
def first_step? |
| vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb | ||
|---|---|---|
| 1 | 1 |
<h1>New Publication</h1> |
| 2 | 2 |
|
| 3 |
<% form_for :publication, :url => { :action => "create" } do |f| %>
|
|
| 3 |
<% form_for @publication, :url => { :action => "create" } do |f| %>
|
|
| 4 | 4 |
<% f.error_messages %> |
| 5 | 5 |
|
| 6 | 6 |
<%= render :partial => "#{@publication.current_step}_bibtex_step", :locals => { :f => f } %>
|
Also available in: Unified diff