From 633104b493173c6edf1468467d99e393b4326479 Mon Sep 17 00:00:00 2001 From: xianbo Date: Tue, 24 Sep 2013 12:15:24 +0800 Subject: [PATCH] modify some bug about course and add db migrate --- app/views/layouts/base_courses.html.erb | 2 +- app/views/layouts/base_users.html.erb | 10 +++---- app/views/users/watch_bids.html.erb | 6 ++--- config/database.yml | 6 ++--- config/locales/zh.yml | 1 + db/schema.rb | 36 +++---------------------- 6 files changed, 16 insertions(+), 45 deletions(-) diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index f634d197..7c1a8c03 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -78,7 +78,7 @@ 课程学期:<%= @course.term %> - <% unless @course.teacher.user_extensions.occupation.nil? %> + <% unless @course.teacher.user_extensions.occupation==""%> 教师单位:<%= @course.teacher.user_extensions.occupation %> diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 7faf4b4e..ca05c401 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -111,23 +111,23 @@ <% unless @user.user_extensions.nil? %> - <%= l(:field_occupation) %><%= @user.user_extensions.occupation %> + <%= l(:field_occupation) %>:<%= @user.user_extensions.occupation %> - <%= l(:label_location) %><%= @user.user_extensions.location %> + <%= l(:label_location) %>:<%= @user.user_extensions.location %> <% if @user.user_extensions.identity == 0 %> - <%= l(:label_technical_title) %><%= @user.user_extensions.technical_title %> + <%= l(:label_technical_title) %>:<%= @user.user_extensions.technical_title %> <% end %> <% else%> - <%= l(:field_occupation) %> + <%= l(:field_occupation) %>: - <%= l(:label_location) %> + <%= l(:label_location) %>: <% end %> diff --git a/app/views/users/watch_bids.html.erb b/app/views/users/watch_bids.html.erb index 747b7946..60ff3a69 100644 --- a/app/views/users/watch_bids.html.erb +++ b/app/views/users/watch_bids.html.erb @@ -18,11 +18,11 @@
<% if bid.reward_type.nil? or bid.reward_type == 1%> - <%= l(:label_bids_reward_method) %><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= bid.budget%> + <%= l(:label_bids_reward_method) %><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= bid.budget%> <% elsif bid.reward_type == 2%> - <%= l(:label_bids_reward_method) %><%= bid.budget%> + <%= l(:label_bids_reward_method) %><%= bid.budget%> <% else %> - <%= l(:label_bids_reward_method) %><%= l(:label_bids_credit) %> <%= bid.budget%> <%= l(:label_bids_credit_number) %> + <%= l(:label_bids_reward_method) %><%= l(:label_bids_credit) %> <%= bid.budget%> <%= l(:label_bids_credit_number) %> <% end %> diff --git a/config/database.yml b/config/database.yml index 15be8447..dc495b73 100644 --- a/config/database.yml +++ b/config/database.yml @@ -15,12 +15,12 @@ production: development: adapter: mysql2 - database: bitnami_redmine - host: 10.0.47.245 + database: tr + host: localhost #socket: /home/pdl/redmine-2.3.1-2/mysql/tmp/mysql.sock port: 3306 username: root - password: "bitnami" + password: "1234" encoding: utf8 # Warning: The database defined as "test" will be erased and diff --git a/config/locales/zh.yml b/config/locales/zh.yml index aa5dc531..ddbf9779 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1515,3 +1515,4 @@ zh: label_course_homework_new: 发布作业 label_course_data: 资料 label_homework_statistics: 作业统计 + label_technical_title: 职称 \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 2ec42eb4..0949dbd4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -69,7 +69,6 @@ ActiveRecord::Schema.define(:version => 20130922123849) do t.string "description" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "reward" end create_table "bids", :force => true do |t| @@ -480,18 +479,6 @@ ActiveRecord::Schema.define(:version => 20130922123849) 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" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - create_table "projects", :force => true do |t| t.string "name", :default => "", :null => false t.text "description" @@ -592,18 +579,10 @@ ActiveRecord::Schema.define(:version => 20130922123849) do t.string "url" t.string "title" t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - t.integer "user_id" - t.string "description" - 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 + t.integer "project_id" + t.integer "user_id" end create_table "students_for_courses", :force => true do |t| @@ -690,8 +669,8 @@ ActiveRecord::Schema.define(:version => 20130922123849) do t.integer "zip_code" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "identity" t.string "technical_title" + t.integer "identity" t.integer "student_id" t.string "teacher_realname" t.string "student_realname" @@ -717,15 +696,6 @@ ActiveRecord::Schema.define(:version => 20130922123849) do add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" - create_table "user_tags", :force => true do |t| - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" - add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" - create_table "users", :force => true do |t| t.string "login", :default => "", :null => false t.string "hashed_password", :limit => 40, :default => "", :null => false