# HG changeset patch # User luisf # Date 1307121394 -3600 # Node ID 948400933de8d7b897695ef62f5a58fcfa88a1ad # Parent 27930c9b424dfda327b9c0684a3f86b2bd43ed15 partial publication form diff -r 27930c9b424d -r 948400933de8 vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Jun 02 14:39:11 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Fri Jun 03 18:16:34 2011 +0100 @@ -54,20 +54,28 @@ def edit @publication = Publication.find(params[:id]) + end + + def update + + logger.error "------>>>> NO UPDATE" + + @publication = Publication.find(params[:id]) + + logger.error @publication + + if @publication.update_attributes(params[:publication]) + flash[:notice] = "Successfully updated Publication." + redirect_to :action => :show, :id => @publication.id + else + render :action => 'edit' + end end - def update - @publication = Publication.find(params[:id]) - if @publication.update_attributes(params[:publication]) - flash[:notice] = "Successfully updated Publication." - redirect_to @publication - else - render :action => 'edit' - end - end - def show + logger.error "-------> No Show" + @publication = Publication.find(params[:id]) if @publication.nil? diff -r 27930c9b424d -r 948400933de8 vendor/plugins/redmine_bibliography/app/views/publications/_edit.html.erb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/_edit.html.erb Fri Jun 03 18:16:34 2011 +0100 @@ -0,0 +1,42 @@ + +<% form_for @publication, :url => {:action => :update }, :id => 13 do |f| -%> + <%= f.error_messages %> +

+ <%= f.label :title, l(:title) %> <%= f.text_field :title %> +

+ + +

<%= l(:authors) -%>

+ + <% f.fields_for :authors do |author| %> +

+ <%= author.label :name, l("name") %> <%= author.text_field :name %> +

+ + <% end %> + + + <% f.fields_for @publication.bibtex_entry do |b| -%> +

+ <%= b.label :year, l(:year) %> <%= b.text_field :year %> +

+

+ <%= b.label :chapter, l(:chapter) %> <%= b.text_field :chapter %> +

+

+ <%= b.label :editor, l(:editor) %> <%= b.text_field :editor %> +

+

+ <%= b.label :booktitle, l(:booktitle) %> <%= b.text_field :booktitle %> +

+

+ <%= b.label :publisher, l(:publisher) %> <%= b.text_field :publisher %> +

+

+ <%= b.label :pages, l(:pages) %> <%= b.text_field :pages %> +

+ <% end -%> + + <%= f.submit %> + +<% end -%>