修改竞赛通知相关文件
This commit is contained in:
parent
372de9932a
commit
1c28edd5d4
|
@ -311,15 +311,15 @@ class ApplicationController < ActionController::Base
|
|||
render_404
|
||||
end
|
||||
|
||||
def find_model_object_contest
|
||||
model = self.class.model_object
|
||||
if model
|
||||
@object = model.find(params[:id])
|
||||
self.instance_variable_set('@' + controller_name.singularize, @object) if @object
|
||||
end
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
# def find_model_object_contest
|
||||
# model = self.class.model_object
|
||||
# if model
|
||||
# @object = model.find(params[:id])
|
||||
# self.instance_variable_set('@' + controller_name.singularize, @object) if @object
|
||||
# end
|
||||
# rescue ActiveRecord::RecordNotFound
|
||||
# render_404
|
||||
# end
|
||||
|
||||
def self.model_object(model)
|
||||
self.model_object = model
|
||||
|
|
|
@ -3,10 +3,10 @@ class ContestnotificationsController < ApplicationController
|
|||
# GET /contestnotifications.json
|
||||
layout 'base_newcontest'
|
||||
default_search_scope :contestnotifications
|
||||
# model_object Contestnotifications
|
||||
# before_filter :find_model_object_contest, :except => [:new, :create, :index]
|
||||
model_object Contestnotification
|
||||
before_filter :find_model_object, :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_author
|
||||
# before_filter :authorize, :except => [:index]
|
||||
|
@ -71,7 +71,7 @@ class ContestnotificationsController < ApplicationController
|
|||
# format.html # show.html.erb
|
||||
# format.json { render json: @contestnotification }
|
||||
# end
|
||||
@notificationcomments = @contestnotifications.notificationcomments
|
||||
@notificationcomments = @contestnotification.notificationcomments
|
||||
@notificationcomments.reverse! if User.current.wants_notificationcomments_in_reverse_order?
|
||||
render :layout => 'base_newcontest'
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ class DocumentsController < ApplicationController
|
|||
model_object Document
|
||||
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_contest, :except => [:index, :new, :create]
|
||||
before_filter :find_project_from_association, :except => [:index, :new, :create]
|
||||
before_filter :authorize , :except => [:index]#Added by young
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ class IssueCategoriesController < ApplicationController
|
|||
menu_item :settings
|
||||
model_object IssueCategory
|
||||
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_by_project_id, :only => [:index, :new, :create]
|
||||
before_filter :authorize
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
class MembersController < ApplicationController
|
||||
model_object Member
|
||||
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_by_project_id, :only => [:index, :create, :autocomplete]
|
||||
before_filter :authorize
|
||||
|
|
|
@ -20,7 +20,7 @@ class VersionsController < ApplicationController
|
|||
menu_item :roadmap
|
||||
model_object Version
|
||||
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_by_project_id, :only => [:index, :new, :create, :close_completed]
|
||||
before_filter :authorize
|
||||
|
|
|
@ -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">
|
||||
<%= watcher_link(@contestnotifications, User.current) %>
|
||||
<%= link_to(l(:button_edit),
|
||||
|
|
Loading…
Reference in New Issue