完善用户资料模块,用户主页课程栏、留言栏、项目栏和标签模块国际化;对一些存储在数据表中的固定的中文属性,比如学期,职称,在helper和model中定义方法封装;平台导航模块,包括各模块内部导航的国际化;课程平台模块国际化整理和修改,去除重复功能标签

memcached_alan
whimlex 10 years ago
parent 22aae1910b
commit 115eb38a02

@ -351,10 +351,28 @@ module CoursesHelper
str
end
# added by nwb
# added by meng
# 课程time+term简写2014.春/2014.秋)国际化输出
def get_course_term course
str = ( course.try(:time).to_s << '.' << course.try(:term).to_s )
str[0..-4]
strterm = course.try(:term).to_s
if !(User.current.language == 'zh')
strterm == '春季学期' ? strterm = 'spring term' : strterm = 'autumn term'
str = ( course.try(:time).to_s << '.' << strterm )
str[0..-6]
else
str = ( course.try(:time).to_s << '.' << strterm )
str[0..-4]
end
end
# added by meng
# 课程term春季学期/秋季学期)国际化输出
def get_course_term_locales course
str = course.try(:term).to_s
if !(User.current.language == 'zh')
str == '春季学期' ? str = ' ' + 'spring term' : str = ' ' + 'autumn term'
end
return str
end
def members_to_user_ids members

@ -341,7 +341,7 @@ module WelcomeHelper
end
str
rescue Exception => e
str << content_tag("span", l(:field_user_active_unknow))
str << content_tag("span", l('user.active.unknow'))
end
def show_event_reply event

@ -33,16 +33,32 @@ class UserExtensions < ActiveRecord::Base
return self.brief_introduction
end
# added by bai
# added by meng
def show_identity
if self.identity == 0
user_identity = '教师'
if User.current.language == 'zh'
user_identity = '教师'
else
user_identity = 'Teacher'
end
elsif self.identity == 1
user_identity = '学生'
if User.current.language == 'zh'
user_identity = '学生'
else
user_identity = 'Student'
end
elsif self.identity == 2
user_identity = '企业'
if User.current.language == 'zh'
user_identity = '企业'
else
user_identity = 'Enterprise'
end
elsif self.identity == 3
user_identity = '开发者'
if User.current.language == 'zh'
user_identity = '开发者'
else
user_identity = 'Developer'
end
else
user_identity = ''
end

@ -12,7 +12,7 @@
<tr>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
高校课程实践社区
<%= l(:label_courses_community)%>
</a>
</td>
<td class="location-list">

@ -7,7 +7,7 @@
<tr>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
高校课程实践社区
<%= l(:label_courses_community)%>
</a>
</td>
<td class="location-list">

@ -37,7 +37,7 @@
:description_placeholder => l(:label_optional_description)
} %>
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
<label class="f_l ml10 c_grey">
<label class="f_l ml10 c_grey" style=" margin-top: 3px;">
<span id="upload_file_count">
<%= l(:label_no_file_uploaded)%>
</span>

@ -1,6 +1,6 @@
$(function(){
$("#button1").click(function(){
myTips("您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!","success");
myTips(<%= l(:label_feedback_success)%>,"success");
});
})

@ -1,13 +1,13 @@
<%= form_tag({:controller => 'homework_attach', :action => 'add_jour_reply'}, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'noline',
:style => "resize: none;", :rows => 4,
:placeholder => l(:label_projects_feedback_respond_content),
:placeholder => l(:label_feedback_respond_content),
:maxlength => 250 %>
<span style="float: left; margin-top: 1px; margin-right: 4px;"></span>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= submit_tag l(:button_projects_feedback_respond),
<%= submit_tag l(:button_feedback_respond),
:name => nil , :class => "enterprise", :style => "float: right; margin-top: 1px; margin-right: 4px;"%>
<% end %>

@ -25,7 +25,7 @@
:homework_id =>homework.id },
:remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
<% end %>
<%= link_to l(:label_projects_feedback_respond),'',
<%= link_to l(:label_newfeedback_respone),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), ''); $('##{ids} textarea') ;return false;"}
%>
</span>

@ -11,7 +11,7 @@
<div class="recall_con">
<% id = 'project_respond_form_'+ reply.id.to_s %>
<%= link_to reply.user.name, user_path(reply.user) %>
回复
<%= l(:label_reply_to)%>
<% parent_jour = JournalsForMessage.find reply.m_reply_id %>
<% if show_name && parent_jour %>
<%= link_to parent_jour.user.name, user_path(parent_jour.user) %>
@ -34,7 +34,7 @@
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
<% end %>
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'',
<%= link_to l(:label_newfeedback_respone),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
<% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: -->
</span>

