Mercurial > hg > soundsoftware-site
changeset 376:ad71d0604ac2 feature_36
controller now saving; menus not working; permissions can be set by admins
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Thu, 31 Mar 2011 18:59:07 +0100 |
parents | d750431a4102 |
children | 4be6b16bc6f9 |
files | vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb vendor/plugins/redmine_bibliography/app/models/publication.rb vendor/plugins/redmine_bibliography/init.rb |
diffstat | 3 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Mar 30 00:55:57 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Mar 31 18:59:07 2011 +0100 @@ -1,10 +1,21 @@ class PublicationsController < ApplicationController def new + @publication = Publication.new(params[:publication]) + + if @publication.save + logger.error "GRAVOU XXXdsfgXXX" + else + logger.error "nao gravou" + end + end def create + + logger.error "AAAA create" + @publication.save end @@ -13,9 +24,15 @@ end def edit + logger.error "AAAA edit" + end def update + + logger.error "AAAA update" + + end def show
--- a/vendor/plugins/redmine_bibliography/app/models/publication.rb Wed Mar 30 00:55:57 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/models/publication.rb Thu Mar 31 18:59:07 2011 +0100 @@ -1,4 +1,7 @@ class Publication < ActiveRecord::Base has_many :authorships has_many :authors, :through => :authorships + + validates_presence_of :title + end
--- a/vendor/plugins/redmine_bibliography/init.rb Wed Mar 30 00:55:57 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/init.rb Thu Mar 31 18:59:07 2011 +0100 @@ -7,4 +7,10 @@ version '0.0.1' url 'http://example.com/path/to/plugin' author_url 'http://example.com/about' + + permission :view_bibliography, :redmine_bibliography => :index + + menu :project_menu, :redmine_bibliography, {:controller => 'publications', :action => 'index'}, :caption => 'Bibliography', :after => :activity, :param => :project_id + end +