forked from edavis10/redmine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote branch 'redmine/master' into upstream-int
- Loading branch information
Showing
654 changed files
with
38,643 additions
and
14,954 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
syntax: glob | ||
|
||
.project | ||
.loadpath | ||
config/additional_environment.rb | ||
config/configuration.yml | ||
config/database.yml | ||
config/email.yml | ||
config/initializers/session_store.rb | ||
coverage | ||
db/*.db | ||
db/*.sqlite3 | ||
db/schema.rb | ||
files/* | ||
lib/redmine/scm/adapters/mercurial/redminehelper.pyc | ||
lib/redmine/scm/adapters/mercurial/redminehelper.pyo | ||
log/*.log* | ||
log/mongrel_debug | ||
public/dispatch.* | ||
public/plugin_assets | ||
tmp/* | ||
tmp/cache/* | ||
tmp/sessions/* | ||
tmp/sockets/* | ||
tmp/test/* | ||
vendor/rails | ||
*.rbc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class CommentsController < ApplicationController | ||
default_search_scope :news | ||
model_object News | ||
before_filter :find_model_object | ||
before_filter :find_project_from_association | ||
before_filter :authorize | ||
|
||
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed } | ||
def create | ||
@comment = Comment.new(params[:comment]) | ||
@comment.author = User.current | ||
if @news.comments << @comment | ||
flash[:notice] = l(:label_comment_added) | ||
end | ||
|
||
redirect_to :controller => 'news', :action => 'show', :id => @news | ||
end | ||
|
||
verify :method => :delete, :only => :destroy, :render => {:nothing => true, :status => :method_not_allowed } | ||
def destroy | ||
@news.comments.find(params[:comment_id]).destroy | ||
redirect_to :controller => 'news', :action => 'show', :id => @news | ||
end | ||
|
||
private | ||
|
||
# ApplicationController's find_model_object sets it based on the controller | ||
# name so it needs to be overriden and set to @news instead | ||
def find_model_object | ||
super | ||
@news = @object | ||
@comment = nil | ||
@news | ||
end | ||
|
||
end |
Oops, something went wrong.