新竞赛代码移植

This commit is contained in:
wanglinchun 2014-04-03 17:26:56 +08:00
parent 075b1d2143
commit 120e84cfc7
14 changed files with 424 additions and 11 deletions

View File

@ -69,6 +69,8 @@ class PraiseTreadController < ApplicationController
@obj = Project.find_by_id(id) @obj = Project.find_by_id(id)
when 'Bid' when 'Bid'
@obj = Bid.find_by_id(id) @obj = Bid.find_by_id(id)
when 'Contest'
@obj = Contest.find_by_id(id)
end end
return @obj return @obj
end end

View File

@ -68,6 +68,8 @@ class ProjectsController < ApplicationController
helper :bids helper :bids
include BidsHelper include BidsHelper
helper :contests
include ContestsHelper
helper :sort helper :sort
include SortHelper include SortHelper
helper :custom_fields helper :custom_fields
@ -567,6 +569,7 @@ class ProjectsController < ApplicationController
"show_messages" => true, "show_messages" => true,
"show_news" => true, "show_news" => true,
"show_bids" => true, "show_bids" => true,
"show_contests" => true,
"show_journals_for_messages" => true "show_journals_for_messages" => true
} }
@date_to ||= Date.today + 1 @date_to ||= Date.today + 1

View File

@ -23,19 +23,20 @@ class UsersController < ApplicationController
menu_item :user_homework, :only => :user_homeworks menu_item :user_homework, :only => :user_homeworks
menu_item :user_project, :only => [:user_projects, :watch_projects] menu_item :user_project, :only => [:user_projects, :watch_projects]
menu_item :requirement_focus, :only => :watch_bids menu_item :requirement_focus, :only => :watch_bids
menu_item :requirement_focus, :only => :watch_contests
menu_item :user_newfeedback, :only => :user_newfeedback menu_item :user_newfeedback, :only => :user_newfeedback
#Ended by young #Ended by young
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info, before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info,
:user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index, :user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index] :activity_score_index, :influence_score_index, :score_index]
#edit has been deleted by huang, 2013-9-23 #edit has been deleted by huang, 2013-9-23
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses,
:user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
:watch_bids, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, :watch_bids, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index] :activity_score_index, :influence_score_index, :score_index]
accept_api_auth :index, :show, :create, :update, :destroy,:tag_save accept_api_auth :index, :show, :create, :update, :destroy,:tag_save
@ -117,6 +118,28 @@ class UsersController < ApplicationController
end end
end end
#new add by linchun
def watch_contests
@bids = Contest.watched_by(@user)
@offset, @limit = api_offset_and_limit({:limit => 10})
@contest_count = @contests.count
@contest_pages = Paginator.new @contest_count, @limit, params['page']
@offset ||= @contest_pages.reverse_offset
unless @offset == 0
@contest = @contests.offset(@offset).limit(@limit).all.reverse
else
limit = @bid_count % @limit
@contest = @contests.offset(@offset).limit(limit).all.reverse
end
respond_to do |format|
format.html {
render :layout => 'base_users'
}
format.api
end
end
# added by fq # added by fq
def user_activities def user_activities
@watcher = User.watched_by_id(@user) @watcher = User.watched_by_id(@user)

View File

@ -120,7 +120,7 @@ class WelcomeController < ApplicationController
def entry_select_contest def entry_select_contest
if request.original_url.match(/contest\.trustie\.net/) if request.original_url.match(/contest\.trustie\.net/)
contest contest
render :contest, layout: false render :contest
return 0 return 0
end end
end end

View File

@ -190,6 +190,8 @@ class WordsController < ApplicationController
obj = User.find_by_id(obj_id) obj = User.find_by_id(obj_id)
elsif ( referer.match(/bids/) || referer.match(/calls/) ) elsif ( referer.match(/bids/) || referer.match(/calls/) )
obj = Bid.find_by_id(obj_id) obj = Bid.find_by_id(obj_id)
elsif ( referer.match(/contests/) || referer.match(/contests/) ) #new added
obj = Contest.find_by_id(obj_id)
else else
raise 'create reply obj unknow type.' raise 'create reply obj unknow type.'
end end
@ -204,6 +206,8 @@ class WordsController < ApplicationController
Project.add_new_jour(nil, nil, obj.id, options) Project.add_new_jour(nil, nil, obj.id, options)
elsif obj.kind_of? Bid elsif obj.kind_of? Bid
obj.add_jour(nil, nil, nil, options) obj.add_jour(nil, nil, nil, options)
elsif obj.kind_of? Contest
obj.add_jour(nil, nil, obj.id, options) #new added
else else
raise 'create reply obj unknow type.' raise 'create reply obj unknow type.'
end end

