diff --git a/app/assets/javascripts/statistics.js.coffee b/app/assets/javascripts/statistics.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/statistics.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss new file mode 100644 index 000000000..6ec6a8ff5 --- /dev/null +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -0,0 +1,69 @@ +body { + background-color: #fff; + color: #333; + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +p, ol, ul, td { + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +pre { + background-color: #eee; + padding: 10px; + font-size: 11px; +} + +a { + color: #000; + &:visited { + color: #666; + } + &:hover { + color: #fff; + background-color: #000; + } +} + +div { + &.field, &.actions { + margin-bottom: 10px; + } +} + +#notice { + color: green; +} + +.field_with_errors { + padding: 2px; + background-color: red; + display: table; +} + +#error_explanation { + width: 450px; + border: 2px solid red; + padding: 7px; + padding-bottom: 0; + margin-bottom: 20px; + background-color: #f0f0f0; + h2 { + text-align: left; + font-weight: bold; + padding: 5px 5px 5px 15px; + font-size: 12px; + margin: -7px; + margin-bottom: 0px; + background-color: #c00; + color: #fff; + } + ul li { + font-size: 12px; + list-style: square; + } +} diff --git a/app/assets/stylesheets/statistics.css.scss b/app/assets/stylesheets/statistics.css.scss new file mode 100644 index 000000000..8ccb96220 --- /dev/null +++ b/app/assets/stylesheets/statistics.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the statistics controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/statistics_controller.rb b/app/controllers/statistics_controller.rb new file mode 100644 index 000000000..1d22bd5eb --- /dev/null +++ b/app/controllers/statistics_controller.rb @@ -0,0 +1,83 @@ +class StatisticsController < ApplicationController + # GET /statistics + # GET /statistics.json + def index + @statistics = Statistic.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @statistics } + end + end + + # GET /statistics/1 + # GET /statistics/1.json + def show + @statistic = Statistic.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @statistic } + end + end + + # GET /statistics/new + # GET /statistics/new.json + def new + @statistic = Statistic.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @statistic } + end + end + + # GET /statistics/1/edit + def edit + @statistic = Statistic.find(params[:id]) + end + + # POST /statistics + # POST /statistics.json + def create + @statistic = Statistic.new(params[:statistic]) + + respond_to do |format| + if @statistic.save + format.html { redirect_to @statistic, notice: 'Statistic was successfully created.' } + format.json { render json: @statistic, status: :created, location: @statistic } + else + format.html { render action: "new" } + format.json { render json: @statistic.errors, status: :unprocessable_entity } + end + end + end + + # PUT /statistics/1 + # PUT /statistics/1.json + def update + @statistic = Statistic.find(params[:id]) + + respond_to do |format| + if @statistic.update_attributes(params[:statistic]) + format.html { redirect_to @statistic, notice: 'Statistic was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @statistic.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /statistics/1 + # DELETE /statistics/1.json + def destroy + @statistic = Statistic.find(params[:id]) + @statistic.destroy + + respond_to do |format| + format.html { redirect_to statistics_url } + format.json { head :no_content } + end + end +end diff --git a/app/helpers/statistics_helper.rb b/app/helpers/statistics_helper.rb new file mode 100644 index 000000000..2d25d41c5 --- /dev/null +++ b/app/helpers/statistics_helper.rb @@ -0,0 +1,2 @@ +module StatisticsHelper +end diff --git a/app/models/statistic.rb b/app/models/statistic.rb new file mode 100644 index 000000000..b3f6d00e7 --- /dev/null +++ b/app/models/statistic.rb @@ -0,0 +1,3 @@ +class Statistic < ActiveRecord::Base + attr_accessible :description, :name, :status, :user_id +end diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 6d9ad618f..60049f5a8 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -22,6 +22,9 @@
Name | +Description | +User | +Status | ++ | + | + |
---|---|---|---|---|---|---|
<%= statistic.name %> | +<%= statistic.description %> | +<%= statistic.user_id %> | +<%= statistic.status %> | +<%= link_to 'Show', statistic %> | +<%= link_to 'Edit', edit_statistic_path(statistic) %> | +<%= link_to 'Destroy', statistic, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ Name: + <%= @statistic.name %> +
+ ++ Description: + <%= @statistic.description %> +
+ ++ User: + <%= @statistic.user_id %> +
+ ++ Status: + <%= @statistic.status %> +
+ + +<%= link_to 'Edit', edit_statistic_path(@statistic) %> | +<%= link_to 'Back', statistics_path %> diff --git a/config/routes.rb b/config/routes.rb index ce8eadfc1..919b036ea 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,1611 +1,1614 @@ -# Redmine - project management software -# Copyright (C) 2006-2013 Jean-Philippe Lang -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write tobthe Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# modified by longjun -# 统一route风格 -# match 'path', :to => 'controller#action' -# 如果 path = controller#action 则 match 'path' -# Example: -# match 'welcome/course', :to => 'welcome#course' 变成 -# match 'welcome/cource' -# 所有的 act: :act 变成 :act => :act -# Example: :via => :get ====> :via => :get - -RedmineApp::Application.routes.draw do - mount Mobile::API => '/api' - - # Enable Grack support - # mount Trustie::Grack.new, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post] - - constraints(Subdomain.new) do - get '/', to: 'organizations#show' - end - - constraints(Subdomain.new(sub: true)) do - get '/:sub_dir_name', to: 'fake#fake' - end - - resources :shield_wechat_messages do - collection do - delete 'show_messages' - end - end - resources :shield_activities do - collection do - delete 'show_acts' - end - end - resources :organizations do - resource :files do - member do - - end - collection do - - end - end - resources :org_document_comments do - member do - - end - collection do - - end - end - member do - get 'edit' - get 'setting'#, :action => 'settings', :as => 'settings' - get 'clear_org_avatar_temp' - put 'set_homepage' - put 'cancel_homepage' - get 'members' - get 'more_org_submains' - get 'more_org_projects' - get 'more_org_courses' - get 'search_courses' - get 'teachers' - get 'students' - get 'projects' - get 'courses' - get 'acts' - post 'join_course_menu' - post 'join_courses' - get 'search_projects' - post 'join_project_menu' - post 'join_projects' - post 'logout' - post 'apply_subdomain' - get 'org_resources_subfield' - get '/:sub_dir_name', :to => 'org_subfields#show', :as => 'show_org_subfield' - end - collection do - get 'check_uniq' - get 'check_uniq_domain' - get 'autocomplete_search' - post 'hide_org_subfield' - post 'show_org_subfield' - post 'set_excellent_teacher' - post 'set_excellent_student' - post 'reset_excellent_teacher' - post 'reset_excellent_student' - post 'agree_apply_subdomain' - post 'refused_apply_subdomain' - post 'update_field_by_admin' - post 'reset_update_field_by_admin' - end - end - - - - - resources :org_member do - member do - - end - collection do - get 'org_member_autocomplete' - get 'org_member_paging' - get 'deleteOrgMember' - end - end - - resources :org_subfields do - resources :files, :only => [:index, :new, :create] do - collection do - match "getattachtype", :via => [:get, :post] - match "search_files_in_subfield",:via => [:post,:get] - match "searchone4reload",:via => [:post,:get] - match "search_org_subfield_tag_attachment", :via => [:post,:get] - match "subfield_upload_file", :via => :post - end - member do - match "quote_resource_show_org_subfield", :via => [:get] - get "update_file_description" - post "edit_file_description" - end - end - - resources :sub_domains, :only => [:index, :new, :create, :show, :update, :destroy] do - resources :sub_document_comments, :only => [:index, :new, :create, :show, :update, :destroy, :edit] do - member do - post 'add_reply' - get 'quote' - post 'reply' - post 'add_reply_in_doc' - delete 'delete_reply' - match 'edit' - end - collection do - end - end - - collection do - end - member do - match 'domain_update_sub_dir', :via => [:put] - match 'domain_update_priority', :via => [:put] - match 'domain_update_status', :via => [:post] - post 'hide_sub_domain' - post 'show_sub_domain' - end - end - - member do - match 'update_sub_dir', :via => [:put] - match 'update_priority', :via => [:put] - match 'update_status', :via => [:post] - end - resource :boards - end - - resources :org_document_comments do - member do - post 'add_reply' - get 'quote' - post 'reply' - post 'add_reply_in_doc' - delete 'delete_reply' - end - collection do - - end - end - - resources :org_projects do - member do - - end - collection do - - end - end - - resources :org_courses do - member do - - end - collection do - - end - end - #match '/organizations/:organization_id/org_document_comments/new', :to => 'org_document_comments#new', :as => 'new_org_documents', :via => [:get, :post] - #match '/organizations/:organization_id/org_document_comments/create', :to => 'org_document_comments#create', :as => 'create_org_documents', :via => [:post] - resources :homework_users - resources :no_uses - delete 'no_uses', :to => 'no_uses#delete' - match 'site_search', :to => 'users#site_search', :as => 'site_search', :via => [:get, :post, :put] - resources :apply_project_masters - delete 'apply_project_masters', :to => 'apply_project_masters#delete' - - resources :comments do - member do - post 'reply' - get 'quote' - end - end - # resources :organization, :except => [:show] do - # - # end - - resources :school, :except => [:show] do - collection do - get 'apply_add_school' - get 'search_repeat_schoolname' - end - - member do - get 'upload_logo' - post 'upload' - get 'edit_apply_name' - get 'edit_apply_address' - get 'edit_apply_province' - end - end - - resources :homework_attach do - collection do - get 'get_homework_member_list' - match 'addjours', :via => [:get, :post] - match 'add_jour_reply', :via => [:get,:post] - match 'destroy_jour', :via => [:get,:post] - match 'comprehensive_evaluation_jour', :via => [:get,:post] - get 'get_not_batch_homework' - get 'get_batch_homeworks' - get 'get_homeworks' - get 'get_homework_jours' - get 'get_student_batch_homework' - get 'get_my_homework' - end - member do - match 'add_homework_users', :via => [:get,:post] - match 'destory_homework_users', :via => [:get,:post] - get 'praise_homework' - end - end - - resources :poll do - member do - get 'statistics_result' - post 'commit_answer' - post 'create_poll_question' - post 'commit_poll' - get 'publish_poll' - get 'save_poll' - get 'republish_poll' - get 'poll_result' - get 'close_poll' - get 'export_poll' - get 'import_poll' - post 'update_question_num' - end - collection do - delete 'delete_poll_question' - post 'update_poll_question' - get 'other_poll' - post 'import_other_poll' - end - end - - #show、index、new、create、edit、update、destroy路由自动生成 - resources :exercise do - member do #生成路径为 /exercise/:id/方法名 - get 'statistics_result' - get 'student_exercise_list' - get 'export_exercise' - get 'publish_exercise' - get 'republish_exercise' - get 'show_student_result' - post 'create_exercise_question' - post 'commit_answer' - get 'commit_exercise' - post 'update_question_num' - post 'send_to_course' - get 'get_student_uncomplete_question' - post 'edit_question_score' - end - - collection do #生成路径为 /exercise/方法名 - get 'delete_exercise_question' - post 'update_exercise_question' - get 'other_exercise' - post 'import_other_exercise' - get 'search_exercises' - get 'search_courses' - end - end - - resources :homework_common, :except => [:show]do - member do - get 'start_anonymous_comment' - get 'stop_anonymous_comment' - get 'alert_anonymous_comment' - get 'alert_forbidden_anonymous_comment' - get 'alert_open_student_works' - get 'open_student_works' - get 'start_evaluation_set' - get 'score_rule_set' - post 'set_evaluation_attr' - get 'alert_score_open_modal' - post 'set_score_open' - get 'add_to_homework_bank' - get 'publish_homework' - end - - collection do - post 'next_step' - post 'programing_test' - end - end - - resources :student_work do - member do - post 'add_score' - post 'revise_attachment' - get 'retry_work' - get 'add_comments_to_work' - get 'praise_student_work' - get 'forbidden_anonymous_comment' - get 'hide_score_detail' - end - collection do - post 'add_score_reply' - post 'student_work_project' - post 'change_project' - get 'new_student_work_project' - get 'search_user_projects' - get 'search_course_students' - get 'cancel_relate_project' - get 'delete_work' - get 'destroy_score_reply' - get 'student_work_absence_penalty' - get 'absence_penalty_list' - get 'evaluation_list' - # post 'set_program_score' - post 'program_test_ex' - post 'code_repeattest' - post 'last_codecomparetime' - post 'set_score_rule' - get 'work_canrepeat' - get 'get_user_infor' - post 'add_group_member' - post 'appeal_anonymous_score' - get 'alert_appeal_box' - get 'deal_appeal_score' - end - end - - resources :open_source_projects do - collection do - match 'search', :via => [:get, :post] - match 'remove_condition', :via => [:get, :post] - match 'allbug', :via => [:get, :post] - end - resources :relative_memos - member do - match 'master_apply', :via => [:get, :post] - match 'accept_master_apply', :via => [:get, :post] - match 'refuse_master_apply', :via => [:get, :post] - match 'showmemo', :via => [:get, :post] - match 'showbug', :via => [:get, :post] - end - end - - - mount SeemsRateable::Engine => '/rateable', :as => :rateable - - namespace :zipdown do - match 'assort' - match 'download_user_homework', :as => :download_user_homework - match 'download' - end - namespace :test do - match 'courselist' - match 'zip' - match 'mailer' - match 'view_office' - end - ##new added by linchun #以发布应用的形式参与竞赛 - resources :softapplications do - - collection do - match 'new_message', :via => :get - match 'search', :via => [:get, :post] - end - member do - match 'create_message' , :via => :post - end - end - - # ## new added by linchun #新竞赛相关 - # resources :contests, only: [:index] do - # resources :contestnotifications do - # # get 'preview', on: :collection - # resources :notificationcomments - # end - # - # collection do - # match 'new_contest' , :via => :get - # match 'join_in_contest' , :via => :post - # match 'unjoin_in_contest' , :via => :delete - # match 'create_contest' , :via => :post - # match 'new_join' , :via => :post - # match 'new' , :via => :post - # end - # member do - # delete 'destroy_contest' - # match 'add_softapplication' - # match 'update_contest' , :via => [:put] - # match 'show_contest' , :via => [:get, :post] - # match 'show_project' , :via => :get - # match 'show_softapplication' , :via => :get - # match 'show_attendingcontest' , :via => :get - # #match 'show_notification' , :via => :get - # match 'show_participator' , :via => :get - # match 'set_reward_project' , :via => [:get, :post] - # match 'set_reward_softapplication' , :via => [:get, :post] - # match 'add' , :via => [:get, :post] - # match 'add_softapplication' , :via => [:get, :post] - # match 'create' , :via => :post - # match 'settings' , :via => [:get, :post] - # match 'show_contest_user' - # get 'watcherlist', :action=> 'watcherlist' - # end - # end - - match '/news/preview', :to => 'previews#news', :as => 'preview_news', :via => [:get, :post, :put] - match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put] - match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put] - match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put] - - resources :stores do - collection do - match 'search', :via => [:get, :post] - get 'lost_file' - end - end - - resources :forums do - collection do - match 'search_forum', :via => [:get, :post] - match 'check_forum_name',:via => [:get] - end - member do - post 'create_memo' - post 'create_feedback' - post 'mail_feedback' - post 'update_memo_description' - match 'search_memo', :via => [:get, :post] - match 'delete_forum_tag',:via =>[:get] - match 'add_forum_tag',:via=>[:get] - end - resources :memos do - collection do - get "quote" - end - member do - get "change_sticky" - end - end - end - - resources :cooperation do - collection do - - end - end - - resources :shares - - #added by william - get "tags/index" - - get "tags/show" - - get "praise_tread/praise_plus" - get "praise_tread/praise_minus" - - get "praise_tread/tread_plus" - #end - - root :to => 'welcome#index', :as => 'home' - # added by longjun - match 'welcome/contest', :via => :get - # end longjun - - #added by nie - match '/projects/search', :via => [:get, :post] - match '/users/search', :via => [:get, :post] - #end - - # 消息相关路由 - resources :system_messages do - collection do - post 'create', :as => 'system_messages' - get 'index', :as => 'index' - end - end - # match 'system_messages/index', to: 'system_messages#index', :via => :get, :as => 'system_messages' - - match 'account/heartbeat', to: 'account#heartbeat', :via => :get - match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post] - match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post] - match 'agreement',:to => 'account#agreement',:as => 'agreement',:via=>[:get] - match 'about_us',:to=>'account#about_us',:as=>'about_us',:via=>[:get] - match 'account/register',:to=>'account#register', :via => [:get, :post], :as => 'register' - match 'account/lost_password', :via => [:get, :post], :as => 'lost_password' - match 'account/activate', :via => :get - match 'account/valid_ajax', :via => :get - match 'account/change_email', :via => :get - match 'account/email_valid', :to => 'account#email_valid', :via => :get - match 'account/resendmail', :to => 'account#resendmail', :via=> :get, :as => 'resendmail' - match 'account/codepedia_login', :to => 'account#codepedia_login', :via => [:get, :post] - match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post - match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post] - - #激活邮箱反馈问题 - match 'users/:id/leave_email_activation_message', :to => 'words#leave_email_activation_message', :via => :post, :as => "leave_email_activation_message" - - # boards - match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message' - match 'boards/:id/join_to_org_subfields', :to => 'boards#join_to_org_subfields' - match 'boards/:id/update_position', :to => 'boards#update_position', :via => :post - match 'boards/:id/update_name', :to => 'boards#update_name', :via => :put - get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message' - match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post] - get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit',:as=>'edit_board_message' - - post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message' - post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply' - post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' - post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy',:as=>'delete_board_message' - get 'boards/board_history', :to => 'boards#board_history' - match 'messages/join_org_subfield', :to => 'messages#join_org_subfield' - match 'messages/get_subfield_on_click_org', :to => 'messages#get_subfield_on_click_org' - match 'messages/join_org_subfields', :to => 'messages#join_org_subfields' - # boards end - - # Misc issue routes. TODO: move into resources - match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues' - match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu', :via => [:get, :post] - match '/issues/changes', :to => 'journals#index', :as => 'issue_changes', :via => :get - match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue' - - match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get - match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post] - match '/journals/destroy/:id', :to => 'journals#destroy', :id => /\d+/, :via => [:get, :post] - - get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt' - get '/issues/gantt', :to => 'gantts#show' - - get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar' - get '/issues/calendar', :to => 'calendars#show' - - get 'projects/:id/issues/statistics', :to => 'issues#statistics', :as => 'project_issues_statistics' - get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report' - get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details' - post '/users/:id/user_activities', :to => 'users#show', :as => "user_activities" - match 'projects/:project_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_course_news' - match 'projects/:project_id/news/new', :to => 'news#new', :via => [:get, :post] - - post '/courses/:id/course_activity', :to => 'courses#show', :as => 'course_activity' - get '/boards/:id/boards_topic', :to =>'boards#show', :as => 'boards_topic' - match 'courses/:course_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_course_news' - get 'news/news_history', :to => 'news#news_history' - match 'courses/:course_id/news/new', :to => 'news#new', :via => [:get, :post] - match 'contests/:contest_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_contest_news' - match 'contests/:contest_id/news/new', :to => 'news#new', :via => [:get, :post] - match 'users/:user_id/homepage/articles/:id', :to => 'article_homepages#show', :as => "user_homepage_show" - - match 'users/:id/courses', :to => 'users#course_community', :as => "user_course_community" - match 'users/:id/projects', :to => 'users#project_community', :as => "user_project_community" - match 'users/:id/contests', :to => 'users#contest_community', :as => "user_contest_community" - - scope ":username" do - resources :posts - end - -# added by cxt - resources :contest_members do - collection do - get 'contest_member_autocomplete' - end - - member do - - end - end - - # added by cxt - resources :contestant_works do - collection do - post 'student_work_project' - get 'new_student_work_project' - get 'cancel_relate_project' - get 'delete_work' - get 'search_contest_students' - end - - member do - get 'retry_work' - post 'add_score' - end - end - - # added by cxt - resources :works do - collection do - - end - - member do - get 'alert_score_open_modal' - post 'set_score_open' - get 'open_contestant_works' - get 'score_rule_set' - post 'set_score_rule' - end - end - - # added by cxt - resources :contests do - collection do - get 'join_contest' - get 'set_contest_attribute' - post 'join_contest_multi_role' - end - - member do - match 'settings' , :via => [:get, :post] - get 'feedback', :action => 'feedback', :as => 'contest_feedback' - get 'dealwith_apply_request' - get 'contest_activities' - get 'private_or_public' - get "switch_role" - get 'set_invite_code_halt' - get 'renew' - get 'member' - get 'export_all_members' - get 'feedback' - end - - resources :boards - resource :files do - member do - - end - collection do - - end - end - resources :news, :except => [:show, :edit, :update, :destroy] - end - - #added by young - resources :users do - collection do - match "tag_saveEx" , :via => [:get, :post] - post "user_new_homework" - get 'new_user_commit_homework' - get 'reply_to' - get 'reply_to_comment' - get 'show_all_replies' - get 'user_messages_unviewed' - post "user_commit_homework" - post 'user_select_homework' - post 'check_homework' - get 'all_journals' - get 'user_archive_courses' - post 'reply_detail' - end - - member do - match 'user_projects_index', :to => 'users#user_projects_index', :via => :get - match 'user_projects', :to => 'users#user_projects', :via => :get - match 'user_activities', :to => 'users#user_activities', :via => :get, :as => "user_activities" - # match 'user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "user_newfeedback" - match 'info', :to => 'users#info', :via => [:get , :post], :as => 'user_info' - match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang - match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang - match 'user_courses', :to => 'users#user_courses', :via => :get - match 'user_courses4show', :to => 'users#user_courses4show', :via => :get - match 'user_projects4show', :to => 'users#user_projects4show', :via => :get - match 'user_contests4show', :to => 'users#user_contests4show', :via => :get - match 'user_course_activities', :to => 'users#user_course_activities', :via => :get - match 'user_project_activities', :to => 'users#user_project_activities', :via => :get - match 'user_feedback4show', :to => 'users#user_feedback4show', :via => :get - match 'user_visitorlist', :to => 'users#user_visitorlist', :via => :get - match 'apply_for_homework', :to => 'users#apply_for_homework', :via => :post - match 'apply_homework', :to => 'users#apply_homework', :via => :get - match 'user_homeworks', :to => 'users#user_homeworks', :via => :get - match 'my_homeworks', :to => 'users#my_homeworks', :via => :get - match 'student_homeworks', :to => 'users#student_homeworks', :via => :get - get 'apply_resource' - get 'user_import_homeworks' - get 'user_search_homeworks' - get 'choose_user_course' - get 'user_import_resource' - match 'watch_projects', :to => 'users#watch_projects', :via => :get - get 'update_message_viewed' - get 'change_user_email' - # - # added by bai - match 'show_score', :to => 'users#show_score', :via => :get - match 'topic_score_index', :to => 'users#topic_score_index', :via => [:get, :post] - match 'project_score_index', :to => 'users#project_score_index', :via => :get - match 'activity_score_index', :to => 'users#activity_score_index', :via => :get - match 'influence_score_index', :to => 'users#influence_score_index', :via => :get - match 'score_index', :to => 'users#score_index', :via => :get - - match 'show_new_score', :to => 'users#show_new_score', :via => :get - match 'topic_new_score_index', :to => 'users#topic_new_score_index', :via => [:get, :post] - match 'project_new_score_index', :to => 'users#project_new_score_index', :via => :get - match 'activity_new_score_index', :to => 'users#activity_new_score_index', :via => :get - match 'influence_new_score_index', :to => 'users#influence_new_score_index', :via => :get - match 'score_new_index', :to => 'users#score_new_index', :via => :get - match 'update_score', :to => 'users#update_score', :via => [:get,:post] - - match 'show_projects_score', :to => 'projects#show_projects_score', :via => [:get, :post] - match 'issue_score_index', :to => 'projects#issue_score_index', :via => [:get, :post] - match 'news_score_index', :to => 'projects#news_score_index', :via => [:get, :post] - match 'file_score_index', :to => 'projects#file_score_index', :via => [:get, :post] - match 'code_submit_score_index', :to => 'projects#code_submit_score_index', :via => [:get, :post] - match 'projects_topic_score_index', :to => 'projects#projects_topic_score_index', :via => [:get, :post] - match 'user_act_issue_assign_to', :to => 'users#user_act_issue_assign_to', :via => [:get, :post] - - #addby yk - match 'user_courselist', :to => 'users#user_courselist', :via => :get, :as => "user_courselist" - match 'user_projectlist', :to => 'users#user_projectlist', :via => :get, :as => "user_projectlist" - match 'user_contestlist', :to => 'users#user_contestlist', :via => :get, :as => "user_contestlist" - - match 'sort_syllabus_list', :to => 'users#sort_syllabus_list', :via => :get, :as => "sort_syllabus_list" - match 'sort_project_list', :to => 'users#sort_project_list', :via => :get, :as => "sort_project_list" - - get 'edit_brief_introduction' - get "user_resource" - match "user_issues", :to => 'users#user_issues', :via => [:get, :post], :as => "user_issues" - match "user_manage_issues", :to => 'users#user_manage_issues', :via => [:get, :post], :as => "user_manage_issues" - match "user_receive_issues", :to => 'users#user_receive_issues', :via => [:get, :post], :as => "user_receive_issues" - match "user_manage_homeworks", :to => 'users#user_manage_homeworks', :via => [:get, :post], :as => "user_manage_homeworks" - match "user_receive_homeworks", :to =>'users#user_receive_homeworks', :via => [:get, :post], :as => "user_receive_homeworks" - get "import_resources" - get "import_resources_search" - post "import_into_container" - get "resource_search" - post "user_resource_create" - post "user_resource_delete" - get "search_user_course" - post "send_homework_to_course" - post "add_exist_file_to_course" - post "add_exist_file_to_project" - post 'add_exist_file_to_org' - post 'share_news_to_course' - post 'share_news_to_project' - post 'share_news_to_org' - post 'share_message_to_course' - post 'share_message_to_project' - post 'share_message_to_org' - get 'resource_preview' - get 'rename_resource' - get 'search_user_project' - get 'user_resource_type' - get 'user_ref_resource_search' - post 'import_resources_to_homework' - get 'dealwith_apply_request' - get 'dealwith_apply_homework' - get 'deal_with_apply_resource' - get 'store_selected_resource' - get 'user_organizations' - get 'search_user_orgs' - get 'search_user_org' #for send resource - get 'user_homework_type' - get 'user_ref_homework_search' - get 'show_homework_detail' - post 'apply_for_homework' - post 'apply_for_resource' - match 'manage_or_receive_homeworks', :to => 'users#manage_or_receive_homeworks', :via => :get - get 'search_m_r_homeworks' - get 'expand_courses' - get 'cancel_or_collect' - get 'homepage' - get 'unsolved_issues_list' - get 'unfinished_homework_list' - get 'unfinished_poll_list' - get 'unfinished_test_list' - get 'anonymous_evaluation_list' - get 'unapproval_applied_list' - # end - end - #resources :blogs - resources :blogs, :path => "report" do - resources :blog_comments, :path => "report_comments" do - member do - post 'reply' - get 'quote' - end - end - end - - resources :homepages do - resources :article_homepages do - member do - end - end - end - end - resources :blog_comments do - collection do - get :search - end - end - resource :homepages do - member do - post 'set_homepage' - post 'cancel_homepage' - end - collection do - - end - end - resources :article_homepages do - member do - end - end - match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback" - match 'users/:id/user_projects', :to => 'users#user_projects', :via => :get - #消息 - match 'users/:id/user_messages', :to => 'users#user_messages', :via => :get, :as => "user_message" - match 'users/:id/user_system_messages', :to => 'users#user_system_messages', :via => :get, :as => "user_system_messages" - match 'set_homepage', :to => 'blogs#set_homepage', :via => :post - match 'cancel_homepage', :to => 'blogs#cancel_homepage', :via => :post - #match 'users/:id/user_messages/:homework', :to => 'users#user_messages_homework', :via => :get, :as => "user_message_homewrok" - - - - #end - match 'my/account', :via => [:get, :post] - match 'my/account/destroy', :to => 'my#destroy', :via => [:get, :post] - match 'my/page', :via => :get - match 'my', :to => 'my#index', :via => :get # Redirects to my/page - match 'my/reset_rss_key', :via => :post - match 'my/reset_api_key', :via => :post - match 'my/password', :via => [:get, :post] - match 'my/page_layout', :via => :get - match 'my/add_block', :via => :post - match 'my/remove_block', :via => :post - match 'my/order_blocks', :via => :post - match 'my/change_mail_notification', via: :get - match 'my/save_user_avatar', :to => 'my#save_user_avatar', :via => [:get, :post] - match 'my/clear_user_avatar_temp', :to => 'my#clear_user_avatar_temp', :via => [:get, :post] - - get 'my/page2', :to => 'my#page2', :as => "my_page2" - - resources :users - match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership' - match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete - match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships' - ################# added by william - match 'users/tag_save', :via => :post, :as => 'tag' - match 'users/tag_saveEx', :via => [:get, :post] - #get 'users/:id/user_organizations', :to => 'users#user_organizations', :as => 'user_organizations' - post 'watchers/watch', :to => 'watchers#watch', :as => 'watch' - delete 'watchers/watch', :to => 'watchers#unwatch' - get 'watchers/new', :to => 'watchers#new' - post 'watchers', :to => 'watchers#create' - post 'watchers/append', :to => 'watchers#append' - delete 'watchers', :to => 'watchers#destroy' - get 'watchers/autocomplete_for_user', :to => 'watchers#autocomplete_for_user' - # Specific routes for issue watchers API - post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue' - delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue' - - post 'applied_project/applied_join', :to => 'applied_project#applied_join_project', :as => 'applied_join_project' - post 'applied_project/applied_project_info', :to => 'applied_project#applied_project_info', :as => 'applied_project_info' - delete 'applied_project/applied', :to => 'applied_project#unapplied_join_project', :as => 'unapplied_join_project' - - resources :projects do - member do - match 'change_project_type', :via => [:get, :post] - get 'settings(/:tab)', :action => 'settings', :as => 'settings' - #by young - get 'member', :to => 'projects#member', :as => 'member' - match 'project_watcherlist', :to => 'projects#project_watcherlist', :as => 'project_watcherlist' - match 'store_mine', :to => 'projects#store_mine', :as => 'store_mine' - match 'enshrine', :to => 'projects#enshrine', :as => 'enshrine' - match 'member_forked', :to => 'projects#member_forked', :as => 'member_forked' - get 'file', :action => 'file', :as => 'file' - get 'statistics', :action => 'statistics', :as => 'statistics' - get 'repository_tree_changes', :action => 'repository_tree_changes', :as => 'repository_tree_changes' - get 'destroy_repository', :action => 'destroy_repository', :as => 'destroy_repository' - - get 'feedback', :action => 'feedback', :as => 'project_feedback' - get 'watcherlist', :action=> 'watcherlist' - - # get 'invite_members', :action=> 'invite_members' - get 'invite_members_by_mail', :action=> 'invite_members_by_mail' - # get 'dts_repos', :aciton => 'dts_repos' - get 'send_mail_to_member', :action => 'send_mail_to_member' - match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" - #end - - post 'add_script' - post 'modules' - post 'archive' - post 'unarchive' - post 'close' - post 'reopen' - get 'training_project_execute' - get 'training_project_update' - get 'training_project_extend' - get 'task_execute' - get 'forked_pop' - get 'training_chiled_project_exec' - get 'delete_member_pop', :to => 'projects#delete_member_pop', :via => :get, :as => "delete_member_pop" - get 'search_public_orgs_not_in_project' - match 'copy', :via => [:get, :post] - match 'set_public_or_private', :via => [:post] - end - - collection do - get 'project_home' - match 'join_project', :via => [:get, :post] - match 'training_task_status', :via => [:get, :post] - end - - #by young - match '/member', :to => 'projects#member', :as => 'member', :via => :get - match '/file', :to => 'projects#file', :as => 'file', :via => :get - match '/statistics', :to => 'projects#statistics', :as => 'statistics', :via => :get - match '/watcherlist', :to=>'projects#watcherlist', :as => 'watcherlist', :via => :get #add by huang - resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do - collection do - get 'autocomplete' - get 'appliedproject' - post 'allow_to_join_project' - get 'refused_allow_to_join_project' - end - end - - resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy] - - get 'issues/:copy_from/copy', :to => 'issues#new', :as => 'copy_issue' - resources :issues, :only => [:index, :new, :create] do - resources :time_entries, :controller => 'timelog' do - collection do - get 'report' - end - end - end - # issue form update - match 'issues/update_form', :to => 'issues#update_form', :via => [:put, :post], :as => 'issue_form' - - resources :files, :only => [:index, :new, :create] do - collection do - match "getattachtype", :via => [:get, :post] - match "search_project",:via => [:post,:get] - match "searchone4reload",:via => [:post,:get] - match "search_tag_attachment", :via => [:post,:get] - end - member do - match "quote_resource_show", :via => [:get] - get "file_hidden" - get "update_file_description" - post "edit_file_description" - end - end - - resources :training_tasks do - collection do - - end - member do - post 'add_journal' - get 'delete_journal' - get 'reply' - post 'add_reply' - end - end - - resources :pull_requests do - collection do - end - member do - get 'accept_pull_request' - get 'pull_request_commits' - get 'pull_request_changes' - get 'update_pull_request' - get 'pull_request_comments' - post 'create_pull_request_comment' - end - end - - resources :quality_analysis, :only => [:index, :create, :edit, :update, :delete] do - collection do - end - member do - match 'update_jenkins_job' - match 'edit' - match 'delete' - match 'create' - get 'error_list' - end - end - # resources :files, :only => [:index, :new, :create] do - # member do - # match "quote_resource_show_project",:via => [:get] - # end - # collection do - # match "getattachtype" , :via => [:get, :post] - # match "search_project",:via => [:post,:get] - # #match 'getattachtype/:attachtype', :to => 'files#getattachtype', :via => [:get, :post] - # end - # end - - - resources :versions, :except => [:index, :show, :edit, :update, :destroy] do - collection do - put 'close_completed' - get 'judge_version_title' - end - end - get 'versions.:format', :to => 'versions#index' - get 'roadmap', :to => 'versions#index', :format => false - get 'versions', :to => 'versions#index' - - resources :news, :except => [:show, :edit, :update, :destroy] - resources :time_entries, :controller => 'timelog' do - get 'report', :on => :collection - end - resources :queries, :only => [:new, :create] - resources :issue_categories, :shallow => true - resources :documents, :except => [:show, :edit, :update, :destroy] - resources :boards - resources :repositories, :shallow => true, :except => [:index, :show] do - member do - match 'committers', :via => [:get, :post] - end - end - resources :repositories, :except => [:index, :show] do - member do - get 'newrepo', :via => [:get, :post] - put 'to_gitlab' - # get 'create', :via=>[:get, :post] - end - end - - match 'wiki/index', :via => :get - resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do - member do - get 'rename' - post 'rename' - get 'history' - get 'diff' - match 'preview', :via => [:post, :put] - post 'protect' - post 'add_attachment' - end - collection do - get 'export' - get 'date_index' - end - end - match 'wiki', :to => 'wiki#show', :via => :get - get 'wiki/:id/:version', :to => 'wiki#show', :constraints => {:version => /\d+/} - delete 'wiki/:id/:version', :to => 'wiki#destroy_version' - get 'wiki/:id/:version/annotate', :to => 'wiki#annotate' - get 'wiki/:id/:version/diff', :to => 'wiki#diff' - end - - resources :issues do - collection do - match 'bulk_edit', :via => [:get, :post] - post 'bulk_update' - get 'issue_commits' - get 'commit_for_issue' - get 'issue_commit_delete' - end - member do - post 'add_journal' - post 'add_journal_in_org' - get 'delete_journal' - get 'reply' - post 'add_reply' - end - resources :time_entries, :controller => 'timelog' do - collection do - get 'report' - end - end - resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy] - end - match '/issues', :to => 'issues#destroy', :via => :delete - - resources :queries, :except => [:show] - - resources :training_tasks do - member do - post 'complete_training_task' - post 'add_reply' - post 'add_journal' - post 'add_journal_in_org' - get 'delete_journal' - get 'reply' - end - collection do - end - end - - resources :news, :only => [:index, :show, :edit, :update, :destroy] - - match '/news/:id/comments', :to => 'comments#create', :via => :post - #match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete - delete '/news/:id/comments/:comment_id', :to => 'comments#destroy', as: :delete_news_comments - - resources :versions, :only => [:show, :edit, :update, :destroy] do - post 'status_by', :on => :member - end - - resources :documents, :only => [:show, :edit, :update, :destroy] do - post 'add_attachment', :on => :member - end - - match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu, :via => [:get, :post] - - resources :time_entries, :controller => 'timelog', :except => :destroy do - collection do - get 'report' - get 'bulk_edit' - post 'bulk_update' - end - end - match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/ - # TODO: delete /time_entries for bulk deletion - match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete - - get 'projects/:id/activity', :to => 'activities#index' - get 'projects/:id/activity.:format', :to => 'activities#index' - get 'activity', :to => 'activities#index' - - # repositories routes - get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats', :as => "stats_repository_project" - get 'projects/:id/repository/:repository_id/quality_analysis', :to => 'repositories#quality_analysis', :as => "quality_analysis" - get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph' - - get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))', :to => 'repositories#changes' - - get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision' - get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision' - post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue' - delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' - get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions' - get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', - :controller => 'repositories', - :format => false, - :constraints => { - :action => /(browse|show|entry|raw|annotate|diff|commit_diff)/, - :rev => /[a-z0-9\.\-_]+/ - } - - get 'projects/:id/repository/statistics', :to => 'repositories#stats' - get 'projects/:id/repository/quality_analysis', :to => 'repositories#quality_analysis' - - get 'projects/:id/repository/graph', :to => 'repositories#graph' - - get 'projects/:id/repository/changes(/*path(.:ext))', :to => 'repositories#changes' - - get 'projects/:id/repository/forked', :to => 'repositories#forked' - get 'projects/:id/repository/training_task_execute', :to => 'repositories#training_task_execute' - get 'projects/:id/repository/tree_head_message', :to => 'repositories#tree_head_message', :as => "tree_head_message" - get 'projects/:id/repository/export_rep_static', :to => 'repositories#export_rep_static' - get 'projects/:id/repository/project_archive', :to => 'repositories#project_archive', :as => 'project_archive' - get 'projects/:id/repository/revisions', :to => 'repositories#revisions' - get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision' - get 'projects/:id/repository/revision', :to => 'repositories#revision' - post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue' - delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' - get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', - :controller => 'repositories', - :format => false, - :constraints => { - :action => /(browse|show|entry|raw|annotate|diff|commit_diff)/, - :rev => /[a-z0-9\.\-_]+/ - } - get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))', - :controller => 'repositories', - :action => /(browse|show|entry|raw|changes|annotate|diff|commit_diff)/ - get 'projects/:id/repository/:action(/*path(.:ext))', - :controller => 'repositories', - :action => /(browse|show|entry|raw|changes|annotate|diff|commit_diff)/ - - get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil - get 'projects/:id/repository/:repository_id/entry_edit', :to => 'repositories#entry_edit', :path => nil - post 'projects/:id/repository/:repository_id/entry_update', :to => 'repositories#entry_update', :path => nil - get 'projects/:id/repository', :to => 'repositories#show', :path => nil - get 'projects/:id/exit', :to => 'projects#exit_project', :as => 'exit_cur_project' - - # additional routes for having the file name at the end of url - get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment' - get 'attachments/attachment_versions/:id',:to=>'attachments#attachment_versions',:as=>'attachments_versions' - get 'attachments/attachment_versions_delete/:id',:to=>'attachments#attachment_versions_delete',:as=>'attachment_versions_delete' - get 'attachments/attachment_history_download/:id',:to=>'attachments#attachment_history_download',:as=>'attachment_history_download' - post 'attachments/upload_attachment_version',:to=>'attachments#upload_attachment_version',:as=>'upload_attachment_version' - get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment' - get 'attachments/download_history/:id/:filename', :to => 'attachments#download_history', :id => /\d+/, :filename => /.*/, :as => 'download_history_attachment' - get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/ - get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail' - get 'attachments/autocomplete' - get 'attachments/update_attachment_publish_time/:id',:to=>'attachments#update_attachment_publish_time',:as=>'update_attachment_publish_time' - match 'attachments/autocomplete', :to => 'attachments#autocomplete', :via => [:post] - post 'attachments/relationfile', to: 'attachments#add_exist_file_to_project', as: 'attach_relation' - post 'attachments/relationfiles', to: 'attachments#add_exist_file_to_projects', as: 'attach_relations' - post 'attachments/courserelationfile', to: 'attachments#add_exist_file_to_course', as: 'course_attach_relation' - post 'attachments/courserelationfiles', to: 'attachments#add_exist_file_to_courses', as: 'course_attach_relations' - match 'attachments/add_exist_file_to_org_subfield' - get 'attachments/renderTag/:attchmentId', :to => 'attachments#renderTag', :attchmentId => /\d+/ - resources :attachments, :only => [:show, :destroy] do - collection do - match "updateType" , :via => [:get, :post] - match "updateFileDense" , :via => [:get, :post] - match "update_file_dense", :via => [:post] - match "renderTag" , :via => [:get, :post] - match 'delete_softapplications', :via => [:get, :post] - get 'batch_setting' - post 'resource_batch_setting' - get 'upload_atta' - end - end - resources :groups do - member do - get 'autocomplete_for_user' - end - end - - match 'groups/:id/users', :to => 'groups#add_users', :id => /\d+/, :via => :post, :as => 'group_users' - match 'groups/:id/users/:user_id', :to => 'groups#remove_user', :id => /\d+/, :via => :delete, :as => 'group_user' - match 'groups/destroy_membership/:id', :to => 'groups#destroy_membership', :id => /\d+/, :via => :post - match 'groups/edit_membership/:id', :to => 'groups#edit_membership', :id => /\d+/, :via => :post - - resources :trackers, :except => :show do - collection do - match 'fields', :via => [:get, :post] - end - end - resources :issue_statuses, :except => :show do - collection do - post 'update_issue_done_ratio' - end - end - resources :custom_fields, :except => :show - resources :roles do - collection do - match 'permissions', :via => [:get, :post] - end - end - resources :web_footer_companies, :except => :show - resources :enumerations, :except => :show - match 'enumerations/:type', :to => 'enumerations#index', :via => :get - - get 'projects/:id/search', :controller => 'search', :action => 'index' - get 'search', :controller => 'search', :action => 'index' - - match 'mail_handler', :to => 'mail_handler#index', :via => :post - match 'mail_handler/cancel/:id', :to => 'mail_handler#cancel_mail_notify',:via => :get - - match 'admin', :to => 'admin#index', :via => :get - match 'admin/projects', :via => :get - match 'admin/export_rep_static_users', :via => :get - get 'admin/courses', as: :all_courses - get 'admin/syllabuses', as: :all_syllabuses - get 'admin/contests', :via => :get - get 'admin/non_syllabus_courses', as: :non_syllabus_courses - post 'admin/update_course_name' - post 'admin/update_syllabus_title' - get 'admin/excellent_courses', as: :excellent_courses - get 'admin/excellent_all_courses', as: :excellent_all_courses - match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course' - match 'admin/cancel_excellent_course/:id', :to => 'admin#cancel_excellent_course' - get 'admin/course_resource_list' - get 'admin/project_resource_list' - match 'admin/users', :via => :get - match 'admin/messages', :via => :get - match 'admin/first_page_made', as: :first_page_made - match 'admin/course_page_made', as: :course_page_made - match 'admin/contest_page_made', as: :contest_page_made - match 'admin/web_footer_made', as: :web_footer_made - match 'admin/enterprise_page_made', as: :enterprise_page_made - match 'admin/mobile_version', as: :mobile_version - match 'admin/create_version', as: :create_version - match 'admin/search', :via => [:get, :post] - match 'admin/plugins', :via => :get - match 'admin/info', :via => :get - match 'admin/test_email', :via => :get - match 'admin/default_configuration', :via => :post - get 'admin/organization' - get 'admin/schools' - get 'admin/applied_schools', as: :unapplied_schools - get 'admin/has_applied_schools', as: :applied_schools - get 'admin/approve_applied_schools' - post 'admin/edit_applied_schools' - get 'admin/all_schools' - get 'admin/apply_shcool_sort', as: :apply_shcool_sort - delete 'admin/delete_applied_schools' - - get 'admin/leave_messages' - match 'admin/messages_list', as: :messages_list - match 'admin/project_messages', as: :project_messages - match'admin/course_messages', as: :course_messages - get 'admin/notices' - match 'admin/latest_login_users', as: :latest_login_users - match 'admin/latest_login_teachers', as: :latest_login_teachers - get 'admin/homework' - get 'admin/apply_for_homework' - get 'admin/code_work_tests' - post 'admin/select_course_syllabus' - post 'admin/create_syllabus' - - resources :auth_sources do - member do - get 'test_connection', :as => 'try_connection' - end - collection do - get 'autocomplete_for_new_user' - end - end - - match 'courses/search' - match '/contests/search', :via => [:get, :post] - - #课程大纲路由设置 - resources :syllabuses do - member do - match 'syllabus_courselist', :to => 'syllabuses#syllabus_courselist', :via => :get, :as => 'syllabus_courselist' - get 'edit_syllabus_eng_name' - get 'edit_syllabus_title' - post 'update_base_info' - get 'delete_syllabus' - get 'delete_des' - get 'members' - end - - collection do - - end - end - - resources :syllabus_member do - member do - post 'update_rank' - end - - collection do - get 'syl_member_autocomplete' - end - end - - # add by nwb - # 课程路由设置 - resources :courses do - member do - get 'sync_temp_excel' - get 'settings(/:tab)', :action => 'settings', :as => 'settings' - get 'search_member', :action => 'search_member' - get 'file', :action => 'file', :as => 'file' - get 'feedback', :action => 'feedback', :as => 'course_feedback' - get 'code_repeat', :action => 'code_repeat', :as => 'code_repeat' - get 'member', :controller => 'courses', :action => 'member', :as => 'member' - get 'group_member', :controller => 'courses', :action => 'group_member', :as => 'group_member' - get 'export_course_member_excel',:controller => 'courses',:action => 'export_course_member_excel' - get 'member_score', :to => 'courses#member_score' - post 'finishcourse' - post 'restartcourse' - match "renew", :to => 'courses#renew', :via => [:post, :get], :as =>'renew' - match "searchmembers", :controller => 'courses', :action => 'searchmembers', :via => [:post,:get] - match "searchgroupmembers", :via => [:post, :get] - match 'member_score_sort', :via => [:get] - match "updategroupname", :via => [:post, :get] - match "addgroups", :via => [:post, :get] - match 'deletegroup', :via => [:delete] - match 'show_member_score', :via => [:get] - match 'show_member_act_score', :via => [:get] - match 'valid_ajax', :to => 'courses#valid_ajax', :via => :get - post 'join_in/join_group', :to => 'courses#join_group', :as => 'join_group' - delete 'join_in/join_group', :to => 'courses#unjoin_group' - get 'copy_course' - get 'private_or_public' - match 'course_activity', :to => 'courses#course_activity', :via => :get, :as => "course_activity" - get 'course_outline' - post 'search_course_outline' - post 'set_course_outline' - post 'teacher_assign_group' - get 'syllabus' - get 'search_public_orgs_not_in_course' - get "homework_search" - get "show_comparecode" - get "course_statistics" - get "switch_role" - get 'search_not_group_member' - post 'add_members' - get 'search_course_teacher_list' - post 'change_manager' - get 'delete_member' - get 'archive_course' - get 'set_invite_code_halt' - get 'open_or_close_os_interface' - end - collection do - match 'join_private_courses', :via => [:get, :post] - post "join_course_multi_role" - - end - - match '/member', :to => 'courses#member', :as => 'member', :via => :get - resources :boards - resources :files, :only => [:index, :new, :create] do - collection do - match "getattachtype", :via => [:get, :post] - match "search",:via => [:post,:get] - match "searchone4reload",:via => [:post,:get] - match "search_tag_attachment", :via => [:post,:get] - end - member do - match "quote_resource_show", :via => [:get] - get "file_hidden" - post "republish_file" - get "update_file_description" - post "edit_file_description" - end - end - resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do - collection do - get 'autocomplete' - get 'appliedproject' - end - end - resources :news, :except => [:show, :edit, :update, :destroy] - # resources :boards do - # member do - # match 'boards_topic', :to => 'boards#boards_topic', :via => :get, :as => "boards_topic" - # end - # end - match '/homework', :to => 'courses#homework', :as => 'homework', :via => :get - resources :activity_notifys do - collection do - match 'chang_read_flag', :via => :get - end - end - - end # end of resources :courses - match 'courses/:id/feedback', :to => 'courses#feedback', :via => :get, :as => 'course_feedback' - match '/courses/search', :via => [:get, :post] - match 'words/:id/leave_course_message', :to => 'words#leave_course_message', :as => "leave_course_message" - - - match 'workflows', :to => 'workflows#index', :via => :get - match 'workflows/edit', :via => [:get, :post] - match 'workflows/permissions', :via => [:get, :post] - match 'workflows/copy', :via => [:get, :post] - match 'settings', :controller => 'settings', :action => 'index', :via => :get - match 'settings/edit', :via => [:get, :post] - match 'settings/plugin/:id', :to => 'settings#plugin', :via => [:get, :post], :as => 'plugin_settings' - match 'settings/hidden_non_project', :via => [:get, :post] - match 'settings/hidden_courses', :via => [:get, :post] - - match 'sys/projects', :via => :get - match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post - match 'sys/fetch_changesets', :via => :get - - match 'uploads', :to => 'attachments#upload', :via => :post - # Added by Tao - match 'upload_avatar', :to => 'avatar#upload', :via => :post - match 'delete_avatar', :to => 'avatar#delete_image',:via => :post - # Endof Tao's code - get 'robots.txt', :to => 'welcome#robots' - ##############测试留言功能 fq - post 'words/new', :to => 'words#new' - post 'words/create', :to => 'words#create' - post 'words/append', :to => 'words#append' - post 'words/create_reply', :to => 'words#create_reply' - delete 'words/destroy', :to => 'words#destroy' - delete 'words/destroyJournal', :to => 'words#destroyJournal' - get 'words/more', :to => 'words#more' - get 'words/back', :to=> 'words#back' - get 'words/destroyJournal', :to => 'words#destroyJournal' - match 'words/add_project_respond', :to => 'words#add_project_respond' - match 'words/:id/leave_project_message', :to => 'words#leave_project_message' - match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback' - match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share - post 'words/:id/leave_user_message', :to => 'words#leave_user_message', :as => "leave_user_message" - post 'words/:id/leave_contest_message', :to => 'words#leave_contest_message', :as => "leave_contest_message" - post 'words/:id/leave_syllabus_message', :to => 'words#leave_syllabus_message', :as => "leave_syllabus_message" - post 'words/:id/leave_homework_message', :to => 'words#leave_homework_message', :as => "leave_homework_message" - post 'words/:id/reply_to_homework', :to => 'words#reply_to_homework', :as => "reply_to_homework" - post 'words/:id/leave_contest_work_message', :to => 'words#leave_contest_work_message', :as => "leave_contest_work_message" - post 'words/:id/reply_to_contest_work', :to => 'words#reply_to_contest_work', :as => "reply_to_contest_work" - post 'words/:id/reply_to_syllabus', :to => 'words#reply_to_syllabus', :as => "reply_to_syllabus" - - post 'join_in/join', :to => 'courses#join', :as => 'join' - delete 'join_in/join', :to => 'courses#unjoin' - post 'join_in/join_group', :to => 'courses#join_group', :as => 'join_group' - delete 'join_in/join_group', :to => 'courses#unjoin_group' - - delete 'attachment/:id', :to => 'attachments#delete_homework' - match 'new_join', :to => 'courses#new_join', :as => 'try_join' - match 'new_join_group', :to => 'courses#new_join_group', :as => 'try_join_group' - match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post - - ######################## - ##added by wen########## - #######confusing######## - get 'welcome/search', to: 'welcome#search' - get 'school/index', to: 'school#index' - get 'school/:school_id', to: 'welcome#course', :as => 'school_course_list' - post 'school/get_options/:province', :to => 'school#get_options' - get 'school/get_options/:province', :to => 'school#get_options' - - post 'school/get_province', :to => 'school#get_province' - get 'school/get_province', :to => 'school#get_province' - - post 'school/get_schoollist/:province', :to => 'school#get_schoollist' - get 'school/get_schoollist/:province', :to => 'school#get_schoollist' - - post 'school/search_school/', :to => 'school#search_school' - get 'school/search_school/', :to => 'school#search_school' - - post 'school/on_search' - post 'school/add_school' - ######added by nie - match 'tags/show_projects_tags' - ########### added by liuping - match 'tags/add_tag', :as=>"add_tag" - match 'tags/delete_tag', :as=>"add_tag" - match 'tags/show_all' - match 'parise_tread/praise_plus', :as=>"praise" - match 'parise_tread/tread_plus', :as=>"tread" - match 'tags/delete' - match 'tags/remove_tag', :as=>"remove_tag" - match 'tags/remove_tag_new', :as=>"remove_tag_new" - match 'tags/tag_save', :as => "save_tag" - match 'tags/update_tag_name',:as => "update_tag_name" - match 'tags/update_project_tag_name',:as => "update_project_tag_name" - match 'tags/update_org_subfield_tag_name' - - match 'words/add_brief_introdution' - - ##added by lizanle 日志查看路由 - match 'system_log/index' - match 'system_log/access_analysis' - match 'system_log/time_analysis' - match "/system_log" ,:to => 'system_log#index' - match 'system_log/clear' - get 'upload_files_menu', :to => 'files#upload_files_menu' - get '/manual/feedback', to:redirect("http://forge.trustie.net/forums/1/memos/1168") - ##ended by lizanle - - resources :git_callback do - collection do - post 'post_update' - end - end - - resources :at - resource :wechat, only:[:show, :create] do - collection do - get :login - get :user_activities - post :bind - post :get_bind - post :is_bind - get :auth - get :auth_callback - end - end - - resource :sso, only: [:show, :create] - - get '/:sub_dir_name', :to => 'org_subfields#show', :as => 'show_subfield_without_id' - - Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir| - file = File.join(plugin_dir, "config/routes.rb") - if File.exists?(file) - begin - instance_eval File.read(file) - rescue Exception => e - puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}." - exit 1 - end - end - end -end +# Redmine - project management software +# Copyright (C) 2006-2013 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write tobthe Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# modified by longjun +# 统一route风格 +# match 'path', :to => 'controller#action' +# 如果 path = controller#action 则 match 'path' +# Example: +# match 'welcome/course', :to => 'welcome#course' 变成 +# match 'welcome/cource' +# 所有的 act: :act 变成 :act => :act +# Example: :via => :get ====> :via => :get + +RedmineApp::Application.routes.draw do + resources :statistics + + + mount Mobile::API => '/api' + + # Enable Grack support + # mount Trustie::Grack.new, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post] + + constraints(Subdomain.new) do + get '/', to: 'organizations#show' + end + + constraints(Subdomain.new(sub: true)) do + get '/:sub_dir_name', to: 'fake#fake' + end + + resources :shield_wechat_messages do + collection do + delete 'show_messages' + end + end + resources :shield_activities do + collection do + delete 'show_acts' + end + end + resources :organizations do + resource :files do + member do + + end + collection do + + end + end + resources :org_document_comments do + member do + + end + collection do + + end + end + member do + get 'edit' + get 'setting'#, :action => 'settings', :as => 'settings' + get 'clear_org_avatar_temp' + put 'set_homepage' + put 'cancel_homepage' + get 'members' + get 'more_org_submains' + get 'more_org_projects' + get 'more_org_courses' + get 'search_courses' + get 'teachers' + get 'students' + get 'projects' + get 'courses' + get 'acts' + post 'join_course_menu' + post 'join_courses' + get 'search_projects' + post 'join_project_menu' + post 'join_projects' + post 'logout' + post 'apply_subdomain' + get 'org_resources_subfield' + get '/:sub_dir_name', :to => 'org_subfields#show', :as => 'show_org_subfield' + end + collection do + get 'check_uniq' + get 'check_uniq_domain' + get 'autocomplete_search' + post 'hide_org_subfield' + post 'show_org_subfield' + post 'set_excellent_teacher' + post 'set_excellent_student' + post 'reset_excellent_teacher' + post 'reset_excellent_student' + post 'agree_apply_subdomain' + post 'refused_apply_subdomain' + post 'update_field_by_admin' + post 'reset_update_field_by_admin' + end + end + + + + + resources :org_member do + member do + + end + collection do + get 'org_member_autocomplete' + get 'org_member_paging' + get 'deleteOrgMember' + end + end + + resources :org_subfields do + resources :files, :only => [:index, :new, :create] do + collection do + match "getattachtype", :via => [:get, :post] + match "search_files_in_subfield",:via => [:post,:get] + match "searchone4reload",:via => [:post,:get] + match "search_org_subfield_tag_attachment", :via => [:post,:get] + match "subfield_upload_file", :via => :post + end + member do + match "quote_resource_show_org_subfield", :via => [:get] + get "update_file_description" + post "edit_file_description" + end + end + + resources :sub_domains, :only => [:index, :new, :create, :show, :update, :destroy] do + resources :sub_document_comments, :only => [:index, :new, :create, :show, :update, :destroy, :edit] do + member do + post 'add_reply' + get 'quote' + post 'reply' + post 'add_reply_in_doc' + delete 'delete_reply' + match 'edit' + end + collection do + end + end + + collection do + end + member do + match 'domain_update_sub_dir', :via => [:put] + match 'domain_update_priority', :via => [:put] + match 'domain_update_status', :via => [:post] + post 'hide_sub_domain' + post 'show_sub_domain' + end + end + + member do + match 'update_sub_dir', :via => [:put] + match 'update_priority', :via => [:put] + match 'update_status', :via => [:post] + end + resource :boards + end + + resources :org_document_comments do + member do + post 'add_reply' + get 'quote' + post 'reply' + post 'add_reply_in_doc' + delete 'delete_reply' + end + collection do + + end + end + + resources :org_projects do + member do + + end + collection do + + end + end + + resources :org_courses do + member do + + end + collection do + + end + end + #match '/organizations/:organization_id/org_document_comments/new', :to => 'org_document_comments#new', :as => 'new_org_documents', :via => [:get, :post] + #match '/organizations/:organization_id/org_document_comments/create', :to => 'org_document_comments#create', :as => 'create_org_documents', :via => [:post] + resources :homework_users + resources :no_uses + delete 'no_uses', :to => 'no_uses#delete' + match 'site_search', :to => 'users#site_search', :as => 'site_search', :via => [:get, :post, :put] + resources :apply_project_masters + delete 'apply_project_masters', :to => 'apply_project_masters#delete' + + resources :comments do + member do + post 'reply' + get 'quote' + end + end + # resources :organization, :except => [:show] do + # + # end + + resources :school, :except => [:show] do + collection do + get 'apply_add_school' + get 'search_repeat_schoolname' + end + + member do + get 'upload_logo' + post 'upload' + get 'edit_apply_name' + get 'edit_apply_address' + get 'edit_apply_province' + end + end + + resources :homework_attach do + collection do + get 'get_homework_member_list' + match 'addjours', :via => [:get, :post] + match 'add_jour_reply', :via => [:get,:post] + match 'destroy_jour', :via => [:get,:post] + match 'comprehensive_evaluation_jour', :via => [:get,:post] + get 'get_not_batch_homework' + get 'get_batch_homeworks' + get 'get_homeworks' + get 'get_homework_jours' + get 'get_student_batch_homework' + get 'get_my_homework' + end + member do + match 'add_homework_users', :via => [:get,:post] + match 'destory_homework_users', :via => [:get,:post] + get 'praise_homework' + end + end + + resources :poll do + member do + get 'statistics_result' + post 'commit_answer' + post 'create_poll_question' + post 'commit_poll' + get 'publish_poll' + get 'save_poll' + get 'republish_poll' + get 'poll_result' + get 'close_poll' + get 'export_poll' + get 'import_poll' + post 'update_question_num' + end + collection do + delete 'delete_poll_question' + post 'update_poll_question' + get 'other_poll' + post 'import_other_poll' + end + end + + #show、index、new、create、edit、update、destroy路由自动生成 + resources :exercise do + member do #生成路径为 /exercise/:id/方法名 + get 'statistics_result' + get 'student_exercise_list' + get 'export_exercise' + get 'publish_exercise' + get 'republish_exercise' + get 'show_student_result' + post 'create_exercise_question' + post 'commit_answer' + get 'commit_exercise' + post 'update_question_num' + post 'send_to_course' + get 'get_student_uncomplete_question' + post 'edit_question_score' + end + + collection do #生成路径为 /exercise/方法名 + get 'delete_exercise_question' + post 'update_exercise_question' + get 'other_exercise' + post 'import_other_exercise' + get 'search_exercises' + get 'search_courses' + end + end + + resources :homework_common, :except => [:show]do + member do + get 'start_anonymous_comment' + get 'stop_anonymous_comment' + get 'alert_anonymous_comment' + get 'alert_forbidden_anonymous_comment' + get 'alert_open_student_works' + get 'open_student_works' + get 'start_evaluation_set' + get 'score_rule_set' + post 'set_evaluation_attr' + get 'alert_score_open_modal' + post 'set_score_open' + get 'add_to_homework_bank' + get 'publish_homework' + end + + collection do + post 'next_step' + post 'programing_test' + end + end + + resources :student_work do + member do + post 'add_score' + post 'revise_attachment' + get 'retry_work' + get 'add_comments_to_work' + get 'praise_student_work' + get 'forbidden_anonymous_comment' + get 'hide_score_detail' + end + collection do + post 'add_score_reply' + post 'student_work_project' + post 'change_project' + get 'new_student_work_project' + get 'search_user_projects' + get 'search_course_students' + get 'cancel_relate_project' + get 'delete_work' + get 'destroy_score_reply' + get 'student_work_absence_penalty' + get 'absence_penalty_list' + get 'evaluation_list' + # post 'set_program_score' + post 'program_test_ex' + post 'code_repeattest' + post 'last_codecomparetime' + post 'set_score_rule' + get 'work_canrepeat' + get 'get_user_infor' + post 'add_group_member' + post 'appeal_anonymous_score' + get 'alert_appeal_box' + get 'deal_appeal_score' + end + end + + resources :open_source_projects do + collection do + match 'search', :via => [:get, :post] + match 'remove_condition', :via => [:get, :post] + match 'allbug', :via => [:get, :post] + end + resources :relative_memos + member do + match 'master_apply', :via => [:get, :post] + match 'accept_master_apply', :via => [:get, :post] + match 'refuse_master_apply', :via => [:get, :post] + match 'showmemo', :via => [:get, :post] + match 'showbug', :via => [:get, :post] + end + end + + + mount SeemsRateable::Engine => '/rateable', :as => :rateable + + namespace :zipdown do + match 'assort' + match 'download_user_homework', :as => :download_user_homework + match 'download' + end + namespace :test do + match 'courselist' + match 'zip' + match 'mailer' + match 'view_office' + end + ##new added by linchun #以发布应用的形式参与竞赛 + resources :softapplications do + + collection do + match 'new_message', :via => :get + match 'search', :via => [:get, :post] + end + member do + match 'create_message' , :via => :post + end + end + + # ## new added by linchun #新竞赛相关 + # resources :contests, only: [:index] do + # resources :contestnotifications do + # # get 'preview', on: :collection + # resources :notificationcomments + # end + # + # collection do + # match 'new_contest' , :via => :get + # match 'join_in_contest' , :via => :post + # match 'unjoin_in_contest' , :via => :delete + # match 'create_contest' , :via => :post + # match 'new_join' , :via => :post + # match 'new' , :via => :post + # end + # member do + # delete 'destroy_contest' + # match 'add_softapplication' + # match 'update_contest' , :via => [:put] + # match 'show_contest' , :via => [:get, :post] + # match 'show_project' , :via => :get + # match 'show_softapplication' , :via => :get + # match 'show_attendingcontest' , :via => :get + # #match 'show_notification' , :via => :get + # match 'show_participator' , :via => :get + # match 'set_reward_project' , :via => [:get, :post] + # match 'set_reward_softapplication' , :via => [:get, :post] + # match 'add' , :via => [:get, :post] + # match 'add_softapplication' , :via => [:get, :post] + # match 'create' , :via => :post + # match 'settings' , :via => [:get, :post] + # match 'show_contest_user' + # get 'watcherlist', :action=> 'watcherlist' + # end + # end + + match '/news/preview', :to => 'previews#news', :as => 'preview_news', :via => [:get, :post, :put] + match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put] + match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put] + match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put] + + resources :stores do + collection do + match 'search', :via => [:get, :post] + get 'lost_file' + end + end + + resources :forums do + collection do + match 'search_forum', :via => [:get, :post] + match 'check_forum_name',:via => [:get] + end + member do + post 'create_memo' + post 'create_feedback' + post 'mail_feedback' + post 'update_memo_description' + match 'search_memo', :via => [:get, :post] + match 'delete_forum_tag',:via =>[:get] + match 'add_forum_tag',:via=>[:get] + end + resources :memos do + collection do + get "quote" + end + member do + get "change_sticky" + end + end + end + + resources :cooperation do + collection do + + end + end + + resources :shares + + #added by william + get "tags/index" + + get "tags/show" + + get "praise_tread/praise_plus" + get "praise_tread/praise_minus" + + get "praise_tread/tread_plus" + #end + + root :to => 'welcome#index', :as => 'home' + # added by longjun + match 'welcome/contest', :via => :get + # end longjun + + #added by nie + match '/projects/search', :via => [:get, :post] + match '/users/search', :via => [:get, :post] + #end + + # 消息相关路由 + resources :system_messages do + collection do + post 'create', :as => 'system_messages' + get 'index', :as => 'index' + end + end + # match 'system_messages/index', to: 'system_messages#index', :via => :get, :as => 'system_messages' + + match 'account/heartbeat', to: 'account#heartbeat', :via => :get + match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post] + match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post] + match 'agreement',:to => 'account#agreement',:as => 'agreement',:via=>[:get] + match 'about_us',:to=>'account#about_us',:as=>'about_us',:via=>[:get] + match 'account/register',:to=>'account#register', :via => [:get, :post], :as => 'register' + match 'account/lost_password', :via => [:get, :post], :as => 'lost_password' + match 'account/activate', :via => :get + match 'account/valid_ajax', :via => :get + match 'account/change_email', :via => :get + match 'account/email_valid', :to => 'account#email_valid', :via => :get + match 'account/resendmail', :to => 'account#resendmail', :via=> :get, :as => 'resendmail' + match 'account/codepedia_login', :to => 'account#codepedia_login', :via => [:get, :post] + match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post + match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post] + + #激活邮箱反馈问题 + match 'users/:id/leave_email_activation_message', :to => 'words#leave_email_activation_message', :via => :post, :as => "leave_email_activation_message" + + # boards + match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message' + match 'boards/:id/join_to_org_subfields', :to => 'boards#join_to_org_subfields' + match 'boards/:id/update_position', :to => 'boards#update_position', :via => :post + match 'boards/:id/update_name', :to => 'boards#update_name', :via => :put + get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message' + match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post] + get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit',:as=>'edit_board_message' + + post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message' + post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply' + post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' + post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy',:as=>'delete_board_message' + get 'boards/board_history', :to => 'boards#board_history' + match 'messages/join_org_subfield', :to => 'messages#join_org_subfield' + match 'messages/get_subfield_on_click_org', :to => 'messages#get_subfield_on_click_org' + match 'messages/join_org_subfields', :to => 'messages#join_org_subfields' + # boards end + + # Misc issue routes. TODO: move into resources + match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues' + match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu', :via => [:get, :post] + match '/issues/changes', :to => 'journals#index', :as => 'issue_changes', :via => :get + match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue' + + match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get + match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post] + match '/journals/destroy/:id', :to => 'journals#destroy', :id => /\d+/, :via => [:get, :post] + + get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt' + get '/issues/gantt', :to => 'gantts#show' + + get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar' + get '/issues/calendar', :to => 'calendars#show' + + get 'projects/:id/issues/statistics', :to => 'issues#statistics', :as => 'project_issues_statistics' + get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report' + get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details' + post '/users/:id/user_activities', :to => 'users#show', :as => "user_activities" + match 'projects/:project_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_course_news' + match 'projects/:project_id/news/new', :to => 'news#new', :via => [:get, :post] + + post '/courses/:id/course_activity', :to => 'courses#show', :as => 'course_activity' + get '/boards/:id/boards_topic', :to =>'boards#show', :as => 'boards_topic' + match 'courses/:course_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_course_news' + get 'news/news_history', :to => 'news#news_history' + match 'courses/:course_id/news/new', :to => 'news#new', :via => [:get, :post] + match 'contests/:contest_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_contest_news' + match 'contests/:contest_id/news/new', :to => 'news#new', :via => [:get, :post] + match 'users/:user_id/homepage/articles/:id', :to => 'article_homepages#show', :as => "user_homepage_show" + + match 'users/:id/courses', :to => 'users#course_community', :as => "user_course_community" + match 'users/:id/projects', :to => 'users#project_community', :as => "user_project_community" + match 'users/:id/contests', :to => 'users#contest_community', :as => "user_contest_community" + + scope ":username" do + resources :posts + end + +# added by cxt + resources :contest_members do + collection do + get 'contest_member_autocomplete' + end + + member do + + end + end + + # added by cxt + resources :contestant_works do + collection do + post 'student_work_project' + get 'new_student_work_project' + get 'cancel_relate_project' + get 'delete_work' + get 'search_contest_students' + end + + member do + get 'retry_work' + post 'add_score' + end + end + + # added by cxt + resources :works do + collection do + + end + + member do + get 'alert_score_open_modal' + post 'set_score_open' + get 'open_contestant_works' + get 'score_rule_set' + post 'set_score_rule' + end + end + + # added by cxt + resources :contests do + collection do + get 'join_contest' + get 'set_contest_attribute' + post 'join_contest_multi_role' + end + + member do + match 'settings' , :via => [:get, :post] + get 'feedback', :action => 'feedback', :as => 'contest_feedback' + get 'dealwith_apply_request' + get 'contest_activities' + get 'private_or_public' + get "switch_role" + get 'set_invite_code_halt' + get 'renew' + get 'member' + get 'export_all_members' + get 'feedback' + end + + resources :boards + resource :files do + member do + + end + collection do + + end + end + resources :news, :except => [:show, :edit, :update, :destroy] + end + + #added by young + resources :users do + collection do + match "tag_saveEx" , :via => [:get, :post] + post "user_new_homework" + get 'new_user_commit_homework' + get 'reply_to' + get 'reply_to_comment' + get 'show_all_replies' + get 'user_messages_unviewed' + post "user_commit_homework" + post 'user_select_homework' + post 'check_homework' + get 'all_journals' + get 'user_archive_courses' + post 'reply_detail' + end + + member do + match 'user_projects_index', :to => 'users#user_projects_index', :via => :get + match 'user_projects', :to => 'users#user_projects', :via => :get + match 'user_activities', :to => 'users#user_activities', :via => :get, :as => "user_activities" + # match 'user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "user_newfeedback" + match 'info', :to => 'users#info', :via => [:get , :post], :as => 'user_info' + match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang + match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang + match 'user_courses', :to => 'users#user_courses', :via => :get + match 'user_courses4show', :to => 'users#user_courses4show', :via => :get + match 'user_projects4show', :to => 'users#user_projects4show', :via => :get + match 'user_contests4show', :to => 'users#user_contests4show', :via => :get + match 'user_course_activities', :to => 'users#user_course_activities', :via => :get + match 'user_project_activities', :to => 'users#user_project_activities', :via => :get + match 'user_feedback4show', :to => 'users#user_feedback4show', :via => :get + match 'user_visitorlist', :to => 'users#user_visitorlist', :via => :get + match 'apply_for_homework', :to => 'users#apply_for_homework', :via => :post + match 'apply_homework', :to => 'users#apply_homework', :via => :get + match 'user_homeworks', :to => 'users#user_homeworks', :via => :get + match 'my_homeworks', :to => 'users#my_homeworks', :via => :get + match 'student_homeworks', :to => 'users#student_homeworks', :via => :get + get 'apply_resource' + get 'user_import_homeworks' + get 'user_search_homeworks' + get 'choose_user_course' + get 'user_import_resource' + match 'watch_projects', :to => 'users#watch_projects', :via => :get + get 'update_message_viewed' + get 'change_user_email' + # + # added by bai + match 'show_score', :to => 'users#show_score', :via => :get + match 'topic_score_index', :to => 'users#topic_score_index', :via => [:get, :post] + match 'project_score_index', :to => 'users#project_score_index', :via => :get + match 'activity_score_index', :to => 'users#activity_score_index', :via => :get + match 'influence_score_index', :to => 'users#influence_score_index', :via => :get + match 'score_index', :to => 'users#score_index', :via => :get + + match 'show_new_score', :to => 'users#show_new_score', :via => :get + match 'topic_new_score_index', :to => 'users#topic_new_score_index', :via => [:get, :post] + match 'project_new_score_index', :to => 'users#project_new_score_index', :via => :get + match 'activity_new_score_index', :to => 'users#activity_new_score_index', :via => :get + match 'influence_new_score_index', :to => 'users#influence_new_score_index', :via => :get + match 'score_new_index', :to => 'users#score_new_index', :via => :get + match 'update_score', :to => 'users#update_score', :via => [:get,:post] + + match 'show_projects_score', :to => 'projects#show_projects_score', :via => [:get, :post] + match 'issue_score_index', :to => 'projects#issue_score_index', :via => [:get, :post] + match 'news_score_index', :to => 'projects#news_score_index', :via => [:get, :post] + match 'file_score_index', :to => 'projects#file_score_index', :via => [:get, :post] + match 'code_submit_score_index', :to => 'projects#code_submit_score_index', :via => [:get, :post] + match 'projects_topic_score_index', :to => 'projects#projects_topic_score_index', :via => [:get, :post] + match 'user_act_issue_assign_to', :to => 'users#user_act_issue_assign_to', :via => [:get, :post] + + #addby yk + match 'user_courselist', :to => 'users#user_courselist', :via => :get, :as => "user_courselist" + match 'user_projectlist', :to => 'users#user_projectlist', :via => :get, :as => "user_projectlist" + match 'user_contestlist', :to => 'users#user_contestlist', :via => :get, :as => "user_contestlist" + + match 'sort_syllabus_list', :to => 'users#sort_syllabus_list', :via => :get, :as => "sort_syllabus_list" + match 'sort_project_list', :to => 'users#sort_project_list', :via => :get, :as => "sort_project_list" + + get 'edit_brief_introduction' + get "user_resource" + match "user_issues", :to => 'users#user_issues', :via => [:get, :post], :as => "user_issues" + match "user_manage_issues", :to => 'users#user_manage_issues', :via => [:get, :post], :as => "user_manage_issues" + match "user_receive_issues", :to => 'users#user_receive_issues', :via => [:get, :post], :as => "user_receive_issues" + match "user_manage_homeworks", :to => 'users#user_manage_homeworks', :via => [:get, :post], :as => "user_manage_homeworks" + match "user_receive_homeworks", :to =>'users#user_receive_homeworks', :via => [:get, :post], :as => "user_receive_homeworks" + get "import_resources" + get "import_resources_search" + post "import_into_container" + get "resource_search" + post "user_resource_create" + post "user_resource_delete" + get "search_user_course" + post "send_homework_to_course" + post "add_exist_file_to_course" + post "add_exist_file_to_project" + post 'add_exist_file_to_org' + post 'share_news_to_course' + post 'share_news_to_project' + post 'share_news_to_org' + post 'share_message_to_course' + post 'share_message_to_project' + post 'share_message_to_org' + get 'resource_preview' + get 'rename_resource' + get 'search_user_project' + get 'user_resource_type' + get 'user_ref_resource_search' + post 'import_resources_to_homework' + get 'dealwith_apply_request' + get 'dealwith_apply_homework' + get 'deal_with_apply_resource' + get 'store_selected_resource' + get 'user_organizations' + get 'search_user_orgs' + get 'search_user_org' #for send resource + get 'user_homework_type' + get 'user_ref_homework_search' + get 'show_homework_detail' + post 'apply_for_homework' + post 'apply_for_resource' + match 'manage_or_receive_homeworks', :to => 'users#manage_or_receive_homeworks', :via => :get + get 'search_m_r_homeworks' + get 'expand_courses' + get 'cancel_or_collect' + get 'homepage' + get 'unsolved_issues_list' + get 'unfinished_homework_list' + get 'unfinished_poll_list' + get 'unfinished_test_list' + get 'anonymous_evaluation_list' + get 'unapproval_applied_list' + # end + end + #resources :blogs + resources :blogs, :path => "report" do + resources :blog_comments, :path => "report_comments" do + member do + post 'reply' + get 'quote' + end + end + end + + resources :homepages do + resources :article_homepages do + member do + end + end + end + end + resources :blog_comments do + collection do + get :search + end + end + resource :homepages do + member do + post 'set_homepage' + post 'cancel_homepage' + end + collection do + + end + end + resources :article_homepages do + member do + end + end + match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback" + match 'users/:id/user_projects', :to => 'users#user_projects', :via => :get + #消息 + match 'users/:id/user_messages', :to => 'users#user_messages', :via => :get, :as => "user_message" + match 'users/:id/user_system_messages', :to => 'users#user_system_messages', :via => :get, :as => "user_system_messages" + match 'set_homepage', :to => 'blogs#set_homepage', :via => :post + match 'cancel_homepage', :to => 'blogs#cancel_homepage', :via => :post + #match 'users/:id/user_messages/:homework', :to => 'users#user_messages_homework', :via => :get, :as => "user_message_homewrok" + + + + #end + match 'my/account', :via => [:get, :post] + match 'my/account/destroy', :to => 'my#destroy', :via => [:get, :post] + match 'my/page', :via => :get + match 'my', :to => 'my#index', :via => :get # Redirects to my/page + match 'my/reset_rss_key', :via => :post + match 'my/reset_api_key', :via => :post + match 'my/password', :via => [:get, :post] + match 'my/page_layout', :via => :get + match 'my/add_block', :via => :post + match 'my/remove_block', :via => :post + match 'my/order_blocks', :via => :post + match 'my/change_mail_notification', via: :get + match 'my/save_user_avatar', :to => 'my#save_user_avatar', :via => [:get, :post] + match 'my/clear_user_avatar_temp', :to => 'my#clear_user_avatar_temp', :via => [:get, :post] + + get 'my/page2', :to => 'my#page2', :as => "my_page2" + + resources :users + match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership' + match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete + match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships' + ################# added by william + match 'users/tag_save', :via => :post, :as => 'tag' + match 'users/tag_saveEx', :via => [:get, :post] + #get 'users/:id/user_organizations', :to => 'users#user_organizations', :as => 'user_organizations' + post 'watchers/watch', :to => 'watchers#watch', :as => 'watch' + delete 'watchers/watch', :to => 'watchers#unwatch' + get 'watchers/new', :to => 'watchers#new' + post 'watchers', :to => 'watchers#create' + post 'watchers/append', :to => 'watchers#append' + delete 'watchers', :to => 'watchers#destroy' + get 'watchers/autocomplete_for_user', :to => 'watchers#autocomplete_for_user' + # Specific routes for issue watchers API + post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue' + delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue' + + post 'applied_project/applied_join', :to => 'applied_project#applied_join_project', :as => 'applied_join_project' + post 'applied_project/applied_project_info', :to => 'applied_project#applied_project_info', :as => 'applied_project_info' + delete 'applied_project/applied', :to => 'applied_project#unapplied_join_project', :as => 'unapplied_join_project' + + resources :projects do + member do + match 'change_project_type', :via => [:get, :post] + get 'settings(/:tab)', :action => 'settings', :as => 'settings' + #by young + get 'member', :to => 'projects#member', :as => 'member' + match 'project_watcherlist', :to => 'projects#project_watcherlist', :as => 'project_watcherlist' + match 'store_mine', :to => 'projects#store_mine', :as => 'store_mine' + match 'enshrine', :to => 'projects#enshrine', :as => 'enshrine' + match 'member_forked', :to => 'projects#member_forked', :as => 'member_forked' + get 'file', :action => 'file', :as => 'file' + get 'statistics', :action => 'statistics', :as => 'statistics' + get 'repository_tree_changes', :action => 'repository_tree_changes', :as => 'repository_tree_changes' + get 'destroy_repository', :action => 'destroy_repository', :as => 'destroy_repository' + + get 'feedback', :action => 'feedback', :as => 'project_feedback' + get 'watcherlist', :action=> 'watcherlist' + + # get 'invite_members', :action=> 'invite_members' + get 'invite_members_by_mail', :action=> 'invite_members_by_mail' + # get 'dts_repos', :aciton => 'dts_repos' + get 'send_mail_to_member', :action => 'send_mail_to_member' + match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" + #end + + post 'add_script' + post 'modules' + post 'archive' + post 'unarchive' + post 'close' + post 'reopen' + get 'training_project_execute' + get 'training_project_update' + get 'training_project_extend' + get 'task_execute' + get 'forked_pop' + get 'training_chiled_project_exec' + get 'delete_member_pop', :to => 'projects#delete_member_pop', :via => :get, :as => "delete_member_pop" + get 'search_public_orgs_not_in_project' + match 'copy', :via => [:get, :post] + match 'set_public_or_private', :via => [:post] + end + + collection do + get 'project_home' + match 'join_project', :via => [:get, :post] + match 'training_task_status', :via => [:get, :post] + end + + #by young + match '/member', :to => 'projects#member', :as => 'member', :via => :get + match '/file', :to => 'projects#file', :as => 'file', :via => :get + match '/statistics', :to => 'projects#statistics', :as => 'statistics', :via => :get + match '/watcherlist', :to=>'projects#watcherlist', :as => 'watcherlist', :via => :get #add by huang + resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do + collection do + get 'autocomplete' + get 'appliedproject' + post 'allow_to_join_project' + get 'refused_allow_to_join_project' + end + end + + resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy] + + get 'issues/:copy_from/copy', :to => 'issues#new', :as => 'copy_issue' + resources :issues, :only => [:index, :new, :create] do + resources :time_entries, :controller => 'timelog' do + collection do + get 'report' + end + end + end + # issue form update + match 'issues/update_form', :to => 'issues#update_form', :via => [:put, :post], :as => 'issue_form' + + resources :files, :only => [:index, :new, :create] do + collection do + match "getattachtype", :via => [:get, :post] + match "search_project",:via => [:post,:get] + match "searchone4reload",:via => [:post,:get] + match "search_tag_attachment", :via => [:post,:get] + end + member do + match "quote_resource_show", :via => [:get] + get "file_hidden" + get "update_file_description" + post "edit_file_description" + end + end + + resources :training_tasks do + collection do + + end + member do + post 'add_journal' + get 'delete_journal' + get 'reply' + post 'add_reply' + end + end + + resources :pull_requests do + collection do + end + member do + get 'accept_pull_request' + get 'pull_request_commits' + get 'pull_request_changes' + get 'update_pull_request' + get 'pull_request_comments' + post 'create_pull_request_comment' + end + end + + resources :quality_analysis, :only => [:index, :create, :edit, :update, :delete] do + collection do + end + member do + match 'update_jenkins_job' + match 'edit' + match 'delete' + match 'create' + get 'error_list' + end + end + # resources :files, :only => [:index, :new, :create] do + # member do + # match "quote_resource_show_project",:via => [:get] + # end + # collection do + # match "getattachtype" , :via => [:get, :post] + # match "search_project",:via => [:post,:get] + # #match 'getattachtype/:attachtype', :to => 'files#getattachtype', :via => [:get, :post] + # end + # end + + + resources :versions, :except => [:index, :show, :edit, :update, :destroy] do + collection do + put 'close_completed' + get 'judge_version_title' + end + end + get 'versions.:format', :to => 'versions#index' + get 'roadmap', :to => 'versions#index', :format => false + get 'versions', :to => 'versions#index' + + resources :news, :except => [:show, :edit, :update, :destroy] + resources :time_entries, :controller => 'timelog' do + get 'report', :on => :collection + end + resources :queries, :only => [:new, :create] + resources :issue_categories, :shallow => true + resources :documents, :except => [:show, :edit, :update, :destroy] + resources :boards + resources :repositories, :shallow => true, :except => [:index, :show] do + member do + match 'committers', :via => [:get, :post] + end + end + resources :repositories, :except => [:index, :show] do + member do + get 'newrepo', :via => [:get, :post] + put 'to_gitlab' + # get 'create', :via=>[:get, :post] + end + end + + match 'wiki/index', :via => :get + resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do + member do + get 'rename' + post 'rename' + get 'history' + get 'diff' + match 'preview', :via => [:post, :put] + post 'protect' + post 'add_attachment' + end + collection do + get 'export' + get 'date_index' + end + end + match 'wiki', :to => 'wiki#show', :via => :get + get 'wiki/:id/:version', :to => 'wiki#show', :constraints => {:version => /\d+/} + delete 'wiki/:id/:version', :to => 'wiki#destroy_version' + get 'wiki/:id/:version/annotate', :to => 'wiki#annotate' + get 'wiki/:id/:version/diff', :to => 'wiki#diff' + end + + resources :issues do + collection do + match 'bulk_edit', :via => [:get, :post] + post 'bulk_update' + get 'issue_commits' + get 'commit_for_issue' + get 'issue_commit_delete' + end + member do + post 'add_journal' + post 'add_journal_in_org' + get 'delete_journal' + get 'reply' + post 'add_reply' + end + resources :time_entries, :controller => 'timelog' do + collection do + get 'report' + end + end + resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy] + end + match '/issues', :to => 'issues#destroy', :via => :delete + + resources :queries, :except => [:show] + + resources :training_tasks do + member do + post 'complete_training_task' + post 'add_reply' + post 'add_journal' + post 'add_journal_in_org' + get 'delete_journal' + get 'reply' + end + collection do + end + end + + resources :news, :only => [:index, :show, :edit, :update, :destroy] + + match '/news/:id/comments', :to => 'comments#create', :via => :post + #match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete + delete '/news/:id/comments/:comment_id', :to => 'comments#destroy', as: :delete_news_comments + + resources :versions, :only => [:show, :edit, :update, :destroy] do + post 'status_by', :on => :member + end + + resources :documents, :only => [:show, :edit, :update, :destroy] do + post 'add_attachment', :on => :member + end + + match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu, :via => [:get, :post] + + resources :time_entries, :controller => 'timelog', :except => :destroy do + collection do + get 'report' + get 'bulk_edit' + post 'bulk_update' + end + end + match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/ + # TODO: delete /time_entries for bulk deletion + match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete + + get 'projects/:id/activity', :to => 'activities#index' + get 'projects/:id/activity.:format', :to => 'activities#index' + get 'activity', :to => 'activities#index' + + # repositories routes + get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats', :as => "stats_repository_project" + get 'projects/:id/repository/:repository_id/quality_analysis', :to => 'repositories#quality_analysis', :as => "quality_analysis" + get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph' + + get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))', :to => 'repositories#changes' + + get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision' + get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision' + post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue' + delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' + get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions' + get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', + :controller => 'repositories', + :format => false, + :constraints => { + :action => /(browse|show|entry|raw|annotate|diff|commit_diff)/, + :rev => /[a-z0-9\.\-_]+/ + } + + get 'projects/:id/repository/statistics', :to => 'repositories#stats' + get 'projects/:id/repository/quality_analysis', :to => 'repositories#quality_analysis' + + get 'projects/:id/repository/graph', :to => 'repositories#graph' + + get 'projects/:id/repository/changes(/*path(.:ext))', :to => 'repositories#changes' + + get 'projects/:id/repository/forked', :to => 'repositories#forked' + get 'projects/:id/repository/training_task_execute', :to => 'repositories#training_task_execute' + get 'projects/:id/repository/tree_head_message', :to => 'repositories#tree_head_message', :as => "tree_head_message" + get 'projects/:id/repository/export_rep_static', :to => 'repositories#export_rep_static' + get 'projects/:id/repository/project_archive', :to => 'repositories#project_archive', :as => 'project_archive' + get 'projects/:id/repository/revisions', :to => 'repositories#revisions' + get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision' + get 'projects/:id/repository/revision', :to => 'repositories#revision' + post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue' + delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' + get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', + :controller => 'repositories', + :format => false, + :constraints => { + :action => /(browse|show|entry|raw|annotate|diff|commit_diff)/, + :rev => /[a-z0-9\.\-_]+/ + } + get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))', + :controller => 'repositories', + :action => /(browse|show|entry|raw|changes|annotate|diff|commit_diff)/ + get 'projects/:id/repository/:action(/*path(.:ext))', + :controller => 'repositories', + :action => /(browse|show|entry|raw|changes|annotate|diff|commit_diff)/ + + get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil + get 'projects/:id/repository/:repository_id/entry_edit', :to => 'repositories#entry_edit', :path => nil + post 'projects/:id/repository/:repository_id/entry_update', :to => 'repositories#entry_update', :path => nil + get 'projects/:id/repository', :to => 'repositories#show', :path => nil + get 'projects/:id/exit', :to => 'projects#exit_project', :as => 'exit_cur_project' + + # additional routes for having the file name at the end of url + get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment' + get 'attachments/attachment_versions/:id',:to=>'attachments#attachment_versions',:as=>'attachments_versions' + get 'attachments/attachment_versions_delete/:id',:to=>'attachments#attachment_versions_delete',:as=>'attachment_versions_delete' + get 'attachments/attachment_history_download/:id',:to=>'attachments#attachment_history_download',:as=>'attachment_history_download' + post 'attachments/upload_attachment_version',:to=>'attachments#upload_attachment_version',:as=>'upload_attachment_version' + get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment' + get 'attachments/download_history/:id/:filename', :to => 'attachments#download_history', :id => /\d+/, :filename => /.*/, :as => 'download_history_attachment' + get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/ + get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail' + get 'attachments/autocomplete' + get 'attachments/update_attachment_publish_time/:id',:to=>'attachments#update_attachment_publish_time',:as=>'update_attachment_publish_time' + match 'attachments/autocomplete', :to => 'attachments#autocomplete', :via => [:post] + post 'attachments/relationfile', to: 'attachments#add_exist_file_to_project', as: 'attach_relation' + post 'attachments/relationfiles', to: 'attachments#add_exist_file_to_projects', as: 'attach_relations' + post 'attachments/courserelationfile', to: 'attachments#add_exist_file_to_course', as: 'course_attach_relation' + post 'attachments/courserelationfiles', to: 'attachments#add_exist_file_to_courses', as: 'course_attach_relations' + match 'attachments/add_exist_file_to_org_subfield' + get 'attachments/renderTag/:attchmentId', :to => 'attachments#renderTag', :attchmentId => /\d+/ + resources :attachments, :only => [:show, :destroy] do + collection do + match "updateType" , :via => [:get, :post] + match "updateFileDense" , :via => [:get, :post] + match "update_file_dense", :via => [:post] + match "renderTag" , :via => [:get, :post] + match 'delete_softapplications', :via => [:get, :post] + get 'batch_setting' + post 'resource_batch_setting' + get 'upload_atta' + end + end + resources :groups do + member do + get 'autocomplete_for_user' + end + end + + match 'groups/:id/users', :to => 'groups#add_users', :id => /\d+/, :via => :post, :as => 'group_users' + match 'groups/:id/users/:user_id', :to => 'groups#remove_user', :id => /\d+/, :via => :delete, :as => 'group_user' + match 'groups/destroy_membership/:id', :to => 'groups#destroy_membership', :id => /\d+/, :via => :post + match 'groups/edit_membership/:id', :to => 'groups#edit_membership', :id => /\d+/, :via => :post + + resources :trackers, :except => :show do + collection do + match 'fields', :via => [:get, :post] + end + end + resources :issue_statuses, :except => :show do + collection do + post 'update_issue_done_ratio' + end + end + resources :custom_fields, :except => :show + resources :roles do + collection do + match 'permissions', :via => [:get, :post] + end + end + resources :web_footer_companies, :except => :show + resources :enumerations, :except => :show + match 'enumerations/:type', :to => 'enumerations#index', :via => :get + + get 'projects/:id/search', :controller => 'search', :action => 'index' + get 'search', :controller => 'search', :action => 'index' + + match 'mail_handler', :to => 'mail_handler#index', :via => :post + match 'mail_handler/cancel/:id', :to => 'mail_handler#cancel_mail_notify',:via => :get + + match 'admin', :to => 'admin#index', :via => :get + match 'admin/projects', :via => :get + match 'admin/export_rep_static_users', :via => :get + get 'admin/courses', as: :all_courses + get 'admin/syllabuses', as: :all_syllabuses + get 'admin/contests', :via => :get + get 'admin/non_syllabus_courses', as: :non_syllabus_courses + post 'admin/update_course_name' + post 'admin/update_syllabus_title' + get 'admin/excellent_courses', as: :excellent_courses + get 'admin/excellent_all_courses', as: :excellent_all_courses + match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course' + match 'admin/cancel_excellent_course/:id', :to => 'admin#cancel_excellent_course' + get 'admin/course_resource_list' + get 'admin/project_resource_list' + match 'admin/users', :via => :get + match 'admin/messages', :via => :get + match 'admin/first_page_made', as: :first_page_made + match 'admin/course_page_made', as: :course_page_made + match 'admin/contest_page_made', as: :contest_page_made + match 'admin/web_footer_made', as: :web_footer_made + match 'admin/enterprise_page_made', as: :enterprise_page_made + match 'admin/mobile_version', as: :mobile_version + match 'admin/create_version', as: :create_version + match 'admin/search', :via => [:get, :post] + match 'admin/plugins', :via => :get + match 'admin/info', :via => :get + match 'admin/test_email', :via => :get + match 'admin/default_configuration', :via => :post + get 'admin/organization' + get 'admin/schools' + get 'admin/applied_schools', as: :unapplied_schools + get 'admin/has_applied_schools', as: :applied_schools + get 'admin/approve_applied_schools' + post 'admin/edit_applied_schools' + get 'admin/all_schools' + get 'admin/apply_shcool_sort', as: :apply_shcool_sort + delete 'admin/delete_applied_schools' + + get 'admin/leave_messages' + match 'admin/messages_list', as: :messages_list + match 'admin/project_messages', as: :project_messages + match'admin/course_messages', as: :course_messages + get 'admin/notices' + match 'admin/latest_login_users', as: :latest_login_users + match 'admin/latest_login_teachers', as: :latest_login_teachers + get 'admin/homework' + get 'admin/apply_for_homework' + get 'admin/code_work_tests' + post 'admin/select_course_syllabus' + post 'admin/create_syllabus' + + resources :auth_sources do + member do + get 'test_connection', :as => 'try_connection' + end + collection do + get 'autocomplete_for_new_user' + end + end + + match 'courses/search' + match '/contests/search', :via => [:get, :post] + + #课程大纲路由设置 + resources :syllabuses do + member do + match 'syllabus_courselist', :to => 'syllabuses#syllabus_courselist', :via => :get, :as => 'syllabus_courselist' + get 'edit_syllabus_eng_name' + get 'edit_syllabus_title' + post 'update_base_info' + get 'delete_syllabus' + get 'delete_des' + get 'members' + end + + collection do + + end + end + + resources :syllabus_member do + member do + post 'update_rank' + end + + collection do + get 'syl_member_autocomplete' + end + end + + # add by nwb + # 课程路由设置 + resources :courses do + member do + get 'sync_temp_excel' + get 'settings(/:tab)', :action => 'settings', :as => 'settings' + get 'search_member', :action => 'search_member' + get 'file', :action => 'file', :as => 'file' + get 'feedback', :action => 'feedback', :as => 'course_feedback' + get 'code_repeat', :action => 'code_repeat', :as => 'code_repeat' + get 'member', :controller => 'courses', :action => 'member', :as => 'member' + get 'group_member', :controller => 'courses', :action => 'group_member', :as => 'group_member' + get 'export_course_member_excel',:controller => 'courses',:action => 'export_course_member_excel' + get 'member_score', :to => 'courses#member_score' + post 'finishcourse' + post 'restartcourse' + match "renew", :to => 'courses#renew', :via => [:post, :get], :as =>'renew' + match "searchmembers", :controller => 'courses', :action => 'searchmembers', :via => [:post,:get] + match "searchgroupmembers", :via => [:post, :get] + match 'member_score_sort', :via => [:get] + match "updategroupname", :via => [:post, :get] + match "addgroups", :via => [:post, :get] + match 'deletegroup', :via => [:delete] + match 'show_member_score', :via => [:get] + match 'show_member_act_score', :via => [:get] + match 'valid_ajax', :to => 'courses#valid_ajax', :via => :get + post 'join_in/join_group', :to => 'courses#join_group', :as => 'join_group' + delete 'join_in/join_group', :to => 'courses#unjoin_group' + get 'copy_course' + get 'private_or_public' + match 'course_activity', :to => 'courses#course_activity', :via => :get, :as => "course_activity" + get 'course_outline' + post 'search_course_outline' + post 'set_course_outline' + post 'teacher_assign_group' + get 'syllabus' + get 'search_public_orgs_not_in_course' + get "homework_search" + get "show_comparecode" + get "course_statistics" + get "switch_role" + get 'search_not_group_member' + post 'add_members' + get 'search_course_teacher_list' + post 'change_manager' + get 'delete_member' + get 'archive_course' + get 'set_invite_code_halt' + get 'open_or_close_os_interface' + end + collection do + match 'join_private_courses', :via => [:get, :post] + post "join_course_multi_role" + + end + + match '/member', :to => 'courses#member', :as => 'member', :via => :get + resources :boards + resources :files, :only => [:index, :new, :create] do + collection do + match "getattachtype", :via => [:get, :post] + match "search",:via => [:post,:get] + match "searchone4reload",:via => [:post,:get] + match "search_tag_attachment", :via => [:post,:get] + end + member do + match "quote_resource_show", :via => [:get] + get "file_hidden" + post "republish_file" + get "update_file_description" + post "edit_file_description" + end + end + resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do + collection do + get 'autocomplete' + get 'appliedproject' + end + end + resources :news, :except => [:show, :edit, :update, :destroy] + # resources :boards do + # member do + # match 'boards_topic', :to => 'boards#boards_topic', :via => :get, :as => "boards_topic" + # end + # end + match '/homework', :to => 'courses#homework', :as => 'homework', :via => :get + resources :activity_notifys do + collection do + match 'chang_read_flag', :via => :get + end + end + + end # end of resources :courses + match 'courses/:id/feedback', :to => 'courses#feedback', :via => :get, :as => 'course_feedback' + match '/courses/search', :via => [:get, :post] + match 'words/:id/leave_course_message', :to => 'words#leave_course_message', :as => "leave_course_message" + + + match 'workflows', :to => 'workflows#index', :via => :get + match 'workflows/edit', :via => [:get, :post] + match 'workflows/permissions', :via => [:get, :post] + match 'workflows/copy', :via => [:get, :post] + match 'settings', :controller => 'settings', :action => 'index', :via => :get + match 'settings/edit', :via => [:get, :post] + match 'settings/plugin/:id', :to => 'settings#plugin', :via => [:get, :post], :as => 'plugin_settings' + match 'settings/hidden_non_project', :via => [:get, :post] + match 'settings/hidden_courses', :via => [:get, :post] + + match 'sys/projects', :via => :get + match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post + match 'sys/fetch_changesets', :via => :get + + match 'uploads', :to => 'attachments#upload', :via => :post + # Added by Tao + match 'upload_avatar', :to => 'avatar#upload', :via => :post + match 'delete_avatar', :to => 'avatar#delete_image',:via => :post + # Endof Tao's code + get 'robots.txt', :to => 'welcome#robots' + ##############测试留言功能 fq + post 'words/new', :to => 'words#new' + post 'words/create', :to => 'words#create' + post 'words/append', :to => 'words#append' + post 'words/create_reply', :to => 'words#create_reply' + delete 'words/destroy', :to => 'words#destroy' + delete 'words/destroyJournal', :to => 'words#destroyJournal' + get 'words/more', :to => 'words#more' + get 'words/back', :to=> 'words#back' + get 'words/destroyJournal', :to => 'words#destroyJournal' + match 'words/add_project_respond', :to => 'words#add_project_respond' + match 'words/:id/leave_project_message', :to => 'words#leave_project_message' + match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback' + match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share + post 'words/:id/leave_user_message', :to => 'words#leave_user_message', :as => "leave_user_message" + post 'words/:id/leave_contest_message', :to => 'words#leave_contest_message', :as => "leave_contest_message" + post 'words/:id/leave_syllabus_message', :to => 'words#leave_syllabus_message', :as => "leave_syllabus_message" + post 'words/:id/leave_homework_message', :to => 'words#leave_homework_message', :as => "leave_homework_message" + post 'words/:id/reply_to_homework', :to => 'words#reply_to_homework', :as => "reply_to_homework" + post 'words/:id/leave_contest_work_message', :to => 'words#leave_contest_work_message', :as => "leave_contest_work_message" + post 'words/:id/reply_to_contest_work', :to => 'words#reply_to_contest_work', :as => "reply_to_contest_work" + post 'words/:id/reply_to_syllabus', :to => 'words#reply_to_syllabus', :as => "reply_to_syllabus" + + post 'join_in/join', :to => 'courses#join', :as => 'join' + delete 'join_in/join', :to => 'courses#unjoin' + post 'join_in/join_group', :to => 'courses#join_group', :as => 'join_group' + delete 'join_in/join_group', :to => 'courses#unjoin_group' + + delete 'attachment/:id', :to => 'attachments#delete_homework' + match 'new_join', :to => 'courses#new_join', :as => 'try_join' + match 'new_join_group', :to => 'courses#new_join_group', :as => 'try_join_group' + match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post + + ######################## + ##added by wen########## + #######confusing######## + get 'welcome/search', to: 'welcome#search' + get 'school/index', to: 'school#index' + get 'school/:school_id', to: 'welcome#course', :as => 'school_course_list' + post 'school/get_options/:province', :to => 'school#get_options' + get 'school/get_options/:province', :to => 'school#get_options' + + post 'school/get_province', :to => 'school#get_province' + get 'school/get_province', :to => 'school#get_province' + + post 'school/get_schoollist/:province', :to => 'school#get_schoollist' + get 'school/get_schoollist/:province', :to => 'school#get_schoollist' + + post 'school/search_school/', :to => 'school#search_school' + get 'school/search_school/', :to => 'school#search_school' + + post 'school/on_search' + post 'school/add_school' + ######added by nie + match 'tags/show_projects_tags' + ########### added by liuping + match 'tags/add_tag', :as=>"add_tag" + match 'tags/delete_tag', :as=>"add_tag" + match 'tags/show_all' + match 'parise_tread/praise_plus', :as=>"praise" + match 'parise_tread/tread_plus', :as=>"tread" + match 'tags/delete' + match 'tags/remove_tag', :as=>"remove_tag" + match 'tags/remove_tag_new', :as=>"remove_tag_new" + match 'tags/tag_save', :as => "save_tag" + match 'tags/update_tag_name',:as => "update_tag_name" + match 'tags/update_project_tag_name',:as => "update_project_tag_name" + match 'tags/update_org_subfield_tag_name' + + match 'words/add_brief_introdution' + + ##added by lizanle 日志查看路由 + match 'system_log/index' + match 'system_log/access_analysis' + match 'system_log/time_analysis' + match "/system_log" ,:to => 'system_log#index' + match 'system_log/clear' + get 'upload_files_menu', :to => 'files#upload_files_menu' + get '/manual/feedback', to:redirect("http://forge.trustie.net/forums/1/memos/1168") + ##ended by lizanle + + resources :git_callback do + collection do + post 'post_update' + end + end + + resources :at + resource :wechat, only:[:show, :create] do + collection do + get :login + get :user_activities + post :bind + post :get_bind + post :is_bind + get :auth + get :auth_callback + end + end + + resource :sso, only: [:show, :create] + + get '/:sub_dir_name', :to => 'org_subfields#show', :as => 'show_subfield_without_id' + + Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir| + file = File.join(plugin_dir, "config/routes.rb") + if File.exists?(file) + begin + instance_eval File.read(file) + rescue Exception => e + puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}." + exit 1 + end + end + end +end diff --git a/db/migrate/20180205031602_create_statistics.rb b/db/migrate/20180205031602_create_statistics.rb new file mode 100644 index 000000000..a87d89cd6 --- /dev/null +++ b/db/migrate/20180205031602_create_statistics.rb @@ -0,0 +1,12 @@ +class CreateStatistics < ActiveRecord::Migration + def change + create_table :statistics do |t| + t.string :name + t.text :description, :limit => 4294967296 + t.integer :user_id + t.integer :status, :default => 0, :limit => 1 + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 471e5c12a..079c5f089 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 => 20170425030242) do +ActiveRecord::Schema.define(:version => 20180205031602) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -84,6 +84,18 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "role", :default => 0 end + create_table "apply_actions", :force => true do |t| + t.integer "user_id" + t.string "reason" + t.integer "container_id" + t.string "container_type" + t.integer "dealer_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :limit => 1, :default => 0 + t.text "apply_reason" + end + create_table "apply_add_departments", :force => true do |t| t.string "name" t.integer "department_id" @@ -144,6 +156,19 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "apply_user_id" end + create_table "apply_user_authentications", :force => true do |t| + t.integer "user_id" + t.integer "status" + t.integer "auth_type" + t.string "remarks" + t.integer "dealer" + t.datetime "deal_time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "apply_user_authentications", ["user_id"], :name => "index_apply_user_authentications_on_user_id" + create_table "article_homepages", :force => true do |t| t.string "title" t.text "content" @@ -244,6 +269,16 @@ ActiveRecord::Schema.define(:version => 20170425030242) do add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" + create_table "authentications", :force => true do |t| + t.integer "level", :limit => 1 + t.text "permissions" + end + + create_table "authentications_users", :force => true do |t| + t.integer "user_id" + t.integer "authentication_id" + end + create_table "biding_projects", :force => true do |t| t.integer "project_id" t.integer "bid_id" @@ -346,6 +381,28 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.datetime "updated_at", :null => false end + create_table "challenge_chooses", :force => true do |t| + t.text "subject" + t.integer "challenge_id" + t.string "standard_answer" + t.text "answer" + t.integer "score" + t.integer "difficult" + t.integer "category" + t.integer "position", :default => 1 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "challenge_questions", :force => true do |t| + t.text "option_name" + t.integer "challenge_choose_id" + t.boolean "right_key" + t.integer "position", :limit => 1 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "challenge_samples", :force => true do |t| t.string "input" t.string "output" @@ -358,8 +415,9 @@ ActiveRecord::Schema.define(:version => 20170425030242) do create_table "challenge_tags", :force => true do |t| t.string "name" t.integer "challenge_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "challenge_choose_id" end create_table "challenges", :force => true do |t| @@ -369,17 +427,20 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "user_id" t.integer "status", :limit => 1, :default => 0 t.integer "position", :limit => 1, :default => 1 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "ready_knowledge" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "ready_knowledge", :limit => 2147483647 t.text "task_pass", :limit => 2147483647 t.text "answer", :limit => 2147483647 - t.integer "score" + t.integer "score", :default => 100 t.integer "visits", :default => 0 t.string "path" t.integer "evaluation_way", :default => 0 t.integer "difficulty", :default => 1 t.text "pipeline_script" + t.string "exec_path" + t.integer "code_line" + t.integer "st", :limit => 1, :default => 0 end create_table "changes", :force => true do |t| @@ -428,6 +489,15 @@ ActiveRecord::Schema.define(:version => 20170425030242) do add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true + create_table "choose_outputs", :force => true do |t| + t.integer "challenge_choose_id" + t.integer "user_id" + t.string "answer" + t.boolean "correct" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "code_review_assignments", :force => true do |t| t.integer "issue_id" t.integer "change_id" @@ -574,13 +644,6 @@ ActiveRecord::Schema.define(:version => 20170425030242) do add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" - create_table "contest_notifications", :force => true do |t| - t.text "title" - t.text "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "contestant_for_contests", :force => true do |t| t.integer "student_id" t.integer "contest_id" @@ -648,37 +711,6 @@ ActiveRecord::Schema.define(:version => 20170425030242) do add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" - 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 "contestnotifications", :force => true do |t| - t.integer "contest_id" - t.string "title" - t.string "summary" - t.text "description" - t.integer "author_id" - t.integer "notificationcomments_count" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "contests", :force => true do |t| t.integer "user_id" t.string "name" @@ -770,6 +802,15 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.datetime "updated_at", :null => false end + create_table "course_lists", :force => true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "user_id" + t.boolean "is_admin", :default => true + t.boolean "support_shixuns_search", :default => false + end + create_table "course_messages", :force => true do |t| t.integer "user_id" t.integer "course_id" @@ -787,6 +828,15 @@ ActiveRecord::Schema.define(:version => 20170425030242) do add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" + create_table "course_modules", :force => true do |t| + t.integer "course_id" + t.string "module_type" + t.integer "position" + t.integer "hidden" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "course_statuses", :force => true do |t| t.integer "changesets_count" t.integer "watchers_count" @@ -804,8 +854,8 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.string "code" t.integer "time" t.string "extra" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "location" t.string "term" t.string "string" @@ -815,28 +865,34 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.string "class_period" t.integer "school_id" t.text "description" - t.integer "status", :default => 1 - t.integer "attachmenttype", :default => 2 + t.integer "status", :default => 1 + t.integer "attachmenttype", :default => 2 t.integer "lft" t.integer "rgt" - t.integer "is_public", :limit => 1, :default => 1 - t.integer "inherit_members", :limit => 1, :default => 1 - t.integer "open_student", :default => 0 - t.integer "outline", :default => 0 - t.integer "publish_resource", :default => 0 - t.integer "is_delete", :default => 0 + t.integer "is_public", :limit => 1, :default => 1 + t.integer "inherit_members", :limit => 1, :default => 1 + t.integer "open_student", :default => 0 + t.integer "outline", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "is_delete", :default => 0 t.integer "end_time" t.string "end_term" - t.integer "is_excellent", :default => 0 - t.integer "excellent_option", :default => 0 - t.integer "is_copy", :default => 0 - t.integer "visits", :default => 0 + t.integer "is_excellent", :default => 0 + t.integer "excellent_option", :default => 0 + t.integer "is_copy", :default => 0 + t.integer "visits", :default => 0 t.integer "syllabus_id" t.string "invite_code" t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.integer "invite_code_halt", :limit => 1, :default => 0 - t.integer "os_allow", :default => 0 + t.integer "qrcode_expiretime", :default => 0 + t.integer "invite_code_halt", :limit => 1, :default => 0 + t.integer "os_allow", :default => 0 + t.float "credit" + t.boolean "is_end", :default => false + t.date "end_date" + t.boolean "choose_group_allow", :default => false + t.boolean "homepage_show", :default => false + t.integer "course_list_id" end add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true @@ -947,6 +1003,21 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.datetime "updated_at", :null => false end + create_table "discusses", :force => true do |t| + t.integer "user_id" + t.string "dis_type" + t.integer "dis_id" + t.text "content" + t.integer "parent_id" + t.integer "root_id" + t.integer "praise_count" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "challenge_id" + end + + add_index "discusses", ["user_id"], :name => "index_discusses_on_user_id" + create_table "documents", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false @@ -1077,6 +1148,15 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "choice_random", :default => 0 end + create_table "experiences", :force => true do |t| + t.integer "user_id" + t.integer "container_id" + t.string "container_type" + t.integer "score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "first_level_disciplines", :force => true do |t| t.integer "discipline_category_id" t.string "name" @@ -1148,6 +1228,15 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.datetime "created_at" end + create_table "game_codes", :force => true do |t| + t.integer "game_id" + t.text "original_code", :limit => 2147483647 + t.text "new_code", :limit => 2147483647 + t.string "path" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "game_outputs", :force => true do |t| t.integer "code" t.integer "game_id" @@ -1160,12 +1249,26 @@ ActiveRecord::Schema.define(:version => 20170425030242) do create_table "games", :force => true do |t| t.integer "myshixun_id" t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - t.integer "final_score", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + t.integer "final_score", :default => 0 t.integer "challenge_id" t.datetime "open_time" + t.string "identifier" + t.boolean "answer_open" + t.datetime "end_time" + t.integer "retry_status", :default => 0 + t.string "resubmit_identifier" + end + + create_table "grades", :force => true do |t| + t.integer "user_id" + t.integer "container_id" + t.string "container_type" + t.integer "score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "groups_users", :id => false, :force => true do |t| @@ -1201,6 +1304,26 @@ ActiveRecord::Schema.define(:version => 20170425030242) do add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" + create_table "homework_bank_samples", :force => true do |t| + t.text "input" + t.text "output" + t.integer "homework_bank_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_bank_samples", ["homework_bank_id"], :name => "index_homework_bank_samples_on_homework_bank_id" + + create_table "homework_bank_shixuns", :force => true do |t| + t.integer "homework_bank_id" + t.integer "shixun_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_bank_shixuns", ["homework_bank_id"], :name => "index_homework_bank_shixuns_on_homework_bank_id" + add_index "homework_bank_shixuns", ["shixun_id"], :name => "index_homework_bank_shixuns_on_shixun_id" + create_table "homework_bank_tests", :force => true do |t| t.text "input" t.text "output" @@ -1215,17 +1338,23 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.string "name" t.text "description" t.integer "homework_type" - t.integer "quotes", :default => 0 + t.integer "quotes", :default => 0 t.boolean "is_public" t.string "language" - t.text "standard_code", :limit => 2147483647 + t.text "standard_code", :limit => 2147483647 t.integer "min_num" t.integer "max_num" t.boolean "base_on_project" t.string "applicable_syllabus" t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "reference_answer" + t.integer "syllabus_id" + t.text "major_level" + t.text "discipline_category_id" + t.text "first_level_discipline_id" + t.integer "course_list_id" end create_table "homework_commons", :force => true do |t| @@ -1248,10 +1377,24 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "anonymous_appeal", :default => 0 t.integer "homework_bank_id" t.boolean "is_update", :default => false + t.boolean "is_public", :default => false + t.text "reference_answer" + t.boolean "answer_public", :default => true + t.datetime "archive_time" + t.boolean "allow_late", :default => true + t.datetime "late_time" + t.boolean "work_public", :default => true end add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" + create_table "homework_commons_shixuns", :force => true do |t| + t.integer "shixun_id" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "homework_detail_groups", :force => true do |t| t.integer "homework_common_id" t.integer "min_num" @@ -1266,18 +1409,20 @@ ActiveRecord::Schema.define(:version => 20170425030242) do create_table "homework_detail_manuals", :force => true do |t| t.float "ta_proportion" t.integer "comment_status" - t.date "evaluation_start" - t.date "evaluation_end" + t.datetime "evaluation_start" + t.datetime "evaluation_end" t.integer "evaluation_num" - t.integer "absence_penalty", :default => 1 + t.integer "absence_penalty", :default => 1 t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "no_anon_penalty", :default => 1 - t.integer "appeal_penalty", :default => 0 - t.integer "ta_mode", :default => 1 - t.float "te_proportion", :default => 1.0 - t.boolean "final_mode", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "no_anon_penalty", :default => 1 + t.integer "appeal_penalty", :default => 0 + t.integer "ta_mode", :default => 1 + t.datetime "appeal_time" + t.float "te_proportion", :default => 1.0 + t.boolean "final_mode", :default => false + t.boolean "answer_open_evaluation", :default => false end create_table "homework_detail_programings", :force => true do |t| @@ -1305,6 +1450,15 @@ ActiveRecord::Schema.define(:version => 20170425030242) do add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" + create_table "homework_reference_answers", :force => true do |t| + t.text "answer" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_reference_answers", ["homework_common_id"], :name => "index_homework_reference_answers_on_homework_common_id" + create_table "homework_samples", :force => true do |t| t.text "input" t.text "output" @@ -1332,6 +1486,16 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.datetime "updated_at", :null => false end + create_table "import_students", :force => true do |t| + t.string "name" + t.string "student_number" + t.integer "course_id" + t.integer "school_id" + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "innodb_monitor", :id => false, :force => true do |t| t.integer "a" end @@ -1496,6 +1660,28 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "owner_type", :default => 0 end + create_table "major_courses", :force => true do |t| + t.integer "course_list_id" + t.integer "major_id" + end + + add_index "major_courses", ["course_list_id"], :name => "index_major_courses_on_course_list_id" + add_index "major_courses", ["major_id"], :name => "index_major_courses_on_major_id" + + create_table "majors", :force => true do |t| + t.string "major_code" + t.string "name" + t.integer "first_level_discipline_id" + t.integer "discipline_category_id" + t.integer "major_level" + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "support_shixuns", :default => false + end + + add_index "majors", ["discipline_category_id"], :name => "index_majors_on_discipline_category_id" + add_index "majors", ["first_level_discipline_id"], :name => "index_majors_on_first_level_discipline_id" + create_table "mark_downs", :force => true do |t| t.text "description" t.datetime "created_at", :null => false @@ -1520,6 +1706,7 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "course_id", :default => -1 t.integer "course_group_id", :default => 0 t.integer "is_collect", :default => 1 + t.integer "import_student_id" end add_index "members", ["course_id"], :name => "index_members_on_course_id" @@ -1585,6 +1772,7 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "quotes" t.integer "status", :default => 0 t.integer "root_id" + t.integer "visits", :default => 0 end add_index "messages", ["author_id"], :name => "index_messages_on_author_id" @@ -1594,6 +1782,54 @@ ActiveRecord::Schema.define(:version => 20170425030242) do add_index "messages", ["parent_id"], :name => "messages_parent_id" add_index "messages", ["root_id"], :name => "index_messages_on_root_id" + create_table "mirror_repositories", :force => true do |t| + t.string "mirrorID" + t.string "name" + t.string "main_type" + t.string "tag" + t.text "description" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "mirror_repository_types", :force => true do |t| + t.integer "mirror_type_id" + t.integer "mirror_repository_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "mirror_repository_types", ["mirror_repository_id"], :name => "index_mirror_repository_types_on_mirror_repository_id" + add_index "mirror_repository_types", ["mirror_type_id"], :name => "index_mirror_repository_types_on_mirror_type_id" + + create_table "mirror_types", :force => true do |t| + t.string "name" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "mirror_update_records", :force => true do |t| + t.integer "user_id" + t.integer "mirror_repository_id" + t.string "oldName" + t.string "newName" + t.string "oldType" + t.string "newType" + t.text "oldTag" + t.text "newTag" + t.text "oldDescription" + t.text "newDescription" + t.integer "oldStatus" + t.integer "newStatus" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "mirror_update_records", ["mirror_repository_id"], :name => "index_mirror_update_records_on_mirror_repository_id" + add_index "mirror_update_records", ["user_id"], :name => "index_mirror_update_records_on_user_id" + create_table "myshixun_members", :force => true do |t| t.integer "myshixun_id" t.integer "user_id" @@ -1613,6 +1849,8 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.integer "status", :default => 0 + t.string "identifier" + t.string "commit_id" end create_table "news", :force => true do |t| @@ -1814,9 +2052,15 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "code" t.integer "game_id" t.text "msg" - t.text "out_put", :limit => 2147483647 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.text "out_put", :limit => 2147483647 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "test_set_position" + t.text "actual_output" + t.boolean "result" + t.boolean "is_public" + t.integer "query_index", :default => 1 + t.integer "compile_success", :default => 1 end create_table "phone_app_versions", :force => true do |t| @@ -1876,6 +2120,14 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "show_result", :default => 1 end + create_table "pr_paths", :force => true do |t| + t.integer "project_id" + t.integer "gitlab_project_id" + t.string "path" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "praise_tread_caches", :force => true do |t| t.integer "object_id", :null => false t.string "object_type" @@ -2107,6 +2359,15 @@ ActiveRecord::Schema.define(:version => 20170425030242) do add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" + create_table "repository_paths", :force => true do |t| + t.string "path" + t.integer "myshixun_id" + t.integer "user_id" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "resource_banks", :force => true do |t| t.integer "course_id" t.integer "attachment_id" @@ -2127,6 +2388,7 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "first_level_discipline_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.string "content_type" end add_index "resource_banks", ["course_id"], :name => "index_resource_banks_on_course_id" @@ -2157,13 +2419,14 @@ ActiveRecord::Schema.define(:version => 20170425030242) do create_table "schools", :force => true do |t| t.string "name" t.string "province" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "logo_link" t.string "pinyin" - t.integer "school_type", :default => 0 + t.integer "school_type", :default => 0 t.string "city" t.string "address" + t.boolean "auto_users_trial", :default => false end create_table "secdomains", :force => true do |t| @@ -2234,6 +2497,17 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.datetime "updated_at", :null => false end + create_table "shixun_major_courses", :force => true do |t| + t.integer "shixun_id" + t.integer "course_list_id" + t.integer "major_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "shixun_major_courses", ["major_id"], :name => "index_shixun_major_courses_on_major_id" + add_index "shixun_major_courses", ["shixun_id"], :name => "index_shixun_major_courses_on_shixun_id" + create_table "shixun_members", :force => true do |t| t.integer "user_id" t.integer "shixun_id" @@ -2242,19 +2516,54 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.datetime "updated_at", :null => false end + create_table "shixun_modifies", :force => true do |t| + t.integer "shixun_id" + t.integer "myshixun_id" + t.integer "status", :limit => 1, :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "shixun_ports", :force => true do |t| + t.integer "shixun_id" + t.integer "port" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "shixun_tags", :force => true do |t| + t.string "name" + t.integer "challenge_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "shixuns", :force => true do |t| t.string "name" t.text "description" t.text "script" - t.boolean "is_public", :default => true + t.boolean "is_public", :default => true t.integer "user_id" t.integer "gpid" - t.integer "visits", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "visits", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.integer "changeset_num" - t.integer "status", :default => 0 + t.integer "status", :default => 0 t.string "language" + t.string "identifier" + t.boolean "authentication", :default => false + t.integer "myshixun_count", :default => 0 + t.string "exec_path" + t.text "propaedeutics", :limit => 2147483647 + t.integer "is_updated", :default => 0 + t.boolean "webssh", :default => false + t.integer "trainee", :default => 1 + t.integer "major_id" + t.boolean "homepage_show", :default => false + t.boolean "hidden", :default => false + t.integer "fork_from" + t.boolean "can_copy", :default => false end create_table "softapplications", :force => true do |t| @@ -2297,6 +2606,41 @@ ActiveRecord::Schema.define(:version => 20170425030242) do add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" + create_table "stage_shixuns", :force => true do |t| + t.integer "subject_id" + t.integer "stage_id" + t.integer "shixun_id" + t.integer "position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "stage_shixuns", ["shixun_id"], :name => "index_stage_shixuns_on_shixun_id" + add_index "stage_shixuns", ["stage_id"], :name => "index_stage_shixuns_on_stage_id" + add_index "stage_shixuns", ["subject_id"], :name => "index_stage_shixuns_on_subject_id" + + create_table "stages", :force => true do |t| + t.integer "subject_id" + t.string "name" + t.text "description" + t.integer "user_id" + t.integer "position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "stages", ["subject_id"], :name => "index_stages_on_subject_id" + add_index "stages", ["user_id"], :name => "index_stages_on_user_id" + + create_table "statistics", :force => true do |t| + t.string "name" + t.text "description" + t.integer "user_id" + t.integer "status", :limit => 1, :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "student_work_projects", :force => true do |t| t.integer "homework_common_id" t.integer "student_work_id" @@ -2348,9 +2692,13 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "is_delete", :default => 0 t.integer "appeal_penalty", :default => 0 t.boolean "re_commit", :default => false + t.text "late_reason" + t.integer "group_id", :default => 0 + t.integer "myshixun_id" end add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" + add_index "student_works", ["myshixun_id"], :name => "myshixun_id" create_table "student_works_evaluation_distributions", :force => true do |t| t.integer "student_work_id" @@ -2425,6 +2773,25 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.datetime "updated_at", :null => false end + create_table "subjects", :force => true do |t| + t.string "name" + t.text "description" + t.integer "user_id" + t.integer "visits" + t.integer "status" + t.integer "course_list_id" + t.integer "major_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "hidden", :default => false + t.text "learning_notes" + t.string "introduction" + end + + add_index "subjects", ["course_list_id"], :name => "index_subjects_on_course_list_id" + add_index "subjects", ["major_id"], :name => "index_subjects_on_major_id" + add_index "subjects", ["user_id"], :name => "index_subjects_on_user_id" + create_table "syllabus_members", :force => true do |t| t.integer "rank" t.integer "syllabus_id" @@ -2467,6 +2834,7 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "major_level" t.integer "discipline_category_id" t.integer "first_level_discipline_id" + t.integer "major_id" end add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" @@ -2521,6 +2889,17 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "position" end + create_table "tests", :force => true do |t| + t.integer "user_id" + t.string "username" + t.integer "change_id" + t.string "pr_path" + t.integer "project_id" + t.integer "gpid" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "time_entries", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false @@ -2569,7 +2948,7 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.datetime "updated_at", :null => false t.integer "author_id" t.integer "status", :limit => 1, :default => 0 - t.integer "position", :limit => 1, :default => 0 + t.integer "position", :limit => 1 t.integer "result", :default => 0 end @@ -2715,6 +3094,47 @@ ActiveRecord::Schema.define(:version => 20170425030242) do end create_table "users", :force => true do |t| + t.string "login", :default => "", :null => false + t.string "hashed_password", :limit => 40, :default => "", :null => false + t.string "firstname", :limit => 30, :default => "", :null => false + t.string "lastname", :default => "", :null => false + t.string "mail", :limit => 60, :default => "", :null => false + t.boolean "admin", :default => false, :null => false + t.integer "status", :default => 1, :null => false + t.datetime "last_login_on" + t.string "language", :limit => 5, :default => "" + t.integer "auth_source_id" + t.datetime "created_on" + t.datetime "updated_on" + t.string "type" + t.string "identity_url" + t.string "mail_notification", :default => "", :null => false + t.string "salt", :limit => 64 + t.integer "gid" + t.integer "visits", :default => 0 + t.integer "excellent_teacher", :default => 0 + t.integer "excellent_student", :default => 0 + t.string "phone" + t.boolean "authentication", :default => false + t.integer "grade" + t.integer "experience", :default => 0 + t.string "nickname" + t.boolean "show_realname", :default => true + t.boolean "professional_certification", :default => false + t.string "ID_number" + t.integer "certification", :default => 0 + end + + add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" + add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" + add_index "users", ["type"], :name => "index_users_on_type" + + create_table "users_authentications", :force => true do |t| + t.integer "user_id" + t.integer "authentication_id" + end + + create_table "users_copy", :force => true do |t| t.string "login", :default => "", :null => false t.string "hashed_password", :limit => 40, :default => "", :null => false t.string "firstname", :limit => 30, :default => "", :null => false @@ -2737,11 +3157,13 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.integer "excellent_student", :default => 0 t.string "phone" t.boolean "authentication", :default => false + t.integer "grade" + t.integer "experience", :default => 0 end - add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" - add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" - add_index "users", ["type"], :name => "index_users_on_type" + add_index "users_copy", ["auth_source_id"], :name => "index_users_on_auth_source_id" + add_index "users_copy", ["id", "type"], :name => "index_users_on_id_and_type" + add_index "users_copy", ["type"], :name => "index_users_on_type" create_table "verification_codes", :force => true do |t| t.string "code" @@ -2805,6 +3227,14 @@ ActiveRecord::Schema.define(:version => 20170425030242) do t.datetime "updated_at", :null => false end + create_table "websshes", :force => true do |t| + t.integer "myshixun_id" + t.string "host" + t.integer "port" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "wechat_logs", :force => true do |t| t.string "openid", :null => false t.text "request_raw"