diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 661a305bd..deeafaa7d 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -145,6 +145,13 @@ class AccountController < ApplicationController else register_manually_by_administrator(@user) end + + #added by bai + unless @user.id.nil? + UserExtensions.create(:identity => params[:identity].to_i, :user_id => @user.id) + end + #end + end end end diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 62a8e4a4e..d5a4834a4 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -50,12 +50,46 @@ class MyController < ApplicationController def account @user = User.current @pref = @user.pref + + + + # if @user.user_extensions.nil? + # se = UserExtebsions.new + # se.user_id = @user.id + # se.occupation = params[:occupation] + # se.save + # else + # # = @user.user_extensions + # end + # @occupation = UserExtensions.occupation + # @occupation.save if request.post? @user.safe_attributes = params[:user] @user.pref.attributes = params[:pref] @user.pref[:no_self_notified] = (params[:no_self_notified] == '1') + + # # UserExtensions.create(:user_id => @user.id, :occupation => params[:occupation]) + # else + # ue = @user.user_extensions + # ue.occupation = params[:occupation] + # ue.save + # end + + # added by bai + if @user.UserExtensions.nil? + se = UserExtensions.new + se.user_id = @user.id + se.occupation = params[:occupation] + se.save + else + se = @user.user_extensions + se.occupation = params[:occupation] + se.save + end + # end + if @user.save @user.pref.save @user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : []) diff --git a/app/models/user_extensions.rb b/app/models/user_extensions.rb index 47578e66f..11df8958d 100644 --- a/app/models/user_extensions.rb +++ b/app/models/user_extensions.rb @@ -1,6 +1,6 @@ class UserExtensions < ActiveRecord::Base belongs_to :user - attr_accessible :user_id,:birthday,:brief_introduction,:gender,:location,:occupation,:work_experience,:zip_code + attr_accessible :user_id,:birthday,:brief_introduction,:gender,:location,:occupation,:work_experience,:zip_code,:identity #this method was used to update the table user_extensions def update_user_extensions(birthday=nil,brief_introduction=nil, gender=nil,location=nil,occupation=nil,work_experience=nil,zip_code=nil) diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb index 8264a4891..295d58426 100644 --- a/app/views/account/register.html.erb +++ b/app/views/account/register.html.erb @@ -20,14 +20,21 @@ <%="#{l(:label_mail_attention)} "%>

<%= f.select :language, lang_options_for_select %>

+ + +

<%= l(:label_identity) %><%= select_tag 'identity', "".html_safe %>

+ + <% if Setting.openid? %>

<%= f.text_field :identity_url %>

<% end %> + <% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %>

<%= custom_field_tag_with_label :user, value %>

<% end %> + <%= submit_tag l(:button_submit) %> <% end %> diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 9ca125368..9a89af75c 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -37,6 +37,8 @@

+

<% if Setting.openid? %>

