龚乐鑫修改意见4:redirect_to后使用 url
This commit is contained in:
parent
f05aee0ca2
commit
602982a124
|
@ -66,7 +66,7 @@ class AccountController < ApplicationController
|
||||||
if @user.save
|
if @user.save
|
||||||
@token.destroy
|
@token.destroy
|
||||||
flash[:notice] = l(:notice_account_password_updated)
|
flash[:notice] = l(:notice_account_password_updated)
|
||||||
redirect_to signin_path
|
redirect_to signin_url
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -92,7 +92,7 @@ class AccountController < ApplicationController
|
||||||
Mailer.lost_password(token).deliver
|
Mailer.lost_password(token).deliver
|
||||||
end
|
end
|
||||||
flash[:notice] = l(:notice_account_lost_email_sent)
|
flash[:notice] = l(:notice_account_lost_email_sent)
|
||||||
redirect_to signin_path
|
redirect_to signin_url
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -136,7 +136,7 @@ class AccountController < ApplicationController
|
||||||
session[:auth_source_registration] = nil
|
session[:auth_source_registration] = nil
|
||||||
self.logged_user = @user
|
self.logged_user = @user
|
||||||
flash[:notice] = l(:notice_account_activated)
|
flash[:notice] = l(:notice_account_activated)
|
||||||
redirect_to my_account_path
|
redirect_to my_account_url
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@user.login = params[:user][:login]
|
@user.login = params[:user][:login]
|
||||||
|
@ -204,7 +204,7 @@ class AccountController < ApplicationController
|
||||||
token.destroy
|
token.destroy
|
||||||
flash[:notice] = l(:notice_account_activated)
|
flash[:notice] = l(:notice_account_activated)
|
||||||
end
|
end
|
||||||
redirect_to signin_path
|
redirect_to signin_url
|
||||||
end
|
end
|
||||||
|
|
||||||
def valid_ajax
|
def valid_ajax
|
||||||
|
@ -363,7 +363,7 @@ class AccountController < ApplicationController
|
||||||
UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
|
UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
|
||||||
Mailer.register(token).deliver
|
Mailer.register(token).deliver
|
||||||
flash[:notice] = l(:notice_account_register_done)
|
flash[:notice] = l(:notice_account_register_done)
|
||||||
redirect_to signin_path
|
redirect_to signin_url
|
||||||
else
|
else
|
||||||
yield if block_given?
|
yield if block_given?
|
||||||
end
|
end
|
||||||
|
@ -380,7 +380,7 @@ class AccountController < ApplicationController
|
||||||
UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
|
UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
|
||||||
self.logged_user = user
|
self.logged_user = user
|
||||||
flash[:notice] = l(:notice_account_activated)
|
flash[:notice] = l(:notice_account_activated)
|
||||||
redirect_to my_account_path
|
redirect_to my_account_url
|
||||||
else
|
else
|
||||||
yield if block_given?
|
yield if block_given?
|
||||||
end
|
end
|
||||||
|
@ -402,6 +402,6 @@ class AccountController < ApplicationController
|
||||||
|
|
||||||
def account_pending
|
def account_pending
|
||||||
flash[:notice] = l(:notice_account_pending)
|
flash[:notice] = l(:notice_account_pending)
|
||||||
redirect_to signin_path
|
redirect_to signin_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -86,7 +86,7 @@ class AdminController < ApplicationController
|
||||||
flash[:error] = l(:error_can_t_load_default_data, e.message)
|
flash[:error] = l(:error_can_t_load_default_data, e.message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
redirect_to admin_path
|
redirect_to admin_url
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_email
|
def test_email
|
||||||
|
@ -100,7 +100,7 @@ class AdminController < ApplicationController
|
||||||
flash[:error] = l(:notice_email_error, e.message)
|
flash[:error] = l(:notice_email_error, e.message)
|
||||||
end
|
end
|
||||||
ActionMailer::Base.raise_delivery_errors = raise_delivery_errors
|
ActionMailer::Base.raise_delivery_errors = raise_delivery_errors
|
||||||
redirect_to settings_path(:tab => 'notifications')
|
redirect_to settings_url(:tab => 'notifications')
|
||||||
end
|
end
|
||||||
|
|
||||||
def info
|
def info
|
||||||
|
@ -159,7 +159,7 @@ class AdminController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
format.html {
|
format.html {
|
||||||
redirect_to admin_first_page_made_path
|
redirect_to admin_first_page_made_url
|
||||||
}
|
}
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
#format.json { render json: @first_page, status: :created, location: @first_page }
|
#format.json { render json: @first_page, status: :created, location: @first_page }
|
||||||
|
@ -194,7 +194,7 @@ class AdminController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to admin_course_page_made_path
|
redirect_to admin_course_page_made_url
|
||||||
}
|
}
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
|
@ -235,7 +235,7 @@ class AdminController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to admin_contest_page_made_path
|
redirect_to admin_contest_page_made_url
|
||||||
}
|
}
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
|
@ -270,7 +270,7 @@ class AdminController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to admin_web_footer_made_path
|
redirect_to admin_web_footer_made_url
|
||||||
}
|
}
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
|
|
|
@ -209,8 +209,8 @@ class ApplicationController < ActionController::Base
|
||||||
url = url_for(:controller => params[:controller], :action => params[:action], :id => params[:id], :project_id => params[:project_id])
|
url = url_for(:controller => params[:controller], :action => params[:action], :id => params[:id], :project_id => params[:project_id])
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to :controller => "account", :action => "login", :back_url => url }
|
format.html { redirect_to signin_url }
|
||||||
format.atom { redirect_to :controller => "account", :action => "login", :back_url => url }
|
format.atom { redirect_to signin_url }
|
||||||
format.xml { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' }
|
format.xml { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' }
|
||||||
format.js { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' }
|
format.js { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' }
|
||||||
format.json { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' }
|
format.json { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' }
|
||||||
|
|
|
@ -36,7 +36,7 @@ class AuthSourcesController < ApplicationController
|
||||||
@auth_source = AuthSource.new_subclass_instance(params[:type], params[:auth_source])
|
@auth_source = AuthSource.new_subclass_instance(params[:type], params[:auth_source])
|
||||||
if @auth_source.save
|
if @auth_source.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to auth_sources_path
|
redirect_to auth_sources_url
|
||||||
else
|
else
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
end
|
end
|
||||||
|
@ -48,7 +48,7 @@ class AuthSourcesController < ApplicationController
|
||||||
def update
|
def update
|
||||||
if @auth_source.update_attributes(params[:auth_source])
|
if @auth_source.update_attributes(params[:auth_source])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to auth_sources_path
|
redirect_to auth_sources_url
|
||||||
else
|
else
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
end
|
end
|
||||||
|
@ -61,7 +61,7 @@ class AuthSourcesController < ApplicationController
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
flash[:error] = l(:error_unable_to_connect, e.message)
|
flash[:error] = l(:error_unable_to_connect, e.message)
|
||||||
end
|
end
|
||||||
redirect_to auth_sources_path
|
redirect_to auth_sources_url
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
@ -69,7 +69,7 @@ class AuthSourcesController < ApplicationController
|
||||||
@auth_source.destroy
|
@auth_source.destroy
|
||||||
flash[:notice] = l(:notice_successful_delete)
|
flash[:notice] = l(:notice_successful_delete)
|
||||||
end
|
end
|
||||||
redirect_to auth_sources_path
|
redirect_to auth_sources_url
|
||||||
end
|
end
|
||||||
|
|
||||||
def autocomplete_for_new_user
|
def autocomplete_for_new_user
|
||||||
|
|
|
@ -612,9 +612,9 @@ class BidsController < ApplicationController
|
||||||
binding_project = params[:binding_project]
|
binding_project = params[:binding_project]
|
||||||
if can_delete_project_homework(BidingProject.find(binding_project),User.current)
|
if can_delete_project_homework(BidingProject.find(binding_project),User.current)
|
||||||
if BidingProject.delete(binding_project)
|
if BidingProject.delete(binding_project)
|
||||||
redirect_to project_for_bid_path
|
redirect_to project_for_bid_url
|
||||||
else
|
else
|
||||||
redirect_to 403;
|
render_403;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -731,7 +731,7 @@ class BidsController < ApplicationController
|
||||||
flash[:notice] = l(:label_bid_succeed)
|
flash[:notice] = l(:label_bid_succeed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
redirect_to respond_path(@bid)
|
redirect_to respond_url(@bid)
|
||||||
else
|
else
|
||||||
@bid.safe_attributes = params[:bid]
|
@bid.safe_attributes = params[:bid]
|
||||||
render :action => 'new_bid'
|
render :action => 'new_bid'
|
||||||
|
@ -755,7 +755,7 @@ class BidsController < ApplicationController
|
||||||
flash[:notice] = l(:label_bid_succeed)
|
flash[:notice] = l(:label_bid_succeed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
redirect_to respond_path(@bid)
|
redirect_to respond_url(@bid)
|
||||||
else
|
else
|
||||||
@bid.safe_attributes = params[:bid]
|
@bid.safe_attributes = params[:bid]
|
||||||
render :action => 'new_bid'
|
render :action => 'new_bid'
|
||||||
|
@ -782,7 +782,7 @@ class BidsController < ApplicationController
|
||||||
flash[:notice] = l(:label_bid_succeed)
|
flash[:notice] = l(:label_bid_succeed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
redirect_to respond_path(@bid)
|
redirect_to respond_url(@bid)
|
||||||
else
|
else
|
||||||
@bid.safe_attributes = params[:bid]
|
@bid.safe_attributes = params[:bid]
|
||||||
render :action => 'new_bid'
|
render :action => 'new_bid'
|
||||||
|
@ -811,7 +811,7 @@ class BidsController < ApplicationController
|
||||||
flash[:notice] = l(:label_bid_succeed)
|
flash[:notice] = l(:label_bid_succeed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
redirect_to respond_path(@bid)
|
redirect_to respond_url(@bid)
|
||||||
else
|
else
|
||||||
@bid.safe_attributes = params[:bid]
|
@bid.safe_attributes = params[:bid]
|
||||||
@homework = @bid
|
@homework = @bid
|
||||||
|
@ -859,7 +859,7 @@ class BidsController < ApplicationController
|
||||||
@bid.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads]))
|
@bid.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads]))
|
||||||
if @bid.save
|
if @bid.save
|
||||||
flash[:notice] = l(:label_update_homework_succeed)
|
flash[:notice] = l(:label_update_homework_succeed)
|
||||||
redirect_to course_homework_path(@course)
|
redirect_to course_homework_url(@course)
|
||||||
else
|
else
|
||||||
@bid.safe_attributes = params[:bid]
|
@bid.safe_attributes = params[:bid]
|
||||||
render :action => 'edit', :layout =>'base_courses'
|
render :action => 'edit', :layout =>'base_courses'
|
||||||
|
|
|
@ -108,7 +108,7 @@ class BoardsController < ApplicationController
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
#Modified by young
|
#Modified by young
|
||||||
#redirect_to_settings_in_projects
|
#redirect_to_settings_in_projects
|
||||||
redirect_to project_board_path(@project, @board)
|
redirect_to project_board_url(@project, @board)
|
||||||
#Ended by young
|
#Ended by young
|
||||||
else
|
else
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
|
@ -137,7 +137,7 @@ class BoardsController < ApplicationController
|
||||||
|
|
||||||
private
|
private
|
||||||
def redirect_to_settings_in_projects
|
def redirect_to_settings_in_projects
|
||||||
redirect_to settings_project_path(@project, :tab => 'boards')
|
redirect_to settings_project_url(@project, :tab => 'boards')
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_board_if_available
|
def find_board_if_available
|
||||||
|
|
|
@ -32,12 +32,12 @@ class CommentsController < ApplicationController
|
||||||
flash[:notice] = l(:label_comment_added)
|
flash[:notice] = l(:label_comment_added)
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to news_path(@news)
|
redirect_to news_url(@news)
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@news.comments.find(params[:comment_id]).destroy
|
@news.comments.find(params[:comment_id]).destroy
|
||||||
redirect_to news_path(@news)
|
redirect_to news_url(@news)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -118,7 +118,7 @@ class ContestnotificationsController < ApplicationController
|
||||||
if @contestnotification.save
|
if @contestnotification.save
|
||||||
render_attachment_warning_if_needed(@contestnotification)
|
render_attachment_warning_if_needed(@contestnotification)
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to contest_contestnotifications_path(@contest)
|
redirect_to contest_contestnotifications_url(@contest)
|
||||||
else
|
else
|
||||||
layout_file = 'base_newcontest'
|
layout_file = 'base_newcontest'
|
||||||
render :action => 'new', :layout => layout_file
|
render :action => 'new', :layout => layout_file
|
||||||
|
@ -145,7 +145,7 @@ class ContestnotificationsController < ApplicationController
|
||||||
if @contestnotification.save
|
if @contestnotification.save
|
||||||
render_attachment_warning_if_needed(@contestnotification)
|
render_attachment_warning_if_needed(@contestnotification)
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to contest_contestnotification_path(@contestnotification.contest, @contestnotification)
|
redirect_to contest_contestnotification_url(@contestnotification.contest, @contestnotification)
|
||||||
else
|
else
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
end
|
end
|
||||||
|
@ -163,7 +163,7 @@ class ContestnotificationsController < ApplicationController
|
||||||
# end
|
# end
|
||||||
@contestnotification = Contestnotification.find(params[:id])
|
@contestnotification = Contestnotification.find(params[:id])
|
||||||
@contestnotification.destroy
|
@contestnotification.destroy
|
||||||
redirect_to contest_contestnotifications_path(@contest)
|
redirect_to contest_contestnotifications_url(@contest)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -44,7 +44,7 @@ class ContestsController < ApplicationController
|
||||||
#@contests = @contests.like(params[:name]) if params[:name].present?
|
#@contests = @contests.like(params[:name]) if params[:name].present?
|
||||||
@contests = Contest.visible.where("name like '%#{params[:name]}%'")
|
@contests = Contest.visible.where("name like '%#{params[:name]}%'")
|
||||||
if params[:contests_search]
|
if params[:contests_search]
|
||||||
(redirect_to contests_path, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
(redirect_to contests_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
||||||
end
|
end
|
||||||
@contest_count = @contests.count
|
@contest_count = @contests.count
|
||||||
@contest_pages = Paginator.new @contest_count, @limit, params['page']
|
@contest_pages = Paginator.new @contest_count, @limit, params['page']
|
||||||
|
@ -617,7 +617,7 @@ class ContestsController < ApplicationController
|
||||||
flash[:notice] = l(:label_contesting_created_succeed)
|
flash[:notice] = l(:label_contesting_created_succeed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
redirect_to show_contest_contest_path(@contest)
|
redirect_to show_contest_contest_url(@contest)
|
||||||
else
|
else
|
||||||
@contest.safe_attributes = params[:contest]
|
@contest.safe_attributes = params[:contest]
|
||||||
render :action => 'new_contest'
|
render :action => 'new_contest'
|
||||||
|
@ -641,7 +641,7 @@ class ContestsController < ApplicationController
|
||||||
flash[:notice] = l(:label_contesting_updated_succeed)
|
flash[:notice] = l(:label_contesting_updated_succeed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
redirect_to show_contest_contest_path(@contest)
|
redirect_to show_contest_contest_url(@contest)
|
||||||
|
|
||||||
else
|
else
|
||||||
@contest.safe_attributes = params[:contest]
|
@contest.safe_attributes = params[:contest]
|
||||||
|
|
|
@ -79,7 +79,7 @@ class CoursesController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to settings_course_path(@course)
|
redirect_to settings_course_url(@course)
|
||||||
}
|
}
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
|
@ -102,7 +102,7 @@ class CoursesController < ApplicationController
|
||||||
def search
|
def search
|
||||||
courses_all = Course.all_course
|
courses_all = Course.all_course
|
||||||
name = params[:name]
|
name = params[:name]
|
||||||
(redirect_to courses_path, :notice => l(:label_sumbit_empty);return) if name.blank?
|
(redirect_to courses_url, :notice => l(:label_sumbit_empty);return) if name.blank?
|
||||||
@courses = courses_all.visible
|
@courses = courses_all.visible
|
||||||
if params[:name].present?
|
if params[:name].present?
|
||||||
@courses_all = @courses.like(params[:name])
|
@courses_all = @courses.like(params[:name])
|
||||||
|
@ -263,11 +263,11 @@ class CoursesController < ApplicationController
|
||||||
format.html {
|
format.html {
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
if params[:continue]
|
if params[:continue]
|
||||||
redirect_to new_course_path(attrs, :course => '0')
|
redirect_to new_course_url(attrs, :course => '0')
|
||||||
elsif params[:course_continue]
|
elsif params[:course_continue]
|
||||||
redirect_to new_course_path(:course => '1')
|
redirect_to new_course_url(:course => '1')
|
||||||
else
|
else
|
||||||
redirect_to settings_course_path(@course, :course_type => 1)
|
redirect_to settings_course_url(@course, :course_type => 1)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) }
|
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) }
|
||||||
|
|
|
@ -34,7 +34,7 @@ class CustomFieldsController < ApplicationController
|
||||||
if @custom_field.save
|
if @custom_field.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field)
|
call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field)
|
||||||
redirect_to custom_fields_path(:tab => @custom_field.class.name)
|
redirect_to custom_fields_url(:tab => @custom_field.class.name)
|
||||||
else
|
else
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
end
|
end
|
||||||
|
@ -47,7 +47,7 @@ class CustomFieldsController < ApplicationController
|
||||||
if @custom_field.update_attributes(params[:custom_field])
|
if @custom_field.update_attributes(params[:custom_field])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field)
|
call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field)
|
||||||
redirect_to custom_fields_path(:tab => @custom_field.class.name)
|
redirect_to custom_fields_url(:tab => @custom_field.class.name)
|
||||||
else
|
else
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
end
|
end
|
||||||
|
@ -59,7 +59,7 @@ class CustomFieldsController < ApplicationController
|
||||||
rescue
|
rescue
|
||||||
flash[:error] = l(:error_can_not_delete_custom_field)
|
flash[:error] = l(:error_can_not_delete_custom_field)
|
||||||
end
|
end
|
||||||
redirect_to custom_fields_path(:tab => @custom_field.class.name)
|
redirect_to custom_fields_url(:tab => @custom_field.class.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -76,7 +76,7 @@ class DocumentsController < ApplicationController
|
||||||
if @document.save
|
if @document.save
|
||||||
render_attachment_warning_if_needed(@document)
|
render_attachment_warning_if_needed(@document)
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to project_documents_path(@project)
|
redirect_to project_documents_url(@project)
|
||||||
else
|
else
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
end
|
end
|
||||||
|
@ -89,7 +89,7 @@ class DocumentsController < ApplicationController
|
||||||
@document.safe_attributes = params[:document]
|
@document.safe_attributes = params[:document]
|
||||||
if request.put? and @document.save
|
if request.put? and @document.save
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to document_path(@document)
|
redirect_to document_url(@document)
|
||||||
else
|
else
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
end
|
end
|
||||||
|
@ -97,7 +97,7 @@ class DocumentsController < ApplicationController
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@document.destroy if request.delete?
|
@document.destroy if request.delete?
|
||||||
redirect_to project_documents_path(@project)
|
redirect_to project_documents_url(@project)
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_attachment
|
def add_attachment
|
||||||
|
@ -107,7 +107,7 @@ class DocumentsController < ApplicationController
|
||||||
if attachments.present? && attachments[:files].present? && Setting.notified_events.include?('document_added')
|
if attachments.present? && attachments[:files].present? && Setting.notified_events.include?('document_added')
|
||||||
Mailer.attachments_added(attachments[:files]).deliver
|
Mailer.attachments_added(attachments[:files]).deliver
|
||||||
end
|
end
|
||||||
redirect_to document_path(@document)
|
redirect_to document_url(@document)
|
||||||
end
|
end
|
||||||
|
|
||||||
# 权限判断
|
# 权限判断
|
||||||
|
|
|
@ -46,7 +46,7 @@ class EnumerationsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
if request.post? && @enumeration.save
|
if request.post? && @enumeration.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to enumerations_path
|
redirect_to enumerations_url
|
||||||
else
|
else
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
end
|
end
|
||||||
|
@ -58,7 +58,7 @@ class EnumerationsController < ApplicationController
|
||||||
def update
|
def update
|
||||||
if request.put? && @enumeration.update_attributes(params[:enumeration])
|
if request.put? && @enumeration.update_attributes(params[:enumeration])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to enumerations_path
|
redirect_to enumerations_url
|
||||||
else
|
else
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
end
|
end
|
||||||
|
@ -68,12 +68,12 @@ class EnumerationsController < ApplicationController
|
||||||
if !@enumeration.in_use?
|
if !@enumeration.in_use?
|
||||||
# No associated objects
|
# No associated objects
|
||||||
@enumeration.destroy
|
@enumeration.destroy
|
||||||
redirect_to enumerations_path
|
redirect_to enumerations_url
|
||||||
return
|
return
|
||||||
elsif params[:reassign_to_id]
|
elsif params[:reassign_to_id]
|
||||||
if reassign_to = @enumeration.class.find_by_id(params[:reassign_to_id])
|
if reassign_to = @enumeration.class.find_by_id(params[:reassign_to_id])
|
||||||
@enumeration.destroy(reassign_to)
|
@enumeration.destroy(reassign_to)
|
||||||
redirect_to enumerations_path
|
redirect_to enumerations_url
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -178,7 +178,7 @@ class FilesController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
format.html {
|
format.html {
|
||||||
redirect_to project_files_path(@project)
|
redirect_to project_files_url(@project)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
elsif @course
|
elsif @course
|
||||||
|
@ -206,7 +206,7 @@ class FilesController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
format.html {
|
format.html {
|
||||||
redirect_to course_files_path(@course)
|
redirect_to course_files_url(@course)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,7 @@ class ForumsController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @memo.save
|
if @memo.save
|
||||||
format.html { redirect_to (forum_memo_path(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id))), notice: "#{l :label_memo_create_succ}" }
|
format.html { redirect_to (forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id))), notice: "#{l :label_memo_create_succ}" }
|
||||||
format.json { render json: @memo, status: :created, location: @memo }
|
format.json { render json: @memo, status: :created, location: @memo }
|
||||||
else
|
else
|
||||||
sort_init 'updated_at', 'desc'
|
sort_init 'updated_at', 'desc'
|
||||||
|
@ -170,7 +170,7 @@ class ForumsController < ApplicationController
|
||||||
def search_forum
|
def search_forum
|
||||||
# @forums = paginateHelper Forum.where("name LIKE '%#{params[:name]}%'")
|
# @forums = paginateHelper Forum.where("name LIKE '%#{params[:name]}%'")
|
||||||
q = "%#{params[:name].strip}%"
|
q = "%#{params[:name].strip}%"
|
||||||
(redirect_to forums_path, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
(redirect_to forums_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
||||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||||
@forums_all = Forum.where("name LIKE ?", q)
|
@forums_all = Forum.where("name LIKE ?", q)
|
||||||
@forums_count = @forums_all.count
|
@forums_count = @forums_all.count
|
||||||
|
|
|
@ -52,7 +52,7 @@ class GroupsController < ApplicationController
|
||||||
if @group.save
|
if @group.save
|
||||||
format.html {
|
format.html {
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to(params[:continue] ? new_group_path : groups_path)
|
redirect_to(params[:continue] ? new_group_url : groups_url)
|
||||||
}
|
}
|
||||||
format.api { render :action => 'show', :status => :created, :location => group_url(@group) }
|
format.api { render :action => 'show', :status => :created, :location => group_url(@group) }
|
||||||
else
|
else
|
||||||
|
@ -71,7 +71,7 @@ class GroupsController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @group.save
|
if @group.save
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
format.html { redirect_to(groups_path) }
|
format.html { redirect_to(groups_url) }
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
else
|
else
|
||||||
format.html { render :action => "edit" }
|
format.html { render :action => "edit" }
|
||||||
|
@ -84,7 +84,7 @@ class GroupsController < ApplicationController
|
||||||
@group.destroy
|
@group.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to(groups_path) }
|
format.html { redirect_to(groups_url) }
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -93,7 +93,7 @@ class GroupsController < ApplicationController
|
||||||
@users = User.find_all_by_id(params[:user_id] || params[:user_ids])
|
@users = User.find_all_by_id(params[:user_id] || params[:user_ids])
|
||||||
@group.users << @users if request.post?
|
@group.users << @users if request.post?
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to edit_group_path(@group, :tab => 'users') }
|
format.html { redirect_to edit_group_url(@group, :tab => 'users') }
|
||||||
format.js
|
format.js
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
|
@ -102,7 +102,7 @@ class GroupsController < ApplicationController
|
||||||
def remove_user
|
def remove_user
|
||||||
@group.users.delete(User.find(params[:user_id])) if request.delete?
|
@group.users.delete(User.find(params[:user_id])) if request.delete?
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to edit_group_path(@group, :tab => 'users') }
|
format.html { redirect_to edit_group_url(@group, :tab => 'users') }
|
||||||
format.js
|
format.js
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
|
@ -118,7 +118,7 @@ class GroupsController < ApplicationController
|
||||||
@membership = Member.edit_membership(params[:membership_id], params[:membership], @group)
|
@membership = Member.edit_membership(params[:membership_id], params[:membership], @group)
|
||||||
@membership.save if request.post?
|
@membership.save if request.post?
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to edit_group_path(@group, :tab => 'memberships') }
|
format.html { redirect_to edit_group_url(@group, :tab => 'memberships') }
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -126,7 +126,7 @@ class GroupsController < ApplicationController
|
||||||
def destroy_membership
|
def destroy_membership
|
||||||
Member.find(params[:membership_id]).destroy if request.post?
|
Member.find(params[:membership_id]).destroy if request.post?
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to edit_group_path(@group, :tab => 'memberships') }
|
format.html { redirect_to edit_group_url(@group, :tab => 'memberships') }
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -110,7 +110,7 @@ class HomeworkAttachController < ApplicationController
|
||||||
|
|
||||||
if @homework.save
|
if @homework.save
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to course_for_bid_path @homework.bid }
|
format.html { redirect_to course_for_bid_url @homework.bid }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -215,7 +215,7 @@ class HomeworkAttachController < ApplicationController
|
||||||
end
|
end
|
||||||
if @homework.save
|
if @homework.save
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to course_for_bid_path @homework.bid }
|
format.html { redirect_to course_for_bid_url @homework.bid }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -230,7 +230,7 @@ class HomeworkAttachController < ApplicationController
|
||||||
if User.current.admin? || User.current == @homework.user
|
if User.current.admin? || User.current == @homework.user
|
||||||
if @homework.destroy
|
if @homework.destroy
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to course_for_bid_path @homework.bid }
|
format.html { redirect_to course_for_bid_url @homework.bid }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -315,7 +315,7 @@ class HomeworkAttachController < ApplicationController
|
||||||
@homework = HomeworkAttach.find(params[:jour_id])
|
@homework = HomeworkAttach.find(params[:jour_id])
|
||||||
@add_jour = @homework.addjours User.current.id, params[:new_form][:user_message],0,params[:is_comprehensive_evaluation]
|
@add_jour = @homework.addjours User.current.id, params[:new_form][:user_message],0,params[:is_comprehensive_evaluation]
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to homework_attach_path @homework }
|
format.html { redirect_to homework_attach_url @homework }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -114,7 +114,7 @@ class IssueCategoriesController < ApplicationController
|
||||||
private
|
private
|
||||||
|
|
||||||
def redirect_to_settings_in_projects
|
def redirect_to_settings_in_projects
|
||||||
redirect_to settings_project_path(@project, :tab => 'categories')
|
redirect_to settings_project_url(@project, :tab => 'categories')
|
||||||
end
|
end
|
||||||
|
|
||||||
# Wrap ApplicationController's find_model_object method to set
|
# Wrap ApplicationController's find_model_object method to set
|
||||||
|
|
|
@ -48,7 +48,7 @@ class IssueRelationsController < ApplicationController
|
||||||
saved = @relation.save
|
saved = @relation.save
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to issue_path(@issue) }
|
format.html { redirect_to issue_url(@issue) }
|
||||||
format.js {
|
format.js {
|
||||||
@relations = @issue.reload.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
|
@relations = @issue.reload.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ class IssueRelationsController < ApplicationController
|
||||||
@relation.destroy
|
@relation.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to issue_path(@relation.issue_from) }
|
format.html { redirect_to issue_url(@relation.issue_from) }
|
||||||
format.js
|
format.js
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,7 +42,7 @@ class IssueStatusesController < ApplicationController
|
||||||
@issue_status = IssueStatus.new(params[:issue_status])
|
@issue_status = IssueStatus.new(params[:issue_status])
|
||||||
if request.post? && @issue_status.save
|
if request.post? && @issue_status.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to issue_statuses_path
|
redirect_to issue_statuses_url
|
||||||
else
|
else
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
end
|
end
|
||||||
|
@ -56,7 +56,7 @@ class IssueStatusesController < ApplicationController
|
||||||
@issue_status = IssueStatus.find(params[:id])
|
@issue_status = IssueStatus.find(params[:id])
|
||||||
if request.put? && @issue_status.update_attributes(params[:issue_status])
|
if request.put? && @issue_status.update_attributes(params[:issue_status])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to issue_statuses_path
|
redirect_to issue_statuses_url
|
||||||
else
|
else
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
end
|
end
|
||||||
|
@ -64,10 +64,10 @@ class IssueStatusesController < ApplicationController
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
IssueStatus.find(params[:id]).destroy
|
IssueStatus.find(params[:id]).destroy
|
||||||
redirect_to issue_statuses_path
|
redirect_to issue_statuses_url
|
||||||
rescue
|
rescue
|
||||||
flash[:error] = l(:error_unable_delete_issue_status)
|
flash[:error] = l(:error_unable_delete_issue_status)
|
||||||
redirect_to issue_statuses_path
|
redirect_to issue_statuses_url
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_issue_done_ratio
|
def update_issue_done_ratio
|
||||||
|
@ -76,6 +76,6 @@ class IssueStatusesController < ApplicationController
|
||||||
else
|
else
|
||||||
flash[:error] = l(:error_issue_done_ratios_not_updated)
|
flash[:error] = l(:error_issue_done_ratios_not_updated)
|
||||||
end
|
end
|
||||||
redirect_to issue_statuses_path
|
redirect_to issue_statuses_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -160,9 +160,9 @@ class IssuesController < ApplicationController
|
||||||
#flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("##{@issue.id}", issue_path(@issue), :title => @issue.subject))
|
#flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("##{@issue.id}", issue_path(@issue), :title => @issue.subject))
|
||||||
if params[:continue]
|
if params[:continue]
|
||||||
attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?}
|
attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?}
|
||||||
redirect_to new_project_issue_path(@issue.project, :issue => attrs)
|
redirect_to new_project_issue_url(@issue.project, :issue => attrs)
|
||||||
else
|
else
|
||||||
redirect_to issue_path(@issue)
|
redirect_to issue_url(@issue)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
format.api { render :action => 'show', :status => :created, :location => issue_url(@issue) }
|
format.api { render :action => 'show', :status => :created, :location => issue_url(@issue) }
|
||||||
|
@ -320,9 +320,9 @@ class IssuesController < ApplicationController
|
||||||
|
|
||||||
if params[:follow]
|
if params[:follow]
|
||||||
if @issues.size == 1 && moved_issues.size == 1
|
if @issues.size == 1 && moved_issues.size == 1
|
||||||
redirect_to issue_path(moved_issues.first)
|
redirect_to issue_url(moved_issues.first)
|
||||||
elsif moved_issues.map(&:project).uniq.size == 1
|
elsif moved_issues.map(&:project).uniq.size == 1
|
||||||
redirect_to project_issues_path(moved_issues.map(&:project).first)
|
redirect_to project_issues_url(moved_issues.map(&:project).first)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
redirect_back_or_default _project_issues_path(@project)
|
redirect_back_or_default _project_issues_path(@project)
|
||||||
|
@ -409,7 +409,7 @@ class IssuesController < ApplicationController
|
||||||
when 'add_notes'
|
when 'add_notes'
|
||||||
issue_attributes = issue_attributes.slice(:notes)
|
issue_attributes = issue_attributes.slice(:notes)
|
||||||
when 'cancel'
|
when 'cancel'
|
||||||
redirect_to issue_path(@issue)
|
redirect_to issue_url(@issue)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -86,7 +86,7 @@ class JournalsController < ApplicationController
|
||||||
@journal.destroy if @journal.details.empty? && @journal.notes.blank?
|
@journal.destroy if @journal.details.empty? && @journal.notes.blank?
|
||||||
call_hook(:controller_journals_edit_post, { :journal => @journal, :params => params})
|
call_hook(:controller_journals_edit_post, { :journal => @journal, :params => params})
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to issue_path(@journal.journalized) }
|
format.html { redirect_to issue_url(@journal.journalized) }
|
||||||
format.js { render :action => 'update' }
|
format.js { render :action => 'update' }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -103,7 +103,7 @@ class JournalsController < ApplicationController
|
||||||
# Delete a journals added by young
|
# Delete a journals added by young
|
||||||
def destroy
|
def destroy
|
||||||
@journal.destroy
|
@journal.destroy
|
||||||
redirect_to issue_path(@journal.journalized)
|
redirect_to issue_url(@journal.journalized)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -317,10 +317,10 @@ class MembersController < ApplicationController
|
||||||
private
|
private
|
||||||
|
|
||||||
def redirect_to_settings_in_projects
|
def redirect_to_settings_in_projects
|
||||||
redirect_to settings_project_path(@project, :tab => 'members')
|
redirect_to settings_project_url(@project, :tab => 'members')
|
||||||
end
|
end
|
||||||
|
|
||||||
def redirect_to_settings_in_courses
|
def redirect_to_settings_in_courses
|
||||||
redirect_to settings_course_path(@course, :tab => 'members')
|
redirect_to settings_course_url(@course, :tab => 'members')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -70,7 +70,7 @@ class MessagesController < ApplicationController
|
||||||
if @message.save
|
if @message.save
|
||||||
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
||||||
render_attachment_warning_if_needed(@message)
|
render_attachment_warning_if_needed(@message)
|
||||||
redirect_to board_message_path(@board, @message)
|
redirect_to board_message_url(@board, @message)
|
||||||
else
|
else
|
||||||
layout_file = @project ? 'base_projects' : 'base_courses'
|
layout_file = @project ? 'base_projects' : 'base_courses'
|
||||||
render :action => 'new', :layout => layout_file
|
render :action => 'new', :layout => layout_file
|
||||||
|
@ -81,7 +81,7 @@ class MessagesController < ApplicationController
|
||||||
# Reply to a topic
|
# Reply to a topic
|
||||||
def reply
|
def reply
|
||||||
if params[:reply][:content] == ""
|
if params[:reply][:content] == ""
|
||||||
(redirect_to board_message_path(@board, @topic, :r => @reply), :notice => l(:label_reply_empty);return)
|
(redirect_to board_message_url(@board, @topic, :r => @reply), :notice => l(:label_reply_empty);return)
|
||||||
end
|
end
|
||||||
@quote = params[:quote][:quote]
|
@quote = params[:quote][:quote]
|
||||||
@reply = Message.new
|
@reply = Message.new
|
||||||
|
@ -98,7 +98,7 @@ class MessagesController < ApplicationController
|
||||||
else
|
else
|
||||||
#render file: 'messages#show', layout: 'base_courses'
|
#render file: 'messages#show', layout: 'base_courses'
|
||||||
end
|
end
|
||||||
redirect_to board_message_path(@board, @topic, :r => @reply)
|
redirect_to board_message_url(@board, @topic, :r => @reply)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ class MessagesController < ApplicationController
|
||||||
render_attachment_warning_if_needed(@message)
|
render_attachment_warning_if_needed(@message)
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
@message.reload
|
@message.reload
|
||||||
redirect_to board_message_path(@message.board, @message.root, :r => (@message.parent_id && @message.id))
|
redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id))
|
||||||
elsif request.get?
|
elsif request.get?
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
|
@ -139,15 +139,15 @@ class MessagesController < ApplicationController
|
||||||
# modify by nwb
|
# modify by nwb
|
||||||
if @project
|
if @project
|
||||||
if @message.parent
|
if @message.parent
|
||||||
redirect_to board_message_path(@board, @message.parent, :r => r)
|
redirect_to board_message_url(@board, @message.parent, :r => r)
|
||||||
else
|
else
|
||||||
redirect_to project_board_path(@project, @board)
|
redirect_to board_message_url(@project, @board)
|
||||||
end
|
end
|
||||||
elsif @course
|
elsif @course
|
||||||
if @message.parent
|
if @message.parent
|
||||||
redirect_to board_message_path(@board, @message.parent, :r => r)
|
redirect_to board_message_url(@board, @message.parent, :r => r)
|
||||||
else
|
else
|
||||||
redirect_to course_board_path(@course, @board)
|
redirect_to course_board_url(@course, @board)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -131,7 +131,7 @@ class MyController < ApplicationController
|
||||||
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
|
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
|
||||||
set_language_if_valid @user.language
|
set_language_if_valid @user.language
|
||||||
flash.now[:notice] = l(:notice_account_updated)
|
flash.now[:notice] = l(:notice_account_updated)
|
||||||
redirect_to user_path(@user)
|
redirect_to user_url(@user)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
# 确保文件被删除
|
# 确保文件被删除
|
||||||
|
@ -152,7 +152,7 @@ class MyController < ApplicationController
|
||||||
def destroy
|
def destroy
|
||||||
@user = User.current
|
@user = User.current
|
||||||
unless @user.own_account_deletable?
|
unless @user.own_account_deletable?
|
||||||
redirect_to my_account_path
|
redirect_to my_account_url
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ class MyController < ApplicationController
|
||||||
logout_user
|
logout_user
|
||||||
flash.now[:notice] = l(:notice_account_deleted)
|
flash.now[:notice] = l(:notice_account_deleted)
|
||||||
end
|
end
|
||||||
redirect_to home_path
|
redirect_to home_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ class MyController < ApplicationController
|
||||||
@user = User.current
|
@user = User.current
|
||||||
unless @user.change_password_allowed?
|
unless @user.change_password_allowed?
|
||||||
flash.now[:error] = l(:notice_can_t_change_password)
|
flash.now[:error] = l(:notice_can_t_change_password)
|
||||||
redirect_to my_account_path
|
redirect_to my_account_url
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if request.post?
|
if request.post?
|
||||||
|
@ -180,7 +180,7 @@ class MyController < ApplicationController
|
||||||
|
|
||||||
if @user.save
|
if @user.save
|
||||||
flash.now[:notice] = l(:notice_account_password_updated)
|
flash.now[:notice] = l(:notice_account_password_updated)
|
||||||
redirect_to my_account_path
|
redirect_to my_account_url
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
flash.now[:error] = l(:notice_account_wrong_password)
|
flash.now[:error] = l(:notice_account_wrong_password)
|
||||||
|
@ -198,7 +198,7 @@ class MyController < ApplicationController
|
||||||
User.current.rss_key
|
User.current.rss_key
|
||||||
flash[:notice] = l(:notice_feeds_access_key_reseted)
|
flash[:notice] = l(:notice_feeds_access_key_reseted)
|
||||||
end
|
end
|
||||||
redirect_to my_account_path
|
redirect_to my_account_url
|
||||||
end
|
end
|
||||||
|
|
||||||
# Create a new API key
|
# Create a new API key
|
||||||
|
@ -211,7 +211,7 @@ class MyController < ApplicationController
|
||||||
User.current.api_key
|
User.current.api_key
|
||||||
flash[:notice] = l(:notice_api_access_key_reseted)
|
flash[:notice] = l(:notice_api_access_key_reseted)
|
||||||
end
|
end
|
||||||
redirect_to my_account_path
|
redirect_to my_account_url
|
||||||
end
|
end
|
||||||
|
|
||||||
# User's page layout configuration
|
# User's page layout configuration
|
||||||
|
@ -241,7 +241,7 @@ class MyController < ApplicationController
|
||||||
@user.pref[:my_page_layout] = layout
|
@user.pref[:my_page_layout] = layout
|
||||||
@user.pref.save
|
@user.pref.save
|
||||||
end
|
end
|
||||||
redirect_to my_page_layout_path
|
redirect_to my_page_layout_url
|
||||||
end
|
end
|
||||||
|
|
||||||
# Remove a block to user's page
|
# Remove a block to user's page
|
||||||
|
@ -254,7 +254,7 @@ class MyController < ApplicationController
|
||||||
%w(top left right).each {|f| (layout[f] ||= []).delete block }
|
%w(top left right).each {|f| (layout[f] ||= []).delete block }
|
||||||
@user.pref[:my_page_layout] = layout
|
@user.pref[:my_page_layout] = layout
|
||||||
@user.pref.save
|
@user.pref.save
|
||||||
redirect_to my_page_layout_path
|
redirect_to my_page_layout_url
|
||||||
end
|
end
|
||||||
|
|
||||||
# Change blocks order on user's page
|
# Change blocks order on user's page
|
||||||
|
|
|
@ -117,7 +117,7 @@ class NewsController < ApplicationController
|
||||||
if @news.save
|
if @news.save
|
||||||
render_attachment_warning_if_needed(@news)
|
render_attachment_warning_if_needed(@news)
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to project_news_index_path(@project)
|
redirect_to project_news_index_url(@project)
|
||||||
else
|
else
|
||||||
layout_file = @project ? 'base_projects' : 'base_courses'
|
layout_file = @project ? 'base_projects' : 'base_courses'
|
||||||
render :action => 'new', :layout => layout_file
|
render :action => 'new', :layout => layout_file
|
||||||
|
@ -129,7 +129,7 @@ class NewsController < ApplicationController
|
||||||
if @news.save
|
if @news.save
|
||||||
render_attachment_warning_if_needed(@news)
|
render_attachment_warning_if_needed(@news)
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to course_news_index_path(@course)
|
redirect_to course_news_index_url(@course)
|
||||||
else
|
else
|
||||||
layout_file = 'base_courses'
|
layout_file = 'base_courses'
|
||||||
render :action => 'new', :layout => layout_file
|
render :action => 'new', :layout => layout_file
|
||||||
|
@ -146,10 +146,10 @@ class NewsController < ApplicationController
|
||||||
if @news.save
|
if @news.save
|
||||||
render_attachment_warning_if_needed(@news)
|
render_attachment_warning_if_needed(@news)
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to news_path(@news)
|
redirect_to news_url(@news)
|
||||||
else
|
else
|
||||||
#flash[:error] = l(:notice_successful_update)
|
#flash[:error] = l(:notice_successful_update)
|
||||||
redirect_to news_path(@news)
|
redirect_to news_url(@news)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -157,9 +157,9 @@ class NewsController < ApplicationController
|
||||||
@news.destroy
|
@news.destroy
|
||||||
# modify by nwb
|
# modify by nwb
|
||||||
if @project
|
if @project
|
||||||
redirect_to project_news_index_path(@project)
|
redirect_to project_news_index_url(@project)
|
||||||
elsif @course
|
elsif @course
|
||||||
redirect_to course_news_index_path(@course)
|
redirect_to course_news_index_url(@course)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,7 +19,7 @@ class NotificationcommentsController < ApplicationController
|
||||||
flash[:notice] = l(:label_comment_added)
|
flash[:notice] = l(:label_comment_added)
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to contest_contestnotification_path(@contest, @contestnotification)
|
redirect_to contest_contestnotification_url(@contest, @contestnotification)
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
@ -30,7 +30,7 @@ class NotificationcommentsController < ApplicationController
|
||||||
#@contestnotifications = notificaioncomments.Contestnotification
|
#@contestnotifications = notificaioncomments.Contestnotification
|
||||||
#@contest = @contestnotifications.contest
|
#@contest = @contestnotifications.contest
|
||||||
#@contestnotifications.notificaioncomments.find(params[:notificaioncomment_id]).destroy
|
#@contestnotifications.notificaioncomments.find(params[:notificaioncomment_id]).destroy
|
||||||
redirect_to contest_contestnotification_path(@contest,@contestnotification)
|
redirect_to contest_contestnotification_url(@contest,@contestnotification)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -215,7 +215,7 @@ class OpenSourceProjectsController < ApplicationController
|
||||||
@app_dir = params[:app_dir]
|
@app_dir = params[:app_dir]
|
||||||
@language = params[:language]
|
@language = params[:language]
|
||||||
@created_at = params[:created_at]
|
@created_at = params[:created_at]
|
||||||
redirect_to open_source_projects_path(:app_dir => @app_dir, :language => @language, :created_at => @created_at, :name => params[:name])
|
redirect_to open_source_projects_url(:app_dir => @app_dir, :language => @language, :created_at => @created_at, :name => params[:name])
|
||||||
end
|
end
|
||||||
|
|
||||||
def search
|
def search
|
||||||
|
@ -229,7 +229,7 @@ class OpenSourceProjectsController < ApplicationController
|
||||||
#
|
#
|
||||||
# @open_source_projects = @open_source_projects.offset(@os_project_pages.offset).limit(@os_project_pages.per_page)
|
# @open_source_projects = @open_source_projects.offset(@os_project_pages.offset).limit(@os_project_pages.per_page)
|
||||||
|
|
||||||
redirect_to open_source_projects_path(:name => params[:name])
|
redirect_to open_source_projects_url(:name => params[:name])
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ class OpenSourceProjectsController < ApplicationController
|
||||||
@apply = ApplyProjectMaster.where("user_id = ? and apply_id = ? and apply_type = 'OpenSourceProject'", params[:user_id], @open_source_project.id)
|
@apply = ApplyProjectMaster.where("user_id = ? and apply_id = ? and apply_type = 'OpenSourceProject'", params[:user_id], @open_source_project.id)
|
||||||
@apply.first.destory
|
@apply.first.destory
|
||||||
|
|
||||||
redirect_to master_apply_open_source_project_path
|
redirect_to master_apply_open_source_project_url
|
||||||
end
|
end
|
||||||
|
|
||||||
def accept_master_apply
|
def accept_master_apply
|
||||||
|
@ -246,7 +246,7 @@ class OpenSourceProjectsController < ApplicationController
|
||||||
@apply.first.update_attributes(:status => 2)
|
@apply.first.update_attributes(:status => 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to master_apply_open_source_project_path
|
redirect_to master_apply_open_source_project_url
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -29,7 +29,7 @@ class ProjectEnumerationsController < ApplicationController
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to settings_project_path(@project, :tab => 'activities')
|
redirect_to settings_project_url(@project, :tab => 'activities')
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
@ -37,6 +37,6 @@ class ProjectEnumerationsController < ApplicationController
|
||||||
time_entry_activity.destroy(time_entry_activity.parent)
|
time_entry_activity.destroy(time_entry_activity.parent)
|
||||||
end
|
end
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to settings_project_path(@project, :tab => 'activities')
|
redirect_to settings_project_url(@project, :tab => 'activities')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -509,9 +509,9 @@ class ProjectsController < ApplicationController
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
if params[:continue]
|
if params[:continue]
|
||||||
attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}
|
attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}
|
||||||
redirect_to new_project_path(attrs, :course => '0')
|
redirect_to new_project_url(attrs, :course => '0')
|
||||||
else
|
else
|
||||||
redirect_to settings_project_path(@project)
|
redirect_to settings_project_url(@project)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) }
|
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) }
|
||||||
|
@ -538,13 +538,13 @@ class ProjectsController < ApplicationController
|
||||||
if validate_parent_id && @project.copy(@source_project, :only => params[:only])
|
if validate_parent_id && @project.copy(@source_project, :only => params[:only])
|
||||||
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
|
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to settings_project_path(@project)
|
redirect_to settings_project_url(@project)
|
||||||
elsif !@project.new_record?
|
elsif !@project.new_record?
|
||||||
# Project was created
|
# Project was created
|
||||||
# But some objects were not copied due to validation failures
|
# But some objects were not copied due to validation failures
|
||||||
# (eg. issues from disabled trackers)
|
# (eg. issues from disabled trackers)
|
||||||
# TODO: inform about that
|
# TODO: inform about that
|
||||||
redirect_to settings_project_path(@project)
|
redirect_to settings_project_url(@project)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -780,7 +780,7 @@ class ProjectsController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to settings_project_path(@project,:course => @project.project_type)
|
redirect_to settings_project_url(@project,:course => @project.project_type)
|
||||||
}
|
}
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
|
@ -798,7 +798,7 @@ class ProjectsController < ApplicationController
|
||||||
def modules
|
def modules
|
||||||
@project.enabled_module_names = params[:enabled_module_names]
|
@project.enabled_module_names = params[:enabled_module_names]
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to settings_project_path(@project, :tab => 'modules')
|
redirect_to settings_project_url(@project, :tab => 'modules')
|
||||||
end
|
end
|
||||||
|
|
||||||
def archive
|
def archive
|
||||||
|
@ -807,22 +807,22 @@ class ProjectsController < ApplicationController
|
||||||
flash[:error] = l(:error_can_not_archive_project)
|
flash[:error] = l(:error_can_not_archive_project)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
redirect_to admin_projects_path(:status => params[:status])
|
redirect_to admin_projects_url(:status => params[:status])
|
||||||
end
|
end
|
||||||
|
|
||||||
def unarchive
|
def unarchive
|
||||||
@project.unarchive if request.post? && !@project.active?
|
@project.unarchive if request.post? && !@project.active?
|
||||||
redirect_to admin_projects_path(:status => params[:status])
|
redirect_to admin_projects_url(:status => params[:status])
|
||||||
end
|
end
|
||||||
|
|
||||||
def close
|
def close
|
||||||
@project.close
|
@project.close
|
||||||
redirect_to project_path(@project)
|
redirect_to project_url(@project)
|
||||||
end
|
end
|
||||||
|
|
||||||
def reopen
|
def reopen
|
||||||
@project.reopen
|
@project.reopen
|
||||||
redirect_to project_path(@project)
|
redirect_to project_url(@project)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Delete @project
|
# Delete @project
|
||||||
|
@ -831,7 +831,7 @@ class ProjectsController < ApplicationController
|
||||||
if api_request? || params[:confirm]
|
if api_request? || params[:confirm]
|
||||||
@project_to_destroy.destroy
|
@project_to_destroy.destroy
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to admin_projects_path }
|
format.html { redirect_to admin_projects_url }
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -59,7 +59,7 @@ class QueriesController < ApplicationController
|
||||||
|
|
||||||
if @query.save
|
if @query.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to _project_issues_path(@project, :query_id => @query)
|
redirect_to _project_issues_url(@project, :query_id => @query)
|
||||||
else
|
else
|
||||||
render :action => 'new', :layout => !request.xhr?
|
render :action => 'new', :layout => !request.xhr?
|
||||||
end
|
end
|
||||||
|
@ -77,7 +77,7 @@ class QueriesController < ApplicationController
|
||||||
|
|
||||||
if @query.save
|
if @query.save
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to _project_issues_path(@project, :query_id => @query)
|
redirect_to _project_issues_url(@project, :query_id => @query)
|
||||||
else
|
else
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
end
|
end
|
||||||
|
@ -85,7 +85,7 @@ class QueriesController < ApplicationController
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@query.destroy
|
@query.destroy
|
||||||
redirect_to _project_issues_path(@project, :set_filter => 1)
|
redirect_to _project_issues_url(@project, :set_filter => 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -104,7 +104,7 @@ class RepositoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
@repository.project = @project
|
@repository.project = @project
|
||||||
if request.post? && @repository.save
|
if request.post? && @repository.save
|
||||||
redirect_to settings_project_path(@project, :tab => 'repositories')
|
redirect_to settings_project_url(@project, :tab => 'repositories')
|
||||||
else
|
else
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
end
|
end
|
||||||
|
@ -153,7 +153,7 @@ class RepositoriesController < ApplicationController
|
||||||
# end
|
# end
|
||||||
@repository.update_attributes(:login => User.current.login.to_s)
|
@repository.update_attributes(:login => User.current.login.to_s)
|
||||||
end
|
end
|
||||||
redirect_to settings_project_path(@project, :tab => 'repositories')
|
redirect_to settings_project_url(@project, :tab => 'repositories')
|
||||||
else if(@repository_tag)
|
else if(@repository_tag)
|
||||||
render :action => 'newrepo', :layout =>'base_projects'
|
render :action => 'newrepo', :layout =>'base_projects'
|
||||||
else
|
else
|
||||||
|
@ -174,7 +174,7 @@ class RepositoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
@repository.project = @project
|
@repository.project = @project
|
||||||
if request.put? && @repository.save
|
if request.put? && @repository.save
|
||||||
redirect_to settings_project_path(@project, :tab => 'repositories')
|
redirect_to settings_project_url(@project, :tab => 'repositories')
|
||||||
else
|
else
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
end
|
end
|
||||||
|
@ -205,7 +205,7 @@ class RepositoriesController < ApplicationController
|
||||||
# Build a hash with repository usernames as keys and corresponding user ids as values
|
# Build a hash with repository usernames as keys and corresponding user ids as values
|
||||||
@repository.committer_ids = params[:committers].values.inject({}) {|h, c| h[c.first] = c.last; h}
|
@repository.committer_ids = params[:committers].values.inject({}) {|h, c| h[c.first] = c.last; h}
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to settings_project_path(@project, :tab => 'repositories')
|
redirect_to settings_project_url(@project, :tab => 'repositories')
|
||||||
elsif request.get?
|
elsif request.get?
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html{
|
format.html{
|
||||||
|
@ -223,7 +223,7 @@ class RepositoriesController < ApplicationController
|
||||||
@repository_name=User.current.login.to_s+"/"+@repository.identifier.to_s+".git"
|
@repository_name=User.current.login.to_s+"/"+@repository.identifier.to_s+".git"
|
||||||
@middle=User.current.login.to_s+"_"+@repository.identifier.to_s+"-write:"
|
@middle=User.current.login.to_s+"_"+@repository.identifier.to_s+"-write:"
|
||||||
@repository.destroy if request.delete?
|
@repository.destroy if request.delete?
|
||||||
redirect_to settings_project_path(@project, :tab => 'repositories')
|
redirect_to settings_project_url(@project, :tab => 'repositories')
|
||||||
if(@repository.type=="Repository::Git")
|
if(@repository.type=="Repository::Git")
|
||||||
logger.info "destory the repository value"+"root path"+@root_path+"repo_name"+@repo_name+
|
logger.info "destory the repository value"+"root path"+@root_path+"repo_name"+@repo_name+
|
||||||
"repository_name"+@repository_name+"user group"+@middle
|
"repository_name"+@repository_name+"user group"+@middle
|
||||||
|
|
|
@ -58,7 +58,7 @@ class RolesController < ApplicationController
|
||||||
@role.workflow_rules.copy(copy_from)
|
@role.workflow_rules.copy(copy_from)
|
||||||
end
|
end
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to roles_path
|
redirect_to roles_url
|
||||||
else
|
else
|
||||||
@roles = Role.sorted.all
|
@roles = Role.sorted.all
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
|
@ -71,7 +71,7 @@ class RolesController < ApplicationController
|
||||||
def update
|
def update
|
||||||
if request.put? and @role.update_attributes(params[:role])
|
if request.put? and @role.update_attributes(params[:role])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to roles_path
|
redirect_to roles_url
|
||||||
else
|
else
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
end
|
end
|
||||||
|
@ -79,10 +79,10 @@ class RolesController < ApplicationController
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@role.destroy
|
@role.destroy
|
||||||
redirect_to roles_path
|
redirect_to roles_url
|
||||||
rescue
|
rescue
|
||||||
flash[:error] = l(:error_can_not_remove_role)
|
flash[:error] = l(:error_can_not_remove_role)
|
||||||
redirect_to roles_path
|
redirect_to roles_url
|
||||||
end
|
end
|
||||||
|
|
||||||
def permissions
|
def permissions
|
||||||
|
@ -94,7 +94,7 @@ class RolesController < ApplicationController
|
||||||
role.save
|
role.save
|
||||||
end
|
end
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to roles_path
|
redirect_to roles_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ class SearchController < ApplicationController
|
||||||
|
|
||||||
# quick jump to an issue
|
# quick jump to an issue
|
||||||
if (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i))
|
if (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i))
|
||||||
redirect_to issue_path(issue)
|
redirect_to issue_url(issue)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ class SettingsController < ApplicationController
|
||||||
Setting[name] = value
|
Setting[name] = value
|
||||||
end
|
end
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to settings_path(:tab => params[:tab])
|
redirect_to settings_url(:tab => params[:tab])
|
||||||
else
|
else
|
||||||
@options = {}
|
@options = {}
|
||||||
user_format = User::USER_FORMATS.collect{|key, value| [key, value[:setting_order]]}.sort{|a, b| a[1] <=> b[1]}
|
user_format = User::USER_FORMATS.collect{|key, value| [key, value[:setting_order]]}.sort{|a, b| a[1] <=> b[1]}
|
||||||
|
@ -61,7 +61,7 @@ class SettingsController < ApplicationController
|
||||||
if request.post?
|
if request.post?
|
||||||
Setting.send "plugin_#{@plugin.id}=", params[:settings]
|
Setting.send "plugin_#{@plugin.id}=", params[:settings]
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to plugin_settings_path(@plugin)
|
redirect_to plugin_settings_url(@plugin)
|
||||||
else
|
else
|
||||||
@partial = @plugin.settings[:partial]
|
@partial = @plugin.settings[:partial]
|
||||||
@settings = Setting.send "plugin_#{@plugin.id}"
|
@settings = Setting.send "plugin_#{@plugin.id}"
|
||||||
|
|
|
@ -153,7 +153,7 @@ class SoftapplicationsController < ApplicationController
|
||||||
ContestingSoftapplication.create(:contest_id => params[:contest_id], :softapplication_id => @softapplication.id)
|
ContestingSoftapplication.create(:contest_id => params[:contest_id], :softapplication_id => @softapplication.id)
|
||||||
#ProjectingSoftapplication.create_softapplication_projecting(:project_id => params[:project_id], :softapplication_id => @softapplication.id)
|
#ProjectingSoftapplication.create_softapplication_projecting(:project_id => params[:project_id], :softapplication_id => @softapplication.id)
|
||||||
#ProjectingSoftapplication.create_softapplication_projecting(@project.id, softapplication.id)
|
#ProjectingSoftapplication.create_softapplication_projecting(@project.id, softapplication.id)
|
||||||
format.html { redirect_to show_attendingcontest_contest_path(:id => params[:contest_id]), notice: l(:notice_attendingcontest_work_successfully_created) }
|
format.html { redirect_to show_attendingcontest_contest_url(:id => params[:contest_id]), notice: l(:notice_attendingcontest_work_successfully_created) }
|
||||||
# format.json { render json: @softapplication, status: :created, location: @softapplication }
|
# format.json { render json: @softapplication, status: :created, location: @softapplication }
|
||||||
else
|
else
|
||||||
#format.js { render status: 406 }
|
#format.js { render status: 406 }
|
||||||
|
@ -207,7 +207,7 @@ class SoftapplicationsController < ApplicationController
|
||||||
@softapplication.destroy
|
@softapplication.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to home_path }
|
format.html { redirect_to home_url }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,14 +7,14 @@ class StoresController < ApplicationController
|
||||||
def search
|
def search
|
||||||
begin
|
begin
|
||||||
q = "%#{params[:name].strip}%"
|
q = "%#{params[:name].strip}%"
|
||||||
(redirect_to stores_path, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
||||||
|
|
||||||
result = find_public_attache q
|
result = find_public_attache q
|
||||||
@searched_attach = paginateHelper result
|
@searched_attach = paginateHelper result
|
||||||
@result_all_count = result.count;
|
@result_all_count = result.count;
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
#render 'stores'
|
#render 'stores'
|
||||||
redirect_to stores_path
|
redirect_to stores_url
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -135,16 +135,16 @@ class TimelogController < ApplicationController
|
||||||
:back_url => params[:back_url]
|
:back_url => params[:back_url]
|
||||||
}
|
}
|
||||||
if @time_entry.issue
|
if @time_entry.issue
|
||||||
redirect_to new_project_issue_time_entry_path(@time_entry.project, @time_entry.issue, options)
|
redirect_to new_project_issue_time_entry_url(@time_entry.project, @time_entry.issue, options)
|
||||||
else
|
else
|
||||||
redirect_to new_project_time_entry_path(@time_entry.project, options)
|
redirect_to new_project_time_entry_url(@time_entry.project, options)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
options = {
|
options = {
|
||||||
:time_entry => {:project_id => @time_entry.project_id, :issue_id => @time_entry.issue_id, :activity_id => @time_entry.activity_id},
|
:time_entry => {:project_id => @time_entry.project_id, :issue_id => @time_entry.issue_id, :activity_id => @time_entry.activity_id},
|
||||||
:back_url => params[:back_url]
|
:back_url => params[:back_url]
|
||||||
}
|
}
|
||||||
redirect_to new_time_entry_path(options)
|
redirect_to new_time_entry_url(options)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
redirect_back_or_default project_time_entries_path(@time_entry.project)
|
redirect_back_or_default project_time_entries_path(@time_entry.project)
|
||||||
|
|
|
@ -54,7 +54,7 @@ class TrackersController < ApplicationController
|
||||||
@tracker.workflow_rules.copy(copy_from)
|
@tracker.workflow_rules.copy(copy_from)
|
||||||
end
|
end
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to trackers_path
|
redirect_to trackers_url
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
|
@ -70,7 +70,7 @@ class TrackersController < ApplicationController
|
||||||
@tracker = Tracker.find(params[:id])
|
@tracker = Tracker.find(params[:id])
|
||||||
if @tracker.update_attributes(params[:tracker])
|
if @tracker.update_attributes(params[:tracker])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to trackers_path
|
redirect_to trackers_url
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
edit
|
edit
|
||||||
|
@ -84,7 +84,7 @@ class TrackersController < ApplicationController
|
||||||
else
|
else
|
||||||
@tracker.destroy
|
@tracker.destroy
|
||||||
end
|
end
|
||||||
redirect_to trackers_path
|
redirect_to trackers_url
|
||||||
end
|
end
|
||||||
|
|
||||||
def fields
|
def fields
|
||||||
|
@ -98,7 +98,7 @@ class TrackersController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to fields_trackers_path
|
redirect_to fields_trackers_url
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@trackers = Tracker.sorted.all
|
@trackers = Tracker.sorted.all
|
||||||
|
|
|
@ -166,7 +166,7 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# added by fq
|
# added by fq
|
||||||
def user_activities
|
def user_activities
|
||||||
redirect_to user_path(@user, type: params[:type], page: params[:page])
|
redirect_to user_url(@user, type: params[:type], page: params[:page])
|
||||||
return
|
return
|
||||||
# useless abort.
|
# useless abort.
|
||||||
@watcher = User.watched_by_id(@user)
|
@watcher = User.watched_by_id(@user)
|
||||||
|
@ -347,7 +347,7 @@ class UsersController < ApplicationController
|
||||||
def search
|
def search
|
||||||
sort_init 'login', 'asc'
|
sort_init 'login', 'asc'
|
||||||
sort_update %w(login firstname lastname mail admin created_on last_login_on)
|
sort_update %w(login firstname lastname mail admin created_on last_login_on)
|
||||||
(redirect_to users_path, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
(redirect_to user_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
||||||
case params[:format]
|
case params[:format]
|
||||||
when 'xml', 'json'
|
when 'xml', 'json'
|
||||||
@offset, @limit = api_offset_and_limit({:limit => 15})
|
@offset, @limit = api_offset_and_limit({:limit => 15})
|
||||||
|
@ -516,9 +516,9 @@ class UsersController < ApplicationController
|
||||||
format.html {
|
format.html {
|
||||||
flash[:notice] = l(:notice_user_successful_create, :id => view_context.link_to(@user.login, user_path(@user)))
|
flash[:notice] = l(:notice_user_successful_create, :id => view_context.link_to(@user.login, user_path(@user)))
|
||||||
if params[:continue]
|
if params[:continue]
|
||||||
redirect_to new_user_path
|
redirect_to new_user_url
|
||||||
else
|
else
|
||||||
redirect_to edit_user_path(@user)
|
redirect_to edit_user_url(@user)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
format.api { render :action => 'show', :status => :created, :location => user_url(@user) }
|
format.api { render :action => 'show', :status => :created, :location => user_url(@user) }
|
||||||
|
@ -585,7 +585,7 @@ class UsersController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to_referer_or edit_user_path(@user)
|
redirect_to_referer_or edit_user_url(@user)
|
||||||
}
|
}
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
|
@ -614,7 +614,7 @@ class UsersController < ApplicationController
|
||||||
@membership = Member.edit_membership(params[:membership_id], params[:membership], @user)
|
@membership = Member.edit_membership(params[:membership_id], params[:membership], @user)
|
||||||
@membership.save
|
@membership.save
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to edit_user_path(@user, :tab => 'memberships') }
|
format.html { redirect_to edit_user_url(@user, :tab => 'memberships') }
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -625,7 +625,7 @@ class UsersController < ApplicationController
|
||||||
@membership.destroy
|
@membership.destroy
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to edit_user_path(@user, :tab => 'memberships') }
|
format.html { redirect_to edit_user_url(@user, :tab => 'memberships') }
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -800,7 +800,7 @@ class UsersController < ApplicationController
|
||||||
def auth_user_extension
|
def auth_user_extension
|
||||||
if @user == User.current && (@user.user_extensions.nil? || @user.user_extensions.school.nil?)
|
if @user == User.current && (@user.user_extensions.nil? || @user.user_extensions.school.nil?)
|
||||||
flash[:error] = l(:error_complete_occupation)
|
flash[:error] = l(:error_complete_occupation)
|
||||||
redirect_to my_account_path
|
redirect_to my_account_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ class VersionsController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html do
|
format.html do
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to settings_project_path(@project, :tab => 'versions')
|
redirect_to settings_project_url(@project, :tab => 'versions')
|
||||||
end
|
end
|
||||||
format.js
|
format.js
|
||||||
format.api do
|
format.api do
|
||||||
|
@ -153,14 +153,14 @@ class VersionsController < ApplicationController
|
||||||
if request.put?
|
if request.put?
|
||||||
@project.close_completed_versions
|
@project.close_completed_versions
|
||||||
end
|
end
|
||||||
redirect_to settings_project_path(@project, :tab => 'versions')
|
redirect_to settings_project_url(@project, :tab => 'versions')
|
||||||
end
|
end
|
||||||
|
|
||||||
def close_completed_contest
|
def close_completed_contest
|
||||||
if request.put?
|
if request.put?
|
||||||
@contest.close_completed_versions
|
@contest.close_completed_versions
|
||||||
end
|
end
|
||||||
redirect_to settings_contest_path(@contest, :tab => 'versions')
|
redirect_to settings_contest_url(@contest, :tab => 'versions')
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
@ -174,7 +174,7 @@ class VersionsController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
flash[:error] = l(:notice_unable_delete_version)
|
flash[:error] = l(:notice_unable_delete_version)
|
||||||
redirect_to settings_project_path(@project, :tab => 'versions')
|
redirect_to settings_project_url(@project, :tab => 'versions')
|
||||||
}
|
}
|
||||||
format.api { head :unprocessable_entity }
|
format.api { head :unprocessable_entity }
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,7 +17,7 @@ class WebFooterCompaniesController < ApplicationController
|
||||||
@company = WebFooterCompany.new(params[:web_footer_company])
|
@company = WebFooterCompany.new(params[:web_footer_company])
|
||||||
if @company.save
|
if @company.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to web_footer_companies_path
|
redirect_to web_footer_companies_url
|
||||||
else
|
else
|
||||||
flash[:error] = "#{l :web_footer_company_create_fail}: #{@company.errors.full_messages[0]}"
|
flash[:error] = "#{l :web_footer_company_create_fail}: #{@company.errors.full_messages[0]}"
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
|
@ -27,7 +27,7 @@ class WebFooterCompaniesController < ApplicationController
|
||||||
def destroy
|
def destroy
|
||||||
@company = WebFooterCompany.find(params[:id])
|
@company = WebFooterCompany.find(params[:id])
|
||||||
@company.destroy
|
@company.destroy
|
||||||
redirect_to web_footer_companies_path
|
redirect_to web_footer_companies_url
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
@ -38,7 +38,7 @@ class WebFooterCompaniesController < ApplicationController
|
||||||
@company = WebFooterCompany.find(params[:id])
|
@company = WebFooterCompany.find(params[:id])
|
||||||
if @company.update_attributes(params[:web_footer_company])
|
if @company.update_attributes(params[:web_footer_company])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to web_footer_companies_path
|
redirect_to web_footer_companies_url
|
||||||
else
|
else
|
||||||
flash[:error] = "#{l :web_footer_company_update_fail}: #{@company.errors.full_messages[0]}"
|
flash[:error] = "#{l :web_footer_company_update_fail}: #{@company.errors.full_messages[0]}"
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
|
|
|
@ -127,21 +127,21 @@ class WelcomeController < ApplicationController
|
||||||
format.html{
|
format.html{
|
||||||
case search_type
|
case search_type
|
||||||
when :projects
|
when :projects
|
||||||
redirect_to projects_search_path(:name => search_condition,
|
redirect_to projects_search_url(:name => search_condition,
|
||||||
:project_type => Project::ProjectType_project)
|
:project_type => Project::ProjectType_project)
|
||||||
when :courses
|
when :courses
|
||||||
redirect_to courses_search_path(:name => search_condition)
|
redirect_to courses_search_url(:name => search_condition)
|
||||||
when :contests
|
when :contests
|
||||||
redirect_to contests_path(:name => search_condition)
|
redirect_to contests_url(:name => search_condition)
|
||||||
when :users
|
when :users
|
||||||
redirect_to users_search_path(:name => search_condition)
|
redirect_to users_search_url(:name => search_condition)
|
||||||
when :users_teacher
|
when :users_teacher
|
||||||
redirect_to users_search_path(:name => search_condition, :role => :teacher)
|
redirect_to users_search_url(:name => search_condition, :role => :teacher)
|
||||||
when :users_student
|
when :users_student
|
||||||
redirect_to users_search_path(:name => search_condition, :role => :student)
|
redirect_to users_search_url(:name => search_condition, :role => :student)
|
||||||
else
|
else
|
||||||
#redirect_to home_path, :alert => l(:label_sumbit_empty)
|
#redirect_to home_path, :alert => l(:label_sumbit_empty)
|
||||||
(redirect_to home_path, :notice => l(:label_sumbit_empty);return) #if params[:name].blank?
|
(redirect_to home_url, :notice => l(:label_sumbit_empty);return) #if params[:name].blank?
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -161,7 +161,7 @@ class WikiController < ApplicationController
|
||||||
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
|
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to project_wiki_page_path(@project, @page.title) }
|
format.html { redirect_to project_wiki_page_url(@project, @page.title) }
|
||||||
format.api {
|
format.api {
|
||||||
if was_new_page
|
if was_new_page
|
||||||
render :action => 'show', :status => :created, :location => project_wiki_page_path(@project, @page.title)
|
render :action => 'show', :status => :created, :location => project_wiki_page_path(@project, @page.title)
|
||||||
|
@ -201,13 +201,13 @@ class WikiController < ApplicationController
|
||||||
@original_title = @page.pretty_title
|
@original_title = @page.pretty_title
|
||||||
if request.post? && @page.update_attributes(params[:wiki_page])
|
if request.post? && @page.update_attributes(params[:wiki_page])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to project_wiki_page_path(@project, @page.title)
|
redirect_to project_wiki_page_url(@project, @page.title)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def protect
|
def protect
|
||||||
@page.update_attribute :protected, params[:protected]
|
@page.update_attribute :protected, params[:protected]
|
||||||
redirect_to project_wiki_page_path(@project, @page.title)
|
redirect_to project_wiki_page_url(@project, @page.title)
|
||||||
end
|
end
|
||||||
|
|
||||||
# show page history
|
# show page history
|
||||||
|
@ -263,7 +263,7 @@ class WikiController < ApplicationController
|
||||||
end
|
end
|
||||||
@page.destroy
|
@page.destroy
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to project_wiki_index_path(@project) }
|
format.html { redirect_to project_wiki_index_url(@project) }
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -273,7 +273,7 @@ class WikiController < ApplicationController
|
||||||
|
|
||||||
@content = @page.content_for_version(params[:version])
|
@content = @page.content_for_version(params[:version])
|
||||||
@content.destroy
|
@content.destroy
|
||||||
redirect_to_referer_or history_project_wiki_page_path(@project, @page.title)
|
redirect_to_referer_or history_project_wiki_page_url(@project, @page.title)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Export wiki to a single pdf or html file
|
# Export wiki to a single pdf or html file
|
||||||
|
|
|
@ -30,7 +30,7 @@ class WikisController < ApplicationController
|
||||||
def destroy
|
def destroy
|
||||||
if request.post? && params[:confirm] && @project.wiki
|
if request.post? && params[:confirm] && @project.wiki
|
||||||
@project.wiki.destroy
|
@project.wiki.destroy
|
||||||
redirect_to settings_project_path(@project, :tab => 'wiki')
|
redirect_to settings_project_url(@project, :tab => 'wiki')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -184,7 +184,7 @@ class WordsController < ApplicationController
|
||||||
message = params[:new_form][:project_message]
|
message = params[:new_form][:project_message]
|
||||||
Project.add_jour(user, message)
|
Project.add_jour(user, message)
|
||||||
|
|
||||||
redirect_to project_feedback_path('trustie')
|
redirect_to project_feedback_url('trustie')
|
||||||
# redirect_to signin_path
|
# redirect_to signin_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -193,10 +193,10 @@ class WordsController < ApplicationController
|
||||||
message = params[:new_form][:project_message]
|
message = params[:new_form][:project_message]
|
||||||
feedback = Project.add_new_jour(user, message, params[:id])
|
feedback = Project.add_new_jour(user, message, params[:id])
|
||||||
if(feedback.errors.empty?)
|
if(feedback.errors.empty?)
|
||||||
redirect_to project_feedback_path(params[:id]), notice: l(:label_feedback_success)
|
redirect_to project_feedback_url(params[:id]), notice: l(:label_feedback_success)
|
||||||
else
|
else
|
||||||
flash[:error] = feedback.errors.full_messages[0]
|
flash[:error] = feedback.errors.full_messages[0]
|
||||||
redirect_to project_feedback_path(params[:id])
|
redirect_to project_feedback_url(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -207,10 +207,10 @@ class WordsController < ApplicationController
|
||||||
message = params[:new_form][:course_message]
|
message = params[:new_form][:course_message]
|
||||||
feedback = Course.add_new_jour(user, message, params[:id])
|
feedback = Course.add_new_jour(user, message, params[:id])
|
||||||
if(feedback.errors.empty?)
|
if(feedback.errors.empty?)
|
||||||
redirect_to course_feedback_path(params[:id]), notice: l(:label_feedback_success)
|
redirect_to course_feedback_url(params[:id]), notice: l(:label_feedback_success)
|
||||||
else
|
else
|
||||||
flash[:error] = feedback.errors.full_messages[0]
|
flash[:error] = feedback.errors.full_messages[0]
|
||||||
redirect_to course_feedback_path(params[:id])
|
redirect_to course_feedback_url(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -219,7 +219,7 @@ class WordsController < ApplicationController
|
||||||
user = User.current
|
user = User.current
|
||||||
message = params[:new_form][:user_introduction]
|
message = params[:new_form][:user_introduction]
|
||||||
UserExtensions.introduction(user, message)
|
UserExtensions.introduction(user, message)
|
||||||
redirect_to user_path(user.id)
|
redirect_to user_url(user.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -38,7 +38,7 @@ class WorkflowsController < ApplicationController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if @role.save
|
if @role.save
|
||||||
redirect_to workflows_edit_path(:role_id => @role, :tracker_id => @tracker, :used_statuses_only => params[:used_statuses_only])
|
redirect_to workflows_edit_url(:role_id => @role, :tracker_id => @tracker, :used_statuses_only => params[:used_statuses_only])
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -64,7 +64,7 @@ class WorkflowsController < ApplicationController
|
||||||
|
|
||||||
if request.post? && @role && @tracker
|
if request.post? && @role && @tracker
|
||||||
WorkflowPermission.replace_permissions(@tracker, @role, params[:permissions] || {})
|
WorkflowPermission.replace_permissions(@tracker, @role, params[:permissions] || {})
|
||||||
redirect_to workflows_permissions_path(:role_id => @role, :tracker_id => @tracker, :used_statuses_only => params[:used_statuses_only])
|
redirect_to workflows_permissions_url(:role_id => @role, :tracker_id => @tracker, :used_statuses_only => params[:used_statuses_only])
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ class WorkflowsController < ApplicationController
|
||||||
else
|
else
|
||||||
WorkflowRule.copy(@source_tracker, @source_role, @target_trackers, @target_roles)
|
WorkflowRule.copy(@source_tracker, @source_role, @target_trackers, @target_roles)
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to workflows_copy_path(:source_tracker_id => @source_tracker, :source_role_id => @source_role)
|
redirect_to workflows_copy_url(:source_tracker_id => @source_tracker, :source_role_id => @source_role)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue