# HG changeset patch # User luisf # Date 1311788386 -3600 # Node ID d4bf55b010923a687ce6ef6314ec2d11cad3308a # Parent e25248ba597cb049e3d15bc87dadce9548f3110c Fixed Bug #233. diff -r e25248ba597c -r d4bf55b01092 vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Jul 27 16:49:38 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Jul 27 18:39:46 2011 +0100 @@ -6,30 +6,26 @@ # before_filter :find_project, :except => [:autocomplete_for_project, :add_author, :sort_authors, :autocomplete_for_author] def new - @publication = Publication.new + find_project_by_project_id + @publication = Publication.new # we'll always want a new publication to have its bibtex entry - # @publication.build_bibtex_entry + @publication.build_bibtex_entry # and at least one author # @publication.authorships.build.build_author @project_id = params[:project_id] - @current_user = User.current + @current_user = User.current end - def create + def create + find_project_by_project_id + @publication = Publication.new(params[:publication]) - - logger.error { "PUBLICATION CREATE ACTION" } - logger.error { params[:publication] } - - @project = Project.find(params[:project_id]) - logger.error { "PARAMS publication" } - logger.error { params[:publication] } - + # @project = Project.find(params[:project_id]) @publication.projects << @project if @publication.save diff -r e25248ba597c -r d4bf55b01092 vendor/plugins/redmine_bibliography/app/views/publications/_edit.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/_edit.html.erb Wed Jul 27 16:49:38 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/_edit.html.erb Wed Jul 27 18:39:46 2011 +0100 @@ -2,24 +2,38 @@ <%= javascript_include_tag 'authors', :plugin => 'redmine_bibliography' %> <% end %> -<% form_for @publication, :url => { :project_id => @project_id, :action => :create } do |f| -%> - <%= f.error_messages %> -

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

+
+ <% form_for @publication, :url => { :project_id => @project_id, :action => :create } do |f| -%> + <%= f.error_messages %> +

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

-

<%= l(:authors) %>

- <% f.fields_for :authorships do |builder| %> - <%= render "authorship_fields", :f => builder %> - <% end %> +

<%= l(:authors) %>

+ <% f.fields_for :authorships do |builder| %> + <%= render "authorship_fields", :f => builder %> + <% end %> -

<%= link_to_add_fields l(:label_add_another_author), f, :authorships %>

- +

<%= link_to_add_fields l(:label_add_another_author), f, :authorships %>

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

Other Details

<% f.fields_for :bibtex_entry do |builder| -%> <%= render :partial => 'bibtex_fields', :locals => { :f => builder} %> <%- end -%> +
- <%= f.submit %> <% end -%> + +<% content_for :sidebar do %> + + placeholder + +<% end %> + + diff -r e25248ba597c -r d4bf55b01092 vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Wed Jul 27 16:49:38 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Wed Jul 27 18:39:46 2011 +0100 @@ -1,9 +1,3 @@

New Publication

-
- <%= render :partial => 'edit' %> -
- -
- -
\ No newline at end of file +<%= render :partial => 'edit' %>