@ -42,7 +42,7 @@
<% ids = 'project_respond_form_'+ jour.id.to_s%>
<div class="ping_disfoot">
<span>
<%= link_to l(:label_projects_feedback_respond),'',
<%= link_to l(:label_newfeedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), ''); $('##{ids} textarea') ;return false;"}
%>
</span>

@ -65,7 +65,7 @@
</span>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span>
<%= link_to l(:label_projects_feedback_respond),'',
<%= link_to l(:label_newfeedback_respone),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"}
%>
<% if journal.user==User.current|| User.current.admin? %>

@ -7,7 +7,7 @@
<tr>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
高校课程实践社区
<%= l(:label_courses_community)%>
</a>
</td>
<td style="width: auto; color: #15bccf">

@ -37,7 +37,7 @@
<tr>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
高校课程实践社区
<%= l(:label_courses_community)%>
</a>
</td>
<td style="color: #15bccf">
@ -86,7 +86,7 @@
<td>
<p class="top-content-list">
<%= link_to "主页", home_path %>
<%= link_to l(:field_homepage), home_path %>
>
<a href="http://<%= Setting.host_course%>" class="link_other_item">
<%=l(:label_courses_management_platform)%>
@ -230,7 +230,7 @@
</td>
<td class="font_lighter_sidebar">
<%= @course.time %>
<%= @course.term %>
<%= get_course_term_locales @course %>
</td>
</tr>
<!-- end -->

