This commit is contained in:
z9hang 2014-09-23 14:48:41 +08:00
commit e5d89590e6
6 changed files with 83 additions and 66 deletions

View File

@ -12,7 +12,7 @@
:filename => attachment.filename%> :filename => attachment.filename%>
<% end %> <% end %>
<span title="<%= attachment.description%>"> <span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: 20, omission: '...')) unless attachment.description.blank? %> <%= h(truncate(" - #{attachment.description}", length: 15, omission: '...')) unless attachment.description.blank? %>
</span> </span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span> <span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% if options[:deletable] %> <% if options[:deletable] %>
@ -34,7 +34,10 @@
<% end %> <% end %>
<% if options[:author] %> <% if options[:author] %>
<!-- modified by zjc author添加超链接 --> <!-- modified by zjc author添加超链接 -->
<span class="author"><%= link_to h(attachment.author),user_path(attachment.author) %>, <%= format_time(attachment.created_on) %></span> <span class="author" title="attachment.author">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>,
<%= format_time(attachment.created_on) %>
</span>
<% end %> <% end %>
</p> </p>
<% end %> <% end %>

View File

@ -1,51 +1,77 @@
<%#= error_messages_for 'softapplication' %> <%#= error_messages_for 'softapplication' %>
<script type="text/javascript" xmlns="http://www.w3.org/1999/html"> <script type="text/javascript" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
//验证作品名称 //验证作品名称
function regexName() function regexName()
{ {
var name = $("#softapplication_name").val(); var name = $("#softapplication_name").val();
if(name.length ==0) if(name.length == 0)
{ {
$("#spane_name_notice").text("作品名称不能为空"); $("#spane_name_notice").text("<%= l(:label_no_softapplication_name) %>");
$("#spane_name_notice").css('color','#ff0000'); $("#spane_name_notice").css('color','#ff0000');
$("#spane_name_notice").focus(); $("#spane_name_notice").focus();
return false; return false;
} }
else if(name.length <= 25) else if(name.length <= 25)
{ {
$("#spane_name_notice").text("填写正确"); $("#spane_name_notice").text("<%= l(:label_field_correct) %>");
$("#spane_name_notice").css('color','#008000'); $("#spane_name_notice").css('color','#008000');
return true; return true;
} }
else else
{ {
$("#spane_name_notice").text("作品名称超过25个汉字"); $("#spane_name_notice").text("<%= l(:label_work_name_condition) %>");
$("#spane_name_notice").css('color','#ff0000'); $("#spane_name_notice").css('color','#ff0000');
$("#spane_name_notice").focus(); $("#spane_name_notice").focus();
return false; return false;
} }
} }
// added by longjun
//验证作品简介
function regexDescription()
{
var name = $("#softapplication_description").val();
if(name.length ==0)
{
$("#span_sofapplication_description").text("<%= l(:label_no_softapplication_description) %>");
$("#span_sofapplication_description").css('color','#ff0000');
$("#span_sofapplication_description").focus();
return false;
}
else if(name.length <= 500)
{
$("#span_sofapplication_description").text("<%= l(:label_field_correct) %>");
$("#span_sofapplication_description").css('color','#008000');
return true;
}
else
{
$("#span_sofapplication_description").text("<%= l(:label_work_description_condition) %>");
$("#span_sofapplication_description").css('color','#ff0000');
$("#span_sofapplication_description").focus();
return false;
}
}
//验证运行平台 //验证运行平台
function regexWorkdescription() function regexWorkdescription()
{ {
var workDescription = $("#softapplication_android_min_version_available").val(); var workDescription = $("#softapplication_android_min_version_available").val();
if(workDescription.length ==0) if(workDescription.length ==0)
{ {
$("#spane_workdescription_notice").text("运行平台不能为空"); $("#spane_workdescription_notice").text("<%= l(:label_no_softapplication_platform) %>");
$("#spane_workdescription_notice").css('color','#ff0000'); $("#spane_workdescription_notice").css('color','#ff0000');
return false; return false;
} }
if(workDescription.length <= 125) if(workDescription.length <= 125)
{ {
$("#spane_workdescription_notice").text("填写正确"); $("#spane_workdescription_notice").text("<%= l(:label_field_correct) %>");
$("#spane_workdescription_notice").css('color','#008000'); $("#spane_workdescription_notice").css('color','#008000');
return true; return true;
} }
else else
{ {
$("#spane_workdescription_notice").text("运行平台超过125个汉字"); $("#spane_workdescription_notice").text("<%= l(:label_work_platform_condition) %>");
$("#spane_workdescription_notice").css('color','#ff0000'); $("#spane_workdescription_notice").css('color','#ff0000');
return false; return false;
} }
@ -77,7 +103,7 @@
//提交验证 //提交验证
function submit_new_softapplication() function submit_new_softapplication()
{ {
if(regexName() && regexWorkdescription() && regexDevelopers()) if(regexName() && regexDescription() && regexDevelopers())
{ {
$("#new_softapplication").submit(); $("#new_softapplication").submit();
} }
@ -90,71 +116,39 @@
<tr style="width:700px; margin-left: -10px;"> <tr style="width:700px; margin-left: -10px;">
<span><%= l(:label_work_name) %></span> <span><%= l(:label_work_name) %></span>
<span class="contest-star"> * </span>: <span class="contest-star"> * </span>:
<td>
<%= f.text_field :name, <%= f.text_field :name,
:required => true, :required => true,
:size => 60, :size => 60,
:style => "width:320px;", :style => "width:320px;",
:onblur => "regexName();" :onblur => "regexName();"
%> %>
</td>
<span style="font-size: 10px;" id="spane_name_notice">(<%= l(:label_workname_lengthlimit) %>)</span> <span style="font-size: 10px;" id="spane_name_notice">(<%= l(:label_workname_lengthlimit) %>)</span>
</tr> </tr>
<br/> <br/>
<br/> <br/>
<br/> <br/>
<tr style="width:800px;">
<span><%= l(:label_running_platform) %></span>
<span class="contest-star"> * </span>: <tr style="width:800px; padding-bottom: 30px;">
<td style="width: 100px">
<%= f.text_field :android_min_version_available, <span style="margin-top: 5px; float: left; display: block;"><%= l(:label_work_description) %>&nbsp;</span>
<span style="margin-top: 5px;float: left; display: block;" class="contest-star"> * </span>
<span style="margin-top: 5px; float: left; display: block;"> &nbsp;:&nbsp;</span>
<!-- modified by longjun 将单行输入框改成多行-->
<%= f.text_area :description,
:required => true, :required => true,
:size => 60, :size => 60,
:style => "width:320px;", :rows => 3,
:onblur=>"regexWorkdescription();" :onblur => 'regexDescription();',
:style => "width:320px; "
%> %>
</td> <span style="font-size: 10px;" id="span_sofapplication_description">(<%= l(:label_work_description_lengthlimit) %>)</span>
<span style="font-size: 10px" id="spane_workdescription_notice">(<%= l(:label_workdescription_lengthlimit) %>)</span>
</tr>
<br/>
<br/>
<br/>
<tr style="width:800px;">
<span><%= l(:label_work_type) %></span>
<span class="contest-star"> * </span>:
<td style="width: 100px">
<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.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %>
</td>
<span style="font-size: 10px;display: none" id="other_span">
<%#= f.text_field :other_input, :required => true, :size => 60, :style => "width:100px;" %>
<input type="text" style="width: 120px;" id="other_input" name = "other_input"/>
</span>
</tr>
<br/>
<br/>
<br/>
<tr style="width:800px;">
<td style="padding-bottom: 290px;">
<span><%= l(:label_work_description) %></span>
<span class="contest-star"> * </span>:
</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--> <!--span style="font-size: 10px">(<%#= l(:label_workdescription_lengthlimit) %>)</span-->
</tr> </tr>
<br/> <br/>
<br/> <br/>
@ -163,14 +157,14 @@
<tr style="width:800px;"> <tr style="width:800px;">
<span><%= l(:label_softapplication_developers) %></span> <span><%= l(:label_softapplication_developers) %></span>
<span class="contest-star"> * </span>: <span class="contest-star"> * </span>:
<td style="width: 100px">
<%= f.text_field :application_developers, <%= f.text_field :application_developers,
:required => true, :required => true,
:size => 60, :size => 60,
:style => "width:320px;", :style => "width:320px;",
:onblur => 'regexDevelopers();' :onblur => 'regexDevelopers();'
%> %>
</td>
<span style="font-size: 10px" id="span_softapplication_application_developers"> <span style="font-size: 10px" id="span_softapplication_application_developers">
(<%= l(:label_workdescription_lengthlimit) %>) (<%= l(:label_workdescription_lengthlimit) %>)
</span> </span>

View File

@ -56,7 +56,7 @@
<div class="sidebar-forums"> <div class="sidebar-forums">
<div class="forums-line"> <div class="forums-line">
<div class="forums-title"><%= @forum.name %></div> <div class="forums-title"><%= @forum.name %></div>
<div class="forums-description"><%= textilizable @forum.description %></div> <div class="forums-description"><%= textAreailizable @forum.description %></div>
</div> </div>
<!--informations--> <!--informations-->
<div class="formus-first-title" >创建人信息</div> <div class="formus-first-title" >创建人信息</div>

View File

@ -2000,8 +2000,15 @@ zh:
label_work_deposit_project_url: 托管项目网址 label_work_deposit_project_url: 托管项目网址
label_work_deposit_project: 托管项目 label_work_deposit_project: 托管项目
label_softapplication_name_condition: 25个汉字以内50个字符 label_softapplication_name_condition: 25个汉字以内50个字符
label_softapplication_description_condition: 125个汉字以内 label_softapplication_description_condition: 125个汉字以内,开发人员用,隔开
label_work_description_lengthlimit: 500个汉字以内
label_softapplication_developers_condition: 开发人员超过125个汉字 label_softapplication_developers_condition: 开发人员超过125个汉字
label_no_softapplication_name: 作品名称不能为空
label_work_name_condition: 作品名称超过25个汉字
label_no_softapplication_description: 作品简介不能为空
label_work_description_condition: 作品简介名称超过500个汉字
label_no_softapplication_platform: 运行平台不能为空
label_work_platform_condition: 运行平台超过125个汉字
label_no_softapplication_developers: 开发人员不能为空 label_no_softapplication_developers: 开发人员不能为空
label_user_login_softapplication_board: 您还没有登录,请登录后参与应用评价。 label_user_login_softapplication_board: 您还没有登录,请登录后参与应用评价。
label_contest_description_no: 暂无描述。 label_contest_description_no: 暂无描述。
@ -2043,7 +2050,7 @@ zh:
label_attending_contest: 参加竞赛 label_attending_contest: 参加竞赛
label_new_attendingcontest_work: 新建参赛作品 label_new_attendingcontest_work: 新建参赛作品
label_workname_lengthlimit: 25个汉字以内 label_workname_lengthlimit: 25个汉字以内
label_workdescription_lengthlimit: 125个汉字以内 label_workdescription_lengthlimit: 125个汉字以内,用英文逗号隔开
label_please_input_password: 请输入竞赛密码 label_please_input_password: 请输入竞赛密码
label_please_select_project: 请选择项目 label_please_select_project: 请选择项目
label_upload_softworkpacket_photo: 上传作品软件包和作品截图 label_upload_softworkpacket_photo: 上传作品软件包和作品截图

View File

@ -0,0 +1,13 @@
class Change225BidData < ActiveRecord::Migration
def up
bid = Bid.find 225
bid.proportion = 60
bid.save
end
def down
bid = Bid.find 225
bid.proportion = 60
bid.save
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140916005319) do ActiveRecord::Schema.define(:version => 20140922032830) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false