diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index abe9e329..7db953a0 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -390,7 +390,7 @@ class ProjectsController < ApplicationController # added by bai @course.term = params[:term] @course.time = params[:time] - @course.school_id = params[:school] + @course.school_name = params[:occupation] @course.setup_time = params[:setup_time] @course.endup_time = params[:endup_time] @course.class_period = params[:class_period] diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 1892574e..54d43481 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -91,7 +91,7 @@
<%= l(:field_occupation) %> <%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onchange => "get_options(this.value)" %> - <%= select_tag "occupation" %> + <%= select_tag "occupation", options_for_select([['安徽大学','安徽大学'],['合肥工业大学','合肥工业大学'],['中国科技大学','中国科技大学']]) %>
diff --git a/app/views/projects/_course_form.html.erb b/app/views/projects/_course_form.html.erb index ff45f237..ca736b05 100644 --- a/app/views/projects/_course_form.html.erb +++ b/app/views/projects/_course_form.html.erb @@ -1,4 +1,19 @@ - + + <% object = [] %> @@ -269,10 +284,12 @@ + ++ <%=l(:label_new_course_school)%>* + <%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onclick => "get_options(this.value)" %> -
- - <%= select_tag 'school', options_from_collection_for_select(School.all, :id, :name)%> + <%= select_tag "occupation", options_for_select([['安徽大学','安徽大学'],['合肥工业大学','合肥工业大学'],['中国科技大学','中国科技大学']]) %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a006ae53..2256ed86 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1746,6 +1746,7 @@ zh: label_exit_course: 退出课程 label_new_join: 加入 label_new_course_password: 课程密码 + label_new_course_school: 开课学校 label_new_course_description: 课程描述 label_new_join_order: 请输入课程密码 label_task_submit_form_accessory: 作业最终以附件形式提交 diff --git a/db/migrate/20140415090718_remove_schoolid_from_courses.rb b/db/migrate/20140415090718_remove_schoolid_from_courses.rb new file mode 100644 index 00000000..96b3a4ac --- /dev/null +++ b/db/migrate/20140415090718_remove_schoolid_from_courses.rb @@ -0,0 +1,11 @@ +class RemoveSchoolidFromCourses < ActiveRecord::Migration + def up + remove_column :courses, :school_id + + end + + def down + add_column :courses, :school_id, :integer + + end +end diff --git a/db/migrate/20140415090829_add_school_name_to_courses.rb b/db/migrate/20140415090829_add_school_name_to_courses.rb new file mode 100644 index 00000000..1c9175e1 --- /dev/null +++ b/db/migrate/20140415090829_add_school_name_to_courses.rb @@ -0,0 +1,6 @@ +class AddSchoolNameToCourses < ActiveRecord::Migration + def change + add_column :courses, :school_name, :string + + end +end diff --git a/db/schema.rb b/db/schema.rb index 9584fa81..a5cb5409 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 => 20140320022724) do +ActiveRecord::Schema.define(:version => 20140415090829) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -157,6 +157,38 @@ ActiveRecord::Schema.define(:version => 20140320022724) 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 "contesting_projects", :force => true do |t| + t.integer "project_id" + t.string "contest_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "contesting_softapplications", :force => true do |t| + t.integer "softapplication_id" + t.integer "contest_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "contests", :force => true do |t| + t.string "name" + t.integer "budget" + t.integer "author_id" + t.date "deadline" + t.string "description" + t.integer "commit" + t.string "password" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + end + create_table "courses", :force => true do |t| t.integer "tea_id" t.string "name" @@ -173,7 +205,7 @@ ActiveRecord::Schema.define(:version => 20140320022724) do t.string "setup_time" t.string "endup_time" t.string "class_period" - t.integer "school_id" + t.string "school_name" end create_table "custom_fields", :force => true do |t| @@ -354,6 +386,13 @@ ActiveRecord::Schema.define(:version => 20140320022724) do add_index "issues", ["status_id"], :name => "index_issues_on_status_id" add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id" + create_table "join_in_competitions", :force => true do |t| + t.integer "user_id" + t.integer "competition_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "join_in_contests", :force => true do |t| t.integer "user_id" t.integer "bid_id" @@ -645,6 +684,21 @@ ActiveRecord::Schema.define(:version => 20140320022724) do t.string "description" end + create_table "softapplications", :force => true do |t| + t.string "name" + t.string "description" + t.integer "app_type_id" + t.string "app_type_name" + t.string "android_min_version_available" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "contest_id" + t.integer "softapplication_id" + t.integer "is_public" + t.string "application_developers" + end + create_table "students_for_courses", :force => true do |t| t.integer "student_id" t.integer "course_id" @@ -758,6 +812,16 @@ ActiveRecord::Schema.define(:version => 20140320022724) do add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" + create_table "user_scores", :force => true do |t| + t.integer "user_id", :null => false + t.integer "collaboration" + t.integer "influence" + t.integer "skill" + t.integer "active" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "user_statuses", :force => true do |t| t.integer "changesets_count" t.integer "watchers_count"