1、修复了丢失的国际化

2、增加了性别
This commit is contained in:
baiyu 2013-09-12 20:19:49 +08:00
parent 7e40999e06
commit 3ae85e93ad
8 changed files with 42 additions and 8 deletions

View File

@ -148,7 +148,7 @@ class AccountController < ApplicationController
#added by bai
unless @user.id.nil?
UserExtensions.create(:identity => params[:identity].to_i, :user_id => @user.id)
UserExtensions.create(:identity => params[:identity].to_i,:gender => params[:gender].to_i, :user_id => @user.id)
end
#end

View File

@ -78,14 +78,16 @@ class MyController < ApplicationController
# end
# added by bai
if @user.UserExtensions.nil?
if @user.user_extensions.nil?
se = UserExtensions.new
se.user_id = @user.id
se.occupation = params[:occupation]
se.gender = params[:gender]
se.save
else
se = @user.user_extensions
se.occupation = params[:occupation]
se.gender = params[:gender]
se.save
end
# end

View File

@ -1,4 +1,4 @@
<h3><%=l(:label_register)%> <%=link_to l(:label_loginkk), signin_url if Setting.openid? %></h3>
<h3><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h3>
<%= labelled_form_for @user, :url => register_path do |f| %>
<%= error_messages_for 'user' %>
@ -20,9 +20,10 @@
<em class="info"><%="#{l(:label_mail_attention)} "%></em></p>
<p><%= f.select :language, lang_options_for_select %></p>
<!-- added by bai -->
<!-- added by bai 增加了身份和性别-->
<p><em class="info"><%= l(:label_identity) %><%= select_tag 'identity', "<option value = '0'>#{l(:label_teacher)}</option><option value = '1'>#{l(:label_student)}</option><option value = '2'>#{l(:label_other)}</option>".html_safe %></em></p>
<p><em class="info"><%= l(:label_gender) %><%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe %></em></p>
<!-- end -->
<% if Setting.openid? %>

View File

@ -33,7 +33,13 @@
<td>
<table>
<tr>
<td class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><%= h @user.lastname<<@user.firstname %> <%=image_tag("/images/sidebar/male.png", weight:"11px", height:"11px") %>
<td class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><%= h @user.lastname<<@user.firstname %>
<!-- added by bai -->
<% unless @user.user_extensions.nil?%>
<% if @user.user_extensions.gender == 1 %> <%=image_tag("/images/sidebar/female.png", weight:"22px", height:"22px") %>
<% else %> <%=image_tag("/images/sidebar/male.png", weight:"25px", height:"25px") %> <% end %>
<% else %> <%=image_tag("/images/sidebar/male.png", weight:"25px", height:"25px") %> <% end %>
<!-- end -->
</td>
</tr>
<tr>

View File

@ -31,14 +31,24 @@
<p style="width:400px;padding-left: 26px;">
<%= f.text_field :lastname, :required => true %>
</p>
<!-- added by bai 增加账户里的性别-->
<p><%= l(:label_gender) %><%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe %></p>
</p>
<!-- end -->
<p style="width:357px;padding-left: 26px;">
<%= f.text_field :mail, :required => true %>
</p>
<p style="width:426px;padding-left:26px;>
<%= f.select :language, :Chinese简体中文 => :zh, :English => :en%>
</p>
<!-- added by bai -->
<p><%= l(:field_occupation)%><%= text_field_tag "occupation"%>
</p>
<!-- end -->
<% if Setting.openid? %>
<p>
<%= f.text_field :identity_url %>

View File

@ -1411,3 +1411,14 @@ en:
label_in_bids: in the call
label_in_users: in the user
label_user_create_project: has created
#added by bai
label_identity: Identity
label_teacher: Teacher
label_student: Student
label_other: Other
label_gender: Gender
label_gender_male: male
label_gender_female: female
#end

View File

@ -1209,6 +1209,8 @@ zh:
#added by liuping
button_unfollow: 取消关注
button_follow: 关注
label_followers: 关注
label_responses: 留言
label_delete_confirm: 确认删除?
label_more_tags: 更多
label_tags_bid: 需求名称
@ -1424,7 +1426,9 @@ zh:
label_teacher: 教师
label_student: 学生
label_other: 其他
label_gender: 性别
label_gender_male:
label_gender_female:
#end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 14 KiB