Merge branch 'alan_competition' into szzh
This commit is contained in:
commit
1ef77fe8db
|
@ -2,33 +2,44 @@
|
|||
# class BidsController < ApplicationController
|
||||
class ContestsController < ApplicationController
|
||||
layout "contest_base"
|
||||
|
||||
menu_item :respond
|
||||
menu_item :project, :only => :show_project
|
||||
menu_item :application, :only => :show_softapplication
|
||||
menu_item :attendingcontests, :only => :show_attendingcontest
|
||||
menu_item :contestnotifications, :only => :index
|
||||
|
||||
before_filter :can_show_contest,except: []
|
||||
before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :index, :set_reward_project, :set_reward_softapplication, :create,:destroy,:more,:back,:add,:add_softapplication,:new,:show_results, :set_reward,
|
||||
:show_contest_project, :show_contest_user, :join_in_contest, :unjoin_in_contest, :new_join,:show_participator, :settings]
|
||||
|
||||
before_filter :can_show_contest, :except => [] # modified by alan
|
||||
|
||||
# modified by longjun
|
||||
before_filter :find_contest, :only => [
|
||||
:show_contest, :show_project, :show_softapplication,
|
||||
:show_attendingcontest, :index, :set_reward_project,
|
||||
:set_reward_softapplication, :create, :destroy, :more,
|
||||
:back, :add, :add_softapplication, :new,:show_results,
|
||||
:set_reward, :show_contest_project, :show_contest_user,
|
||||
:join_in_contest, :unjoin_in_contest, :new_join, :show_participator, :settings
|
||||
]
|
||||
# end longjun
|
||||
|
||||
# added by fq
|
||||
before_filter :require_login, :only => [:join_in_contest, :unjoin_in_contest]
|
||||
# end
|
||||
before_filter :require_login,:only => [:set_reward, :destroy, :add, :new, ]
|
||||
before_filter :require_login,:only => [:set_reward, :destroy, :add, :new ]
|
||||
|
||||
helper :watchers
|
||||
helper :attachments
|
||||
include AttachmentsHelper
|
||||
include ApplicationHelper
|
||||
helper :projects
|
||||
helper :words
|
||||
|
||||
include AttachmentsHelper
|
||||
include ApplicationHelper
|
||||
|
||||
|
||||
def index
|
||||
# @contests = Contest.visible
|
||||
# @contests ||= []
|
||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
@offset, @limit = api_offset_and_limit(:limit => 10)
|
||||
#@contests = Contest.visible
|
||||
#@contests = @contests.like(params[:name]) if params[:name].present?
|
||||
@contests = Contest.visible.where("name like '%#{params[:name]}%'")
|
||||
|
@ -41,43 +52,55 @@ class ContestsController < ApplicationController
|
|||
@offset ||= @contest_pages.reverse_offset
|
||||
if params[:contest_sort_type].present?
|
||||
case params[:contest_sort_type]
|
||||
when '0'
|
||||
unless @offset == 0
|
||||
@contests = @contests.reorder('contests.commit').offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @contest_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@contests = @contests.reorder('contests.commit').offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
when '1'
|
||||
unless @offset == 0
|
||||
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @contest_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 1
|
||||
when '2'
|
||||
unless @offset == 0
|
||||
@contests = @contests.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @contest_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@contests = @contests.offset(@offset).limit(@limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
end
|
||||
when '0'
|
||||
# modified by longjun
|
||||
# never use unless and else
|
||||
# unless @offset == 0
|
||||
if @offset != 0
|
||||
@contests = @contests.reorder('contests.commit').offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
unless @offset == 0
|
||||
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @contest_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 1
|
||||
limit = @contest_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@contests = @contests.reorder('contests.commit').offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
when '1'
|
||||
# modified by longjun
|
||||
# never use unless and else
|
||||
# unless @offset == 0
|
||||
if @offset != 0
|
||||
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @contest_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 1
|
||||
when '2'
|
||||
# modified by longjun
|
||||
# never use unless and else
|
||||
# unless @offset == 0
|
||||
if @offset != 0
|
||||
@contests = @contests.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @contest_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@contests = @contests.offset(@offset).limit(@limit).all.reverse
|
||||
end
|
||||
@s_state = 0
|
||||
end
|
||||
else
|
||||
# modified by longjun
|
||||
# never use unless and else
|
||||
# unless @offset == 0
|
||||
if @offset != 0
|
||||
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @contest_count % @limit
|
||||
limit = @limit if limit == 0
|
||||
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_state = 1
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -93,7 +116,10 @@ class ContestsController < ApplicationController
|
|||
@bid_pages = Paginator.new @bid_count, @limit, params['page']
|
||||
|
||||
@offset ||= @bid_pages.reverse_offset
|
||||
unless @offset == 0
|
||||
# modified by longjun
|
||||
# never use unless and else
|
||||
# unless @offset == 0
|
||||
if @offset != 0
|
||||
@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
||||
else
|
||||
limit = @bid_count % @limit
|
||||
|
@ -149,10 +175,7 @@ class ContestsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def new_join
|
||||
|
||||
|
||||
end
|
||||
|
||||
def show_participator
|
||||
render :layout => 'base_newcontest'
|
||||
|
@ -186,26 +209,43 @@ class ContestsController < ApplicationController
|
|||
def show_contest_project
|
||||
contests = Contest.where('parent_id = ?', @contest.id)
|
||||
@projects = []
|
||||
for contest in contests
|
||||
@projects += contest.contesting_projects
|
||||
end
|
||||
|
||||
# Modified by longjun
|
||||
# 用 arr.each 替换 for [ according to the style guide ]
|
||||
|
||||
# for contest in contests
|
||||
# @projects += contest.contesting_projects
|
||||
# end
|
||||
|
||||
contests.each do |contest|
|
||||
@projects += contest.contesting_projects
|
||||
end
|
||||
|
||||
# end
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'base_newcontest'
|
||||
}
|
||||
format.api
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def show_contest_softapplication
|
||||
contests = Contest.where('parent_id = ?', @contest.id)
|
||||
@softapplications = []
|
||||
for contest in contests
|
||||
@softapplications += contest.contesting_softapplications
|
||||
end
|
||||
|
||||
|
||||
# Modified by Longjun
|
||||
# for contest in contests
|
||||
# @softapplications += contest.contesting_softapplications
|
||||
|
||||
|
||||
contests.each do |contest|
|
||||
@softapplications += contest.contesting_softapplications
|
||||
end
|
||||
|
||||
# end
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'base_newcontest'
|
||||
|
@ -218,12 +258,21 @@ class ContestsController < ApplicationController
|
|||
def show_contest_user
|
||||
contests = Contest.find(:all)
|
||||
@users = []
|
||||
for contest in contests
|
||||
for project in contest.projects
|
||||
@users += project.users
|
||||
end
|
||||
|
||||
# Modified by Longjun
|
||||
# for contest in contests
|
||||
# for project in contest.projects
|
||||
# @users += project.users
|
||||
# end
|
||||
|
||||
|
||||
contests.each do |contest|
|
||||
contest.projects.each do |project|
|
||||
@uers += project.users
|
||||
end
|
||||
end
|
||||
|
||||
# end
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'base_newcontest'
|
||||
|
@ -239,11 +288,20 @@ class ContestsController < ApplicationController
|
|||
# @contesting_project_count = @contesting_project_all.count
|
||||
# @contesting_project_pages = Paginator.new @contesting_project_count, per_page_option, params['page']
|
||||
@membership.each do |membership|
|
||||
unless(membership.project.project_type==1)
|
||||
if User.current.allowed_to?(:quote_project, membership.project)
|
||||
|
||||
# Modified by Longjun
|
||||
# 将两个判断语句合并
|
||||
# unless membership.project.project_type==1
|
||||
# if User.current.allowed_to?(:quote_project, membership.project)
|
||||
# @option << membership.project
|
||||
# end
|
||||
# end
|
||||
if membership.project.project_type != 1 && User.current.allowed_to?(:quote_project, membership.project)
|
||||
@option << membership.project
|
||||
end
|
||||
|
||||
end
|
||||
# end
|
||||
|
||||
end
|
||||
@user = @contest.author
|
||||
@contesting_project = @contest.contesting_projects.all
|
||||
|
@ -262,16 +320,19 @@ class ContestsController < ApplicationController
|
|||
|
||||
@temp = []
|
||||
@contesting_project.each do |pro|
|
||||
if pro.project && pro.project.project_status
|
||||
@temp << pro
|
||||
end
|
||||
# modified by longjun
|
||||
# if pro.project && pro.project.project_status
|
||||
# @temp << pro
|
||||
# end
|
||||
@temp << pro if pro.project && pro.project.project_status
|
||||
# end longjun
|
||||
@temp
|
||||
end
|
||||
if @temp.size > 0
|
||||
@contesting_project = @temp.sort {|a,b| b.project.project_status.grade <=> a.project.project_status.grade}
|
||||
end
|
||||
end
|
||||
@contesting_project = paginateHelper @contesting_project
|
||||
@contesting_project = paginateHelper(@contesting_project)
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'base_newcontest'
|
||||
|
@ -290,7 +351,7 @@ class ContestsController < ApplicationController
|
|||
@softapplication = Softapplication.all
|
||||
@contesting_softapplication = @contest.contesting_softapplications
|
||||
|
||||
@contesting_softapplication = paginateHelper @contesting_softapplication, 10
|
||||
@contesting_softapplication = paginateHelper(@contesting_softapplication, 10)
|
||||
|
||||
# @temp = []
|
||||
# @softapplicationt.each do |pro|
|
||||
|
@ -328,7 +389,7 @@ class ContestsController < ApplicationController
|
|||
# @contesting_project_count = @contesting_project_all.count
|
||||
# @contesting_project_pages = Paginator.new @contesting_project_count, per_page_option, params['page']
|
||||
@membership.each do |membership|
|
||||
unless(membership.project.project_type==1)
|
||||
unless membership.project.project_type==1
|
||||
#拥有编辑项目权限的可将该项目参赛
|
||||
if User.current.allowed_to?(:quote_project, membership.project)
|
||||
@option << membership.project
|
||||
|
@ -352,27 +413,31 @@ class ContestsController < ApplicationController
|
|||
|
||||
@temp = []
|
||||
@contesting_project.each do |pro|
|
||||
if pro.project && pro.project.project_status
|
||||
@temp << pro
|
||||
end
|
||||
# modified by longjun
|
||||
# if pro.project && pro.project.project_status
|
||||
# @temp << pro
|
||||
# end
|
||||
@temp << pro if pro.project && pro.project.project_status
|
||||
# end longjun
|
||||
@temp
|
||||
end
|
||||
if @temp.size > 0
|
||||
@contesting_project = @temp.sort {|a,b| b.project.project_status.grade <=> a.project.project_status.grade}
|
||||
end
|
||||
end
|
||||
##取出参赛应用 --应用列表
|
||||
# 取出参赛应用 --应用列表
|
||||
@softapplication = Softapplication.all
|
||||
@contesting_softapplication = @contest.contesting_softapplications.
|
||||
joins("LEFT JOIN softapplications ON contesting_softapplications.softapplication_id=softapplications.id").
|
||||
joins("LEFT JOIN (
|
||||
SELECT * FROM seems_rateable_cached_ratings WHERE cacheable_type='Softapplication' AND DIMENSION = 'quality') AS cached
|
||||
ON cached.cacheable_id=softapplications.id").
|
||||
SELECT * FROM seems_rateable_cached_ratings
|
||||
WHERE cacheable_type='Softapplication' AND DIMENSION = 'quality') AS cached
|
||||
ON cached.cacheable_id=softapplications.id").
|
||||
order("cached.avg").reverse_order
|
||||
@contesting_softapplication = paginateHelper @contesting_softapplication, 10
|
||||
|
||||
|
||||
##引用base_newcontest整体样式
|
||||
#引用base_newcontest整体样式
|
||||
@contest = Contest.find_by_id(params[:id])
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
|
@ -384,15 +449,15 @@ class ContestsController < ApplicationController
|
|||
|
||||
###end
|
||||
|
||||
def show_notification
|
||||
@contest = Contest.find_by_id(params[:id])
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'base_newcontest'
|
||||
}
|
||||
format.api
|
||||
end
|
||||
end
|
||||
def show_notification
|
||||
@contest = Contest.find_by_id(params[:id])
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'base_newcontest'
|
||||
}
|
||||
format.api
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def set_reward_project
|
||||
|
@ -437,7 +502,11 @@ end
|
|||
project = Project.find(params[:contest])
|
||||
contest_message = params[:contest_for_save][:contest_message]
|
||||
if ContestingProject.where("project_id = ? and contest_id = ?", project.id, @contest.id).size == 0
|
||||
if ContestingProject.cerate_contesting(@contest.id, project.id, contest_message)
|
||||
# modified by longjun, create 写错了
|
||||
# if ContestingProject.cerate_contesting(@contest.id, project.id, contest_message)
|
||||
if ContestingProject.create_contesting(@contest.id, project.id, contest_message)
|
||||
# end longjun
|
||||
|
||||
flash.now[:notice] = l(:label_bidding_contest_succeed)
|
||||
end
|
||||
else
|
||||
|
@ -633,9 +702,7 @@ end
|
|||
end
|
||||
|
||||
|
||||
def manage
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ module ApplicationHelper
|
|||
extend Forwardable
|
||||
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
|
||||
|
||||
#Added by young
|
||||
#Define the course menu's link class
|
||||
# Added by young
|
||||
# Define the course menu's link class
|
||||
# 不是数组的转化成数组,然后判断当前menu_item是否在给定的列表
|
||||
# REVIEW: 目测menu的机制,貌似不是很需要转换,再说
|
||||
def link_class(label)
|
||||
|
@ -679,15 +679,15 @@ module ApplicationHelper
|
|||
def textilizable(*args)
|
||||
options = args.last.is_a?(Hash) ? args.pop : {}
|
||||
case args.size
|
||||
when 1
|
||||
obj = options[:object]
|
||||
text = args.shift
|
||||
when 2
|
||||
obj = args.shift
|
||||
attr = args.shift
|
||||
text = obj.send(attr).to_s
|
||||
else
|
||||
raise ArgumentError, 'invalid arguments to textilizable'
|
||||
when 1
|
||||
obj = options[:object]
|
||||
text = args.shift
|
||||
when 2
|
||||
obj = args.shift
|
||||
attr = args.shift
|
||||
text = obj.send(attr).to_s
|
||||
else
|
||||
raise ArgumentError, 'invalid arguments to textilizable'
|
||||
end
|
||||
return '' if text.blank?
|
||||
project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)
|
||||
|
|
|
@ -22,6 +22,9 @@ module AttachmentsHelper
|
|||
# Options:
|
||||
# :author -- author names are not displayed if set to false
|
||||
# :thumbails -- display thumbnails if enabled in settings
|
||||
|
||||
include Redmine::Pagination
|
||||
|
||||
def link_to_attachments(container, options = {})
|
||||
options.assert_valid_keys(:author, :thumbnails)
|
||||
|
||||
|
@ -171,7 +174,9 @@ module AttachmentsHelper
|
|||
s.html_safe
|
||||
end
|
||||
|
||||
def private_filter resultSet
|
||||
# Modified by Longjun
|
||||
# 有参数的方法要加()
|
||||
def private_filter(resultSet)
|
||||
result = resultSet.to_a.dup
|
||||
|
||||
# modify by nwb
|
||||
|
@ -190,8 +195,12 @@ module AttachmentsHelper
|
|||
result
|
||||
end
|
||||
|
||||
include Redmine::Pagination
|
||||
def paginateHelper obj, pre_size=10
|
||||
# Modified by Longjun
|
||||
# include 应放在class/model 的开始处
|
||||
# include Redmine::Pagination
|
||||
# end
|
||||
|
||||
def paginateHelper (obj, pre_size=10)
|
||||
@obj_count = obj.count
|
||||
@obj_pages = Paginator.new @obj_count, pre_size, params['page']
|
||||
if obj.kind_of? ActiveRecord::Base or obj.kind_of? ActiveRecord::Relation
|
||||
|
|
|
@ -43,16 +43,16 @@ module ContestsHelper
|
|||
def sort_contest_enterprise(state, project_type)
|
||||
content = ''.html_safe
|
||||
case state
|
||||
when 0
|
||||
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:contest_sort_type => '1', :project_type => project_type)))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:contest_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
||||
|
||||
when 1
|
||||
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:contest_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:contest_sort_type => '0', :project_type => project_type)))
|
||||
end
|
||||
content = content_tag('ul', content)
|
||||
content_tag('div', content, :class => "tabs_enterprise")
|
||||
when 0
|
||||
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:contest_sort_type => '1', :project_type => project_type)))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:contest_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
||||
|
||||
when 1
|
||||
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:contest_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:contest_sort_type => '0', :project_type => project_type)))
|
||||
end
|
||||
content = content_tag('ul', content)
|
||||
content_tag('div', content, :class => "tabs_enterprise")
|
||||
end
|
||||
#end
|
||||
|
||||
|
@ -100,7 +100,10 @@ module ContestsHelper
|
|||
def count_contest_project
|
||||
contests = Contest.find(:id)
|
||||
@projects = []
|
||||
for contest in contests
|
||||
# Modified by longjun
|
||||
# for contest in contests
|
||||
contests.each do |contest|
|
||||
# end longjun
|
||||
@projects += contest.contesting_projects
|
||||
end
|
||||
@projects.count
|
||||
|
@ -109,7 +112,10 @@ module ContestsHelper
|
|||
def count_contest_softapplication
|
||||
contests = Contest.find(:id)
|
||||
@softapplications = []
|
||||
for contest in contests
|
||||
# Modified by alan
|
||||
# for contest in contests
|
||||
contests.each do |contest|
|
||||
# end alan
|
||||
@softapplications += contest.contesting_softapplications
|
||||
end
|
||||
@projects.count
|
||||
|
@ -119,19 +125,29 @@ module ContestsHelper
|
|||
def count_contest_user
|
||||
contests = Contest.find(:id)
|
||||
@users = []
|
||||
for contest in contests
|
||||
for project in contest.projects
|
||||
# Modified by alan
|
||||
# for contest in contests
|
||||
contests.each do |contest|
|
||||
|
||||
contest.projects.each do |project|
|
||||
|
||||
@users += project.users
|
||||
end
|
||||
end
|
||||
# end alan
|
||||
|
||||
@users.count
|
||||
end
|
||||
|
||||
def count_contest_softapplication_user
|
||||
contests = Contest.find(:id)
|
||||
@users = []
|
||||
for contest in contests
|
||||
for project in contest.softapplications
|
||||
# Modified by alan
|
||||
# for contest in contests
|
||||
contests.each do |contest|
|
||||
|
||||
contest.projects.each do |softapplications|
|
||||
# for project in contest.softapplications
|
||||
@users += softapplication.users
|
||||
end
|
||||
end
|
||||
|
|
|
@ -44,7 +44,7 @@ module ProjectsHelper
|
|||
content = ''.html_safe
|
||||
case state
|
||||
when 0
|
||||
|
||||
|
||||
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type)))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type)))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
||||
|
@ -70,19 +70,19 @@ module ProjectsHelper
|
|||
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id)))
|
||||
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
|
||||
|
||||
|
||||
when 1
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id), :class=>"selected"), :class=>"selected")
|
||||
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
|
||||
|
||||
|
||||
when 2
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id)))
|
||||
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
||||
content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
|
||||
|
||||
|
||||
#gcm
|
||||
when 3
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
|
||||
|
@ -101,7 +101,7 @@ module ProjectsHelper
|
|||
content = ''.html_safe
|
||||
case state
|
||||
when 0
|
||||
|
||||
|
||||
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type)))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type)))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
|
||||
|
@ -142,7 +142,7 @@ module ProjectsHelper
|
|||
# end
|
||||
|
||||
|
||||
#Added by young
|
||||
# Added by young
|
||||
def course_settings_tabs
|
||||
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},
|
||||
#{:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural, :project_type => 1},
|
||||
|
@ -151,7 +151,7 @@ module ProjectsHelper
|
|||
]
|
||||
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
|
||||
end
|
||||
#Ended by young
|
||||
# Ended by young
|
||||
|
||||
|
||||
|
||||
|
@ -174,20 +174,37 @@ module ProjectsHelper
|
|||
def render_project_hierarchy(projects)
|
||||
render_project_nested_lists(projects) do |project|
|
||||
#Modified by young
|
||||
if (project.try(:project_type) == Project::ProjectType_course )
|
||||
unless project.is_public == 1
|
||||
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
|
||||
else
|
||||
s = "".html_safe
|
||||
end
|
||||
s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
|
||||
else
|
||||
unless project.is_public
|
||||
if project.try(:project_type) == Project::ProjectType_course
|
||||
|
||||
# modified by longjun
|
||||
# never use unless and else
|
||||
# unless project.is_public == 1
|
||||
|
||||
if project.is_public != 1
|
||||
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
|
||||
else
|
||||
s = "".html_safe
|
||||
end
|
||||
s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
|
||||
# end longjun
|
||||
|
||||
# modified by Longjun
|
||||
s += link_to_project(project, {},
|
||||
:class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
|
||||
# end longjun
|
||||
else
|
||||
# modified by longjun
|
||||
# unless project.is_public
|
||||
|
||||
if !project.is_public
|
||||
# end longjun
|
||||
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
|
||||
else
|
||||
s = "".html_safe
|
||||
end
|
||||
# modified by longjun
|
||||
s += link_to_project(project, {},
|
||||
:class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
|
||||
# end longjun
|
||||
end
|
||||
#Ended by young
|
||||
if project.description.present?
|
||||
|
@ -254,9 +271,14 @@ module ProjectsHelper
|
|||
def is_manager?(user_id,project_id)
|
||||
@result = false
|
||||
@user_id = ProjectInfo.find_by_project_id(project_id)
|
||||
if @user_id == user.id
|
||||
@result = true
|
||||
end
|
||||
|
||||
# modified by longjun
|
||||
# if @user_id == user.id
|
||||
# @result = true
|
||||
# end
|
||||
|
||||
@result = true if @user_id = user.id
|
||||
# end longjun
|
||||
return @result
|
||||
end
|
||||
|
||||
|
@ -341,9 +363,9 @@ module ProjectsHelper
|
|||
return true if (project.nil? && project.course_extra.nil?)
|
||||
courses_year = project.course_extra.time
|
||||
current_year = Time.now.year
|
||||
if(courses_year >= current_year)
|
||||
if courses_year >= current_year
|
||||
return false
|
||||
elsif( (courses_year < current_year) && (Time.now.month < 3) )
|
||||
elsif (courses_year < current_year) && (Time.now.month < 3)
|
||||
return false
|
||||
else
|
||||
return true
|
||||
|
|
|
@ -72,11 +72,14 @@ class Contest < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def self.creat_contests(budget, deadline, name, description=nil)
|
||||
self.create(:author_id => User.current.id, :budget => budget,
|
||||
:deadline => deadline, :name => name, :description => description, :commit => 0)
|
||||
end
|
||||
|
||||
# modified by longjun
|
||||
# 这个函数没有用到
|
||||
# def self.creat_contests(budget, deadline, name, description=nil)
|
||||
# self.create(:author_id => User.current.id, :budget => budget,
|
||||
# :deadline => deadline, :name => name, :description => description, :commit => 0)
|
||||
# end
|
||||
# end longjun
|
||||
|
||||
def update_contests(budget, deadline, name, description=nil)
|
||||
if(User.current.id == self.author_id)
|
||||
self.name = name
|
||||
|
|
|
@ -14,7 +14,7 @@ class ContestingProject < ActiveRecord::Base
|
|||
validate :validate_project
|
||||
validates_uniqueness_of :contest_id, :scope => :project_id
|
||||
|
||||
def self.cerate_contesting(contest_id, project_id, description = nil)
|
||||
def self.create_contesting(contest_id, project_id, description = nil)
|
||||
self.create(:user_id => User.current.id, :contest_id => contest_id,
|
||||
:project_id => project_id, :description => description)
|
||||
end
|
||||
|
|
|
@ -67,12 +67,15 @@
|
|||
<% @topics.each do |topic| %>
|
||||
<table class="content-text-list">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50"><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %></td>
|
||||
<td colspan="2" valign="top" width="50">
|
||||
<%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %>
|
||||
</td>
|
||||
<td>
|
||||
<table width="640px" border="0">
|
||||
<tr>
|
||||
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %>
|
||||
<%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title:topic.subject.to_s %>
|
||||
<%= topic.locked? ? 'locked' : '' %>">
|
||||
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title:topic.subject.to_s %>
|
||||
</td>
|
||||
<td align="right" rowspan="3">
|
||||
<table class="borad-count">
|
||||
|
|
|
@ -9,8 +9,12 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px"><a href="http://contest.trustie.net/">contest.trustie.net</td>
|
||||
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'welcome', :action => 'contest' %> > 详情</td>
|
||||
<td style="padding-left: 8px">
|
||||
<a href="http://contest.trustie.net/">contest.trustie.net</a>
|
||||
</td>
|
||||
<td >
|
||||
<%=link_to l(:field_homepage), home_path %> >
|
||||
<%=link_to l(:label_contest_innovate), welcome_contest_path %> > 详情</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -3,8 +3,23 @@
|
|||
<%= l(:bale_news_notice) %>
|
||||
</div>
|
||||
<div class="box tabular">
|
||||
<p><%= f.text_field :title, :required => true, :size => 60,:maxlength => 60, :style => "width:488px;" %></p>
|
||||
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %></p>
|
||||
<p>
|
||||
<%= f.text_field :title,
|
||||
:required => true,
|
||||
:size => 60,
|
||||
:maxlength => 60,
|
||||
:style => "width:488px;"
|
||||
%>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.text_area :description,
|
||||
:required => true,
|
||||
:cols => 60,
|
||||
:rows => 11,
|
||||
:class => 'wiki-edit',
|
||||
:style => "width:490px;"
|
||||
%>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -2,24 +2,47 @@
|
|||
<table><tr><td><img src="/images/new/news.png" width="40" height="40"/></td><td><%#= link_to h(news.title), news_path(news) %>
|
||||
<%#= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %>
|
||||
|
||||
<%# unless news.summary.blank? %></td><td><span class="fontligher"><%#=h news.summary %></span><% end %></td>
|
||||
<%# unless news.summary.blank? %></td><td><span class="fontligher"><%#=h news.summary %></span></td>
|
||||
<td><span class="author"><%#= authoring news.created_on, news.author %></span></td></tr></table></p>-->
|
||||
|
||||
<table width="660px" border="0" align="center">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><img src="/images/new/news.png" width="40" height="40"/></td>
|
||||
<td colspan="2" valign="top" width="50" >
|
||||
<img src="/images/new/news.png" width="40" height="40"/>
|
||||
</td>
|
||||
<td><table width="580px" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong> <%=link_to contestnotifications.author,contest_contestnotification_path(contestnotifications)%></strong>
|
||||
<a class="font_lighter"><%= l(:label_project_newshare) %></a> <%= link_to h(contestnotifications.title), contest_contestnotification_path(contestnotifications) %>
|
||||
<td colspan="2" valign="top">
|
||||
<strong>
|
||||
<%=link_to contestnotifications.author,
|
||||
contest_contestnotification_path(contestnotifications)
|
||||
%>
|
||||
</strong>
|
||||
<a class="font_lighter">
|
||||
<%= l(:label_project_newshare) %>
|
||||
</a>
|
||||
<%= link_to h(contestnotifications.title),
|
||||
contest_contestnotification_path(contestnotifications)
|
||||
%>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" ><p class="font_description"><%=h contestnotifications.description%></p></td>
|
||||
<td colspan="2" width="580px" >
|
||||
<p class="font_description">
|
||||
<%=h contestnotifications.description%>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><a class="font_lighter"> <%= contestnotifications.created_at %></a></td>
|
||||
<td width="200" align="right" class="a"><%= link_to l(:label_project_newother),contest_contestnotification_path(contestnotifications)%>
|
||||
<td align="left">
|
||||
<a class="font_lighter">
|
||||
<%= contestnotifications.created_at %>
|
||||
</a>
|
||||
</td>
|
||||
<td width="200" align="right" class="a">
|
||||
<%= link_to l(:label_project_newother),
|
||||
contest_contestnotification_path(contestnotifications)
|
||||
%>
|
||||
<%= "(#{l(:label_x_comments, :count => contestnotifications.notificationcomments_count)})" if contestnotifications.notificationcomments_count > 0 %>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
<h3><%=l(:label_news)%></h3>
|
||||
|
||||
<%= labelled_form_for @contestnotification, url: contest_contestnotification_path, :html => { :id => 'contestnotifications-form', :multipart => true, :method => :put } do |f| %>
|
||||
<%= labelled_form_for @contestnotification,
|
||||
:url => contest_contestnotification_path,
|
||||
:html => { :id => 'contestnotifications-form',
|
||||
:multipart => true,
|
||||
:method => :put } do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<%= preview_link preview_contestnotifications_path(id: @contestnotification), 'contestnotifications-form' %>
|
||||
<%= preview_link preview_contestnotifications_path(id: @contestnotification),
|
||||
'contestnotifications-form'
|
||||
%>
|
||||
<% end %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
<%= labelled_form_for @contestnotification, :url => contest_contestnotifications_path(@contest), :html => { :id => 'contestnotifications-form', :multipart => true } do |f| %>
|
||||
<%= labelled_form_for @contestnotification,
|
||||
:url => contest_contestnotifications_path(@contest),
|
||||
:html => { :id => 'contestnotifications-form', :multipart => true } do |f| %>
|
||||
<%= render :partial => 'contestnotifications/form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
|
||||
<%= submit_tag l(:button_cancel), :class => "whiteButton m3p10 h30",:onclick => "cancel();" %>
|
||||
|
|
|
@ -1,21 +1,26 @@
|
|||
|
||||
<div class="contextual">
|
||||
<%= link_to(l(:button_edit),
|
||||
edit_contest_contestnotification_path(@contest, @contestnotification),
|
||||
:class => 'icon icon-edit',
|
||||
:accesskey => accesskey(:edit),
|
||||
:onclick => '$("#edit-contestnotifications").show(); return true;') if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?)%>
|
||||
edit_contest_contestnotification_path(@contest, @contestnotification),
|
||||
:class => 'icon icon-edit',
|
||||
:accesskey => accesskey(:edit),
|
||||
:onclick => '$("#edit-contestnotifications").show(); return true;') if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?)%>
|
||||
<%= delete_link contest_contestnotification_path(@contest, @contestnotification) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %>
|
||||
</div>
|
||||
|
||||
<h3><strong><%=h @contestnotification.title %></strong></h3>
|
||||
|
||||
<div id="edit-contestnotifications" style="display:none;">
|
||||
<%= labelled_form_for @contestnotification, :url => contest_contestnotification_path(@contest),
|
||||
:html => { :id => 'contestnotifications-form', :multipart => true, :method => :put } do |f| %>
|
||||
<%= labelled_form_for @contestnotification,
|
||||
:url => contest_contestnotification_path(@contest),
|
||||
:html => { :id => 'contestnotifications-form',
|
||||
:multipart => true,
|
||||
:method => :put } do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-contestnotifications").hide(); return false;' %>
|
||||
<%= link_to l(:button_cancel),
|
||||
"#",
|
||||
:onclick => '$("#edit-contestnotifications").hide(); return false;' %>
|
||||
<% end %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
</div>
|
||||
|
@ -23,7 +28,9 @@
|
|||
<div id="notificationcomments" style="margin-bottom:16px;">
|
||||
|
||||
<div style="margin:15px">
|
||||
<span class="font_description"> <%= textilizable(@contestnotification, :description) %> </span>
|
||||
<span class="font_description">
|
||||
<%= textilizable(@contestnotification, :description) %>
|
||||
</span>
|
||||
<br/>
|
||||
<%#= link_to_attachments @contestnotification %>
|
||||
<br/>
|
||||
|
@ -31,16 +38,26 @@
|
|||
|
||||
<% if User.current.logged? %>
|
||||
<p>
|
||||
<%= toggle_link l(:label_comment_add), "add_notificationcomment_form", :focus => "notificationcomment_notificationcomments" %>
|
||||
<%= toggle_link l(:label_comment_add),
|
||||
"add_notificationcomment_form",
|
||||
:focus => "notificationcomment_notificationcomments"
|
||||
%>
|
||||
</p>
|
||||
<% else %>
|
||||
<%= l(:label_user_login_notificationcomment) %>
|
||||
<%= link_to l(:label_user_login_new), signin_path %>
|
||||
<% end %>
|
||||
|
||||
<%= form_tag( contest_contestnotification_notificationcomments_path(@contest, @contestnotification) , :id => "add_notificationcomment_form", :style => "display:none;") do %>
|
||||
<%= form_tag( contest_contestnotification_notificationcomments_path(@contest, @contestnotification) ,
|
||||
:id => "add_notificationcomment_form",
|
||||
:style => "display:none;") do %>
|
||||
<div class="box">
|
||||
<%= text_area 'notificationcomment', 'notificationcomments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
|
||||
<%= text_area 'notificationcomment',
|
||||
'notificationcomments',
|
||||
:cols => 80,
|
||||
:rows => 15,
|
||||
:class => 'wiki-edit'
|
||||
%>
|
||||
<%= wikitoolbar_for 'notificationcomment_notificationcomments' %>
|
||||
</div>
|
||||
<p>
|
||||
|
@ -65,7 +82,9 @@
|
|||
<% next if notificationcomment.new_record? %>
|
||||
<table width="660px" border="0" align="center">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(notificationcomment.author), :class => "avatar")%></td>
|
||||
<td colspan="2" valign="top" width="50" >
|
||||
<%= image_tag(url_to_avatar(notificationcomment.author), :class => "avatar")%>
|
||||
</td>
|
||||
<td>
|
||||
<table width="580px" border="0">
|
||||
<tr>
|
||||
|
@ -80,8 +99,9 @@
|
|||
</td>
|
||||
<td>
|
||||
<% if notificationcomment.author==User.current|| User.current.admin? %>
|
||||
<%= link_to(l(:label_bid_respond_delete), contest_contestnotification_notificationcomment_path(@contest, @contestnotification,notificationcomment),
|
||||
:method => :delete,:confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
|
||||
<%= link_to(l(:label_bid_respond_delete),
|
||||
contest_contestnotification_notificationcomment_path(@contest, @contestnotification,notificationcomment),
|
||||
:method => :delete,:confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -92,7 +112,11 @@
|
|||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><span class="font_lighter"> <%= format_time(notificationcomment.created_at) %></span></td>
|
||||
<td align="left">
|
||||
<span class="font_lighter">
|
||||
<%= format_time(notificationcomment.created_at) %>
|
||||
</span>
|
||||
</td>
|
||||
<td width="200" align="right" class="a"><%#= link_to_if_authorized_contest image_tag('delete.png'), {:controller => 'notificationcomments', :action => 'destroy', :id => @contestnotifications, :notificationcomment_id => notificationcomment},
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %></td>
|
||||
</tr>
|
||||
|
|
|
@ -4,7 +4,10 @@
|
|||
<tr>
|
||||
<td colspan="2" valign="top" width="50" >
|
||||
<% unless contest.author.nil? %>
|
||||
<%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'), user_path(contest.author), :class => "avatar") %>
|
||||
<%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'),
|
||||
user_path(contest.author),
|
||||
:class => "avatar")
|
||||
%>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -12,33 +15,85 @@
|
|||
<tr>
|
||||
<td colspan="2" valign="top"><strong>
|
||||
<% unless contest.author.nil? %>
|
||||
<%= link_to(contest.author, user_path(contest.author), :class => 'bid_user') %>:
|
||||
<%= link_to(contest.author,
|
||||
user_path(contest.author),
|
||||
:class => 'bid_user')
|
||||
%>:
|
||||
<% end %>
|
||||
<%= link_to(contest.name, contest_contestnotifications_path(contest), :class => 'bid_path', :target => "_blank") %></strong></td>
|
||||
<%= link_to(contest.name,
|
||||
contest_contestnotifications_path(contest),
|
||||
:class => 'bid_path',
|
||||
:target => "_blank") %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="500">
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<strong><%= l(:label_contests_reward_method) %>: <span style="word-break: break-all; color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= contest.budget%></span></strong>
|
||||
<strong><%= l(:label_contests_reward_method) %>:
|
||||
<span style="word-break: break-all; color: #15bccf; font-family: 14px; font-family: '微软雅黑'">
|
||||
<%= contest.budget%>
|
||||
</span>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="font_lighter">
|
||||
<!-- <span class="font_lighter"><%= l(:label_contest_project, :count => contest.contesting_projects.count) %>(<strong><span style="font-size: 17px"><%= link_to(contest.contesting_projects.count, show_project_contest_path(contest), :target => "_blank") %></span></strong>)</span>
|
||||
<span class="font_lighter"><%= l(:label_contest_softapplication, :count => contest.contesting_softapplications.count) %>(<strong><span style="font-size: 17px"><%= link_to(contest.contesting_softapplications.count, show_softapplication_contest_path(contest), :target => "_blank") %></span></strong>)</span> -->
|
||||
<% if contest.id == 2 or contest.id == 3 or contest.id == 6 %>
|
||||
<%= l(:label_contest_work, :count => contest.contesting_projects.count) %>(<strong><span style="font-size: 17px"><%= link_to(contest.projects.where('is_public=1').count, show_attendingcontest_contest_path(contest), :target => "_blank") %></span></strong>)
|
||||
<!-- <span class="font_lighter">
|
||||
<%= l(:label_contest_project,
|
||||
:count => contest.contesting_projects.count)
|
||||
%>
|
||||
(<strong><span style="font-size: 17px">
|
||||
<%= link_to(contest.contesting_projects.count,
|
||||
show_project_contest_path(contest),
|
||||
:target => "_blank")
|
||||
%></span></strong>)</span>
|
||||
<span class="font_lighter">
|
||||
<%= l(:label_contest_softapplication,
|
||||
:count => contest.contesting_softapplications.count)
|
||||
%>
|
||||
(<strong><span style="font-size: 17px">
|
||||
<%= link_to(contest.contesting_softapplications.count,
|
||||
show_softapplication_contest_path(contest),
|
||||
:target => "_blank")
|
||||
%>
|
||||
</span></strong>)</span> -->
|
||||
<!-- modified by longjun
|
||||
将 or 改成 || -->
|
||||
<% if contest.id == 2 || contest.id == 3 || contest.id == 6 %>
|
||||
<%= l(:label_contest_work,
|
||||
:count => contest.contesting_projects.count)
|
||||
%>
|
||||
(<strong>
|
||||
<span style="font-size: 17px">
|
||||
<%= link_to(contest.projects.where('is_public=1').count,
|
||||
show_attendingcontest_contest_path(contest),
|
||||
:target => "_blank")
|
||||
%>
|
||||
</span>
|
||||
</strong>)
|
||||
<% else %>
|
||||
<%= l(:label_contest_work, :count => contest.contesting_softapplications.count) %>(<strong><span style="font-size: 17px"><%= link_to(contest.contesting_softapplications.count, show_attendingcontest_contest_path(contest), :target => "_blank") %></span></strong>)
|
||||
<%= l(:label_contest_work,
|
||||
:count => contest.contesting_softapplications.count)
|
||||
%>
|
||||
(<strong>
|
||||
<span style="font-size: 17px">
|
||||
<%= link_to(contest.contesting_softapplications.count,
|
||||
show_attendingcontest_contest_path(contest),
|
||||
:target => "_blank") %>
|
||||
</span>
|
||||
</strong>)
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table></td>
|
||||
<td width="200" align="right" class="a"><span class="font_lighter"> <%= l :label_create_time %>: <%= format_time contest.created_on %></span></td>
|
||||
<td width="200" align="right" class="a">
|
||||
<span class="font_lighter">
|
||||
<%= l :label_create_time %>: <%= format_time contest.created_on %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -58,6 +113,6 @@
|
|||
<div class="pagination">
|
||||
<ul>
|
||||
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -20,17 +20,55 @@
|
|||
</script>
|
||||
<%= error_messages_for 'contest' %>
|
||||
<!--[form:project]-->
|
||||
<p style="width:500px;"><%= l(:label_bids_form_contest_new_description) %></p>
|
||||
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Contest::NAME_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_name)}" %></p>
|
||||
<p style="width:500px;">
|
||||
<%= l(:label_bids_form_contest_new_description) %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.text_field :name,
|
||||
:required => true,
|
||||
:size => 60,
|
||||
:style => "width:490px;",
|
||||
:maxlength => Contest::NAME_LENGTH_LIMIT,
|
||||
:placeholder => "#{l(:label_contest_name)}"
|
||||
%>
|
||||
</p>
|
||||
|
||||
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 5, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Contest::DESCRIPTION_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_description)}" %></p>
|
||||
<p style="margin-left:-10px;padding-right: 20px;">
|
||||
<%= f.text_area :description,
|
||||
:rows => 5,
|
||||
:class => 'wiki-edit',
|
||||
:style => "font-size:small;width:490px;margin-left:10px;",
|
||||
:maxlength => Contest::DESCRIPTION_LENGTH_LIMIT,
|
||||
:placeholder => "#{l(:label_contest_description)}"
|
||||
%>
|
||||
</p>
|
||||
|
||||
<p style="margin-left:-10px;"><%= f.text_field :password, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
|
||||
<p style="margin-left:-10px;">
|
||||
<%= f.text_field :password,
|
||||
:size => 60,
|
||||
:style => "width:488px;margin-left: 10px;"
|
||||
%>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.text_area :budget, :required => true, :size => 60,:rows => 4,:maxlength => Contest::DESCRIPTION_LENGTH_LIMIT, :style => "width:490px;", :placeholder => l(:label_bids_reward_what) %>
|
||||
<%= f.text_area :budget,
|
||||
:required => true,
|
||||
:size => 60,
|
||||
:rows => 4,
|
||||
:maxlength => Contest::DESCRIPTION_LENGTH_LIMIT,
|
||||
:style => "width:490px;",
|
||||
:placeholder => l(:label_bids_reward_what)
|
||||
%>
|
||||
|
||||
<!-- 设置奖项设置的打开 关闭开关-->
|
||||
</p>
|
||||
<!-- <em class="info" style="margin-left:95px;"><%= l(:text_contest_reward) %></em> -->
|
||||
<p><%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;", :placeholder => "#{l(:label_deadline)}" %><%= calendar_for('contest_deadline')%></p>
|
||||
<p>
|
||||
<%= f.text_field :deadline,
|
||||
:required => true,
|
||||
:size => 60,
|
||||
:style => "width:150px;",
|
||||
:placeholder => "#{l(:label_deadline)}"
|
||||
%>
|
||||
<%= calendar_for('contest_deadline')%>
|
||||
</p>
|
||||
|
|
|
@ -11,36 +11,66 @@
|
|||
<ul class="message-for-user">
|
||||
<% for journal in journals%>
|
||||
<li id='word_li_<%= journal.id.to_s %>' class="outer-message-for-user">
|
||||
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span>
|
||||
<span class="body">
|
||||
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
|
||||
<span class="font_lighter"><% label = l(:label_contest_requirement) %></span>
|
||||
<div> <%= textilizable journal.notes%> </div>
|
||||
<span class="font_lighter"><%= l(:label_bids_published) %> <%= time_tag(journal.created_on).html_safe %> <%= l(:label_bids_published_ago) %></span>
|
||||
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
|
||||
<span>
|
||||
<% if reply_allow %>
|
||||
<%#= link_to(l(:button_quote), {:controller => 'contests', :action => 'new', :id => contest, :journal_id => journal}, :remote => true, :method => 'post', :title => l(:button_quote))%>
|
||||
<%= link_to(l(:button_quote), contests_path(:id => contest, :journal_id => journal), :remote => true, :method => 'post', :title => l(:button_quote))%>
|
||||
<%= link_to l(:label_bid_respond_quote),'',
|
||||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"}%>
|
||||
<% end %>
|
||||
|
||||
<% if @user==User.current|| User.current.admin? %>
|
||||
<%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
|
||||
:remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
|
||||
<%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</span>
|
||||
</span>
|
||||
<span class="portrait">
|
||||
<%= image_tag(url_to_avatar(journal.user), :class => "avatar") %>
|
||||
</span>
|
||||
<span class="body">
|
||||
<span class="user">
|
||||
<%= link_to journal.user, user_path(journal.user)%>
|
||||
</span>
|
||||
<span class="font_lighter">
|
||||
<% label = l(:label_contest_requirement) %>
|
||||
</span>
|
||||
<div> <%= textilizable journal.notes%> </div>
|
||||
<span class="font_lighter">
|
||||
<%= l(:label_bids_published) %>
|
||||
<%= time_tag(journal.created_on).html_safe %>
|
||||
<%= l(:label_bids_published_ago) %>
|
||||
</span>
|
||||
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
|
||||
<span>
|
||||
<% if reply_allow %>
|
||||
<%#= link_to(l(:button_quote), {:controller => 'contests', :action => 'new', :id => contest, :journal_id => journal}, :remote => true, :method => 'post', :title => l(:button_quote))%>
|
||||
<%= link_to(l(:button_quote),
|
||||
contests_path(:id => contest,
|
||||
:journal_id => journal),
|
||||
:remote => true,
|
||||
:method => 'post',
|
||||
:title => l(:button_quote))
|
||||
%>
|
||||
<%= link_to l(:label_bid_respond_quote),
|
||||
'',
|
||||
{:focus => 'project_respond',
|
||||
:onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"
|
||||
}
|
||||
%>
|
||||
<% end %>
|
||||
|
||||
<% if @user==User.current|| User.current.admin? %>
|
||||
<%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
|
||||
:remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
|
||||
<!-- modified by longjun -->
|
||||
<%= link_to(l(:label_bid_respond_delete),
|
||||
|
||||
words_destroy_path(:user_id => @user, :object_id => journal),
|
||||
:remote => true,
|
||||
:confirm => l(:text_are_you_sure),
|
||||
:method => 'delete',
|
||||
:class => "delete",
|
||||
:title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<div style="clear: both;"></div>
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
<% if reply_allow %>
|
||||
<div id='<%= ids %>' class="respond-form">
|
||||
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
|
||||
<%= render :partial => 'words/new_respond',
|
||||
:locals => {:journal => journal, :m_reply_id => journal}
|
||||
%>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="clear: both;"></div>
|
||||
|
|
|
@ -26,8 +26,9 @@
|
|||
<td style="color: #ec6300;" align="right" valign="0.1em" width="16%">
|
||||
<strong>
|
||||
<span id="reward_result_<%=c_project.id%>"> <!-- 调用js进行刷新 -->
|
||||
<%= l(:label_system_grade) %>:<%= (c_project.project.project_status.nil? ? 0.0 : c_project.project.project_status.grade) unless (c_project.project.project_status.nil? && c_project.project.nil?) %>
|
||||
<% if get_prize(c_project).nil? or get_prize(c_project) == "" %>
|
||||
<%= l(:label_system_grade) %>:
|
||||
<%= (c_project.project.project_status.nil? ? 0.0 : c_project.project.project_status.grade) unless (c_project.project.project_status.nil? && c_project.project.nil?) %>
|
||||
<% if get_prize(c_project).nil? || get_prize(c_project) == "" %>
|
||||
<% if @contest.deadline < Date.today %>
|
||||
<%= l(:label_noawards)%>
|
||||
<% end %>
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
<tr>
|
||||
<td><strong><%=l(:label_softapplication)%>:</strong></td>
|
||||
<td>
|
||||
<%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %>
|
||||
<%= link_to(c_softapplication.softapplication.name,
|
||||
softapplication_path(c_softapplication.softapplication),
|
||||
:target => '_blank')
|
||||
%>
|
||||
</td>
|
||||
</tr></br>
|
||||
</div>
|
||||
|
@ -31,5 +34,7 @@
|
|||
<% end %>
|
||||
<div class="underline-contests_three"></div>
|
||||
<% end %>
|
||||
<div class="pagination"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %></div>
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -30,7 +30,18 @@
|
|||
<% if User.current.logged? %>
|
||||
<table border="0" width="525px" align="center" >
|
||||
<tr>
|
||||
<td><%= f.text_area 'message', :rows => 3, :cols => 65, :placeholder => l(:label_my_respond), :style => "resize: none;", :class => 'noline'%></td>
|
||||
|
||||
<!-- modified by longjun 修改格式 -->
|
||||
<td>
|
||||
<%= f.text_area 'message',
|
||||
:rows => 3,
|
||||
:cols => 65,
|
||||
:placeholder => l(:label_my_respond),
|
||||
:style => "resize: none;",
|
||||
:class => 'noline'
|
||||
%>
|
||||
</td>
|
||||
<!-- end longjun -->
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
@ -39,8 +50,23 @@
|
|||
<!-- modified by bai -->
|
||||
<table border="0" width="525px" align="center">
|
||||
<tr>
|
||||
<td align="right"> <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "contest_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%>
|
||||
<%= submit_tag l(:button_clear_meassge), :name => nil, :onclick => "clearMessage('contest_message_message');", :type => 'button', :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'" %> </td>
|
||||
<!-- modified by longjun 修改格式 -->
|
||||
<td align="right">
|
||||
<%= submit_tag l(:button_leave_meassge),
|
||||
:name => nil ,
|
||||
:class => "contest_btn",
|
||||
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -31px'"
|
||||
%>
|
||||
<%= submit_tag l(:button_clear_meassge),
|
||||
:name => nil,
|
||||
:onclick => "clearMessage('contest_message_message');",
|
||||
:type => 'button', :class => "bid_btn",
|
||||
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -31px'"
|
||||
%>
|
||||
</td>
|
||||
<!-- end longjun -->
|
||||
</tr>
|
||||
</table>
|
||||
<!-- end -->
|
||||
|
|
|
@ -50,8 +50,17 @@
|
|||
<%= text_field_tag 'contest_password', nil, :size => 45 %>
|
||||
|
||||
<p class="buttons" style="padding-top: 10px; padding-bottom: 1px; margin-bottom: 1px">
|
||||
<%= submit_tag l(:label_new_join), :name => nil, :class => "contest_btn", :onclick => "hideModal(this);" %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :class => "contest_btn", :onclick => "hideModal(this);", :type => 'button' %>
|
||||
<%= submit_tag l(:label_new_join),
|
||||
:name => nil, :class => "contest_btn",
|
||||
:onclick => "hideModal(this);"
|
||||
%>
|
||||
<%= submit_tag l(:button_cancel),
|
||||
:name => nil,
|
||||
:class => "contest_btn",
|
||||
:onclick => "hideModal(this);",
|
||||
:type => 'button'
|
||||
%>
|
||||
</p>
|
||||
</td>
|
||||
</tr></table>
|
||||
<% end %>
|
||||
|
|
|
@ -90,7 +90,14 @@
|
|||
<tr style="width:700px; margin-left: -10px;">
|
||||
<span><%= l(:label_work_name) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td><%= f.text_field :name, :required => true, :size => 60, :style => "width:320px;", :onblur => "regexName();" %></td>
|
||||
<td>
|
||||
<%= f.text_field :name,
|
||||
:required => true,
|
||||
:size => 60,
|
||||
:style => "width:320px;",
|
||||
:onblur => "regexName();"
|
||||
%>
|
||||
</td>
|
||||
<span style="font-size: 10px;" id="spane_name_notice">(<%= l(:label_workname_lengthlimit) %>)</span>
|
||||
</tr>
|
||||
<br/>
|
||||
|
@ -101,7 +108,12 @@
|
|||
<span><%= l(:label_running_platform) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td style="width: 100px">
|
||||
<%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:320px;", :onblur=>"regexWorkdescription();"%>
|
||||
<%= f.text_field :android_min_version_available,
|
||||
:required => true,
|
||||
:size => 60,
|
||||
:style => "width:320px;",
|
||||
:onblur=>"regexWorkdescription();"
|
||||
%>
|
||||
</td>
|
||||
<span style="font-size: 10px" id="spane_workdescription_notice">(<%= l(:label_workdescription_lengthlimit) %>)</span>
|
||||
</tr>
|
||||
|
@ -116,7 +128,9 @@
|
|||
<span>
|
||||
<%#= select_tag 'app_type_name', work_type_opttion, {:name => 'app_type_name',:style => "width:358px;"} %>
|
||||
</span>
|
||||
<%= f.select :app_type_name,work_type_opttion, {},{:style => "width:328px;",:onchange => "selectChange(this)"} %>
|
||||
<%= f.select :app_type_name,work_type_opttion,
|
||||
{},
|
||||
{:style => "width:328px;",:onchange => "selectChange(this)"} %>
|
||||
<%#= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %>
|
||||
</td>
|
||||
<span style="font-size: 10px;display: none" id="other_span">
|
||||
|
@ -131,7 +145,13 @@
|
|||
<tr style="width:800px;">
|
||||
<span><%= l(:label_work_description) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:320px;" %></td>
|
||||
<td style="width: 100px">
|
||||
<%= f.text_field :description,
|
||||
:required => true,
|
||||
:size => 60,
|
||||
:style => "width:320px;"
|
||||
%>
|
||||
</td>
|
||||
<!--span style="font-size: 10px">(<%#= l(:label_workdescription_lengthlimit) %>)</span-->
|
||||
</tr>
|
||||
<br/>
|
||||
|
@ -141,8 +161,17 @@
|
|||
<tr style="width:800px;">
|
||||
<span><%= l(:label_softapplication_developers) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td style="width: 100px"><%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:320px;", :onblur => 'regexDevelopers();' %></td>
|
||||
<span style="font-size: 10px" id="span_softapplication_application_developers">(<%= l(:label_workdescription_lengthlimit) %>)</span>
|
||||
<td style="width: 100px">
|
||||
<%= f.text_field :application_developers,
|
||||
:required => true,
|
||||
:size => 60,
|
||||
:style => "width:320px;",
|
||||
:onblur => 'regexDevelopers();'
|
||||
%>
|
||||
</td>
|
||||
<span style="font-size: 10px" id="span_softapplication_application_developers">
|
||||
(<%= l(:label_workdescription_lengthlimit) %>)
|
||||
</span>
|
||||
</tr>
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -150,8 +179,23 @@
|
|||
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_work_deposit_project) %>:</span>
|
||||
<span style="padding-left: 4px"><%= select_tag 'project', options_for_select(select_option_helper(@option)), :name => 'project', :class => 'grayline2',:style => "width:328px;" %></span>
|
||||
<span><%= link_to l(:label_create_new_projects),{:controller => 'projects',:action => 'new',course: 0, project_type: 0,host: Setting.project_domain}, :target => '_blank' %></span><!-- new_project_path(course: 0, project_type: 0) -->
|
||||
<span style="padding-left: 4px">
|
||||
<%= select_tag 'project',
|
||||
options_for_select(select_option_helper(@option)),
|
||||
:name => 'project',
|
||||
:class => 'grayline2',
|
||||
:style => "width:328px;"
|
||||
%>
|
||||
</span>
|
||||
<span>
|
||||
|
||||
<!-- modified by longjun -->
|
||||
<%= link_to l(:label_create_new_projects),
|
||||
new_project_path(:course => 0, :project_type => 0, :host => Setting.project_domain),
|
||||
:target => '_blank'
|
||||
%>
|
||||
<!-- end longjun -->
|
||||
</span><!-- new_project_path(course: 0, project_type: 0) -->
|
||||
</tr>
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -177,8 +221,12 @@
|
|||
<div class="align-center" style="padding-top: -3px; padding-bottom: 8px">
|
||||
<input type="button" class="enterprise" value="<%=l(:button_create) %>" onclick="submit_new_softapplication();" >
|
||||
<%#= submit_tag l(:button_create) %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();",
|
||||
:type => 'button', :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
<%= submit_tag l(:button_cancel),
|
||||
:name => nil,
|
||||
:onclick => "cancel();",
|
||||
:type => 'button',
|
||||
:class => "enterprise",
|
||||
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
|
||||
</div>
|
||||
<% end %>
|
|
@ -5,7 +5,12 @@
|
|||
<td> <%= textilizable content %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= hidden_field_tag 'reference_content', params[:reference_content], :value => content%></td>
|
||||
<td>
|
||||
<%= hidden_field_tag 'reference_content',
|
||||
params[:reference_content],
|
||||
:value => content
|
||||
%>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<%= render_flash_messages %>
|
||||
|
||||
<table width="100%" border="0" style="padding-left: 15px">
|
||||
<td width="15%" class="font_lighter" style="font-size: 15px;"><%= l(:label_bidding_project) %>(<%= contesting_project.count%>)</td> <!--标注参与项目及数量-->
|
||||
<td width="15%" class="font_lighter" style="font-size: 15px;">
|
||||
<%= l(:label_bidding_project) %>(<%= contesting_project.count%>)
|
||||
</td> <!--标注参与项目及数量-->
|
||||
<% if User.current.logged? %>
|
||||
<td width="85%">
|
||||
<div class='icon icon-add'> <!--标注我要参加及添加图标-->
|
||||
|
@ -12,4 +14,6 @@
|
|||
<% end %>
|
||||
</table>
|
||||
|
||||
<%= render :partial=> "list_projects",:locals => {:contesting_project => contesting_project,:contest => @contest }%>
|
||||
<%= render :partial=> "list_projects",
|
||||
:locals => {:contesting_project => contesting_project,:contest => @contest }
|
||||
%>
|
||||
|
|
|
@ -2,14 +2,23 @@
|
|||
<%= render_flash_messages %>
|
||||
|
||||
<table width="100%" border="0" style="padding-left: 15px">
|
||||
<td width="15%" class="font_lighter" style="font-size: 15px;"><%= l(:label_contest_softapplication) %>(<%= @contest.contesting_softapplications.count%>)</td> <!--标注参赛应用及数量-->
|
||||
<td width="15%" class="font_lighter" style="font-size: 15px;">
|
||||
<%= l(:label_contest_softapplication) %>
|
||||
(<%= @contest.contesting_softapplications.count%>)
|
||||
</td> <!--标注参赛应用及数量-->
|
||||
<% if User.current.logged? %>
|
||||
<td width="85%">
|
||||
<div class='icon icon-add'> <!--标注我要参加及添加图标-->
|
||||
|
||||
<%= link_to l(:button_contesting_as_application), "javascript:void(0);", onclick: "$('#put-bid-form').toggle();" %>
|
||||
<%= link_to l(:button_contesting_as_application),
|
||||
"javascript:void(0);",
|
||||
onclick: "$('#put-bid-form').toggle();"
|
||||
%>
|
||||
</div>
|
||||
</td>
|
||||
<% end %>
|
||||
</table>
|
||||
<%= render :partial=> "list_softapplications",:locals => {:contesting_softapplication => contesting_softapplication,:contest => @contest }%>
|
||||
<%= render :partial=> "list_softapplications",
|
||||
:locals => {:contesting_softapplication => contesting_softapplication,
|
||||
:contest => @contest }
|
||||
%>
|
||||
|
|
|
@ -6,22 +6,44 @@
|
|||
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
|
||||
<td rowspan="2">
|
||||
<% if User.current.logged? %>
|
||||
<% unless User.current.user_extensions.identity == 1 %>
|
||||
<%= link_to(l(:label_newtype_contest), {:controller => 'contests', :action => 'new_contest'}, :class => 'icon icon-add', :target => "_blank") %>
|
||||
<% end %>
|
||||
<% unless User.current.user_extensions.identity == 1 %>
|
||||
<!--
|
||||
modified by longjun
|
||||
<%=link_to l(:label_newtype_contest), :controller => 'contests', :action => 'new_contest' %>
|
||||
-->
|
||||
<%= link_to(l(:label_newtype_contest), contest_new_contest_path, :class => 'icon icon-add', :target => "_blank") %>
|
||||
<!-- end longjun -->
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td rowspan="2" >
|
||||
<div class="project-search" style="float: right">
|
||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px"><a><%= link_to request.host()+"/contests", :controller => 'contests', :action => 'index' %> </a></td>
|
||||
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %></td>
|
||||
<td style="padding-left: 8px">
|
||||
<a>
|
||||
<!--
|
||||
modified by longjun
|
||||
<%=link_to request.host()+"/contests", :controller => 'contests', :action => 'index' %>
|
||||
-->
|
||||
<%= link_to request.host()+"/contests", contests_path %>
|
||||
<!-- end longjun -->
|
||||
</a>
|
||||
</td>
|
||||
<td >
|
||||
<%=link_to l(:field_homepage), home_path %> >
|
||||
<!--
|
||||
modified by longjun
|
||||
<%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %>
|
||||
-->
|
||||
<%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %>
|
||||
<!-- end longjun -->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
<!-- huang -->
|
||||
<h3><%=l(:label_newtype_contest)%></h3>
|
||||
|
||||
<%= labelled_form_for @contest, :url => {:controller => 'contests', :action => 'create_contest'}, method: :post do |f| %>
|
||||
<%= labelled_form_for @contest,
|
||||
:url => {:controller => 'contests', :action => 'create_contest'},
|
||||
method: :post do |f| %>
|
||||
<div class="box tabular">
|
||||
<%= render :partial => 'form_contest', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= javascript_tag "$('#bid_name').focus();" %>
|
||||
<% end %>
|
||||
<%= render :partial => 'form_contest', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= javascript_tag "$('#bid_name').focus();" %>
|
||||
<% end %>
|
||||
</div>
|
|
@ -1,26 +1,27 @@
|
|||
<!-- modified by longjun 将or 改成 || -->
|
||||
$('#reward_result_<%= @contesting_project_id %>').html('<%= j(
|
||||
|
||||
if get_prize(@c_p).nil? or get_prize(@c_p) == ""
|
||||
if get_prize(@c_p).nil? || get_prize(@c_p) == ""
|
||||
if @contest.deadline < Date.today
|
||||
puts '未评奖'
|
||||
end
|
||||
else
|
||||
|
||||
case get_prize(@c_p)
|
||||
when '-1'
|
||||
image_tag("/images/bid/special_reward.png")
|
||||
when '0'
|
||||
image_tag("/images/bid/first_reward.png")
|
||||
when '1'
|
||||
image_tag("/images/bid/second_reward.png")
|
||||
when '2'
|
||||
image_tag("/images/bid/third_reward.png")
|
||||
when '3'
|
||||
image_tag("/images/bid/forth_reward.png")
|
||||
when '4'
|
||||
image_tag("/images/bid/fifth_reward.png")
|
||||
when '5'
|
||||
image_tag("/images/bid/qualified.png")
|
||||
when '-1'
|
||||
image_tag("/images/bid/special_reward.png")
|
||||
when '0'
|
||||
image_tag("/images/bid/first_reward.png")
|
||||
when '1'
|
||||
image_tag("/images/bid/second_reward.png")
|
||||
when '2'
|
||||
image_tag("/images/bid/third_reward.png")
|
||||
when '3'
|
||||
image_tag("/images/bid/forth_reward.png")
|
||||
when '4'
|
||||
image_tag("/images/bid/fifth_reward.png")
|
||||
when '5'
|
||||
image_tag("/images/bid/qualified.png")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,26 +1,28 @@
|
|||
<!-- modified by longjun 将or 改成 || -->
|
||||
$('#reward_result_<%= @contesting_softapplication_id %>').html('<%= j(
|
||||
|
||||
if get_prize(@c_sa).nil? or get_prize(@c_sa) == ""
|
||||
|
||||
if get_prize(@c_sa).nil? || get_prize(@c_sa) == ""
|
||||
if @contest.deadline < Date.today
|
||||
puts '未评奖'
|
||||
end
|
||||
else
|
||||
|
||||
case get_prize(@c_sa)
|
||||
when '-1'
|
||||
image_tag("/images/bid/special_reward.png")
|
||||
when '0'
|
||||
image_tag("/images/bid/first_reward.png")
|
||||
when '1'
|
||||
image_tag("/images/bid/second_reward.png")
|
||||
when '2'
|
||||
image_tag("/images/bid/third_reward.png")
|
||||
when '3'
|
||||
image_tag("/images/bid/forth_reward.png")
|
||||
when '4'
|
||||
image_tag("/images/bid/fifth_reward.png")
|
||||
when '5'
|
||||
image_tag("/images/bid/qualified.png")
|
||||
when '-1'
|
||||
image_tag("/images/bid/special_reward.png")
|
||||
when '0'
|
||||
image_tag("/images/bid/first_reward.png")
|
||||
when '1'
|
||||
image_tag("/images/bid/second_reward.png")
|
||||
when '2'
|
||||
image_tag("/images/bid/third_reward.png")
|
||||
when '3'
|
||||
image_tag("/images/bid/forth_reward.png")
|
||||
when '4'
|
||||
image_tag("/images/bid/fifth_reward.png")
|
||||
when '5'
|
||||
image_tag("/images/bid/qualified.png")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<!-- added by bai -->
|
||||
<p>
|
||||
<td><%=l(:label_contest_settings)%></td>
|
||||
<td><%=l(:label_contest_settings)%></td>
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -79,18 +79,35 @@
|
|||
<%= render_flash_messages %>
|
||||
<!--参赛步骤-->
|
||||
<div style="padding-left: 23px; padding-bottom: 10px; color: grey; font-size: 12px">
|
||||
<div><%= l(:label_wellmeaning_intimation_contentone) %></div>
|
||||
<div style="margin-left: 59px; padding-top: 2px">1) <%= l(:label_wellmeaning_intimation_contenttwo) %></div>
|
||||
<div style="margin-left: 59px; padding-top: 2px">2) <%= l(:label_wellmeaning_intimation_contentthree) %></div>
|
||||
<div>
|
||||
<%= l(:label_wellmeaning_intimation_contentone) %>
|
||||
</div>
|
||||
<div style="margin-left: 59px; padding-top: 2px">
|
||||
1) <%= l(:label_wellmeaning_intimation_contenttwo) %>
|
||||
</div>
|
||||
<div style="margin-left: 59px; padding-top: 2px">
|
||||
2) <%= l(:label_wellmeaning_intimation_contentthree) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if User.current.logged? %>
|
||||
<div style="padding-bottom: 10px; line-height: 15px">
|
||||
<div style="padding-left: 82px; font-size: 14px">
|
||||
<span><strong><%= l(:label_attending_contest) %>:</strong></span>
|
||||
<span><%= link_to l(:label_new_attendingcontest_work), "javascript:void(0);", onclick: "$('#put-project-form').slideToggle();" %></span>
|
||||
<span>
|
||||
<%= link_to l(:label_new_attendingcontest_work),
|
||||
"javascript:void(0);",
|
||||
onclick: "$('#put-project-form').slideToggle();"
|
||||
%>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- modified by longjun, 登录之后才能参赛 -->
|
||||
<div id="put-project-form" style=" padding-left: 83px; width: 88%">
|
||||
<%= render "new_softapplication" %>
|
||||
</div>
|
||||
<!-- end longjun -->
|
||||
<% else %>
|
||||
<div style="font-size: 14px;margin:10px;padding-left: 73px">
|
||||
<%= l(:label_user_login_attending_contest) %>
|
||||
|
@ -98,10 +115,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
|
||||
<!--点击新建参赛作品弹出框新建参赛作品并关联到竞赛中-->
|
||||
<div id="put-project-form" style=" padding-left: 83px; width: 88%">
|
||||
<%= render "new_softapplication" %>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,9 +2,18 @@
|
|||
<div style="margin-left: 20px;">
|
||||
<span class="portrait"><%= image_tag(url_to_avatar(@contest.author), :class => "avatar")%></span>
|
||||
<span class="body">
|
||||
<h3><%= link_to(@contest.author.lastname+@contest.author.firstname, user_path(@contest.author))%>:<%= @contest.name %></h3>
|
||||
<h3>
|
||||
<%= link_to(@contest.author.lastname+@contest.author.firstname,
|
||||
user_path(@contest.author))
|
||||
%>
|
||||
:<%= @contest.name %></h3>
|
||||
<p>
|
||||
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= @contest.budget%></span></strong>
|
||||
<strong>
|
||||
<%= l(:label_bids_reward_method) %>
|
||||
<span class="bonus">
|
||||
<%= @contest.budget%>
|
||||
</span>
|
||||
</strong>
|
||||
</p>
|
||||
<div class="bid_description" style="width: 100%;word-break:break-all;word-wrap: break-word;">
|
||||
<%= @contest.description %>
|
||||
|
@ -15,7 +24,11 @@
|
|||
</div>
|
||||
<span id="praise_tread" style="float: right">
|
||||
<%= render :partial => "/praise_tread/praise_tread",
|
||||
:locals => {:obj => @contest,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%>
|
||||
:locals => {:obj => @contest,
|
||||
:show_flag => true,
|
||||
:user_id =>User.current.id,
|
||||
:horizontal => false}
|
||||
%>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -23,7 +36,9 @@
|
|||
<div style="clear: both;"></div>
|
||||
|
||||
<div id="history">
|
||||
<%= render :partial => 'history', :locals => { :contest => @contest, :journals => @jour, :state => false} %>
|
||||
<%= render :partial => 'history',
|
||||
:locals => { :contest => @contest, :journals => @jour, :state => false}
|
||||
%>
|
||||
</div>
|
||||
|
||||
<div class="pagination" style="float:left;">
|
||||
|
|
|
@ -6,9 +6,12 @@
|
|||
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(user), :class => "avatar") %></td>
|
||||
<td><table width="580px" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to_user(user), :class => "project_avatar_name" %>
|
||||
<td colspan="2" valign="top">
|
||||
<strong>
|
||||
<%= content_tag "div", link_to_user(user), :class => "project_avatar_name" %>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" ><p class="font_description">
|
||||
<% unless user.memberships.empty? %>
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<!--add by bai-->
|
||||
<h3><%=link_to l(:label_x_join_in_contest, :count => @contest.join_in_contests.count)+"("+@contest.join_in_contests(@user.id).count.to_s+")", :controller=>"contests", :action=>"show_participator"%></h3>
|
||||
<h3>
|
||||
<%=link_to l(:label_x_join_in_contest, :count => @contest.join_in_contests.count)+"("+@contest.join_in_contests(@user.id).count.to_s+")",
|
||||
show_participator_contest_path
|
||||
%>
|
||||
</h3>
|
||||
<div class="inf_user_image">
|
||||
<% for temp in @contest.join_in_contests %>
|
||||
<% user = temp.user %>
|
||||
|
|
|
@ -60,15 +60,28 @@
|
|||
<!--我要竞标弹出框-->
|
||||
<div id = 'flash' style="float:left; width: 100%; display: none" ></div>
|
||||
<div id="put-bid-form" style="display: none">
|
||||
<%= form_for "contest_for_save", :remote=>true, :url => {:controller => 'contests', :action => 'add'}, :update => "contesting_project_list", :complete => '$("#put-bid-form").hide();' do |f| %>
|
||||
<%= form_for "contest_for_save", :remote=>true,
|
||||
:url => {:controller => 'contests', :action => 'add'},
|
||||
:update => "contesting_project_list",
|
||||
:complete => '$("#put-bid-form").hide();' do |f|
|
||||
%>
|
||||
<table id="contesting_table" border="0" width="100%" style="margin-left: 40px;"> <!--该table为点击我要参加后弹出的-->
|
||||
<tr>
|
||||
<td><%= select_tag 'contest', options_for_select(select_option_helper(@option)), :name => 'contest', :class => 'grayline' %></td>
|
||||
<td>
|
||||
<%= select_tag 'contest',
|
||||
options_for_select(select_option_helper(@option)),
|
||||
:name => 'contest',
|
||||
:class => 'grayline'
|
||||
%>
|
||||
</td>
|
||||
<div id="prompt_create_pro">
|
||||
<td>
|
||||
<p>
|
||||
<div class="font_lighter" style="font-size: 13px;">
|
||||
<%= link_to l(:label_create_new_projects), new_project_path(course: 0, project_type: 0), :target=>'_blank'%> <!--跳转到project的new.html.erb-->
|
||||
<%= link_to l(:label_create_new_projects),
|
||||
new_project_path(course: 0, project_type: 0),
|
||||
:target=>'_blank'
|
||||
%> <!--跳转到project的new.html.erb-->
|
||||
</div>
|
||||
</p>
|
||||
</td>
|
||||
|
@ -81,12 +94,20 @@
|
|||
|
||||
<tr>
|
||||
<td align="right">
|
||||
<%= submit_tag l(:button_add), :name => nil , :class => "enterprise",
|
||||
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -30px'"%>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();",
|
||||
:type => 'button', :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
|
||||
<%= submit_tag l(:button_add),
|
||||
:name => nil ,
|
||||
:class => "enterprise",
|
||||
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -30px'"
|
||||
%>
|
||||
<%= submit_tag l(:button_cancel),
|
||||
:name => nil,
|
||||
:onclick => "cancel();",
|
||||
:type => 'button',
|
||||
:class => "enterprise",
|
||||
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -30px'"
|
||||
%>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -94,7 +115,9 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<div id='contesting_project_list'>
|
||||
<%= render :partial => 'project_list', :locals => {:contesting_project => @contesting_project,:contest => @contest} %>
|
||||
<%= render :partial => 'project_list',
|
||||
:locals => {:contesting_project => @contesting_project,:contest => @contest}
|
||||
%>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -60,15 +60,29 @@
|
|||
<!--我要以发布应用的形式参加竞赛-弹出框-->
|
||||
<div id = 'flash' style="float:left; width: 100%; display: nonea" ></div>
|
||||
<div id="put-bid-form" style="display: none">
|
||||
<%= form_for "contest_for_save", :remote=>true, :url => {:controller => 'contests', :action => 'add_softapplication'}, :update => "contesting_softapplication_list", :complete => '$("#put-bid-form").hide();' do |f| %>
|
||||
<%= form_for "contest_for_save",
|
||||
:remote=>true,
|
||||
:url => {:controller => 'contests', :action => 'add_softapplication'},
|
||||
:update => "contesting_softapplication_list",
|
||||
:complete => '$("#put-bid-form").hide();' do |f|
|
||||
%>
|
||||
<table id="contesting_table" border="0" width="100%" style="margin-left: 40px;"> <!--该table为点击我要参加后弹出的-->
|
||||
<tr>
|
||||
<td><%= select_tag 'contest', options_for_select(select_option_app_helper(@softapplication)), :name => 'contest', :class => 'grayline' %></td>
|
||||
<td>
|
||||
<%= select_tag 'contest',
|
||||
options_for_select(select_option_app_helper(@softapplication)),
|
||||
:name => 'contest',
|
||||
:class => 'grayline'
|
||||
%>
|
||||
</td>
|
||||
<div id="prompt_create_pro">
|
||||
<td>
|
||||
<p>
|
||||
<div class="font_lighter" style="font-size: 13px;">
|
||||
<%= link_to l(:label_release_softapplication), new_softapplication_path(:target=>'_blank'), :target=>'_blank' %>
|
||||
<%= link_to l(:label_release_softapplication),
|
||||
new_softapplication_path(:target=>'_blank'),
|
||||
:target=>'_blank'
|
||||
%>
|
||||
</div>
|
||||
</p>
|
||||
</td>
|
||||
|
@ -81,12 +95,20 @@
|
|||
|
||||
<tr>
|
||||
<td align="right">
|
||||
<%= submit_tag l(:button_add), :name => nil , :class => "enterprise",
|
||||
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -30px'"%>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();",
|
||||
:type => 'button', :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
|
||||
<%= submit_tag l(:button_add),
|
||||
:name => nil ,
|
||||
:class => "enterprise",
|
||||
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -30px'"
|
||||
%>
|
||||
<%= submit_tag l(:button_cancel),
|
||||
:name => nil,
|
||||
:onclick => "cancel();",
|
||||
:type => 'button',
|
||||
:class => "enterprise",
|
||||
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -30px'"
|
||||
%>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -191,7 +191,7 @@
|
|||
|
||||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||
<h3 style="margin-left: 5px; color: #e8770d;">
|
||||
<h3 style="margin-left: 5px; color: rgb(21, 188, 207);">
|
||||
<strong><%=l(:label_notification)%></strong>
|
||||
</h3>
|
||||
|
||||
|
|
305
config/routes.rb
305
config/routes.rb
|
@ -15,6 +15,16 @@
|
|||
# along with this program; if not, write tobthe Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
# modified by longjun
|
||||
# 统一route风格
|
||||
# match 'path', :to => 'controller#action'
|
||||
# 如果 path = controller#action 则 match 'path'
|
||||
# Example:
|
||||
# match 'welcome/course', :to => 'welcome#course' 变成
|
||||
# match 'welcome/cource'
|
||||
# 所有的 act: :act 变成 :act => :act
|
||||
# Example: :via => :get ====> :via => :get
|
||||
|
||||
RedmineApp::Application.routes.draw do
|
||||
|
||||
|
||||
|
@ -31,14 +41,14 @@ RedmineApp::Application.routes.draw do
|
|||
resources :homework_attach do
|
||||
collection do
|
||||
get 'get_homework_member_list'
|
||||
match 'addjours', via: [:get, :post]
|
||||
match 'add_jour_reply', via: [:get,:post]
|
||||
match 'destroy_jour', via: [:get,:post]
|
||||
match 'comprehensive_evaluation_jour', via: [:get,:post]
|
||||
match 'addjours', :via => [:get, :post]
|
||||
match 'add_jour_reply', :via => [:get,:post]
|
||||
match 'destroy_jour', :via => [:get,:post]
|
||||
match 'comprehensive_evaluation_jour', :via => [:get,:post]
|
||||
end
|
||||
member do
|
||||
match 'add_homework_users', via:[:get,:post]
|
||||
match 'destory_homework_users',via:[:get,:post]
|
||||
match 'add_homework_users', :via => [:get,:post]
|
||||
match 'destory_homework_users', :via => [:get,:post]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -46,17 +56,17 @@ RedmineApp::Application.routes.draw do
|
|||
|
||||
resources :open_source_projects do
|
||||
collection do
|
||||
match 'search', via: [:get, :post]
|
||||
match 'remove_condition', via: [:get, :post]
|
||||
match 'allbug', via: [:get, :post]
|
||||
match 'search', :via => [:get, :post]
|
||||
match 'remove_condition', :via => [:get, :post]
|
||||
match 'allbug', :via => [:get, :post]
|
||||
end
|
||||
resources :relative_memos
|
||||
member do
|
||||
match 'master_apply', via: [:get, :post]
|
||||
match 'accept_master_apply', via: [:get, :post]
|
||||
match 'refuse_master_apply', via: [:get, :post]
|
||||
match 'showmemo', via: [:get, :post]
|
||||
match 'showbug', via: [:get, :post]
|
||||
match 'master_apply', :via => [:get, :post]
|
||||
match 'accept_master_apply', :via => [:get, :post]
|
||||
match 'refuse_master_apply', :via => [:get, :post]
|
||||
match 'showmemo', :via => [:get, :post]
|
||||
match 'showbug', :via => [:get, :post]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -75,11 +85,11 @@ RedmineApp::Application.routes.draw do
|
|||
resources :softapplications do
|
||||
|
||||
collection do
|
||||
match 'new_message', via: :get
|
||||
match 'search', via: [:get, :post]
|
||||
match 'new_message', :via => :get
|
||||
match 'search', :via => [:get, :post]
|
||||
end
|
||||
member do
|
||||
match 'create_message' , via: :post
|
||||
match 'create_message' , :via => :post
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -90,46 +100,44 @@ RedmineApp::Application.routes.draw do
|
|||
#resources :contestnotifications, :only => [:index, :show, :edit, :update, :destroy]
|
||||
# match '/contestnotifications/:id/notificationcomments', :to => 'notificationcomments#create', :via => :post
|
||||
# match '/contestnotifications/:id/notificationcomments/:notificationcomment_id', :to => 'notificationcomments#destroy', :via => :delete
|
||||
match '/contestnotifications/preview', :controller => 'previews', :action => 'contestnotification', :as => 'preview_contestnotifications', :via => [:get, :post, :put]
|
||||
match '/contestnotifications/preview', :to => 'previews#contestnotification', :as => 'preview_contestnotifications', :via => [:get, :post, :put]
|
||||
## new added by linchun #新竞赛相关
|
||||
resources :contests, only: [:index] do
|
||||
resources :contestnotifications do
|
||||
# get 'preview', on: :collection
|
||||
resources :notificationcomments do
|
||||
|
||||
end
|
||||
resources :notificationcomments
|
||||
end
|
||||
|
||||
collection do
|
||||
match 'new_contest' , via: :get
|
||||
match 'join_in_contest' , via: :post
|
||||
match 'unjoin_in_contest' , via: :delete
|
||||
match 'create_contest' , via: :post
|
||||
match 'new_join' , via: :post
|
||||
match 'new' , via: :post
|
||||
match 'new_contest' , :via => :get
|
||||
match 'join_in_contest' , :via => :post
|
||||
match 'unjoin_in_contest' , :via => :delete
|
||||
match 'create_contest' , :via => :post
|
||||
match 'new_join' , :via => :post
|
||||
match 'new' , :via => :post
|
||||
end
|
||||
member do
|
||||
delete 'destroy_contest'
|
||||
match 'add_softapplication'
|
||||
match 'update_contest' , via: [:put]
|
||||
match 'show_contest' , via: [:get, :post]
|
||||
match 'show_project' , via: :get
|
||||
match 'show_softapplication' , via: :get
|
||||
match 'show_attendingcontest' , via: :get
|
||||
#match 'show_notification' , via: :get
|
||||
match 'show_participator' , via: :get
|
||||
match 'set_reward_project' , via: [:get, :post]
|
||||
match 'set_reward_softapplication' , via: [:get, :post]
|
||||
match 'add' , via: [:get, :post]
|
||||
match 'add_softapplication' , via: [:get, :post]
|
||||
match 'create' , via: :post
|
||||
match 'settings' , via: [:get, :post]
|
||||
match 'update_contest' , :via => [:put]
|
||||
match 'show_contest' , :via => [:get, :post]
|
||||
match 'show_project' , :via => :get
|
||||
match 'show_softapplication' , :via => :get
|
||||
match 'show_attendingcontest' , :via => :get
|
||||
#match 'show_notification' , :via => :get
|
||||
match 'show_participator' , :via => :get
|
||||
match 'set_reward_project' , :via => [:get, :post]
|
||||
match 'set_reward_softapplication' , :via => [:get, :post]
|
||||
match 'add' , :via => [:get, :post]
|
||||
match 'add_softapplication' , :via => [:get, :post]
|
||||
match 'create' , :via => :post
|
||||
match 'settings' , :via => [:get, :post]
|
||||
end
|
||||
end
|
||||
|
||||
resources :stores do
|
||||
collection do
|
||||
match 'search', via: [:get, :post]
|
||||
match 'search', :via => [:get, :post]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -161,22 +169,25 @@ RedmineApp::Application.routes.draw do
|
|||
#end
|
||||
|
||||
root :to => 'welcome#index', :as => 'home'
|
||||
# added by longjun
|
||||
match 'welcome/contest', :via => :get
|
||||
# end longjun
|
||||
|
||||
#added by baiyu
|
||||
match 'git_usage/ch_usage', :controller => 'git_usage', :action => 'ch_usage', :via => :get, :as => 'ch_usage'
|
||||
match 'git_usage/en_usage', :controller => 'git_usage', :action => 'en_usage', :via => :get, :as => 'en_usage'
|
||||
match 'git_usage/ch_usage', :via => :get, :as => 'ch_usage'
|
||||
match 'git_usage/en_usage', :via => :get, :as => 'en_usage'
|
||||
#added by nie
|
||||
match '/projects/search', :controller => 'projects', :action => 'search', :via => [:get, :post]
|
||||
match '/users/search', :controller => 'users', :action => 'search', :via => [:get, :post]
|
||||
match '/projects/search', :via => [:get, :post]
|
||||
match '/users/search', :via => [:get, :post]
|
||||
#end
|
||||
match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
|
||||
match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
|
||||
match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register'
|
||||
match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password'
|
||||
match 'account/activate', :to => 'account#activate', :via => :get
|
||||
match 'account/valid_ajax', :to => 'account#valid_ajax', :via => :get
|
||||
match 'account/register', :via => [:get, :post], :as => 'register'
|
||||
match 'account/lost_password', :via => [:get, :post], :as => 'lost_password'
|
||||
match 'account/activate', :via => :get
|
||||
match 'account/valid_ajax', :via => :get
|
||||
|
||||
match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post, :put]
|
||||
match '/news/preview', :to => 'previews#news', :as => 'preview_news', :via => [:get, :post, :put]
|
||||
match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put]
|
||||
match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put]
|
||||
match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put]
|
||||
|
@ -220,13 +231,13 @@ RedmineApp::Application.routes.draw do
|
|||
#added by young
|
||||
resources :users do
|
||||
collection do
|
||||
match "tag_saveEx" , via: [:get, :post]
|
||||
match "tag_saveEx" , :via => [:get, :post]
|
||||
end
|
||||
member do
|
||||
match 'user_projects', :to => 'users#user_projects', :via => :get
|
||||
match 'user_activities', :to => 'users#user_activities', :via => :get, :as => "user_activities"
|
||||
match 'user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "user_newfeedback"
|
||||
match 'watch_calls', :controller => 'users', :action => 'watch_bids', :via => [:get , :post]
|
||||
match 'watch_calls', :to => 'users#watch_bids', :via => [:get , :post]
|
||||
match 'info', :to => 'users#info', :via => [:get , :post], :as => 'user_info'
|
||||
match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang
|
||||
match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang
|
||||
|
@ -235,14 +246,14 @@ RedmineApp::Application.routes.draw do
|
|||
match 'watch_projects', :to => 'users#watch_projects', :via => :get
|
||||
# added by bai
|
||||
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', :to => 'users#topic_score_index', :via => [:get, :post]
|
||||
match 'project_score_index', :to => 'users#project_score_index', :via => :get
|
||||
match 'activity_score_index', :to => 'users#activity_score_index', :via => :get
|
||||
match 'influence_score_index', :to => 'users#influence_score_index', :via => :get
|
||||
match 'score_index', :to => 'users#score_index', :via => :get
|
||||
|
||||
match 'show_new_score', :to => 'users#show_new_score', :via => :get
|
||||
match 'topic_new_score_index', :controller => 'users', :action => 'topic_new_score_index', :via => [:get, :post]
|
||||
match 'topic_new_score_index', :to => 'users#topic_new_score_index', :via => [:get, :post]
|
||||
match 'project_new_score_index', :to => 'users#project_new_score_index', :via => :get
|
||||
match 'activity_new_score_index', :to => 'users#activity_new_score_index', :via => :get
|
||||
match 'influence_new_score_index', :to => 'users#influence_new_score_index', :via => :get
|
||||
|
@ -259,21 +270,21 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
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', :to => 'users#user_projects', :via => :get
|
||||
#match 'user/:id/watch_calls', :controller => 'users', :action => 'watch_bids', :via => [:get , :post]
|
||||
|
||||
#end
|
||||
match 'my/account', :controller => 'my', :action => 'account', :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', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
|
||||
match 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :via => :post
|
||||
match 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :via => :post
|
||||
match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
|
||||
match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get
|
||||
match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
|
||||
match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
|
||||
match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
|
||||
match 'my/account', :via => [:get, :post]
|
||||
match 'my/account/destroy', :to => 'my#destroy', :via => [:get, :post]
|
||||
match 'my/page', :via => :get
|
||||
match 'my', :to => 'my#index', :via => :get # Redirects to my/page
|
||||
match 'my/reset_rss_key', :via => :post
|
||||
match 'my/reset_api_key', :via => :post
|
||||
match 'my/password', :via => [:get, :post]
|
||||
match 'my/page_layout', :via => :get
|
||||
match 'my/add_block', :via => :post
|
||||
match 'my/remove_block', :via => :post
|
||||
match 'my/order_blocks', :via => :post
|
||||
|
||||
get 'my/page2', :to => 'my#page2', :as => "my_page2"
|
||||
|
||||
|
@ -282,8 +293,8 @@ RedmineApp::Application.routes.draw do
|
|||
match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete
|
||||
match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships'
|
||||
################# added by william
|
||||
match 'users/tag_save', :to => 'users#tag_save', :via => :post, :as => 'tag'
|
||||
match 'users/tag_saveEx', :to => 'users#tag_saveEx', :via => [:get, :post]
|
||||
match 'users/tag_save', :via => :post, :as => 'tag'
|
||||
match 'users/tag_saveEx', :via => [:get, :post]
|
||||
|
||||
post 'watchers/watch', :to => 'watchers#watch', :as => 'watch'
|
||||
delete 'watchers/watch', :to => 'watchers#unwatch'
|
||||
|
@ -308,9 +319,10 @@ RedmineApp::Application.routes.draw do
|
|||
member do
|
||||
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
|
||||
#by young
|
||||
get 'member', :controller => 'projects', :action => 'member', :as => 'member'
|
||||
get 'member', :to => 'projects#member', :as => 'member'
|
||||
get 'file', :action => 'file', :as => 'file'
|
||||
get 'statistics', :action => 'statistics', :as => 'statistics'
|
||||
|
||||
get 'feedback', :action => 'feedback', :as => 'project_feedback'
|
||||
get 'watcherlist', :action=> 'watcherlist'
|
||||
match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" #add by huang
|
||||
|
@ -327,11 +339,11 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
|
||||
#by young
|
||||
match '/member', :controller => 'projects', :action => 'member', :as => 'member', :via => :get
|
||||
match '/file', :controller => 'projects', :action => 'file', :as => 'file', :via => :get
|
||||
match '/statistics', :controller => 'projects', :action => 'statistics', :as => 'statistics', :via => :get
|
||||
match '/member', :to => 'projects#member', :as => 'member', :via => :get
|
||||
match '/file', :to => 'projects#file', :as => 'file', :via => :get
|
||||
match '/statistics', :to => 'projects#statistics', :as => 'statistics', :via => :get
|
||||
# match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get
|
||||
match '/homework', :controller => 'projects', :action => 'homework', :as => 'homework', :via => :get
|
||||
match '/homework', :to => 'projects#homework', :as => 'homework', :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
|
||||
|
@ -340,7 +352,7 @@ RedmineApp::Application.routes.draw do
|
|||
# get 'projects/:project_id/repository', :to => 'repositories#show', :as => 'project_repository'
|
||||
|
||||
# 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', :to=>'projects#watcherlist', :as => 'watcherlist', :via => :get #add by huang
|
||||
# matche '/news', :controller => 'news', :action => 'index', :as => 'news', :via => :get
|
||||
#end
|
||||
|
||||
|
@ -362,12 +374,12 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
# issue form update
|
||||
match 'issues/update_form', :controller => 'issues', :action => 'update_form', :via => [:put, :post], :as => 'issue_form'
|
||||
match 'issues/update_form', :to => 'issues#update_form', :via => [:put, :post], :as => 'issue_form'
|
||||
|
||||
resources :files, :only => [:index, :new, :create] do
|
||||
collection do
|
||||
match "getattachtype" , via: [:get, :post]
|
||||
#match 'getattachtype/:attachtype', :to => 'files#getattachtype', via: [:get, :post]
|
||||
match "getattachtype" , :via => [:get, :post]
|
||||
#match 'getattachtype/:attachtype', :to => 'files#getattachtype', :via => [:get, :post]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -399,7 +411,7 @@ RedmineApp::Application.routes.draw do
|
|||
# get 'create', :via=>[:get, :post]
|
||||
end
|
||||
end
|
||||
match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
|
||||
match 'wiki/index', :via => :get
|
||||
resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do
|
||||
member do
|
||||
get 'rename'
|
||||
|
@ -415,7 +427,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'date_index'
|
||||
end
|
||||
end
|
||||
match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
|
||||
match 'wiki', :to => 'wiki#show', :via => :get
|
||||
get 'wiki/:id/:version', :to => 'wiki#show', :constraints => {:version => /\d+/}
|
||||
delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
|
||||
get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
|
||||
|
@ -434,7 +446,7 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
|
||||
end
|
||||
match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete
|
||||
match '/issues', :to => 'issues#destroy', :via => :delete
|
||||
|
||||
resources :queries, :except => [:show]
|
||||
|
||||
|
@ -520,16 +532,16 @@ RedmineApp::Application.routes.draw do
|
|||
get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/
|
||||
get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail'
|
||||
get 'attachments/autocomplete'
|
||||
match 'attachments/autocomplete', :to => 'attachments#autocomplete', via: [:post]
|
||||
match 'attachments/autocomplete', :to => 'attachments#autocomplete', :via => [:post]
|
||||
post 'attachments/relationfile', to: 'attachments#add_exist_file_to_project', as: 'attach_relation'
|
||||
post 'attachments/courserelationfile', to: 'attachments#add_exist_file_to_course', as: 'course_attach_relation'
|
||||
get 'attachments/renderTag/:attchmentId', :to => 'attachments#renderTag', :attchmentId => /\d+/
|
||||
resources :attachments, :only => [:show, :destroy] do
|
||||
collection do
|
||||
match "updateType" , via: [:get, :post]
|
||||
match "updateFileDense" , via: [:get, :post]
|
||||
match "renderTag" , via: [:get, :post]
|
||||
match 'delete_softapplications', via: [:get, :post]
|
||||
match "updateType" , :via => [:get, :post]
|
||||
match "updateFileDense" , :via => [:get, :post]
|
||||
match "renderTag" , :via => [:get, :post]
|
||||
match 'delete_softapplications', :via => [:get, :post]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -539,10 +551,10 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
match 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :via => :post, :as => 'group_users'
|
||||
match 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :via => :delete, :as => 'group_user'
|
||||
match 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :via => :post
|
||||
match 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :via => :post
|
||||
match 'groups/:id/users', :to => 'groups#add_users', :id => /\d+/, :via => :post, :as => 'group_users'
|
||||
match 'groups/:id/users/:user_id', :to => 'groups#remove_user', :id => /\d+/, :via => :delete, :as => 'group_user'
|
||||
match 'groups/destroy_membership/:id', :to => 'groups#destroy_membership', :id => /\d+/, :via => :post
|
||||
match 'groups/edit_membership/:id', :to => 'groups#edit_membership', :id => /\d+/, :via => :post
|
||||
|
||||
resources :trackers, :except => :show do
|
||||
collection do
|
||||
|
@ -566,20 +578,20 @@ RedmineApp::Application.routes.draw do
|
|||
get 'projects/:id/search', :controller => 'search', :action => 'index'
|
||||
get 'search', :controller => 'search', :action => 'index'
|
||||
|
||||
match 'mail_handler', :controller => 'mail_handler', :action => 'index', :via => :post
|
||||
match 'mail_handler/cancel/:id', :controller => 'mail_handler', :action => 'cancel_mail_notify',:via => :get
|
||||
match 'mail_handler', :to => 'mail_handler#index', :via => :post
|
||||
match 'mail_handler/cancel/:id', :to => 'mail_handler#cancel_mail_notify',:via => :get
|
||||
|
||||
match 'admin', :controller => 'admin', :action => 'index', :via => :get
|
||||
match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
|
||||
match 'admin/users', :controller => 'admin', :action => 'users', :via => :get
|
||||
match 'admin/first_page_made',:controller => 'admin',:action => 'first_page_made',:via => [:get,:post]
|
||||
match 'admin/course_page_made',:controller => 'admin',:action => 'course_page_made',:via => [:get,:post]
|
||||
match 'admin/contest_page_made',:controller => 'admin',:action => 'contest_page_made',:via => [:get,:post]
|
||||
match 'admin/search', :controller => 'admin', :action => 'search', :via => [:get, :post]
|
||||
match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
|
||||
match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
|
||||
match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get
|
||||
match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post
|
||||
match 'admin', :to => 'admin#index', :via => :get
|
||||
match 'admin/projects', :via => :get
|
||||
match 'admin/users', :via => :get
|
||||
match 'admin/first_page_made', :via => [:get,:post]
|
||||
match 'admin/course_page_made', :via => [:get,:post]
|
||||
match 'admin/contest_page_made', :via => [:get,:post]
|
||||
match 'admin/search', :via => [:get, :post]
|
||||
match 'admin/plugins', :via => :get
|
||||
match 'admin/info', :via => :get
|
||||
match 'admin/test_email', :via => :get
|
||||
match 'admin/default_configuration', :via => :post
|
||||
|
||||
resources :auth_sources do
|
||||
member do
|
||||
|
@ -590,8 +602,8 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
match 'courses/search', :to => 'courses#search'
|
||||
match '/contests/search', :controller => 'contests', :action => 'search', :via => [:get, :post]
|
||||
match 'courses/search'
|
||||
match '/contests/search', :via => [:get, :post]
|
||||
# add by nwb
|
||||
# 课程路由设置
|
||||
resources :courses do
|
||||
|
@ -605,11 +617,11 @@ RedmineApp::Application.routes.draw do
|
|||
post 'finishcourse'
|
||||
post 'restartcourse'
|
||||
end
|
||||
match '/member', :controller => 'courses', :action => 'member', :as => 'member', :via => :get
|
||||
match '/member', :to => 'courses#member', :as => 'member', :via => :get
|
||||
resources :boards
|
||||
resources :files, :only => [:index, :new, :create] do
|
||||
collection do
|
||||
match "getattachtype", via: [:get, :post]
|
||||
match "getattachtype", :via => [:get, :post]
|
||||
end
|
||||
end
|
||||
resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
|
||||
|
@ -620,24 +632,24 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
resources :news, :except => [:show, :edit, :update, :destroy]
|
||||
resources :boards
|
||||
match '/homework', :controller => 'courses', :action => 'homework', :as => 'homework', :via => :get
|
||||
match '/homework', :to => 'courses#homework', :as => 'homework', :via => :get
|
||||
end # end of resources :courses
|
||||
match 'courses/:id/feedback', :to => 'courses#feedback', :via => :get, :as => 'course_feedback'
|
||||
match '/courses/search', :controller => 'courses', :action => 'search', :via => [:get, :post]
|
||||
match 'words/:id/leave_course_message', :controller => 'words', :action => 'leave_course_message'
|
||||
match '/courses/search', :via => [:get, :post]
|
||||
match 'words/:id/leave_course_message', :to => 'words#leave_course_message'
|
||||
|
||||
|
||||
match 'workflows', :controller => 'workflows', :action => 'index', :via => :get
|
||||
match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post]
|
||||
match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post]
|
||||
match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post]
|
||||
match 'workflows', :to => 'workflows#index', :via => :get
|
||||
match 'workflows/edit', :via => [:get, :post]
|
||||
match 'workflows/permissions', :via => [:get, :post]
|
||||
match 'workflows/copy', :via => [:get, :post]
|
||||
match 'settings', :controller => 'settings', :action => 'index', :via => :get
|
||||
match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post]
|
||||
match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post], :as => 'plugin_settings'
|
||||
match 'settings/edit', :via => [:get, :post]
|
||||
match 'settings/plugin/:id', :to => 'settings#plugin', :via => [:get, :post], :as => 'plugin_settings'
|
||||
|
||||
match 'sys/projects', :to => 'sys#projects', :via => :get
|
||||
match 'sys/projects', :via => :get
|
||||
match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
|
||||
match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => :get
|
||||
match 'sys/fetch_changesets', :via => :get
|
||||
|
||||
match 'uploads', :to => 'attachments#upload', :via => :post
|
||||
# Added by Tao
|
||||
|
@ -659,20 +671,20 @@ RedmineApp::Application.routes.draw do
|
|||
############## fq
|
||||
post 'calls/create', :to => 'bids#create'
|
||||
delete 'calls/destroy', :to => 'bids#destroy'
|
||||
match 'calls/new', :controller => 'bids', :action => 'new', :via => [:get , :post]
|
||||
match 'calls/new', :to => 'bids#new', :via => [:get , :post]
|
||||
get 'calls/more', :to => 'bids#more'
|
||||
get 'calls/back', :to=> 'bids#back'
|
||||
match 'calls/new_bid', :controller => 'bids', :action => 'new_bid'
|
||||
match 'contest/new_contest', :controller => 'bids', :action => 'new_contest' #huang
|
||||
match 'calls/:id/show_project', :controller => 'bids', :action => 'show_project', :as => 'project_for_bid'
|
||||
match 'calls/:id/show_course', :controller => 'bids', :action => 'show_courseEx', :as => 'course_for_bid' # nwb added
|
||||
match 'calls/:id/new_exercise_book', :controller => 'homework_attach', :action => 'new', :as => 'new_homework_attach'
|
||||
match 'calls/:id/add', :controller => 'bids', :action => 'add'
|
||||
match 'calls/:id/delete', :controller => 'bids', :action => 'delete'
|
||||
match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework', via: :post
|
||||
match 'calls/:id/new_submit_homework', to: 'bids#new_submit_homework', via: :get, as: 'new_submit_homework'
|
||||
match 'words/add_project_respond', :controller => 'words', :action => 'add_project_respond'
|
||||
match 'words/:id/leave_project_message', :controller => 'words', :action => 'leave_project_message'
|
||||
match 'calls/new_bid', :to => 'bids#new_bid'
|
||||
match 'contest/new_contest', :to => 'bids#new_contest' #huang
|
||||
match 'calls/:id/show_project', :to => 'bids#show_project', :as => 'project_for_bid'
|
||||
match 'calls/:id/show_course', :to => 'bids#show_courseEx', :as => 'course_for_bid' # nwb added
|
||||
match 'calls/:id/new_exercise_book', :to => 'homework_attach#new', :as => 'new_homework_attach'
|
||||
match 'calls/:id/add', :to => 'bids#add'
|
||||
match 'calls/:id/delete', :to => 'bids#delete'
|
||||
match 'calls/:id/add_homework', :to => 'bids#add_homework', :via => :post
|
||||
match 'calls/:id/new_submit_homework', :to => 'bids#new_submit_homework', :via => :get, :as => 'new_submit_homework'
|
||||
match 'words/add_project_respond', :to => 'words#add_project_respond'
|
||||
match 'words/:id/leave_project_message', :to => 'words#leave_project_message'
|
||||
|
||||
match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
|
||||
match 'calls/create_bid', :to => 'bids#create_bid'
|
||||
|
@ -693,9 +705,9 @@ RedmineApp::Application.routes.draw do
|
|||
delete 'join_in/join', :to => 'courses#unjoin'
|
||||
post 'calls/:id/join_in_contest', :to => 'bids#join_in_contest', :as => 'join_in_contest'
|
||||
delete 'calls/:id/join_in_contest', :to => 'bids#unjoin_in_contest'
|
||||
match 'calls/:id/show_participator', :to => 'bids#show_participator' #bai
|
||||
match 'calls/:id/update_contest', :to => 'bids#update_contest' #bai
|
||||
match 'calls/:id/settings', :to => 'bids#settings' #bai
|
||||
match 'calls/:id/show_participator', :to => 'bids#show_participator' # bai
|
||||
match 'calls/:id/update_contest', :to => 'bids#update_contest' # bai
|
||||
match 'calls/:id/settings', :to => 'bids#settings' # bai
|
||||
|
||||
delete 'attachment/:id', :to => 'attachments#delete_homework'
|
||||
match 'new_join', :to => 'courses#new_join', :as => 'try_join'
|
||||
|
@ -707,13 +719,16 @@ RedmineApp::Application.routes.draw do
|
|||
#added by william
|
||||
# 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_reward',:controller => 'bids',:action => 'set_reward',:as => 'set_reward'
|
||||
match 'calls/:id/set_reward',:to => 'bids#set_reward',:as => 'set_reward'
|
||||
|
||||
# added by young
|
||||
match 'calls', :controller => 'bids', :action => 'index'
|
||||
match 'calls', :to => 'bids#index'
|
||||
|
||||
match 'calls/:id', :controller => 'bids', :action => 'show', :as => 'respond'
|
||||
match 'contest', :controller => 'bids', :action => 'contests', :as => 'contest' #modified @20140403
|
||||
match 'calls/:id', :to => 'bid#show', :as => 'respond'
|
||||
# modified by longjun
|
||||
# bids#contests is not exist
|
||||
# match 'contest', :to => 'bids#contests', :as => 'contest' #modified @20140403
|
||||
# end longjun
|
||||
|
||||
########################
|
||||
##added by wen##########
|
||||
|
@ -738,17 +753,17 @@ RedmineApp::Application.routes.draw do
|
|||
get 'school/upload_logo', :to => 'school#upload_logo'
|
||||
|
||||
######added by nie
|
||||
match 'tags/show_projects_tags',:to => 'tags#show_projects_tags'
|
||||
match 'tags/show_projects_tags'
|
||||
########### added by liuping
|
||||
match 'tags/add_tag',:to => 'tags#add_tag',:as=>"add_tag"
|
||||
match 'tags/delete_tag',:to => 'tags#delete_tag',:as=>"add_tag"
|
||||
match 'tags/show_all',:to => 'tags#show_all'
|
||||
match 'parise_tread/praise_plus',:to => 'parise_tread#praise_plus',:as=>"praise"
|
||||
match 'parise_tread/tread_plus',:to => 'parise_tread#tread_plus',:as=>"tread"
|
||||
match 'tags/delete',:to=>'tags#delete'
|
||||
match 'tags/remove_tag',:to=>'tags#remove_tag',:as=>"remove_tag"
|
||||
match 'tags/add_tag', :as=>"add_tag"
|
||||
match 'tags/delete_tag', :as=>"add_tag"
|
||||
match 'tags/show_all'
|
||||
match 'parise_tread/praise_plus', :as=>"praise"
|
||||
match 'parise_tread/tread_plus', :as=>"tread"
|
||||
match 'tags/delete'
|
||||
match 'tags/remove_tag', :as=>"remove_tag"
|
||||
|
||||
match 'words/add_brief_introdution', :controller => 'words', :action => 'add_brief_introdution'
|
||||
match 'words/add_brief_introdution'
|
||||
|
||||
|
||||
Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
|
||||
|
|
Loading…
Reference in New Issue