@ -28,23 +28,23 @@ class ContestnotificationsController < ApplicationController
@limit = 10
end
scope = @contest ? @contest . contestnotification . visible : Contestnotification . visible
scope = @contest ? @contest . contestnotification s . visible : Contestnotification s . visible
@contestnotification_count = scope . count
@contestnotification_pages = Paginator . new @contestnotification_count , @limit , params [ 'page' ]
@offset || = @contestnotification_pages . offset
@contestnotifications = scope . all ( :include = > [ :author , :contest ] ,
@contestnotifications s = scope . all ( :include = > [ :author , :contest ] ,
:order = > " #{ Contestnotification . table_name } .created_on DESC " ,
:offset = > @offset ,
:limit = > @limit )
respond_to do | format |
format . html {
@contestnotification = Contestnotification . new # for adding news inline
@contestnotification s = Contestnotification s . new # for adding news inline
render :layout = > 'base_contest'
}
format . api
format . atom { render_feed ( @contestnotifications , :title = > ( @contest ? @contest . name : Setting . app_title ) + " : #{ l ( :label_contest_notification ) } " ) }
format . atom { render_feed ( @contestnotifications s , :title = > ( @contest ? @contest . name : Setting . app_title ) + " : #{ l ( :label_contest_notification ) } " ) }
end
### end ###
end
@ -58,7 +58,7 @@ class ContestnotificationsController < ApplicationController
# format.html # show.html.erb
# format.json { render json: @contestnotification }
# end
@comments = @contestnotification . comments
@comments = @contestnotification s . comments
@comments . reverse! if User . current . wants_comments_in_reverse_order?
render :layout = > 'base_contest'
@ -73,7 +73,7 @@ class ContestnotificationsController < ApplicationController
# format.html # new.html.erb
# format.json { render json: @contestnotification }
# end
@contestnotification = Contestnotification . new ( :contest = > @contest , :author = > User . current )
@contestnotification s = Contestnotification s . new ( :contest = > @contest , :author = > User . current )
render :layout = > 'base_contest'
end
@ -96,11 +96,11 @@ class ContestnotificationsController < ApplicationController
# format.json { render json: @contestnotification.errors, status: :unprocessable_entity }
# end
# end
@contestnotification = Contestnotification . new ( :contest = > @contest , :author = > User . current )
@contestnotification . safe_attributes = params [ :contestnotification ]
@contestnotification s = Contestnotification s . new ( :contest = > @contest , :author = > User . current )
@contestnotification s . safe_attributes = params [ :contestnotification s ]
@news . save_attachments ( params [ :attachments ] )
if @contestnotification . save
render_attachment_warning_if_needed ( @contestnotification )
if @contestnotification s . save
render_attachment_warning_if_needed ( @contestnotification s )
flash [ :notice ] = l ( :notice_successful_create )
redirect_to project_news_index_path ( @contest )
else
@ -123,12 +123,12 @@ class ContestnotificationsController < ApplicationController
# format.json { render json: @contestnotification.errors, status: :unprocessable_entity }
# end
# end
@contestnotification . safe_attributes = params [ :contestnotification ]
@contestnotification . save_attachments ( params [ :attachments ] )
if @contestnotification . save
render_attachment_warning_if_needed ( @contestnotification )
@contestnotification s . safe_attributes = params [ :contestnotification s ]
@contestnotification s . save_attachments ( params [ :attachments ] )
if @contestnotification s . save
render_attachment_warning_if_needed ( @contestnotification s )
flash [ :notice ] = l ( :notice_successful_update )
redirect_to contestnotification_path ( @contestnotification )
redirect_to contestnotification_path ( @contestnotification s )
else
render :action = > 'edit'
end
@ -144,7 +144,7 @@ class ContestnotificationsController < ApplicationController
# format.html { redirect_to contestnotifications_url }
# format.json { head :no_content }
# end
@contestnotification . destroy
@contestnotification s . destroy
redirect_to contest_contestnotification_index_path ( @contest )
end