Mercurial > hg > soundsoftware-site
changeset 539:d4bf55b01092 feature_36
Fixed Bug #233.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Wed, 27 Jul 2011 18:39:46 +0100 |
parents | e25248ba597c |
children | 951fcb1711f2 |
files | vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb vendor/plugins/redmine_bibliography/app/views/publications/_edit.html.erb vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb |
diffstat | 3 files changed, 36 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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 %> - <p> - <%= f.label :title, l(:title) %><br /> - <%= f.text_field :title %> - </p> +<div class="splitcontentleft"> + <% form_for @publication, :url => { :project_id => @project_id, :action => :create } do |f| -%> + <%= f.error_messages %> + <p> + <%= f.label :title, l(:title) %><br /> + <%= f.text_field :title %> + </p> - <h3><%= l(:authors) %></h3> - <% f.fields_for :authorships do |builder| %> - <%= render "authorship_fields", :f => builder %> - <% end %> + <h3><%= l(:authors) %></h3> + <% f.fields_for :authorships do |builder| %> + <%= render "authorship_fields", :f => builder %> + <% end %> - <p><%= link_to_add_fields l(:label_add_another_author), f, :authorships %></p> - + <p><%= link_to_add_fields l(:label_add_another_author), f, :authorships %></p> + + <%= f.submit %> + +</div> + +<div class="splitcontentright"> <h3>Other Details</h3> <% f.fields_for :bibtex_entry do |builder| -%> <%= render :partial => 'bibtex_fields', :locals => { :f => builder} %> <%- end -%> +</div> - <%= f.submit %> <% end -%> + +<% content_for :sidebar do %> + + placeholder + +<% end %> + +
--- 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 @@ <h1>New Publication</h1> -<div class="splitcontentleft"> - <%= render :partial => 'edit' %> -</div> - -<div class="splitcontentright"> - -</div> \ No newline at end of file +<%= render :partial => 'edit' %>