View File

@ -1411,6 +1411,50 @@ module ApplicationHelper
html.html_safe html.html_safe
end end
#display contest project
def show_more_contest_project?(contest)
if contest.projects.where('is_public = 1').count > 12
return true
else
return false
end
end
def show_contest_project(bid)
html = ''
if contest.projects.where('is_public = 1').count == 0
html << (content_tag "p", l(:label_no_bid_project), :class => "font_lighter")
else
contest.projects.where('is_public = 1').take(12).each do |project|
html << (link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar")
end
end
html.html_safe
end
def show_contest_project(contest)
html = ''
if contest.projects.where('is_public = 1').count == 0
html << (content_tag "p", l(:label_no_bid_project), :class => "font_lighter")
else
contest.projects.where('is_public = 1').take(12).each do |project|
html << (link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar")
end
end
html.html_safe
end
def show_contest_fans_picture(obj)
html = ''
if obj.watcher_users.count == 0
html << (content_tag "span", l(:label_project_no_follow))
else
obj.watcher_users.take(12).each do |user|
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name)
end
end
html.html_safe
end
#display fans picture #display fans picture
def show_more_fans?(obj) def show_more_fans?(obj)
if obj.watcher_users.count > 12 if obj.watcher_users.count > 12
@ -1500,7 +1544,7 @@ module ApplicationHelper
courses_link = link_to l(:label_course_practice), {:controller => 'projects', :action => 'course', :project_type => 1, :host => Setting.course_domain} courses_link = link_to l(:label_course_practice), {:controller => 'projects', :action => 'course', :project_type => 1, :host => Setting.course_domain}
projects_link = link_to l(:label_project_deposit), {:controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain} projects_link = link_to l(:label_project_deposit), {:controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}
users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain} users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain}
contest_link = link_to l(:label_contest_innovate), {:controller => 'bids', :action => 'contest', :project_type => 1 , :host => Setting.contest_domain} contest_link = link_to l(:label_contest_innovate), {:controller => 'contests', :action => 'index'}
bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'} bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'}
forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index"} forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index"}
stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'} stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'}

View File

@ -30,7 +30,7 @@ module WatchersHelper
objects = Array.wrap(objects) objects = Array.wrap(objects)
watched = objects.any? {|object| object.watched_by?(user)} watched = objects.any? {|object| object.watched_by?(user)}
@watch_flag = (objects.first.instance_of?(User) or objects.first.instance_of?(Project) or (objects.first.instance_of?(Bid))) @watch_flag = (objects.first.instance_of?(User) or objects.first.instance_of?(Project) or objects.first.instance_of?(Contest) or (objects.first.instance_of?(Bid)))
css = @watch_flag ? ([watcher_css(objects), watched ? 'icon ' : 'icon '].join(' ') << options[0].to_s) : css = @watch_flag ? ([watcher_css(objects), watched ? 'icon ' : 'icon '].join(' ') << options[0].to_s) :
([watcher_css(objects), watched ? 'icon icon-fav ' : 'icon icon-fav-off '].join(' ') << options[0].to_s) ([watcher_css(objects), watched ? 'icon icon-fav ' : 'icon icon-fav-off '].join(' ') << options[0].to_s)
@ -46,6 +46,27 @@ module WatchersHelper
link_to text, url, :remote => true, :method => method, :class => css link_to text, url, :remote => true, :method => method, :class => css
end end
############## added by linchun
def new_watcher_link(objects, user, options=[])
return '' unless user && user.logged?
objects = Array.wrap(objects)
watched = objects.any? {|object| object.watched_by?(user)}
@watch_flag = (objects.first.instance_of?(User) or objects.first.instance_of?(Project) or (objects.first.instance_of?(Contest)))
css = @watch_flag ? ([watcher_css(objects), watched ? 'icon ' : 'icon '].join(' ') << options[0].to_s) :
([watcher_css(objects), watched ? 'icon icon-fav ' : 'icon icon-fav-off '].join(' ') << options[0].to_s)
text = @watch_flag ?
(watched ? l(:button_unfollow) : l(:button_follow)) : (watched ? l(:button_unwatch) : l(:button_watch))
url = watch_path(
:object_type => objects.first.class.to_s.underscore,
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)
)
method = watched ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method, :class => css
end
# added by fq, modify nyan # added by fq, modify nyan
# Somebody may use option params # Somebody may use option params
def join_in_course(course, user, options=[]) def join_in_course(course, user, options=[])
@ -93,7 +114,39 @@ module WatchersHelper
end end
end end
end end
##new add by linchun
def join_in_contest(contest, user, options=[])
return '' unless user && user.logged?
joined = user.join_in_contest?(contest)
text = joined ? l(:label_exit_contest) : l(:label_join_contest)
url_t = join_in_contest_path(:id => contest.id)
url_f = try_join_in_contest_path(:id => contest.id)
# url = join_in_contest_path(:id => contest.id)
method = joined ? 'delete' : 'post'
if joined
link_to text, url_t, :remote => true, :method => method, :id => "#{contest.id}", :confirm => l(:text_are_you_sure_out), :class => []+options
else
link_to text, url_f, :remote => true, :method => method, :id => "#{contest.id}", :class => []+options
end
end
# liuwanwei 的需求, 新竞赛
# 新路由命名为 competition
def join_in_competition(competition, user)
return '' unless user && user.logged?
joined = JoinInCompetition.where('competition_id = ? AND user_id = ?', competition.id, user.id).count>0
text = joined ? l(:label_exit_contest) : l(:label_join_contest)
url_f = new_join_contests_path(:id => competition.id)
url_t = unjoin_in_contest_contests_path(:id => competition.id)
method = joined ? 'delete' : 'post'
if joined
# 退出竞赛用
link_to text, url_t, :remote => true, :method => method, :id => "#{competition.id}", :confirm => l(:text_are_you_sure_out)
else
# 加入竞赛用
link_to text, url_f, :remote => true, :method => method, :id => "#{competition.id}"
end
end
# Returns the css class used to identify watch links for a given +object+ # Returns the css class used to identify watch links for a given +object+
def watcher_css(objects) def watcher_css(objects)

