Merge branch 'develop'
This commit is contained in:
commit
00b866f06a
|
@ -5,7 +5,7 @@ class ContestsController < ApplicationController
|
|||
menu_item :project, :only => :show_project
|
||||
menu_item :application, :only => :show_softapplication
|
||||
menu_item :attendingcontest, :only => :show_attendingcontest
|
||||
before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :create,:destroy,:more,:back,:add,:add_softapplication,:new,:show_results, :set_reward,
|
||||
before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :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]
|
||||
|
||||
# added by fq
|
||||
|
@ -335,7 +335,12 @@ class ContestsController < ApplicationController
|
|||
end
|
||||
##取出参赛应用
|
||||
@softapplication = Softapplication.all
|
||||
@contesting_softapplication = @contest.contesting_softapplications.reverse
|
||||
@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").
|
||||
order("cached.avg").reverse_order
|
||||
@contesting_softapplication = paginateHelper @contesting_softapplication, 10
|
||||
|
||||
|
||||
|
@ -350,6 +355,44 @@ class ContestsController < ApplicationController
|
|||
end
|
||||
|
||||
###end
|
||||
|
||||
def set_reward_project
|
||||
@c_p = nil
|
||||
@contesting_project_id = nil
|
||||
|
||||
if params[:set_reward_project][:reward]&&((User.current.id==@contest.author_id)||User.current.admin)
|
||||
# @bid_id = params[:id]
|
||||
@contesting_project_id = params[:set_reward_project][:c_id]
|
||||
@c_p = ContestingProject.find_by_id(@contesting_project_id)
|
||||
|
||||
# 把字段存进表中
|
||||
@c_p.update_reward(params[:set_reward_project][:reward].to_s)
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def set_reward_softapplication
|
||||
@c_sa = nil
|
||||
@contesting_softapplication_id = nil
|
||||
|
||||
if params[:set_reward_softapplication][:reward]&&((User.current.id==@contest.author_id)||User.current.admin)
|
||||
# @bid_id = params[:id]
|
||||
@contesting_softapplication_id = params[:set_reward_softapplication][:c_id]
|
||||
@c_sa = ContestingSoftapplication.find_by_id(@contesting_softapplication_id)
|
||||
|
||||
# 把字段存进表中
|
||||
@c_sa.update_reward(params[:set_reward_softapplication][:reward].to_s)
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
###添加已创建的参赛项目
|
||||
def add
|
||||
project = Project.find(params[:contest])
|
||||
|
|
|
@ -100,14 +100,34 @@ class SoftapplicationsController < ApplicationController
|
|||
|
||||
# POST /softapplications
|
||||
# POST /softapplications.json
|
||||
# def create
|
||||
# @softapplication = Softapplication.new(params[:softapplication])
|
||||
# @softapplication.user = User.current
|
||||
# @softapplication.save_attachments(params[:attachments])
|
||||
# respond_to do |format|
|
||||
# if @softapplication.save
|
||||
# format.js
|
||||
# format.html { redirect_to @softapplication, notice: 'Softapplication was successfully created.' }
|
||||
# # format.json { render json: @softapplication, status: :created, location: @softapplication }
|
||||
# else
|
||||
# format.js { render status: 406 }
|
||||
# format.html { render action: "new" }
|
||||
# # format.json { render json: @softapplication.errors, status: :unprocessable_entity }
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
|
||||
#new changed created function
|
||||
def create
|
||||
@softapplication = Softapplication.new(params[:softapplication])
|
||||
@softapplication.user = User.current
|
||||
@softapplication.save_attachments(params[:attachments])
|
||||
respond_to do |format|
|
||||
if @softapplication.save
|
||||
ContestingSoftapplication.create(:contest_id => params[:contest_id], :softapplication_id => @softapplication.id)
|
||||
format.js
|
||||
format.html { redirect_to @softapplication, notice: 'Softapplication was successfully created.' }
|
||||
format.html { redirect_to show_attendingcontest_contest_path(:id => params[:contest_id]) }
|
||||
# format.json { render json: @softapplication, status: :created, location: @softapplication }
|
||||
else
|
||||
format.js { render status: 406 }
|
||||
|
@ -115,8 +135,13 @@ class SoftapplicationsController < ApplicationController
|
|||
# format.json { render json: @softapplication.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
#关联新建的参赛作品
|
||||
|
||||
# @contesting_softapplication = paginateHelper @contest.contesting_softapplications
|
||||
|
||||
|
||||
|
||||
end
|
||||
# PUT /softapplications/1
|
||||
# PUT /softapplications/1.json
|
||||
def update
|
||||
|
|
|
@ -92,6 +92,10 @@ module ContestsHelper
|
|||
c_project.get_reward
|
||||
end
|
||||
|
||||
def get_prize(c_softapplication)
|
||||
c_softapplication.get_reward
|
||||
end
|
||||
|
||||
def count_contest_project
|
||||
contests = Contest.find(:id)
|
||||
@projects = []
|
||||
|
|
|
@ -34,4 +34,8 @@ module OpenSourceProjectsHelper
|
|||
def get_open_source_projects_by_tag(tag_name)
|
||||
OpenSourceProject.tagged_with(tag_name).order('created_at desc')
|
||||
end
|
||||
|
||||
def show_origin(url)
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,4 +12,17 @@ class ContestingSoftapplication < ActiveRecord::Base
|
|||
:softapplication_id => softapplication_id, :description => description)
|
||||
end
|
||||
|
||||
def self.create_work_contesting(contest_id, softapplication_id)
|
||||
self.create(:user_id => User.current.id, :contest_id => contest_id,
|
||||
:softapplication_id => softapplication_id)
|
||||
end
|
||||
|
||||
def update_reward(which)
|
||||
self.update_attribute(:reward,which)
|
||||
end
|
||||
|
||||
def get_reward
|
||||
self.reward
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class Softapplication < ActiveRecord::Base
|
||||
attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers
|
||||
attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers, :deposit_project_url
|
||||
acts_as_attachable
|
||||
seems_rateable :allow_update => true, :dimensions => :quality
|
||||
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
$('#reward_result_<%= @contesting_project_id %>').html('<%= j(
|
||||
|
||||
if get_prize(@b_p).nil? or get_prize(@b_p) == ""
|
||||
if get_prize(@c_p).nil? or get_prize(@c_p) == ""
|
||||
if @contest.deadline < Date.today
|
||||
puts '未评奖'
|
||||
end
|
||||
else
|
||||
|
||||
case get_prize(@b_p)
|
||||
case get_prize(@c_p)
|
||||
when '-1'
|
||||
image_tag("/images/bid/special_reward.png")
|
||||
when '1'
|
||||
when '0'
|
||||
image_tag("/images/bid/first_reward.png")
|
||||
when '1'
|
|
@ -0,0 +1,30 @@
|
|||
$('#reward_result_<%= @contesting_softapplication_id %>').html('<%= j(
|
||||
|
||||
if get_prize(@c_sa).nil? or 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")
|
||||
end
|
||||
|
||||
end
|
||||
)
|
||||
%>')
|
||||
|
||||
$('#<%= @contesting_softapplication_id %>').hide()
|
|
@ -61,61 +61,59 @@
|
|||
</script>
|
||||
|
||||
<!--参赛步骤-->
|
||||
<div style="padding-left: 17px; padding-bottom: 15px">
|
||||
温馨提示:如果您希望在我们平台托管参赛数据和代码,请按下面参赛步骤参赛!
|
||||
<div style="padding-left: 17px; padding-bottom: 10px; color: grey">
|
||||
温馨提示:如果您准备参加竞赛,请点击下面的"新建参赛作品"!
|
||||
</div>
|
||||
<% if User.current.logged? %>
|
||||
|
||||
<div style="padding-bottom: 10px; line-height: 25px">
|
||||
<div style="padding-left: 17px; font-size: 15px">
|
||||
<strong>参赛步骤:</strong>
|
||||
<div style="padding-bottom: 10px; line-height: 15px">
|
||||
<div style="padding-left: 82px; font-size: 14px">
|
||||
<span><strong>参加竞赛:</strong></span>
|
||||
<span><%= link_to '新建参赛作品', "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %></span>
|
||||
</div>
|
||||
<div style="padding-left: 82px; ">
|
||||
<!-- <div style="padding-left: 82px; ">
|
||||
<span style="padding-top: 50px">步骤1:</span>
|
||||
<span><%#= link_to '新建参赛作品', new_softapplication_path(:target=>'_blank'), :target=>'_blank' %></span>
|
||||
<span><%= link_to '新建参赛作品', "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %></span>
|
||||
<span style="font-size: 12px; color: grey">(先点击“新建参赛作品”,然后刷新页面,再继续步骤2。)</span>
|
||||
</div>
|
||||
<div style="padding-left: 82px; ">
|
||||
<span style="padding-top: 50px">步骤2:</span>
|
||||
<span><%= link_to '关联参赛作品', "javascript:void(0);", onclick: "$('#put-bid-form').toggle();" %></span>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
<!--点击新建参赛作品弹出框-->
|
||||
<div id="put-project-form" style="display: none; padding-left: 83px; width: 70%">
|
||||
<%= form_for Softapplication.new, :remote=>true, :url => softapplications_path, :complete => '$("#put-bid-form").hide();' do |f| %>
|
||||
<fieldset class="contes-new-box", style="padding-left: 36px">
|
||||
|
||||
<tr style="width:700px; margin-left: -10px">
|
||||
<span><%= l(:label_softapplication_name) %></span>
|
||||
<!--点击新建参赛作品弹出框新建参赛作品并关联到竞赛中-->
|
||||
<div id="put-project-form" style="display: none; padding-left: 83px; width: 88%">
|
||||
<%= form_for Softapplication.new, :url => softapplications_path do |f| %>
|
||||
<fieldset class="contes-new-box", style="padding-left: 36px; line-height: 10px">
|
||||
<%= hidden_field_tag 'contest_id', @contest.id %>
|
||||
<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:400px;" %></td>
|
||||
</tr></ br>
|
||||
</tr><br/>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_softapplication_version_available) %></span>
|
||||
<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:400px;" %></td>
|
||||
|
||||
</tr></ br>
|
||||
</tr><br/>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_softapplication_type) %></span>
|
||||
<span><%= l(:label_work_type) %></span>
|
||||
|
||||
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
|
||||
</tr></ br>
|
||||
</tr><br/>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_softapplication_description) %></span>
|
||||
<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:400px;" %></td>
|
||||
|
||||
</tr></ br>
|
||||
<span style="font-size: 10px">(125个汉字以内)</span>
|
||||
</tr><br/>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
|
@ -123,59 +121,38 @@
|
|||
<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:400px;" %></td>
|
||||
|
||||
</tr></ br>
|
||||
</tr><br/>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<fieldset style="width: 500px", style="padding-top: 10px">
|
||||
<legend>
|
||||
上传应用软件包和应用截图
|
||||
上传作品软件包和作品截图
|
||||
</legend>
|
||||
<%= render_flash_messages %>
|
||||
<p id="put-bid-form-partial">
|
||||
<%= render :partial => 'attachments/form' %>
|
||||
</p>
|
||||
<p style="font-size: 10px">
|
||||
1、<%= l(:label_upload_softapplication_packets_mustpacketed)%>
|
||||
<p style="font-size: 11px">
|
||||
1、<%= l(:label_upload_softapplication_packets_mustpacketed)%> <br />
|
||||
<br>
|
||||
2、<%= l(:label_upload_softapplication_photo_condition)%>
|
||||
</p>
|
||||
<p style="font-size: 10px; color: red">
|
||||
<p style="font-size: 11px; color: red">
|
||||
<%= l(:label_updated_caution)%>
|
||||
</p>
|
||||
|
||||
</fieldset>
|
||||
</fieldset></br>
|
||||
<div class="align-center", style="padding-top: -3px; padding-bottom: 8px">
|
||||
<%= submit_tag l(:button_create), :onclick => "cancel();" %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= 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 %>
|
||||
</div>
|
||||
|
||||
<!--点击关联参赛作品后弹出关联框-->
|
||||
<div id="put-bid-form" style="display: none; padding-left: 83px; width: 70%">
|
||||
<%= 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="102%" style="margin-left: -3px;">
|
||||
<!--该table为点击关联参赛作品后弹出的-->
|
||||
<tr style="padding-left: 50px">
|
||||
<%= select_tag 'contest', options_for_select(select_option_app_helper(@softapplication)), :name => 'contest', :class => 'grayline' %>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><%= f.text_area :contest_message, :id => "contest_message", :required => true, :rows => 2, :cols => 40, :placeholder => l(:label_bid_reason), :style => "resize: none;", :class => 'noline'%></td>
|
||||
</tr>
|
||||
|
||||
<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'" %> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
|
@ -189,10 +166,63 @@
|
|||
<% if c_project.project %>
|
||||
<div style="padding-left: 18px">
|
||||
<div style="font-size: 15px">
|
||||
<tr>
|
||||
<td><strong>参赛作品: </strong></td>
|
||||
<td> <%= link_to(c_project.project.name, project_path(c_project.project), :target => '_blank') %> </td>
|
||||
</tr></br>
|
||||
<div>
|
||||
<div><strong>参赛作品: <%= link_to(c_project.project.name, project_path(c_project.project), :target => '_blank') %> </strong>
|
||||
<div style="float: right">
|
||||
<td style="color: #ec6300;" align="right" valign="0.1em" width="16%">
|
||||
<strong>
|
||||
<span id="reward_result_<%=c_project.id%>"> <!-- 调用js进行刷新 -->
|
||||
<% if get_prize(c_project).nil? or get_prize(c_project) == "" %>
|
||||
<% if @contest.deadline < Date.today %>
|
||||
<span style="color: red"><%= l(:label_noawards)%></span>
|
||||
<% else%>
|
||||
<span style="color: red"><%= l(:label_noawards_current)%></span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% case get_prize(c_project) %>
|
||||
<% 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 %>
|
||||
</span>
|
||||
</strong>
|
||||
</td>
|
||||
|
||||
<!-- 评价显隐控制按钮-->
|
||||
<% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %>
|
||||
<td valign="top" align="right" width="10%">
|
||||
<span> <%= toggle_link '评奖', c_project.id.to_s %></span>
|
||||
<!-- 评价应标项目的表单 -->
|
||||
<span style="display: none; vertical-align: top " id = '<%= c_project.id %>'>
|
||||
<%= form_for "set_reward_project",:remote=>true,:url=>set_reward_project_contest_path do |f| %>
|
||||
<%= f.text_field :c_id,:style => "display:none",:value => c_project.id,:size=>"0" %>
|
||||
<%= f.select :reward,"<option value = '-1'>#{l(:label_special_reward)}</option>
|
||||
<option value = '0'>#{l(:label_first_reward)}</option>
|
||||
<option value = '1'>#{l(:label_second_reward)}</option>
|
||||
<option value = '2'>三等奖</option>
|
||||
<option value = '3'>四等奖</option>
|
||||
<option value = '4'>五等奖</option>
|
||||
<option value = '5'>#{l(:label_comfort_reward)}</option>".html_safe %>
|
||||
<%= f.submit "提交",:class=>"submit" %>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div></br>
|
||||
</div>
|
||||
<div style="padding-left: 68px">
|
||||
<tr>
|
||||
|
@ -201,11 +231,12 @@
|
|||
</tr></br>
|
||||
</div>
|
||||
<div style="padding-left: 68px; padding-bottom: 8px">
|
||||
<tr>
|
||||
<td>发布时间:</td>
|
||||
<td> <%= format_time c_project.created_at%> </td>
|
||||
<span><strong>参赛时间:</strong><%= format_time c_project.created_at%></span>
|
||||
<span style="padding-left: 240px"><strong>参赛代表:</strong><%= c_project.user.name %></span>
|
||||
</div>
|
||||
|
||||
<div style="padding-left: 68px">
|
||||
|
||||
</tr>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -221,18 +252,75 @@
|
|||
<td> <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %> </td>
|
||||
</tr></br>
|
||||
</div>
|
||||
<div style="padding-left: 68px">
|
||||
|
||||
<div style="padding-left: 68px; padding-top: 5px">
|
||||
<tr>
|
||||
<td>简介:</td>
|
||||
<td><strong>简介:</strong></td>
|
||||
<td> <%= c_softapplication.softapplication.description.truncate(90, omission: '...') %> </td>
|
||||
</tr></br>
|
||||
</div>
|
||||
<div style="padding-left: 68px; padding-bottom: 8px">
|
||||
<tr>
|
||||
<td>发布时间:</td>
|
||||
<td> <%= format_time c_softapplication.created_at %> </td>
|
||||
|
||||
</tr>
|
||||
<div style="padding-left: 68px; pading-bottom: 8px">
|
||||
<span><strong>参赛时间:</strong><%= format_time c_softapplication.created_at %></span>
|
||||
<span style="padding-left: 240px"><strong>参赛代表:</strong><%= c_softapplication.softapplication.user.name %></span>
|
||||
</div>
|
||||
|
||||
<!--获奖及教师评奖-->
|
||||
<div style="padding-left: 18px; padding-bottom: 5px">
|
||||
<span style="padding-left: 50px"><strong>最终得分:</strong></span><span style="color: red"><%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分</span>
|
||||
<span style="padding-left: 334px">
|
||||
<td>
|
||||
<strong>
|
||||
<span id="reward_result_<%=c_softapplication.id%>" > <!-- 调用js进行刷新 -->
|
||||
<% if get_prize(c_softapplication).nil? or get_prize(c_softapplication) == "" %>
|
||||
<% if @contest.deadline < Date.today %>
|
||||
<span style="color: red"><%= l(:label_noawards)%></span>
|
||||
<% else%>
|
||||
<span style="color: red"><%= l(:label_noawards_current)%></span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% case get_prize(c_softapplication) %>
|
||||
<% 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 %>
|
||||
</span>
|
||||
</strong>
|
||||
</td>
|
||||
|
||||
<!-- 评价显隐控制按钮-->
|
||||
<% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %>
|
||||
<div style="valign="top" align="right" width="10%"">
|
||||
<span style="padding-right: 5px; padding-top: 1px"> <%= toggle_link '评奖', c_softapplication.id.to_s %></span>
|
||||
<!-- 评价应标项目的表单 -->
|
||||
<span style="display: none; vertical-align: top " id = '<%= c_softapplication.id %>'>
|
||||
<%= form_for "set_reward_softapplication",:remote=>true,:url=>set_reward_softapplication_contest_path do |f| %>
|
||||
<%= f.text_field :c_id,:style => "display:none",:value => c_softapplication.id,:size=>"0" %>
|
||||
<%= f.select :reward,"<option value = '-1'>#{l(:label_special_reward)}</option>
|
||||
<option value = '0'>#{l(:label_first_reward)}</option>
|
||||
<option value = '1'>#{l(:label_second_reward)}</option>
|
||||
<option value = '2'>三等奖</option>
|
||||
<option value = '3'>四等奖</option>
|
||||
<option value = '4'>五等奖</option>
|
||||
<option value = '5'>#{l(:label_comfort_reward)}</option>".html_safe %>
|
||||
<%= f.submit "提交",:class=>"submit" %>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<p>git add .</p>
|
||||
<p>git commit -m "first commit"</p>
|
||||
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
|
||||
<p>git push -u origin master:matser</p>
|
||||
<p>git push -u origin master:master</p>
|
||||
</div>
|
||||
</h3>
|
||||
<h3>从网上获取别人的开源版本库,转交到trustie网站上,打开命令行执行如下:</h3>
|
||||
|
@ -45,7 +45,7 @@
|
|||
<p>git add .</p>
|
||||
<p>git commit -m "first commit"</p>
|
||||
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
|
||||
<p>git push -u trustie master:matser</p>
|
||||
<p>git push -u trustie master:master</p>
|
||||
<p><%= link_to "李海提供", user_path(646)%></p>
|
||||
</div>
|
||||
</h3>
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<!-- <%= image_tag(url_to_avatar(@user), :class => "avatar2") %> -->
|
||||
<div style="height: auto; padding-bottom: 10px">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="320" >
|
||||
|
@ -47,6 +46,13 @@
|
|||
<td style="padding-left: 40px">平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></td>
|
||||
<td>发布时间:<%=format_time @softapplication.created_at %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 40px">
|
||||
<% unless @softapplication.deposit_project_url.nil? %>
|
||||
<%= textilizable ("托管项目网址: " + @softapplication.deposit_project_url) %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
|
@ -80,13 +86,14 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div style="float: left; padding-left: 100px; padding-top:35px ">
|
||||
<div style="padding-left: 25px;">最终得分</div>
|
||||
<div style="padding-top: 3px"><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></div>
|
||||
<div style="float: left; padding-left: 100px; padding-top:35px " align="center">
|
||||
<div>最终得分</div>
|
||||
<div style="padding-top: 1px; font-size: 15px; color: blue"><%=@softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分</div>
|
||||
<div><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></div>
|
||||
</div>
|
||||
<div style="float: left; padding-left: 100px; padding-top:35px ">
|
||||
<div style="float: left; padding-left: 100px; padding-top:35px;" align="center">
|
||||
<div>打分总人数</div>
|
||||
<div style="padding-left: 28px; padding-top: 1px; font-size: 25px; color: blue"><strong><%= @softapplication.raters(:quality).count%></strong></div>
|
||||
<div style="padding-top: 1px; font-size: 25px; color: blue; alignment-baseline: "><strong><%= @softapplication.raters(:quality).count%></strong></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
<% if contest.id == 2 or contest.id == 3 or contest.id == 6 %>
|
||||
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("含#{contest.projects.where('is_public=1').count}个作品", show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
|
||||
<% else %>
|
||||
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("含#{contest.contesting_softapplications.count}个app", show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
|
||||
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("含#{contest.contesting_softapplications.count}个作品", show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1857,15 +1857,20 @@ zh:
|
|||
label_release_softapplication: 发布应用
|
||||
label_upload_softapplication_packets: 上传应用软件包
|
||||
label_upload_softapplication_photo: 上传产品截图
|
||||
label_upload_softapplication_packets_mustpacketed: 应用软件作品必须打包后以压缩包的形式上传,便于上传和下载 ;
|
||||
label_upload_softapplication_photo_condition: 应用软件截图需上传4张;格式为gif/jpg/png, 尺寸480*800, 每张小于2M
|
||||
label_updated_caution: 注意:若修改应用,则之前上传的软件包和截图都将被删除,请重新上传!
|
||||
label_upload_softapplication_packets_mustpacketed: 作品相关代码及相关说明文件必须打包后以压缩包的形式上传,便于上传和下载 ;
|
||||
label_upload_softapplication_photo_condition: 作品截图需上传0~4张;格式为gif/jpg/png, 每张小于5M
|
||||
label_updated_caution: 注意:若参赛作品,则之前上传的软件包和截图都将被删除,请重新上传!
|
||||
label_softapplication_name: 应用名称
|
||||
label_work_name: 作品名称
|
||||
label_softapplication_description: 应用简介
|
||||
label_work_description: 作品简介
|
||||
label_softapplication_type: 应用分类
|
||||
label_work_type: 作品分类
|
||||
label_softapplication_version_available: 适配版本
|
||||
label_running_platform: 运行平台
|
||||
label_softapplication_developer: 上传人员
|
||||
label_softapplication_developers: 开发人员
|
||||
label_work_deposit_project_url: 托管项目网址
|
||||
label_softapplication_name_condition: 25个汉字以内(50个字符)
|
||||
label_user_login_softapplication_board: 您还没有登录,请登录后参与应用评价。
|
||||
label_contest_description_no: 暂无描述。
|
||||
|
@ -1895,6 +1900,7 @@ zh:
|
|||
label_relation_files: 关联已有资源
|
||||
label_contest_settings: 配置竞赛
|
||||
label_contest_delete: 删除竞赛
|
||||
label_noawards_current: 暂未评奖
|
||||
|
||||
# ajax异步验证
|
||||
modal_valid_passing: 可以使用
|
||||
|
|
|
@ -73,6 +73,8 @@ RedmineApp::Application.routes.draw do
|
|||
match 'show_softapplication' , via: :get
|
||||
match 'show_attendingcontest' , 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
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddDepositProjectUrlToSoftapplications < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :softapplications, :deposit_project_url, :string
|
||||
end
|
||||
end
|
|
@ -0,0 +1,7 @@
|
|||
class AddAuthorToRelativeMemo < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :relative_memos, :username, :string
|
||||
add_column :relative_memos, :userhomeurl, :string
|
||||
add_column :relative_memos, :date_collected, :date
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20140509020307) do
|
||||
ActiveRecord::Schema.define(:version => 20140513073801) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -756,6 +756,7 @@ ActiveRecord::Schema.define(:version => 20140509020307) do
|
|||
t.integer "softapplication_id"
|
||||
t.integer "is_public"
|
||||
t.string "application_developers"
|
||||
t.string "deposit_project_url"
|
||||
end
|
||||
|
||||
create_table "students_for_courses", :force => true do |t|
|
||||
|
@ -866,6 +867,8 @@ ActiveRecord::Schema.define(:version => 20140509020307) do
|
|||
create_table "user_levels", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "level"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "user_preferences", :force => true do |t|
|
||||
|
|
Loading…
Reference in New Issue