<%= f.text_field :identity_url %> diff --git a/app/views/projects/show_new.html.erb b/app/views/projects/show_new.html.erb index 25ee6e702..caa8bf94a 100644 --- a/app/views/projects/show_new.html.erb +++ b/app/views/projects/show_new.html.erb @@ -44,7 +44,12 @@ <% for tracker in @trackers %>

  • <%= link_to h(tracker.name), project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id) %>: <%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i, - :total => @total_issues_by_tracker[tracker].to_i) %> + :total => @total_issues_by_tracker[tr +
  • <%= l(:default_tracker_bug) %>
  • + <% end %> + <% if tracker.[4]%> +
  • <%= l(:default_tracker_mission) %>
  • + <% end %> <% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 8e4799ae4..6bd74fdb8 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -32,13 +32,15 @@
    <%= link_to l(:label_find_all_comments), respond_path(e.act_id) %><%= l(:label_comments_count, :count => e.act.commit)%>
    <% when 'Journal' %> + <% if e.user == User.current%> - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to("项目:"+act.issue.project.name, project_path(act.issue.project.identifier))%> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier))%> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> <% else %> - <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to("项目:"+act.issue.project.name, project_path(act.issue.project.identifier))%> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> + <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to( l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier))%> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> <% end %> +

    @@ -117,13 +119,15 @@

    <%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %><%= l(:label_comments_count, :count => e.act.comments_count)%>
    <% when 'Issue' %> + <% if e.user == User.current%> - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to("项目:"+act.project.name, project_path(act.project.identifier))%> <%= link_to format_activity_title("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to(l(:label_activity_project)+act.project.name, project_path(act.project.identifier))%> <%= link_to format_activity_title("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> <% else %> - <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to("项目:"+act.project.name, project_path(act.project.identifier))%> <%= link_to format_activity_title("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> + <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to(l(:label_activity_project)+act.project.name, project_path(act.project.identifier))%> <%= link_to format_activity_title("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> <% end %> +

    diff --git a/config/locales/en.yml b/config/locales/en.yml index f993c16a6..552e029e7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -483,6 +483,7 @@ en: label_user_new: New user label_user_anonymous: Anonymous label_project: Project + label_activity_project: 'Project: ' #added by bai label_project_new: New project label_project_plural: Projects label_x_projects: diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 8d664ddcd..373e080ce 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -222,7 +222,6 @@ zh: field_firstname: 名字 field_lastname: 姓氏 field_mail: 邮件地址 - field_job_category: 职业 # added by bai field_filename: 文件 field_filesize: 大小 field_downloads: 下载次数 @@ -442,6 +441,7 @@ zh: label_user_new: 新建用户 label_user_anonymous: 匿名用户 label_project: 项目 + label_activity_project: '项目: ' #added by bai label_project_new: 新建项目 label_project_plural: 项目 label_x_projects: @@ -1354,7 +1354,7 @@ zh: field_birthday: 生日 field_brief_introduction: 个人简介 field_location: 现住址 - field_occupation: 学校/公司 + field_occupation: 工作单位 field_work_experience: 工作经验(年) field_zip_code: 邮编 label_reward: 奖励: @@ -1418,5 +1418,18 @@ zh: button_projects_feedback_respond: 回复 label_projects_feedback_respond_content: 请输入回复内容 label_user_create_project: 创建了 +<<<<<<< Updated upstream +#added by bai +======= +>>>>>>> Stashed changes + label_identity: 身份 + label_teacher: 教师 + label_student: 学生 + label_other: 其他 +<<<<<<< Updated upstream +#end +======= + +>>>>>>> Stashed changes diff --git a/db/schema.rb b/db/schema.rb index ddd0ce85c..02014643a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130828080407) do +ActiveRecord::Schema.define(:version => 20130911140205) do create_table "a_user_watchers", :force => true do |t| t.string "name" @@ -77,6 +77,7 @@ ActiveRecord::Schema.define(:version => 20130828080407) do t.string "description" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.integer "reward" end create_table "bids", :force => true do |t| @@ -161,6 +162,18 @@ ActiveRecord::Schema.define(:version => 20130828080407) do add_index "comments", ["author_id"], :name => "index_comments_on_author_id" add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" + create_table "courses", :force => true do |t| + t.integer "tea_id" + t.string "name" + t.integer "state" + t.string "code" + t.integer "time" + t.string "extra" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "location" + end + create_table "custom_fields", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 30, :default => "", :null => false @@ -246,6 +259,11 @@ ActiveRecord::Schema.define(:version => 20130828080407) do add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true + create_table "homework_for_courses", :force => true do |t| + t.integer "project_id" + t.integer "bid_id" + end + create_table "issue_categories", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "name", :limit => 30, :default => "", :null => false @@ -476,6 +494,9 @@ ActiveRecord::Schema.define(:version => 20130828080407) do t.integer "project_id" end + add_index "project_statuses", ["changesets_count"], :name => "index_project_statuses_on_changesets_count" + add_index "project_statuses", ["watchers_count"], :name => "index_project_statuses_on_watchers_count" + create_table "project_tags", :force => true do |t| t.integer "project_id" t.integer "tag_id" @@ -578,6 +599,13 @@ ActiveRecord::Schema.define(:version => 20130828080407) do t.datetime "updated_at", :null => false end + create_table "students_for_courses", :force => true do |t| + t.integer "student_id" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "taggings", :force => true do |t| t.integer "tag_id" t.integer "taggable_id" @@ -595,6 +623,16 @@ ActiveRecord::Schema.define(:version => 20130828080407) do t.string "name" end + create_table "teachers", :force => true do |t| + t.string "tea_name" + t.string "location" + t.integer "couurse_time" + t.integer "course_code" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "extra" + end + create_table "time_entries", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false @@ -645,6 +683,7 @@ ActiveRecord::Schema.define(:version => 20130828080407) do t.integer "zip_code" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.integer "identity" end create_table "user_preferences", :force => true do |t| diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index ad8883d19..3c9e21a6b 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -1742,7 +1742,7 @@ input[type='text'].noline { font-family:微软雅黑; /*modify by men*/ border: #d5dee9 1px solid; font-size: 12px; - color: #ACAEB1; + color: #818283; # modified by bai padding: 9px 5px; width: 98%; cursor: text;