View File

@ -55,6 +55,7 @@ class Project < ActiveRecord::Base
has_many :changesets, :through => :repository has_many :changesets, :through => :repository
#added by xianbo for delete biding_project #added by xianbo for delete biding_project
has_many :biding_projects, :dependent => :destroy has_many :biding_projects, :dependent => :destroy
has_many :contesting_projects, :dependent => :destroy
#ended by xianbo #ended by xianbo
# added by fq # added by fq
has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :journals_for_messages, :as => :jour, :dependent => :destroy

View File

@ -78,11 +78,13 @@ class User < Principal
belongs_to :ucourse, :class_name => 'Course', :foreign_key => :id #huang belongs_to :ucourse, :class_name => 'Course', :foreign_key => :id #huang
## added by xianbo for delete ## added by xianbo for delete
has_many :biding_projects, :dependent => :destroy has_many :biding_projects, :dependent => :destroy
has_many :contesting_projects, :dependent => :destroy
##ended by xianbo ##ended by xianbo
#####fq #####fq
has_many :jours, :class_name => 'JournalsForMessage', :dependent => :destroy has_many :jours, :class_name => 'JournalsForMessage', :dependent => :destroy
has_many :bids, :foreign_key => 'author_id', :dependent => :destroy has_many :bids, :foreign_key => 'author_id', :dependent => :destroy
has_many :contests, :foreign_key => 'author_id', :dependent => :destroy
has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1" has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1"
has_many :journal_replies, :dependent => :destroy has_many :journal_replies, :dependent => :destroy

View File