@ -29,7 +29,7 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">软件项目托管社区</td>
<td class="info_font" style="width: 240px; color: #15bccf"><%= l(:label_projects_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="top-content-search">

@ -50,7 +50,7 @@
<tr>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
高校课程实践社区
<%= l(:label_courses_community)%>
</a>
</td>
<td style="width: auto; color: #15bccf">

@ -33,7 +33,7 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">软件项目托管社区</td>
<td class="info_font" style="width: 240px; color: #15bccf"><%= l(:label_projects_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="top-content-search">

@ -32,7 +32,7 @@
<tr>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_name%>" style="color: #15bccf;">
软件项目托管社区
<%= l(:label_projects_community)%>
</a>
</td>
<td style="width: 430px; color: #15bccf">

@ -8,7 +8,7 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">软件项目托管社区</td>
<td class="info_font" style="width: 240px; color: #15bccf"><%= l(:label_projects_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="top-content-search">
@ -17,7 +17,7 @@
</tr>
<tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/forums", forums_path %></td>
<td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to '公共贴吧', :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name %></p></td>
<td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to l(:label_forum), :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name %></p></td>
</tr>
</table>
</div>

@ -64,7 +64,7 @@
$("#my_account_form").submit();
}
else {
parent.alert("姓氏和名字不能为空");
parent.alert("<%= l(:label_firstname_lastname_empty)%>");
}
}
function get_options(value) {
@ -320,7 +320,7 @@
<p style="width:400px;padding-left: 55px;"><label style="margin-right: 5px;" for="userProvince"><%= l(:label_location) %></label>
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince" class="location">
<option value="">--请选择省份--</option>
<option value=""><%= l('location.select.click')%></option>
<option value="北京">北京</option>
<option value="上海">上海</option>
<option value="广东">广东</option>

@ -19,7 +19,7 @@
<div>
<%= render :partial => 'news/news', :collection => @news %>
<div class=more><%= link_to"更多",:contoller=>'project',:action=>'index'%></div>
<div class=more><%= link_to l(:button_more),:contoller=>'project',:action=>'index'%></div>
</div>
<% end %>
<%= call_hook(:view_projects_show_right, :project => @project) %>
@ -47,7 +47,7 @@
</li> <% end -%>
</ul>
<% end -%>
<div class=more><%= link_to"更多",:contoller=>'project',:action=>'index'%></div>
<div class=more><%= link_to l(:button_more),:contoller=>'project',:action=>'index'%></div>
</div>

@ -2,12 +2,12 @@
<%= text_area_tag 'project_respond', "",
:class => 'noline', :required => true,
:style => "resize: none;", :rows => 3,
:placeholder => l(:label_projects_feedback_respond_content),
:placeholder => l(:label_feedback_respond_content),
:maxlength => 250 %>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "enterprise"%>
<%= submit_tag l(:button_feedback_respond), :name => nil , :class => "enterprise"%>
<%end%>

@ -1,8 +1,8 @@
<div style="width: 57%;margin: 10px auto;">
<%= form_tag( search_stores_path, method: 'post') do %>
<%= text_field_tag 'name', params[:name], placeholder:'请输入要搜索的关键字', name: "name", :class => 'blueinputbar', :style => 'width:450px;'%>
<%= text_field_tag 'name', params[:name], placeholder: l('welcome.search.information'), name: "name", :class => 'blueinputbar', :style => 'width:450px;'%>
&nbsp;&nbsp;
<%= submit_tag l(:label_search), :class => "enterprise"%>
<% end %>
<div class='font_lighter' style="display: inline-block; margin-top:3px;">全站文件搜索。不会搜索私有项目中的内容。</div>
<div class='font_lighter' style="display: inline-block; margin-top:3px;"><%= l(:label_resources_search_all)%></div>
</div>

@ -1,9 +1,9 @@
<div>&nbsp;&nbsp;&nbsp; 踩别人的帖子数量 * (-2) = <%= option_num.tread %> * (-2) = <%= option_num.tread * (-2) %></div>
<div>&nbsp;&nbsp;&nbsp; 帖子被一级会员顶的次数 * 4 = <%= option_num.praise_by_one %> * 4 = <%= option_num.praise_by_one * 4 %></div>
<div>&nbsp;&nbsp;&nbsp; 帖子被二级会员顶的次数 * 6 = <%= option_num.praise_by_two %> * 6 = <%= option_num.praise_by_two * 6 %></div>
<div>&nbsp;&nbsp;&nbsp; 帖子被三级会员顶的次数 * 8 = <%= option_num.praise_by_three %> * 8 = <%= option_num.praise_by_three * 8 %></div>
<div>&nbsp;&nbsp;&nbsp; 帖子被一级会员踩的次数 * (-2) = <%= option_num.tread_by_one %> * (-2) = <%= option_num.tread_by_one * (-2) %></div>
<div>&nbsp;&nbsp;&nbsp; 帖子被二级会员踩的次数 * (-4) = <%= option_num.tread_by_two %> * (-4) = <%= option_num.tread_by_two * (-4) %></div>
<div>&nbsp;&nbsp;&nbsp; 帖子被三级会员踩的次数 * (-6) = <%= option_num.tread_by_three %> * (-6) = <%= option_num.tread_by_three * (-6) %></div>
<div>&nbsp;&nbsp;&nbsp; 技术得分 = <%= option_num.tread * (-2) %> + <%= option_num.praise_by_one * 4 %> + <%= option_num.praise_by_two * 6 %> + <%= option_num.praise_by_three * 8 %> + (<%= option_num.tread_by_one * (-2) %>) + ( <%= option_num.tread_by_two * (-4) %>) + (<%= option_num.tread_by_three * (-6) %>) = <%= skill(option_num) %> </div>
<div>&nbsp;&nbsp;&nbsp; <%= l('userscore.skill.tramples')%> * (-2) = <%= option_num.tread %> * (-2) = <%= option_num.tread * (-2) %></div>
<div>&nbsp;&nbsp;&nbsp; <%= l('userscore.skill.like.level1')%> * 4 = <%= option_num.praise_by_one %> * 4 = <%= option_num.praise_by_one * 4 %></div>
<div>&nbsp;&nbsp;&nbsp; <%= l('userscore.skill.like.level2')%> * 6 = <%= option_num.praise_by_two %> * 6 = <%= option_num.praise_by_two * 6 %></div>
<div>&nbsp;&nbsp;&nbsp; <%= l('userscore.skill.like.level3')%> * 8 = <%= option_num.praise_by_three %> * 8 = <%= option_num.praise_by_three * 8 %></div>
<div>&nbsp;&nbsp;&nbsp; <%= l('userscore.skill.dislike.level1')%> * (-2) = <%= option_num.tread_by_one %> * (-2) = <%= option_num.tread_by_one * (-2) %></div>
<div>&nbsp;&nbsp;&nbsp; <%= l('userscore.skill.dislike.level2')%> * (-4) = <%= option_num.tread_by_two %> * (-4) = <%= option_num.tread_by_two * (-4) %></div>
<div>&nbsp;&nbsp;&nbsp; <%= l('userscore.skill.dislike.level3')%> * (-6) = <%= option_num.tread_by_three %> * (-6) = <%= option_num.tread_by_three * (-6) %></div>
<div>&nbsp;&nbsp;&nbsp; <%= l(:label_user_score_of_skill)%> = <%= option_num.tread * (-2) %> + <%= option_num.praise_by_one * 4 %> + <%= option_num.praise_by_two * 6 %> + <%= option_num.praise_by_three * 8 %> + (<%= option_num.tread_by_one * (-2) %>) + ( <%= option_num.tread_by_two * (-4) %>) + (<%= option_num.tread_by_three * (-6) %>) = <%= skill(option_num) %> </div>

@ -57,7 +57,7 @@
</span>
<span style="float: right; padding-left: 8px">
<%= l(:label_course_term) %>
: <%= @course.time %><%= @course.term %>
: <%= @course.time %><%= get_course_term_locales @course %>
</span>
<% end %>
</td>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save