改了个课程截至日期,并且在courses_controller中设置了过期不允许加入的设定,目测没什么问题,明天再看看
This commit is contained in:
parent
6ac640f36a
commit
e0c87996bf
|
@ -1,20 +1,26 @@
|
||||||
class CoursesController < ApplicationController
|
class CoursesController < ApplicationController
|
||||||
|
include CoursesHelper
|
||||||
|
|
||||||
before_filter :require_login, :only => [:join, :unjoin]
|
before_filter :require_login, :only => [:join, :unjoin]
|
||||||
|
before_filter :allow_join, :only => [:join]
|
||||||
|
|
||||||
def join
|
def join
|
||||||
if User.current.logged?
|
if User.current.logged?
|
||||||
course = Project.find(params[:object_id])
|
course = Project.find(params[:object_id])
|
||||||
if params[:course_password] == Course.find_by_extra(course.identifier).password
|
if ( !course_endTime_timeout?(course) )
|
||||||
members = []
|
course_prefs = Course.find_by_extra(course.identifier)
|
||||||
members << Member.new(:role_ids => [10], :user_id => User.current.id)
|
if params[:course_password] == course_prefs.password
|
||||||
course.members << members
|
members = []
|
||||||
|
members << Member.new(:role_ids => [10], :user_id => User.current.id)
|
||||||
|
course.members << members
|
||||||
|
|
||||||
StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id])
|
StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id])
|
||||||
@state = 0
|
@state = 0
|
||||||
|
else
|
||||||
|
@state = 1
|
||||||
|
end
|
||||||
else
|
else
|
||||||
@state = 1
|
@state = 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -39,4 +45,11 @@ class CoursesController < ApplicationController
|
||||||
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id]), :object_id => params[:object_id]} }
|
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id]), :object_id => params[:object_id]} }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def allow_join
|
||||||
|
course_endTime_timeout? Project.find(params[:object_id])
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -45,9 +45,10 @@ class ProjectsController < ApplicationController
|
||||||
# menu_item l(:label_settings), :only => settings
|
# menu_item l(:label_settings), :only => settings
|
||||||
|
|
||||||
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise]
|
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise]
|
||||||
before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file,
|
# before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file,
|
||||||
:statistics, :feedback, :course, :enterprise_course, :course_enterprise, :project_respond, :share,
|
# :statistics, :feedback, :course, :enterprise_course, :course_enterprise, :project_respond, :share,
|
||||||
:show_projects_score, :issue_score_index, :news_score_index, :file_score_index, :code_submit_score_index, :projects_topic_score_index]
|
# :show_projects_score, :issue_score_index, :news_score_index, :file_score_index, :code_submit_score_index, :projects_topic_score_index]
|
||||||
|
before_filter :authorize, :only => [:sort_project_demo, :show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen]
|
||||||
before_filter :authorize_global, :only => [:new, :create]
|
before_filter :authorize_global, :only => [:new, :create]
|
||||||
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
||||||
#by young
|
#by young
|
||||||
|
@ -558,7 +559,8 @@ class ProjectsController < ApplicationController
|
||||||
"show_documents" => true,
|
"show_documents" => true,
|
||||||
"show_messages" => true,
|
"show_messages" => true,
|
||||||
"show_news" => true,
|
"show_news" => true,
|
||||||
"show_bids" => true
|
"show_bids" => true,
|
||||||
|
"show_journals_for_messages" => true
|
||||||
}
|
}
|
||||||
@date_to ||= Date.today + 1
|
@date_to ||= Date.today + 1
|
||||||
@date_from = @date_to - @days
|
@date_from = @date_to - @days
|
||||||
|
@ -569,6 +571,7 @@ class ProjectsController < ApplicationController
|
||||||
:with_subprojects => @with_subprojects,
|
:with_subprojects => @with_subprojects,
|
||||||
:author => @author)
|
:author => @author)
|
||||||
@activity.scope_select {|t| !has["show_#{t}"].nil?}
|
@activity.scope_select {|t| !has["show_#{t}"].nil?}
|
||||||
|
# logger.debug "=========================================#{@activity.scope}"
|
||||||
# @activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
|
# @activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
|
||||||
#Added by young
|
#Added by young
|
||||||
events = @activity.events(@date_from, @date_to)
|
events = @activity.events(@date_from, @date_to)
|
||||||
|
@ -801,6 +804,35 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
end
|
end
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
def finishcourse
|
||||||
|
course_prefs = Course.find_by_extra(@project.identifier)
|
||||||
|
# setup_time = Time.parse(course_prefs.setup_time)
|
||||||
|
# end_time = Time.parse(course_prefs.endup_time)
|
||||||
|
yesterday = Date.today.prev_day.to_time
|
||||||
|
|
||||||
|
course_prefs.endup_time = yesterday
|
||||||
|
@save_flag = course_prefs.save
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def restartcourse
|
||||||
|
course_prefs = Course.find_by_extra(@project.identifier)
|
||||||
|
day = Time.parse("3000-01-01")
|
||||||
|
|
||||||
|
course_prefs.endup_time = day
|
||||||
|
@save_flag = course_prefs.save
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.js {
|
||||||
|
render action:'finishcourse'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Validates parent_id param according to user's permissions
|
# Validates parent_id param according to user's permissions
|
||||||
|
|
|
@ -79,6 +79,11 @@ module CoursesHelper
|
||||||
str
|
str
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_course_term project
|
||||||
|
str = ( project.try(:course_extra).try(:time).to_s << '.' << project.try(:course_extra).try(:term).to_s )
|
||||||
|
str[0..-4]
|
||||||
|
end
|
||||||
|
|
||||||
def members_to_user_ids members
|
def members_to_user_ids members
|
||||||
people = []
|
people = []
|
||||||
members.each { |member|
|
members.each { |member|
|
||||||
|
@ -86,5 +91,17 @@ module CoursesHelper
|
||||||
}
|
}
|
||||||
people
|
people
|
||||||
end
|
end
|
||||||
|
# 截至到2014-03-17 这个是最终的判断课程是否过期的方法
|
||||||
|
def course_endTime_timeout? project
|
||||||
|
end_time_str = Course.find_by_extra(project.try(:identifier)).try(:endup_time)
|
||||||
|
begin
|
||||||
|
cTime = Time.parse(end_time_str.to_s)
|
||||||
|
rescue TypeError,ArgumentError
|
||||||
|
cTime = Time.parse("3000-01-01")
|
||||||
|
end
|
||||||
|
now = Time.now
|
||||||
|
|
||||||
|
now > cTime
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -286,7 +286,7 @@ module ProjectsHelper
|
||||||
WHERE project_type = 0 ORDER BY grade DESC LIMIT #{limit} ) AS t ON p.id = t.project_id ")
|
WHERE project_type = 0 ORDER BY grade DESC LIMIT #{limit} ) AS t ON p.id = t.project_id ")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 判断课程是否结束
|
# 判断课程是否结束,快别用,这个定日子的方法有问题
|
||||||
def course_timeout? project
|
def course_timeout? project
|
||||||
return true if (project.nil? && project.course_extra.nil?)
|
return true if (project.nil? && project.course_extra.nil?)
|
||||||
courses_year = project.course_extra.time
|
courses_year = project.course_extra.time
|
||||||
|
|
|
@ -22,11 +22,6 @@ module WelcomeHelper
|
||||||
include CoursesHelper
|
include CoursesHelper
|
||||||
include ProjectsHelper
|
include ProjectsHelper
|
||||||
|
|
||||||
def get_course_term project
|
|
||||||
str = ( project.try(:course_extra).try(:time).to_s << '.' << project.try(:course_extra).try(:term).to_s )
|
|
||||||
str[0..-4]
|
|
||||||
end
|
|
||||||
|
|
||||||
def welcome_join_in_course(project, user)
|
def welcome_join_in_course(project, user)
|
||||||
if(user.logged? &&
|
if(user.logged? &&
|
||||||
!(course_timeout? project) &&
|
!(course_timeout? project) &&
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<%
|
||||||
|
id = "finish_course_tag"
|
||||||
|
%>
|
||||||
|
|
||||||
|
<% if course_endTime_timeout?(@project) #如果课程已结束%>
|
||||||
|
<%= link_to '重启课程', restartcourse_project_path, :remote => true, :method => :post, :id => id, :confirm => ('确定要重启课程?') %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to '关闭课程', finishcourse_project_path, :remote => true, :method => :post, :id => id, :confirm => ('确定要关闭课程?') %>
|
||||||
|
<% end %>
|
|
@ -2,7 +2,11 @@ $("#<%=object_id%>").replaceWith('<%= escape_javascript join_in_course_for_list(
|
||||||
<% if @state %>
|
<% if @state %>
|
||||||
<% if @state == 0 %>
|
<% if @state == 0 %>
|
||||||
alert("加入成功")
|
alert("加入成功")
|
||||||
<% else %>
|
<% elsif @state == 1 %>
|
||||||
alert("密码错误")
|
alert("密码错误")
|
||||||
|
<% elsif @state == 2 %>
|
||||||
|
alert("课程已过期")
|
||||||
|
<% else %>
|
||||||
|
alert("未知错误,请稍后再试")
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -71,10 +71,11 @@
|
||||||
<td class="info-course"><%= @project.name %></td>
|
<td class="info-course"><%= @project.name %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td align="center">
|
<tr><td align="center">
|
||||||
<div id=join_in_course>
|
<div id="join_in_course">
|
||||||
<%if User.current.logged? %>
|
<%if User.current.logged? %>
|
||||||
<% if @course.teacher.id == User.current.id %>
|
<% if @course.teacher.id == User.current.id %>
|
||||||
<%= link_to l(:label_course_modify_settings), {:controller => 'projects', :action => 'settings', :id => @project} %>
|
<%= link_to l(:label_course_modify_settings), {:controller => 'projects', :action => 'settings', :id => @project} %>
|
||||||
|
<%= render :partial => 'courses/set_course_time'%>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
||||||
<%= join_in_course(@project, User.current) %></div>
|
<%= join_in_course(@project, User.current) %></div>
|
||||||
|
|
|
@ -25,13 +25,16 @@
|
||||||
<%= l(:label_information_plural)%>
|
<%= l(:label_information_plural)%>
|
||||||
</legend>
|
</legend>
|
||||||
<div>
|
<div>
|
||||||
<span id = 'name' style = 'display:none'>
|
<span id = 'name' style = 'display:none'>
|
||||||
<p style="width:400px;padding-left: 26px;">
|
<p style="width:530px;padding-left: 26px;">
|
||||||
<%= f.text_field :firstname, :required => true %>
|
<%= f.text_field :lastname, :required => true %>
|
||||||
|
<span class='font_lighter'><%=l(:field_lastname_eg)%></span>
|
||||||
</p>
|
</p>
|
||||||
<p style="width:400px;padding-left: 26px;">
|
<p style="width:530px;padding-left: 26px;">
|
||||||
<%#= f.text_field :lastname, :required => true %>
|
<%= f.text_field :firstname, :required => true %>
|
||||||
</p></span>
|
<span class='font_lighter'><%=l(:field_firstname_eg)%></span>
|
||||||
|
</p>
|
||||||
|
</span>
|
||||||
|
|
||||||
<span id = 'enterprise' style = 'display:none'>
|
<span id = 'enterprise' style = 'display:none'>
|
||||||
<p style="width:400px;padding-left: 26px;">企业名<%= text_field_tag :enterprise_name, @user.firstname %>
|
<p style="width:400px;padding-left: 26px;">企业名<%= text_field_tag :enterprise_name, @user.firstname %>
|
||||||
|
@ -75,7 +78,7 @@
|
||||||
<p style="width:357px;padding-left: 26px;">
|
<p style="width:357px;padding-left: 26px;">
|
||||||
<%= f.text_field :mail, :required => true %>
|
<%= f.text_field :mail, :required => true %>
|
||||||
</p>
|
</p>
|
||||||
<p style="width:426px;padding-left:26px;>
|
<p style="width:426px;padding-left:26px;">
|
||||||
<%= f.select :language, :Chinese简体中文 => :zh, :English => :en%>
|
<%= f.select :language, :Chinese简体中文 => :zh, :English => :en%>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -47,12 +47,12 @@
|
||||||
</p>
|
</p>
|
||||||
<div class="buttons_for_course" style="margin-top:30px;margin-left:144px">
|
<div class="buttons_for_course" style="margin-top:30px;margin-left:144px">
|
||||||
<span class="info"></span>
|
<span class="info"></span>
|
||||||
<% if(!course_timeout? @project) %>
|
<% if(course_timeout? @project) %>
|
||||||
<%= join_in_course_for_list(@project, User.current,['regular'])%>
|
|
||||||
<% else %>
|
|
||||||
<span class="font_lighter">
|
<span class="font_lighter">
|
||||||
课程学期已结束
|
课程学期已结束
|
||||||
</span>
|
</span>
|
||||||
|
<% else %>
|
||||||
|
<%= join_in_course_for_list(@project, User.current,['regular'])%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
<div class="add-info">
|
<div class="add-info">
|
||||||
<div class="main-language" style="margin-left: 30px;margin-top:-10px">
|
<div class="main-language" style="margin-left: 30px;margin-top:-10px">
|
||||||
<%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%>
|
<%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%>
|
||||||
<%= findCourseTime @project %>
|
<%= get_course_term @project %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<% if @save_flag %>
|
||||||
|
<% if Rails.env.development? %>
|
||||||
|
console.debug('课程修改成功:结束时间改为<%=Course.find_by_extra(@project.identifier).try(:endup_time)%>');
|
||||||
|
<% end %>
|
||||||
|
$('#finish_course_tag').replaceWith("<%= j(render partial: 'courses/set_course_time' )%>")
|
||||||
|
<% else %>
|
||||||
|
alert('设置失败,请在论坛提交问题,等待管理员处理。');
|
||||||
|
<% end %>
|
|
@ -126,7 +126,9 @@
|
||||||
<span class='font_lighter' title =<%=project.description.to_s%>><%=project.description.truncate(25, omission: '...')%></span>
|
<span class='font_lighter' title =<%=project.description.to_s%>><%=project.description.truncate(25, omission: '...')%></span>
|
||||||
</div>
|
</div>
|
||||||
<div style="position:absolute; bottom:0;right:0;margin:5px 10px 5px 5px ;">
|
<div style="position:absolute; bottom:0;right:0;margin:5px 10px 5px 5px ;">
|
||||||
|
<% if !course_endTime_timeout?(project)%>
|
||||||
<%= join_in_course(project, User.current)%>
|
<%= join_in_course(project, User.current)%>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<% end; reset_cycle %>
|
<% end; reset_cycle %>
|
||||||
|
|
|
@ -234,7 +234,9 @@ zh:
|
||||||
field_summary: 摘要
|
field_summary: 摘要
|
||||||
field_is_required: 必填
|
field_is_required: 必填
|
||||||
field_firstname: 名字
|
field_firstname: 名字
|
||||||
|
field_firstname_eg: '(例:张三丰,请填写[三丰])'
|
||||||
field_lastname: 姓氏
|
field_lastname: 姓氏
|
||||||
|
field_lastname_eg: '(例:张三丰,请填写[张])'
|
||||||
field_mail: 邮件地址
|
field_mail: 邮件地址
|
||||||
field_filename: 文件
|
field_filename: 文件
|
||||||
field_filesize: 大小
|
field_filesize: 大小
|
||||||
|
|
|
@ -120,7 +120,7 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'user_courses', :to => 'users#user_courses', :via => :get
|
match 'user_courses', :to => 'users#user_courses', :via => :get
|
||||||
match 'user_homeworks', :to => 'users#user_homeworks', :via => :get
|
match 'user_homeworks', :to => 'users#user_homeworks', :via => :get
|
||||||
match 'watch_projects', :to => 'users#watch_projects', :via => :get
|
match 'watch_projects', :to => 'users#watch_projects', :via => :get
|
||||||
# added by bai
|
# added by bai
|
||||||
match 'show_score', :to => 'users#show_score', :via => :get
|
match 'show_score', :to => 'users#show_score', :via => :get
|
||||||
match 'topic_score_index', :controller => 'users', :action => 'topic_score_index', :via => [:get, :post]
|
match 'topic_score_index', :controller => 'users', :action => 'topic_score_index', :via => [:get, :post]
|
||||||
match 'project_score_index', :to => 'users#project_score_index', :via => :get
|
match 'project_score_index', :to => 'users#project_score_index', :via => :get
|
||||||
|
@ -134,14 +134,14 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'file_score_index', :to => 'projects#file_score_index', :via => [:get, :post]
|
match 'file_score_index', :to => 'projects#file_score_index', :via => [:get, :post]
|
||||||
match 'code_submit_score_index', :to => 'projects#code_submit_score_index', :via => [:get, :post]
|
match 'code_submit_score_index', :to => 'projects#code_submit_score_index', :via => [:get, :post]
|
||||||
match 'projects_topic_score_index', :to => 'projects#projects_topic_score_index', :via => [:get, :post]
|
match 'projects_topic_score_index', :to => 'projects#projects_topic_score_index', :via => [:get, :post]
|
||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback"
|
match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback"
|
||||||
match 'users/:id/user_projects', :controller => 'users', :action => 'user_projects', :via => :get
|
match 'users/:id/user_projects', :controller => 'users', :action => 'user_projects', :via => :get
|
||||||
#match 'user/:id/watch_calls', :controller => 'users', :action => 'watch_bids', :via => [:get , :post]
|
#match 'user/:id/watch_calls', :controller => 'users', :action => 'watch_bids', :via => [:get , :post]
|
||||||
|
|
||||||
#end
|
#end
|
||||||
match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
|
match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
|
||||||
match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
|
match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
|
||||||
match 'my/page', :controller => 'my', :action => 'page', :via => :get
|
match 'my/page', :controller => 'my', :action => 'page', :via => :get
|
||||||
|
@ -173,8 +173,10 @@ RedmineApp::Application.routes.draw do
|
||||||
delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
|
delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
|
||||||
|
|
||||||
resources :bids, :only=>[:edit,:update,:show]
|
resources :bids, :only=>[:edit,:update,:show]
|
||||||
resources :projects do
|
resources :projects do
|
||||||
member do
|
member do
|
||||||
|
post 'finishcourse'
|
||||||
|
post 'restartcourse'
|
||||||
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
|
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
|
||||||
#by young
|
#by young
|
||||||
get 'member', :controller => 'projects', :action => 'member', :as => 'member'
|
get 'member', :controller => 'projects', :action => 'member', :as => 'member'
|
||||||
|
@ -196,24 +198,24 @@ RedmineApp::Application.routes.draw do
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
#by young
|
#by young
|
||||||
match '/member', :controller => 'projects', :action => 'member', :as => 'member', :via => :get
|
match '/member', :controller => 'projects', :action => 'member', :as => 'member', :via => :get
|
||||||
match '/file', :controller => 'projects', :action => 'file', :as => 'file', :via => :get
|
match '/file', :controller => 'projects', :action => 'file', :as => 'file', :via => :get
|
||||||
match '/statistics', :controller => 'projects', :action => 'statistics', :as => 'statistics', :via => :get
|
match '/statistics', :controller => 'projects', :action => 'statistics', :as => 'statistics', :via => :get
|
||||||
# match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get
|
# match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get
|
||||||
match '/homework', :controller => 'projects', :action => 'homework', :as => 'homework', :via => :get
|
match '/homework', :controller => 'projects', :action => 'homework', :as => 'homework', :via => :get
|
||||||
|
|
||||||
|
|
||||||
# match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get
|
# match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get
|
||||||
# match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get
|
# match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get
|
||||||
# match '/', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
|
# match '/', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
|
||||||
# get 'projects/:project_id/show', :to => 'projects#show', :as => 'project_show'
|
# get 'projects/:project_id/show', :to => 'projects#show', :as => 'project_show'
|
||||||
# get 'projects/:project_id/repository', :to => 'repositories#show', :as => 'project_repository'
|
# get 'projects/:project_id/repository', :to => 'repositories#show', :as => 'project_repository'
|
||||||
|
|
||||||
# match '/show', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
|
# match '/show', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
|
||||||
match '/watcherlist', :controller=>'projects', :action=> 'watcherlist', :as => 'watcherlist', :via => :get #add by huang
|
match '/watcherlist', :controller=>'projects', :action=> 'watcherlist', :as => 'watcherlist', :via => :get #add by huang
|
||||||
# matche '/news', :controller => 'news', :action => 'index', :as => 'news', :via => :get
|
# matche '/news', :controller => 'news', :action => 'index', :as => 'news', :via => :get
|
||||||
#end
|
#end
|
||||||
|
|
||||||
resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
|
resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
|
||||||
collection do
|
collection do
|
||||||
|
@ -336,8 +338,7 @@ RedmineApp::Application.routes.draw do
|
||||||
get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
|
get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
|
||||||
get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
|
get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
|
||||||
|
|
||||||
get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))',
|
get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))', :to => 'repositories#changes'
|
||||||
:to => 'repositories#changes'
|
|
||||||
|
|
||||||
get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
|
get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
|
||||||
get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
|
get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
|
||||||
|
@ -348,15 +349,14 @@ RedmineApp::Application.routes.draw do
|
||||||
:controller => 'repositories',
|
:controller => 'repositories',
|
||||||
:format => false,
|
:format => false,
|
||||||
:constraints => {
|
:constraints => {
|
||||||
:action => /(browse|show|entry|raw|annotate|diff)/,
|
:action => /(browse|show|entry|raw|annotate|diff)/,
|
||||||
:rev => /[a-z0-9\.\-_]+/
|
:rev => /[a-z0-9\.\-_]+/
|
||||||
}
|
}
|
||||||
|
|
||||||
get 'projects/:id/repository/statistics', :to => 'repositories#stats'
|
get 'projects/:id/repository/statistics', :to => 'repositories#stats'
|
||||||
get 'projects/:id/repository/graph', :to => 'repositories#graph'
|
get 'projects/:id/repository/graph', :to => 'repositories#graph'
|
||||||
|
|
||||||
get 'projects/:id/repository/changes(/*path(.:ext))',
|
get 'projects/:id/repository/changes(/*path(.:ext))', :to => 'repositories#changes'
|
||||||
:to => 'repositories#changes'
|
|
||||||
|
|
||||||
get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
|
get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
|
||||||
get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
|
get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
|
||||||
|
@ -367,9 +367,9 @@ RedmineApp::Application.routes.draw do
|
||||||
:controller => 'repositories',
|
:controller => 'repositories',
|
||||||
:format => false,
|
:format => false,
|
||||||
:constraints => {
|
:constraints => {
|
||||||
:action => /(browse|show|entry|raw|annotate|diff)/,
|
:action => /(browse|show|entry|raw|annotate|diff)/,
|
||||||
:rev => /[a-z0-9\.\-_]+/
|
:rev => /[a-z0-9\.\-_]+/
|
||||||
}
|
}
|
||||||
get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))',
|
get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))',
|
||||||
:controller => 'repositories',
|
:controller => 'repositories',
|
||||||
:action => /(browse|show|entry|raw|changes|annotate|diff)/
|
:action => /(browse|show|entry|raw|changes|annotate|diff)/
|
||||||
|
@ -529,9 +529,9 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'project/course', :to => 'projects#course', :as => 'course'
|
match 'project/course', :to => 'projects#course', :as => 'course'
|
||||||
|
|
||||||
#added by william
|
#added by william
|
||||||
# match 'calls/:id/set_results',:controller => 'bids', :action => 'set_results',:via => [:get,:post],:as => 'set_results'
|
# match 'calls/:id/set_results',:controller => 'bids', :action => 'set_results',:via => [:get,:post],:as => 'set_results'
|
||||||
# match 'calls/:id/set_prizes',:controller => 'bids',:action => 'set_prizes',:as => 'set_prizes'
|
# match 'calls/:id/set_prizes',:controller => 'bids',:action => 'set_prizes',:as => 'set_prizes'
|
||||||
match 'calls/:id/set_reward',:controller => 'bids',:action => 'set_reward',:as => 'set_reward'
|
match 'calls/:id/set_reward',:controller => 'bids',:action => 'set_reward',:as => 'set_reward'
|
||||||
|
|
||||||
## 测试用
|
## 测试用
|
||||||
match 'test/index', :controller => 'test', :action => 'index'
|
match 'test/index', :controller => 'test', :action => 'index'
|
||||||
|
|
Loading…
Reference in New Issue