From 1468f4a8dfea1e332157131e56b435686ba36363 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 10 Nov 2014 08:58:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=B5=84=E6=96=99=E3=80=8B=E9=A1=B5=E9=9D=A2=20Signed-off-by:?= =?UTF-8?q?=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/my_controller.rb | 6 +- app/helpers/issues_helper.rb | 2 + app/views/layouts/base_users.html.erb | 51 ++++++++++---- app/views/my/account.html.erb | 99 +++++++++++++++++++-------- config/locales/zh.yml | 1 + 5 files changed, 115 insertions(+), 44 deletions(-) diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index fa2784f22..308cb62ca 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -91,7 +91,11 @@ class MyController < ApplicationController end @se = @user.extensions - @se.school_id = params[:occupation] if params[:occupation] + if params[:occupation].to_i.to_s == params[:occupation] + @se.school_id = params[:occupation] + else + @se.occupation = params[:occupation] + end @se.gender = params[:gender] @se.location = params[:province] if params[:province] @se.location_city = params[:city] if params[:city] diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 637c92db3..dfa485a70 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -227,6 +227,7 @@ module IssuesHelper strings = [] values_by_field = {} details.each do |detail| + unless detail.property == 'attachment' if detail.property == 'cf' field_id = detail.prop_key field = CustomField.find_by_id(field_id) @@ -242,6 +243,7 @@ module IssuesHelper end end strings << show_detail(detail, no_html, options) + end end values_by_field.each do |field_id, changes| detail = JournalDetail.new(:property => 'cf', :prop_key => field_id) diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 04501532d..fafa79d32 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -223,7 +223,7 @@ <% unless @user.user_extensions.nil? %> - <% unless @user.user_extensions.identity == 2 %> + <% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %> <%= l(:field_occupation) %>: <% unless @user.user_extensions.school.nil? %> @@ -231,38 +231,59 @@ <% end %> - <% end %> + <% elsif @user.user_extensions.identity == 3 %> + + <%= l(:field_occupation) %>: + + <%= @user.user_extensions.occupation %> + + + <% end %> - <%= l(:label_location) %>:<%= @user.user_extensions.location %><%= @user.user_extensions.location_city %> + <%= l(:label_location) %>:<%= @user.user_extensions.location %><%= @user.user_extensions.location_city %> <% if @user.user_extensions.identity == 0 %> - - <%= l(:label_technical_title) %>: + + <%= l(:label_technical_title) %>: <% end %> - <% if( (@user.user_extensions.identity == 1) && (is_watching?(@user) ) )%> + <% if @user.user_extensions.identity == 1 %> + <% if(is_watching?(@user) ) %> - - <%= l(:label_bidding_user_studentcode)%>: + + <%= l(:label_bidding_user_studentcode)%>: <%= @user.user_extensions.student_id %> - <% end %> - <% else%> - - <%= l(:field_occupation) %>: - + <% else %> + + + <%= l(:label_identity)%>: + + + <%= l(:label_account_student) %> + + + + <% end %> + <% elsif @user.user_extensions.identity == 3 %> - <%= l(:label_location) %>: + + <%= l(:label_identity)%>: + + + <%= l(:label_account_developer) %> + - <% end %> + <% end %> + <% end %> diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index fc712933c..3b4221da6 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -3,6 +3,7 @@ @nav_dispaly_main_project_label = 1 @nav_dispaly_main_contest_label = 1 %> <% @nav_dispaly_forum_label = 1%> + -

<%= l(:label_location) %> +

<%= l(:label_location) %>