Mercurial > hg > soundsoftware-site
changeset 444:b461f84ed41a feature_36
Publications: Routes for regular REST behaviour; Import view and controller action; New beahviour for new action.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Sat, 04 Jun 2011 18:08:01 +0100 |
parents | 27930c9b424d |
children | 77f88379115a |
files | vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb vendor/plugins/redmine_bibliography/app/views/publications/import.html.erb vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb vendor/plugins/redmine_bibliography/config/routes.rb |
diffstat | 4 files changed, 27 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- 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 Sat Jun 04 18:08:01 2011 +0100 @@ -5,15 +5,13 @@ unloadable def new - # we always try to create at least one publication - @publication = Publication.new + @publication = Publication.new # the step we're at in the form @publication.current_step = session[:publication_step] @new_publications = [] session[:publications] ||= {} - end def create @@ -53,6 +51,7 @@ end def edit + @publication = Publication.find(params[:id]) end @@ -145,10 +144,10 @@ end author.authorships.create!( - :publication => @publication, - :institution => institution, - :email => email, - :order => idx) + :publication => @publication, + :institution => institution, + :email => email, + :order => idx) end end @@ -158,6 +157,11 @@ end + def import + @publication = Publication.new + + + end def review_new_entries
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/import.html.erb Sat Jun 04 18:08:01 2011 +0100 @@ -0,0 +1,12 @@ +<h1>New Publication</h1> + +<% form_for @publication, :url => { :action => "create" } do |f| %> + <% f.error_messages %> + + <%= render :partial => "#{@publication.current_step}_bibtex_step", :locals => { :f => f } %> + + <p><%= f.submit "Submit" %></p> + <p><%= f.submit "Back", :name => "back_button" unless @publication.first_step? %></p> + +<% end %> +
--- a/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Thu Jun 02 14:39:11 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Sat Jun 04 18:08:01 2011 +0100 @@ -1,12 +1,4 @@ <h1>New Publication</h1> -<% form_for @publication, :url => { :action => "create" } do |f| %> - <% f.error_messages %> +<%= render :partial => 'edit' %> - <%= render :partial => "#{@publication.current_step}_bibtex_step", :locals => { :f => f } %> - - <p><%= f.submit "Submit" %></p> - <p><%= f.submit "Back", :name => "back_button" unless @publication.first_step? %></p> - -<% end %> -