将contest 中的中文转换成zh.yml中的标签

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2014-09-17 14:58:13 +08:00
parent 8c19ec8aa0
commit 0e07bed1ad
14 changed files with 114 additions and 67 deletions

Binary file not shown.

View File

@ -54,39 +54,29 @@ class ContestsController < ApplicationController
case params[:contest_sort_type]
when '0'
# modified by longjun
# never use unless and else
# never use unless and else, 将下面重复操作模块化放在private下
# unless @offset == 0
if @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
# if @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
@contests = index_page_sort(@offset, @limit, @contest_count, @contests, 'contests.commit')
# 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
@contests = index_page_sort(@offset, @limit, @contest_count, @contests, 'contests.created_on')
@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
# modified by longjun
# 目前只有 0 1 两个sort_type
# when '2'
else
limit = @contest_count % @limit
limit = @limit if limit == 0
@contests = @contests.offset(@offset).limit(@limit).all.reverse
end
# end longjun
@contests = index_page_sort(@offset, @limit, @contest_count, @contests, '')
@s_state = 0
end
else
@ -723,5 +713,20 @@ class ContestsController < ApplicationController
end
end
# added by longjun
# 将index页面中分页排序的方法抽离出来
def index_page_sort(offset, limit, contest_count, contests, contest_sort_by)
# modified by longjun
# never use unless and else
# unless @offset == 0
if offset != 0
contests = contests.reorder(contest_sort_by).offset(offset).limit(limit).all.reverse
else
limit = contest_count % limit
limit = limit if limit == 0
contests = contests.reorder(contest_sort_by).offset(offset).limit(limit).all.reverse
end
contests
end
end

View File

@ -14,7 +14,7 @@
</td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_innovate), welcome_contest_path %> > 详情</td>
<%=link_to l(:label_contest_innovate), welcome_contest_path %> > l(:label_details)</td>
</tr>
</table>
</div>

View File

