Revision 430:948400933de8 vendor/plugins
| vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb | ||
|---|---|---|
| 54 | 54 |
|
| 55 | 55 |
def edit |
| 56 | 56 |
@publication = Publication.find(params[:id]) |
| 57 |
end |
|
| 58 |
|
|
| 59 |
def update |
|
| 60 |
|
|
| 61 |
logger.error "------>>>> NO UPDATE" |
|
| 62 |
|
|
| 63 |
@publication = Publication.find(params[:id]) |
|
| 64 |
|
|
| 65 |
logger.error @publication |
|
| 66 |
|
|
| 67 |
if @publication.update_attributes(params[:publication]) |
|
| 68 |
flash[:notice] = "Successfully updated Publication." |
|
| 69 |
redirect_to :action => :show, :id => @publication.id |
|
| 70 |
else |
|
| 71 |
render :action => 'edit' |
|
| 72 |
end |
|
| 57 | 73 |
|
| 58 | 74 |
end |
| 59 | 75 |
|
| 60 |
def update |
|
| 61 |
@publication = Publication.find(params[:id]) |
|
| 62 |
if @publication.update_attributes(params[:publication]) |
|
| 63 |
flash[:notice] = "Successfully updated Publication." |
|
| 64 |
redirect_to @publication |
|
| 65 |
else |
|
| 66 |
render :action => 'edit' |
|
| 67 |
end |
|
| 68 |
end |
|
| 69 |
|
|
| 70 | 76 |
def show |
| 77 |
logger.error "-------> No Show" |
|
| 78 |
|
|
| 71 | 79 |
@publication = Publication.find(params[:id]) |
| 72 | 80 |
|
| 73 | 81 |
if @publication.nil? |
| vendor/plugins/redmine_bibliography/app/views/publications/_edit.html.erb | ||
|---|---|---|
| 1 |
|
|
| 2 |
<% form_for @publication, :url => {:action => :update }, :id => 13 do |f| -%>
|
|
| 3 |
<%= f.error_messages %> |
|
| 4 |
<p> |
|
| 5 |
<%= f.label :title, l(:title) %> <%= f.text_field :title %> |
|
| 6 |
</p> |
|
| 7 |
|
|
| 8 |
|
|
| 9 |
<h3><%= l(:authors) -%></h3> |
|
| 10 |
|
|
| 11 |
<% f.fields_for :authors do |author| %> |
|
| 12 |
<p> |
|
| 13 |
<%= author.label :name, l("name") %> <%= author.text_field :name %>
|
|
| 14 |
</p> |
|
| 15 |
|
|
| 16 |
<% end %> |
|
| 17 |
|
|
| 18 |
|
|
| 19 |
<% f.fields_for @publication.bibtex_entry do |b| -%> |
|
| 20 |
<p> |
|
| 21 |
<%= b.label :year, l(:year) %> <%= b.text_field :year %> |
|
| 22 |
</p> |
|
| 23 |
<p> |
|
| 24 |
<%= b.label :chapter, l(:chapter) %> <%= b.text_field :chapter %> |
|
| 25 |
</p> |
|
| 26 |
<p> |
|
| 27 |
<%= b.label :editor, l(:editor) %> <%= b.text_field :editor %> |
|
| 28 |
</p> |
|
| 29 |
<p> |
|
| 30 |
<%= b.label :booktitle, l(:booktitle) %> <%= b.text_field :booktitle %> |
|
| 31 |
</p> |
|
| 32 |
<p> |
|
| 33 |
<%= b.label :publisher, l(:publisher) %> <%= b.text_field :publisher %> |
|
| 34 |
</p> |
|
| 35 |
<p> |
|
| 36 |
<%= b.label :pages, l(:pages) %> <%= b.text_field :pages %> |
|
| 37 |
</p> |
|
| 38 |
<% end -%> |
|
| 39 |
|
|
| 40 |
<%= f.submit %> |
|
| 41 |
|
|
| 42 |
<% end -%> |
|
Also available in: Unified diff