From a2cc191a4eda7a0452ab6cbe36fb2705d283f713 Mon Sep 17 00:00:00 2001
From: baiyu
Date: Thu, 12 Sep 2013 08:38:47 +0800
Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E2=80=9C=E6=88=91?=
=?UTF-8?q?=E7=9A=84=E8=B4=A6=E5=8F=B7=E2=80=9D=E9=87=8C=E7=9A=84=E4=BA=86?=
=?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8D=95=E4=BD=8D=202=E3=80=81=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E4=BA=86=E2=80=9C=E6=B3=A8=E5=86=8C=E2=80=9D=E9=87=8C?=
=?UTF-8?q?=E7=9A=84=E2=80=9C=E8=BA=AB=E4=BB=BD=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/account_controller.rb | 7 ++++
app/controllers/my_controller.rb | 34 +++++++++++++++
app/models/user_extensions.rb | 2 +-
app/views/account/register.html.erb | 7 ++++
app/views/my/account.html.erb | 2 +
app/views/projects/show_new.html.erb | 7 +++-
app/views/users/show.html.erb | 12 ++++--
config/locales/en.yml | 1 +
config/locales/zh.yml | 17 +++++++-
db/schema.rb | 41 ++++++++++++++++++-
.../stylesheets/application.css | 2 +-
11 files changed, 122 insertions(+), 10 deletions(-)
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 @@
<% 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 @@
|
<% 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;
|