@ -41,20 +41,20 @@
<tr>
<td class="font_lighter">
<!-- <span class="font_lighter">
<%= l(:label_contest_project,
<%#= l(:label_contest_project,
:count => contest.contesting_projects.count)
%>
(<strong><span style="font-size: 17px">
<%= link_to(contest.contesting_projects.count,
<%#= link_to(contest.contesting_projects.count,
show_project_contest_path(contest),
:target => "_blank")
%></span></strong>)</span>
<span class="font_lighter">
<%= l(:label_contest_softapplication,
<%#= l(:label_contest_softapplication,
:count => contest.contesting_softapplications.count)
%>
(<strong><span style="font-size: 17px">
<%= link_to(contest.contesting_softapplications.count,
<%#= link_to(contest.contesting_softapplications.count,
show_softapplication_contest_path(contest),
:target => "_blank")
%>
@ -77,7 +77,7 @@
<%= l(:label_contest_work,
:count => contest.contesting_softapplications.count)
%>
(<strong>
(<strong>
<span style="font-size: 17px">
<%= link_to(contest.contesting_softapplications.count,
show_attendingcontest_contest_path(contest),
@ -100,7 +100,7 @@
<div class="bid-description" style="border-left: 1px solid #d9d8d8; border-bottom: 1px solid #d9d8d8; padding-left: 20px; padding-bottom: 10px; margin-bottom: 20px;">
<table width="100%">
<tr>
<!-- <td> <%= contest.description%> </td> -->
<!-- <td> <%#= contest.description%> </td> -->
</tr>
</table>
</div>

View File

@ -62,7 +62,7 @@
<!-- 设置奖项设置的打开 关闭开关-->
</p>
<!-- <em class="info" style="margin-left:95px;"><%= l(:text_contest_reward) %></em> -->
<!-- <em class="info" style="margin-left:95px;"><%#= l(:text_contest_reward) %></em> -->
<p>
<%= f.text_field :deadline,
:required => true,

View File

@ -78,7 +78,9 @@
<%= l(:label_contest_user) %>
<% unless c_project.user.nil? %>
<!-- modified by zjc 添加超链接 -->
<%= link_to c_project.user.lastname + c_project.user.firstname,user_path(c_project.user) %>
<%= link_to c_project.user.lastname + c_project.user.firstname,
user_path(c_project.user)
%>
<% end %>
</strong>
@ -101,5 +103,7 @@
</table>
<% end %>
<% 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>

View File

@ -1,6 +1,6 @@
<%#= error_messages_for 'softapplication' %>
<script type="text/javascript">
<script type="text/javascript" xmlns="http://www.w3.org/1999/html">
//验证作品名称
function regexName()
{
@ -57,19 +57,19 @@
var workDescription = $("#softapplication_application_developers").val();
if(workDescription.length ==0)
{
$("#span_softapplication_application_developers").text("开发人员不能为空");
$("#span_softapplication_application_developers").text(<%= l(:label_no_softapplication_developers) %>);
$("#span_softapplication_application_developers").css('color','#ff0000');
return false;
}
if(workDescription.length <= 125)
{
$("#span_softapplication_application_developers").text("填写正确");
$("#span_softapplication_application_developers").text(<%= l(:label_field_correct) %>);
$("#span_softapplication_application_developers").css('color','#008000');
return true;
}
else
{
$("#span_softapplication_application_developers").text("开发人员超过125个汉字");
$("#span_softapplication_application_developers").text(<%= l(:label_softapplication_developers_condition) %>);
$("#span_softapplication_application_developers").css('color','#ff0000');
return false;
}
@ -143,8 +143,10 @@
<br/>
<tr style="width:800px;">
<span><%= l(:label_work_description) %></span>
<span class="contest-star"> * </span>:
<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,

View File

@ -1,8 +1,9 @@
$("#<%=object_id%>").replaceWith('<%= escape_javascript join_in_competition(@contest, user) %>');
<% if @state %>
// modified by longjun 去掉中文引用zh.yml中的标签
<% if @state == 0 %>
alert("加入成功")
alert(<%= l(:notice_successful_join) %>)
<% else %>
alert("密码错误")
alert(<%= l(:notice_account_wrong_password) %>)
<% end %>
<% end %>

View File

@ -9,9 +9,13 @@
<% 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), :controller => 'contests', :action => 'new_contest' %>
-->
<%= link_to(l(:label_newtype_contest), contest_new_contest_path, :class => 'icon icon-add', :target => "_blank") %>
<%= link_to(l(:label_newtype_contest),
contest_new_contests_path,
:class => 'icon icon-add',
:target => "_blank")
%>
<!-- end longjun -->
<% end %>
<% end %>
@ -20,17 +24,17 @@
<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" %>
<%= submit_tag l(:label_search),
:class => "enterprise",
:name => "contests_search"
%>
</div>
</td>
</tr>
<tr>
<td style="padding-left: 8px">
<a>
<!--
modified by longjun
<%=link_to request.host()+"/contests", :controller => 'contests', :action => 'index' %>
-->
<!--modified by longjun-->
<%= link_to request.host()+"/contests", contests_path %>
<!-- end longjun -->
</a>
@ -39,9 +43,9 @@
<%=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' %>
-->
<%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %>
<%=link_to l(:label_contest_innovate), contests_path %>
<!-- end longjun -->
</td>
</tr>
@ -51,7 +55,9 @@
<% if @contests.size > 0%>
<%= sort_contest(@s_state)%>
<div id="bid-show">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
<%= render :partial => 'contest_list',
:locals => {:contests => @contests, :contest_pages => @contest_pages}
%>
</div>
<% else %>
<%= render :partial => "layouts/no_content"%>

View File

@ -1,6 +1,8 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<div style="margin-left: 20px;">
<span class="portrait"><%= image_tag(url_to_avatar(@contest.author), :class => "avatar")%></span>
<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,

View File

@ -3,7 +3,9 @@
<ul class="list_watch"><li>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(user), :class => "avatar") %></td>
<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">
@ -15,15 +17,17 @@
<tr>
<td colspan="2" width="580px" ><p class="font_description">
<% unless user.memberships.empty? %>
<%= l(:label_x_contribute_to, :count => user.memberships.count) %>
<% for member in user.memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<%= l(:label_x_contribute_to, :count => user.memberships.count) %>
<% for member in user.memberships %>
<%= link_to_project(member.project) %>
<%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<% end %>
</p></td>
</tr>
<tr>
<td width="200" align="right" class="font_lighter"><%= l(:label_user_joinin) %><%= format_date(user.created_on) %>
<td width="200" align="right" class="font_lighter">
<%= l(:label_user_joinin) %><%= format_date(user.created_on) %>
</td>
</tr>
</table></td>

View File

@ -13,12 +13,20 @@
<tr>
<!-- modified by bai 显示人名全称-->
<td colspan="2" valign="top" width="50" >
<%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :title => "#{user.show_name}" %>
<%= link_to image_tag(url_to_avatar(user), :class => "avatar"),
user_path(user),
:title => "#{user.show_name}"
%>
</td>
<td>
<table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><%= content_tag "div", link_to(user.show_name, user_path(user)), :class => "project_avatar_name" , :title => "#{user.show_name}" %>
<td colspan="2" valign="top">
<%= content_tag "div",
link_to(user.show_name, user_path(user)),
:class => "project_avatar_name" ,
:title => "#{user.show_name}"
%>
<!-- added by bai 增加了学员的学号 -->
<% if (im_watching_student_id? @contest) && user.user_extensions.identity.to_i.eql?(1) %>
<%= l(:label_bidding_user_studentcode) %> <%= user.user_extensions.student_id%>

View File

@ -66,7 +66,8 @@
:update => "contesting_softapplication_list",
:complete => '$("#put-bid-form").hide();' do |f|
%>
<table id="contesting_table" border="0" width="100%" style="margin-left: 40px;"> <!--该table为点击我要参加后弹出的-->
<!--该table为点击我要参加后弹出的-->
<table id="contesting_table" border="0" width="100%" style="margin-left: 40px;">
<tr>
<td>
<%= select_tag 'contest',
@ -90,7 +91,17 @@
</tr>
<tr>
<td><%= f.text_area :contest_message, :id => "contest_message", :required => true, :rows => 4, :cols => 40, :placeholder => l(:label_bid_reason), :style => "resize: none;", :class => 'noline'%></td>
<td>
<%= f.text_area :contest_message,
:id => "contest_message",
:required => true,
:rows => 4,
:cols => 40,
:placeholder => l(:label_bid_reason),
:style => "resize: none;",
:class => 'noline'
%>
</td>
</tr>
<tr>

View File

@ -173,6 +173,7 @@ zh:
notice_successful_delete: 删除成功
notice_failed_delete: 删除失败
notice_successful_connection: 连接成功
notice_successful_join: 加入成功
notice_file_not_found: 您访问的页面不存在或已被删除。
notice_locking_conflict: 数据已被另一位用户更新
notice_not_authorized: 对不起,您无权访问此页面。
@ -2003,9 +2004,12 @@ zh:
label_work_deposit_project: 托管项目
label_softapplication_name_condition: 25个汉字以内50个字符
label_softapplication_description_condition: 125个汉字以内
label_softapplication_developers_condition: 开发人员超过125个汉字
label_no_softapplication_developers: 开发人员不能为空
label_user_login_softapplication_board: 您还没有登录,请登录后参与应用评价。
label_contest_description_no: 暂无描述。
label_no_contest_softapplication: 暂无参赛应用
label_field_correct: 填写正确
label_button_ok: 确定
label_tags_contest: 竞赛标签
label_tags_contest: 竞赛名称