修改竞赛通知相关文件

This commit is contained in:
wanglinchun 2014-06-06 16:03:47 +08:00
parent 372de9932a
commit 1c28edd5d4
7 changed files with 16 additions and 53 deletions

View File

@ -311,15 +311,15 @@ class ApplicationController < ActionController::Base
render_404 render_404
end end
def find_model_object_contest # def find_model_object_contest
model = self.class.model_object # model = self.class.model_object
if model # if model
@object = model.find(params[:id]) # @object = model.find(params[:id])
self.instance_variable_set('@' + controller_name.singularize, @object) if @object # self.instance_variable_set('@' + controller_name.singularize, @object) if @object
end # end
rescue ActiveRecord::RecordNotFound # rescue ActiveRecord::RecordNotFound
render_404 # render_404
end # end
def self.model_object(model) def self.model_object(model)
self.model_object = model self.model_object = model

View File

@ -3,10 +3,10 @@ class ContestnotificationsController < ApplicationController
# GET /contestnotifications.json # GET /contestnotifications.json
layout 'base_newcontest' layout 'base_newcontest'
default_search_scope :contestnotifications default_search_scope :contestnotifications
# model_object Contestnotifications model_object Contestnotification
# before_filter :find_model_object_contest, :except => [:new, :create, :index] before_filter :find_model_object, :except => [:new, :create, :index]
before_filter :find_contest_from_association, :except => [:new, :create, :index] before_filter :find_contest_from_association, :except => [:new, :create, :index]
# before_filter :find_contest_by_contest_id, :only => [:new, :create] before_filter :find_contest_by_contest_id, :only => [:new, :create]
before_filter :find_contest before_filter :find_contest
before_filter :find_author before_filter :find_author
# before_filter :authorize, :except => [:index] # before_filter :authorize, :except => [:index]
@ -71,7 +71,7 @@ class ContestnotificationsController < ApplicationController
# format.html # show.html.erb # format.html # show.html.erb
# format.json { render json: @contestnotification } # format.json { render json: @contestnotification }
# end # end
@notificationcomments = @contestnotifications.notificationcomments @notificationcomments = @contestnotification.notificationcomments
@notificationcomments.reverse! if User.current.wants_notificationcomments_in_reverse_order? @notificationcomments.reverse! if User.current.wants_notificationcomments_in_reverse_order?
render :layout => 'base_newcontest' render :layout => 'base_newcontest'

View File

@ -21,7 +21,6 @@ class DocumentsController < ApplicationController
model_object Document model_object Document
before_filter :find_project_by_project_id, :only => [:index, :new, :create] before_filter :find_project_by_project_id, :only => [:index, :new, :create]
before_filter :find_model_object, :except => [:index, :new, :create] before_filter :find_model_object, :except => [:index, :new, :create]
before_filter :find_model_object_contest, :except => [:index, :new, :create]
before_filter :find_project_from_association, :except => [:index, :new, :create] before_filter :find_project_from_association, :except => [:index, :new, :create]
before_filter :authorize , :except => [:index]#Added by young before_filter :authorize , :except => [:index]#Added by young

View File

@ -19,7 +19,7 @@ class IssueCategoriesController < ApplicationController
menu_item :settings menu_item :settings
model_object IssueCategory model_object IssueCategory
before_filter :find_model_object, :except => [:index, :new, :create] before_filter :find_model_object, :except => [:index, :new, :create]
before_filter :find_model_object_contest, :except => [:index, :new, :create] #before_filter :find_model_object_contest, :except => [:index, :new, :create]
before_filter :find_project_from_association, :except => [:index, :new, :create] before_filter :find_project_from_association, :except => [:index, :new, :create]
before_filter :find_project_by_project_id, :only => [:index, :new, :create] before_filter :find_project_by_project_id, :only => [:index, :new, :create]
before_filter :authorize before_filter :authorize

View File

@ -17,7 +17,7 @@
class MembersController < ApplicationController class MembersController < ApplicationController
model_object Member model_object Member
before_filter :find_model_object, :except => [:index, :create, :autocomplete] before_filter :find_model_object, :except => [:index, :create, :autocomplete]
before_filter :find_model_object_contest, :except => [:index, :create, :autocomplete] #before_filter :find_model_object_contest, :except => [:index, :create, :autocomplete]
before_filter :find_project_from_association, :except => [:index, :create, :autocomplete] before_filter :find_project_from_association, :except => [:index, :create, :autocomplete]
before_filter :find_project_by_project_id, :only => [:index, :create, :autocomplete] before_filter :find_project_by_project_id, :only => [:index, :create, :autocomplete]
before_filter :authorize before_filter :authorize

View File

@ -20,7 +20,7 @@ class VersionsController < ApplicationController
menu_item :roadmap menu_item :roadmap
model_object Version model_object Version
before_filter :find_model_object, :except => [:index, :new, :create, :close_completed] before_filter :find_model_object, :except => [:index, :new, :create, :close_completed]
before_filter :find_model_object_contest, :except => [:index, :new, :create] #before_filter :find_model_object_contest, :except => [:index, :new, :create]
before_filter :find_project_from_association, :except => [:index, :new, :create, :close_completed] before_filter :find_project_from_association, :except => [:index, :new, :create, :close_completed]
before_filter :find_project_by_project_id, :only => [:index, :new, :create, :close_completed] before_filter :find_project_by_project_id, :only => [:index, :new, :create, :close_completed]
before_filter :authorize before_filter :authorize

View File

@ -1,40 +1,4 @@
<!-- <p id="notice"><%= notice %></p>
<p>
<b>Contest:</b>
<%= @contestnotification.contest_id %>
</p>
<p>
<b>Title:</b>
<%= @contestnotification.title %>
</p>
<p>
<b>Summary:</b>
<%= @contestnotification.summary %>
</p>
<p>
<b>Description:</b>
<%= @contestnotification.description %>
</p>
<p>
<b>Author:</b>
<%= @contestnotification.author_id %>
</p>
<p>
<b>Comments count:</b>
<%= @contestnotification.comments_count %>
</p>
<%= link_to 'Edit', edit_contestnotification_path(@contestnotification) %> |
<%= link_to 'Back', contestnotifications_path %> -->
<!--begin-->
<div class="contextual"> <div class="contextual">
<%= watcher_link(@contestnotifications, User.current) %> <%= watcher_link(@contestnotifications, User.current) %>
<%= link_to(l(:button_edit), <%= link_to(l(:button_edit),