@ -1,8 +1,244 @@
<%= stylesheet_link_tag 'welcome' %>
<script type="text/javascript" language="javascript">
function clearInfo(id, content) {
var text = $('#' + id);
if (text.val() == content) {
$('#' + id).val('');
}
}
$(function(){
$("#main").find("a").attr("target", "_blank");
});
function showInfo(id, content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
// 给主页用户弹新页面
$(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank");
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
});
</script>
<script type="text/javascript">
(function (){
window.onload = function(){
function fixedBar(id, options){
var ele = document.getElementById(id);
if(!ele) return;
if(/msie (\d+\.\d+)/i.test(navigator.userAgent)){
var pageHeight=window.innerHeight;
var d=document;
if(typeof pageHeight!="number"){
if(document.compatMode=="CSS1Compat"){
pageHeight=document.documentElement.clientHeight;
}else{
pageHeight=document.body.clientHeight;
}
}
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
if(options.addclass) ele.className = options.addclass;
ele.style.position= 'absolute';
if(options.show){
ele.style.top = 0 + "px";
ele.style.display= 'block';
}
window.attachEvent('onscroll' , function (){
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
ele.style.top = 0 + "px";
if(options.autoHidden){
if(ieScrollTop==0){
ele.style.display="none";
}else{
ele.style.display="block";
}
}
});
}else{
var ele = document.getElementById(id);
if(typeof pageHeight!="number"){
if(document.compatMode=="CSS1Compat"){
pageHeight=document.documentElement.clientHeight;
}else{
pageHeight=document.body.clientHeight;
}
}
if(options.show) ele.style.display= 'block';
ele.style.top = 0 +'px';
window.addEventListener('scroll',function (){
if(options.autoHidden){
if(baidu.page.getScrollTop()==0){
ele.style.display="none";
}else{
ele.style.display="block";
}
}
},false);
}
}
fixedBar('backTopBtn' , {autoHidden: true, top : 186});
fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true});
}
})();
</script>
<div class='top_bar'> <div class='top_bar'>
<div class="main-content-bar" style="text-align: center; color: green; font-size: 30px; margin-top: 250px"> <div id="identifier-pannel" style="display:none">
正在升级中。。。。。。。。。。。。 <%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %>
<div class="weixin-content">微信扫码</div>
</div>
<div class="main-content-bar">
<div class="welcome_left" >
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_contest) %></span> <span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_contest_description) %></span>
</div>
<div class="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
</div>
<div style="clear: both;"></div>
</div> </div>
</div> </div>
<div style="clear:both"></div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_miracle_project(10, 3).map do |project| %>
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
<div style="float: left;">
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
</div>
<!-- 上左下右 -->
<div style="float: left; margin-left: 10px; width: 380px;">
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
</div>
<div class='text_nowrap' style="float: left;margin:5px; margin-left: 10px; width: 380px;">
<span class='font_lighter' title =<%=project.description.to_s%>><%=project.description.truncate(50, omission: '...')%></span>
</div>
<div style="position:absolute; bottom:0;right:0;margin:5px 10px 5px 5px ;">
<%= content_tag "span", show_grade(project),
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ",
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
:class => "tooltip",
:id => "tooltip-#{project.id}" %>
</p>
</div>
</li>
<% end; reset_cycle %>
</ul>
</div>
</div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<ul class="user-welcome-message-list">
<h3 style="color: rgb(21, 188, 207)"><strong>用户动态</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %></span>
<div class="user-message-box-list" style="margin-top: 10px;">
<% find_all_activities.each do |event| %>
<li style="display: block;height:60px; padding-bottom: 4px;">
<div class="inner-right" style="float: left; height: 100%; ">
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
</div>
<div class="inner-right" style="float: right; width:86%; height: 100%; ">
<span style="color: green;"><%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %></span><%= show_user_content event %>
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
</div>
</li>
<% end %>
</div>
</ul>
</div>
<div class="right" style="float: right; width: 48%; ">
<ul class="welcome-message-list">
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
<h3 style="color: rgb(21, 188, 207);">
<strong>贴吧动态</strong>
<%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%></h3>
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
</div>
<div class="welcome-box-list-new">
<% find_new_forum_topics(7).each do |topic|%>
<li class="message-brief-intro" style="line-height: 1.63em;padding-bottom:3px;">
<div style="display: inline-block; width: 100%;">
<span style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;", :target => "_blank" %>
</span>
<br>
<span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;"><%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前</span>
<span style="margin-left: 8px; margin-bottom: 0px; color: rgb(172, 174, 177) !important; white-space: nowrap;">
由&nbsp;<%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);", :target => "_blank" %>&nbsp;发表
</span>
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;">回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url, :target => "_blank" %>)</span>
</div>
</li>
<% end %>
</div>
</ul>
</div>
<!-- <div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<h3 style="margin-left: 5px; color: color: (51, 119, 51);"><strong>热门竞赛</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'bids', :action => 'contest', :project_type => 1, :host => Setting.contest_domain}, :target => "_blank" %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
<li style="background-image:none;">
<p class="layout">
<span style = "background: url('/images/007.gif') no-repeat scroll ;background-position: left center;"><%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}",
:style => "margin-left: 28px;", :target => "_blank") %></span>
</p>
<p class="layout-1" >
<%= content_tag "span", contest.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => contest.description %>
</p>
</li>
<% end %>
</ul>
</div>
</div> -->
<!-- <div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<h3 style="margin-left: 5px; color: color: (51, 119, 51);"><strong>热门众包</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'bids', :action => 'index'}, :target => "_blank" %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_all_hot_bid.map do |bid| break if(bid == find_all_hot_bid[5]) %>
<li style="background-image:none;">
<p class="layout">
<span style = "background: url('/images/007.gif') no-repeat scroll ;background-position: left center;"><%= link_to( bid.name, respond_path(bid.id), :class => "d-g-blue d-p-project-name", :title => "#{bid.name}",
:style => "margin-left: 28px;", :target => "_blank") %></span>
</p>
<p class="layout-1" >
<%= content_tag "span", bid.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => bid.description %>
</p>
</li>
<% end %>
</ul>
</div>
</div> -->
<div class="clr">
</div>
<br/><br/><br/><br/><br/><br/><br/>
<div style="padding-top: 40px"></div> <div style="padding-top: 40px"></div>

View File

@ -1,6 +1,6 @@
<% if @journal_destroyed.nil? %> <% if @journal_destroyed.nil? %>
alert('<%=l(:notice_failed_delete)%>'); alert('<%=l(:notice_failed_delete)%>');
<% elsif (['Principal','Project', 'Bid'].include? @journal_destroyed.jour_type)%> <% elsif (['Principal','Project', 'Bid', 'Contest'].include? @journal_destroyed.jour_type)%>
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>') var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
destroyedItem.fadeOut(600,function(){ destroyedItem.fadeOut(600,function(){
destroyedItem.remove(); destroyedItem.remove();

View File

@ -1549,8 +1549,10 @@ zh:
label_welcome_trustie: Trustie label_welcome_trustie: Trustie
label_welcome_trustie_project: 在线项目托管平台 label_welcome_trustie_project: 在线项目托管平台
label_welcome_trustie_course: 在线课程实践平台 label_welcome_trustie_course: 在线课程实践平台
label_welcome_trustie_contest: 在线竞赛实战平台
label_welcome_trustie_project_description: 面向中国大学生与软件从业者,提供社交化的项目管理、代码托管、资源共享、合作交流。 label_welcome_trustie_project_description: 面向中国大学生与软件从业者,提供社交化的项目管理、代码托管、资源共享、合作交流。
label_welcome_trustie_course_description: 面向中国高校教师与大学生,提供社交化的课程管理、资源共享、合作实验、协同研究。 label_welcome_trustie_course_description: 面向中国高校教师与大学生,提供社交化的课程管理、资源共享、合作实验、协同研究。
label_welcome_trustie_contest_description: 面向中国大学生与编程爱好者,提供社交化的竞赛管理、应用管理、代码托管、合作交流。
label_user_project: 项目 label_user_project: 项目
label_user_course: 课程 label_user_course: 课程
label_user_homework: 作业 label_user_homework: 作业
@ -1811,3 +1813,14 @@ zh:
label_contest_reason: 参赛宣言: label_contest_reason: 参赛宣言:
label_notification: 通知 label_notification: 通知
label_sumbit_empty: 搜索内容不能为空 label_sumbit_empty: 搜索内容不能为空
#add by linchun (竞赛相关)
label_upload_files: 上传文件
label_upload_softwarepackage: 上传软件包
label_upload_cuttingphoto: 上传截图
label_contests_reward_method: 奖励方式
label_system_platform: 系统平台
label_nextstep: 下一步
label_participate: 参赛者
label_contest_project: 参赛项目
label_contest_application: 参赛应用

View File

@ -16,6 +16,28 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
RedmineApp::Application.routes.draw do RedmineApp::Application.routes.draw do
## new added by linchun #新竞赛相关
resources :contests, only: [:index] do
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
end
member do
match 'update_contest' , via: [:put]
match 'show_contest' , via: :get
match 'show_project' , via: :get
match 'show_application' , via: :get
match 'show_participator' , via: :get
match 'add' , via: [:get, :post]
match 'create' , via: :post
match 'settings' , via: [:get, :post]
end
end
resources :stores do resources :stores do
collection do collection do
match 'search', via: [:get, :post] match 'search', via: [:get, :post]

View File

@ -276,6 +276,16 @@ Redmine::MenuManager.map :bid_menu do |menu|
# menu.push :result, { :controller => 'bids', :action => 'show_results' }, # menu.push :result, { :controller => 'bids', :action => 'show_results' },
# :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p } # :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p }
end end
###new add by linchun
Redmine::MenuManager.map :contest_menu do |menu|
menu.push :respond, :show_contest_contest_path, :caption => :label_user_response
menu.push :project, :show_project_contest_path, :caption => :label_contest_project
menu.push :application, :show_application_contest_path, :caption => :label_contest_application
# menu.push :result, { :controller => 'bids', :action => 'show_results' },
# :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p }
end
####
Redmine::MenuManager.map :application_menu do |menu| Redmine::MenuManager.map :application_menu do |menu|
# Empty # Empty
end end