diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index f6ff98d30..82aadf229 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -2,11 +2,12 @@ class ContestsController < ApplicationController before_filter :find_contest, :only => [:show] before_filter :is_logged, :only => [:index, :new, :create] + layout "base_contests" def show respond_to do |format| format.js - format.html{render :layout => 'base_contests'} + format.html end end diff --git a/app/views/contests/_mamager_setting.html.erb b/app/views/contests/_mamager_setting.html.erb new file mode 100644 index 000000000..b4b359bcb --- /dev/null +++ b/app/views/contests/_mamager_setting.html.erb @@ -0,0 +1,12 @@ +
+ +
\ No newline at end of file diff --git a/app/views/layouts/base_contests.html.erb b/app/views/layouts/base_contests.html.erb index e69de29bb..c42613287 100644 --- a/app/views/layouts/base_contests.html.erb +++ b/app/views/layouts/base_contests.html.erb @@ -0,0 +1,287 @@ + + + + + <%= h html_title %> + + + <%= csrf_meta_tag %> + <%= favicon %> + <%= javascript_heads %> + <%= heads_for_theme %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','syllabus', 'css/moduel','css/contest'%> + <%= javascript_include_tag "course","avatars","header","attachments",'prettify' %> + <%= call_hook :view_layouts_base_html_head %> + + <%= yield :header_tags -%> + + + + + +
+ +
+
+
+

+ <%= link_to @contest.user.try(:show_name), user_path(@contest.user), :class => "sy_cgrey" %> >  + <%= link_to @contest.name, contest_path(@contest), :class => "sy_cgrey" %> >  + <%= link_to "配置", settings_contest_path(@contest), :class => "sy_cgrey" %> +

+ <% if is_contest_manager?(User.current.id, @contest.id) %> + <%= render :partial => "contests/mamager_setting" %> + <% end %> + +
+ +
+
+

<%= @contest.name %>

+ <% unless @contest.is_public %> + + <% end %> +
+
+

+ 管理员:<%= contest_managers(@contest).count %> + 评委:<%= contest_judges(@contest).count %> + 参赛者:<%= contest_contestants(@contest).count %> +

+
+ 加入竞赛 + 邀请码:JVCR +
+
+
+ +
+

竞赛配置

+
+ +
+
+
+
    +
  • + + 上传图片 + +
  • +
  • + + + +
  • +
  • + + +
  • +
  • + + + (选中后对所有用户可见,否则仅对成员可见。) +
  • +
  • + 删除 +

    (友情提示:删除该竞赛后如果您想恢复,请联系系统管理员!)

    + 保存 +
  • +
+
+
+
+ +
+
+ 添加成员 +
+
+ +
+
    +
  • shashashashashashasshashashashashashshashashashashashshashashashashashshashashashashashhasha
  • +
  • shashashashashashashasha
  • +
  • shashashashashashashasha
  • +
  • shashashashashashashasha
  • + +
+
    +
  • + +

    管理员

    +
  • +
  • + +

    评委

    +
  • +
  • + +

    参赛者

    +
  • +
+
+ 取消保存 +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
序号用户角色操作
1shashasha管理人员编辑删除
2shashasha主办人编辑删除
3shashashashashashashashashahashashashashashashasha +
    +
  • + +

    管理员

    +
  • +
  • + +

    评委

    +
  • +
  • + +

    参赛者

    +
  • +
+ +
保存删除
+
+
+ +
+
+
+
+
    +
  • + + +
  • +
+ 取消保存 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
名称操作
竞赛讨论区添加子栏目
技术讨论区下移编辑删除
学术论区上移下移编辑删除
学术论区上移编辑删除
+
+
+
+
+ + +
+
+
+
+ + <%= render_flash_messages %> + <%= yield %> + <%= call_hook :view_layouts_base_content %> +
+ +
+
+ +
+<%= render :partial => 'layouts/footer' %> +
+<% if hidden_unproject_infos %> + <%= render :partial => 'layouts/new_feedback' %> +<% end %> + + + +<%= call_hook :view_layouts_base_body_bottom %> + + + + + +<%= javascript_include_tag 'cookie','project',"avatars", 'header','prettify','select_list_move','attachments' %> + + diff --git a/db/migrate/20161222033007_update_mail_notification.rb b/db/migrate/20161222033007_update_mail_notification.rb new file mode 100644 index 000000000..4469bd8f0 --- /dev/null +++ b/db/migrate/20161222033007_update_mail_notification.rb @@ -0,0 +1,7 @@ +class UpdateMailNotification < ActiveRecord::Migration + def up + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 6dd41fa00..0d39dcbb6 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 => 20161208015939) do +ActiveRecord::Schema.define(:version => 20161222033007) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -325,14 +325,16 @@ ActiveRecord::Schema.define(:version => 20161208015939) do add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false + t.integer "repository_id", :null => false + t.string "revision", :null => false t.string "committer" - t.datetime "committed_on", :null => false + t.datetime "committed_on", :null => false t.text "comments" t.date "commit_date" t.string "scmid" t.integer "user_id" + t.integer "project_id" + t.integer "type", :default => 0 end add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" @@ -426,6 +428,14 @@ ActiveRecord::Schema.define(:version => 20161208015939) do add_index "comments", ["author_id"], :name => "index_comments_on_author_id" add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" + create_table "commit_issues", :force => true do |t| + t.string "commit_id" + t.integer "issue_id" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "commits", :force => true do |t| t.integer "repository_id" t.string "version" @@ -437,54 +447,123 @@ ActiveRecord::Schema.define(:version => 20161208015939) do t.datetime "updated_at", :null => false end - create_table "contest_notifications", :force => true do |t| - t.text "title" + create_table "contest_activities", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.integer "contest_act_id" + t.string "contest_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_activities", ["contest_id"], :name => "index_contest_activities_on_contest_id" + add_index "contest_activities", ["user_id"], :name => "index_contest_activities_on_user_id" + + create_table "contest_member_roles", :force => true do |t| + t.integer "contest_member_id" + t.integer "role_id" + t.boolean "is_current", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_member_roles", ["contest_member_id"], :name => "index_contest_member_roles_on_contest_member_id" + add_index "contest_member_roles", ["role_id"], :name => "index_contest_member_roles_on_role_id" + + create_table "contest_members", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.boolean "is_collect", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_members", ["contest_id"], :name => "index_contest_members_on_contest_id" + add_index "contest_members", ["user_id"], :name => "index_contest_members_on_user_id" + + create_table "contest_messages", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.integer "contest_message_id" + t.string "course_message_type" + t.boolean "viewed", :default => false t.text "content" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + 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 "contestant_for_contests", :force => true do |t| + t.integer "student_id" + t.integer "contest_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end - 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 + add_index "contestant_for_contests", ["contest_id"], :name => "index_contestant_for_contests_on_contest_id" + add_index "contestant_for_contests", ["student_id"], :name => "index_contestant_for_contests_on_student_id" - create_table "contesting_softapplications", :force => true do |t| - t.integer "softapplication_id" + create_table "contestant_work_projects", :force => true do |t| t.integer "contest_id" + t.integer "work_id" + t.integer "contestant_work_id" + t.integer "project_id" t.integer "user_id" - t.string "description" + t.boolean "is_leader" 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 + add_index "contestant_work_projects", ["contest_id"], :name => "index_contestant_work_projects_on_contest_id" + add_index "contestant_work_projects", ["contestant_work_id"], :name => "index_contestant_work_projects_on_contestant_work_id" + add_index "contestant_work_projects", ["user_id"], :name => "index_contestant_work_projects_on_user_id" + add_index "contestant_work_projects", ["work_id"], :name => "index_contestant_work_projects_on_work_id" + + create_table "contestant_work_scores", :force => true do |t| + t.integer "contestant_work_id" + t.integer "user_id" + t.integer "score" + t.text "comment" + t.integer "reviewer_role" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end + add_index "contestant_work_scores", ["contestant_work_id"], :name => "index_contestant_work_scores_on_contestant_work_id" + add_index "contestant_work_scores", ["user_id"], :name => "index_contestant_work_scores_on_user_id" + + create_table "contestant_works", :force => true do |t| + t.string "name" + t.text "description" + t.integer "work_id" + t.integer "user_id" + t.float "work_score" + t.integer "project_id" + t.integer "work_status" + t.datetime "commit_time" + t.boolean "is_delete", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_works", ["project_id"], :name => "index_contestant_works_on_project_id" + 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 "contests", :force => true do |t| + t.integer "user_id" t.string "name" - t.string "budget", :default => "" - t.integer "author_id" - t.date "deadline" - t.string "description" - t.integer "commit" - t.string "password" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false + t.text "description" + t.boolean "is_public" + t.boolean "is_delete", :default => false + t.integer "visits", :default => 0 + t.string "invite_code" + t.integer "invite_code_halt", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "course_activities", :force => true do |t| @@ -516,20 +595,6 @@ ActiveRecord::Schema.define(:version => 20161208015939) do t.integer "container_id", :default => 0 end - create_table "course_class_post", :id => false, :force => true do |t| - t.integer "班级id", :default => 0, :null => false - t.string "班级名" - t.integer "帖子id", :default => 0, :null => false - t.integer "主贴id" - t.string "帖子标题", :default => "", :null => false - t.text "帖子内容" - t.integer "帖子用户id" - t.integer "帖子回复数", :default => 0, :null => false - t.integer "最后回帖id" - t.datetime "发帖时间", :null => false - t.datetime "帖子更新时间", :null => false - end - create_table "course_contributor_scores", :force => true do |t| t.integer "course_id" t.integer "user_id" @@ -598,8 +663,8 @@ ActiveRecord::Schema.define(:version => 20161208015939) 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" @@ -609,27 +674,28 @@ ActiveRecord::Schema.define(:version => 20161208015939) 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 "qrcode_expiretime", :default => 0 + t.integer "professional_level_id", :limit => 1 + t.integer "invite_code_halt", :limit => 1, :default => 0 end add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true @@ -680,6 +746,14 @@ ActiveRecord::Schema.define(:version => 20161208015939) do add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" + create_table "data_exceptions", :force => true do |t| + t.string "message" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "delayed_jobs", :force => true do |t| t.integer "priority", :default => 0, :null => false t.integer "attempts", :default => 0, :null => false @@ -696,6 +770,11 @@ ActiveRecord::Schema.define(:version => 20161208015939) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + create_table "disciplines", :force => true do |t| + t.string "name" + t.integer "professional_level_id", :limit => 1 + end + create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -821,13 +900,11 @@ ActiveRecord::Schema.define(:version => 20161208015939) do t.integer "exercise_status" t.integer "user_id" t.integer "time" - 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.datetime "publish_time" t.datetime "end_time" t.integer "show_result" - t.integer "question_random", :default => 0 - t.integer "choice_random", :default => 0 end create_table "first_pages", :force => true do |t| @@ -944,6 +1021,7 @@ ActiveRecord::Schema.define(:version => 20161208015939) do t.integer "is_open", :default => 0 t.datetime "simi_time" t.integer "score_open", :default => 1 + t.integer "anonymous_appeal", :default => 0 end add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" @@ -970,6 +1048,7 @@ ActiveRecord::Schema.define(:version => 20161208015939) do 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 end create_table "homework_detail_programings", :force => true do |t| @@ -1014,6 +1093,10 @@ ActiveRecord::Schema.define(:version => 20161208015939) do t.datetime "updated_at", :null => false end + create_table "innodb_monitor", :id => false, :force => true do |t| + t.integer "a" + end + create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1545,9 +1628,12 @@ ActiveRecord::Schema.define(:version => 20161208015939) do end create_table "professional_levels", :force => true do |t| - t.string "level" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "level" + end + + create_table "professions", :force => true do |t| + t.string "name" + t.integer "discipline_id", :limit => 1 end create_table "project_infos", :force => true do |t| @@ -1610,7 +1696,6 @@ ActiveRecord::Schema.define(:version => 20161208015939) do t.boolean "hidden_repo", :default => false, :null => false t.integer "attachmenttype", :default => 1 t.integer "user_id" - t.integer "dts_test", :default => 0 t.string "enterprise_name" t.integer "organization_id" t.integer "project_new_type" @@ -1618,6 +1703,11 @@ ActiveRecord::Schema.define(:version => 20161208015939) do t.integer "forked_from_project_id" t.integer "forked_count" t.integer "publish_resource", :default => 0 + t.integer "boards_count", :default => 0 + t.integer "news_count", :default => 0 + t.integer "acts_count", :default => 0 + t.integer "journals_count", :default => 0 + t.integer "boards_reply_count", :default => 0 t.integer "visits", :default => 0 t.integer "hot", :default => 0 t.string "invite_code" @@ -1922,6 +2012,7 @@ ActiveRecord::Schema.define(:version => 20161208015939) do t.integer "work_status", :default => 0 t.datetime "commit_time" t.integer "is_delete", :default => 0 + t.integer "appeal_penalty", :default => 0 end add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" @@ -1939,13 +2030,23 @@ ActiveRecord::Schema.define(:version => 20161208015939) do t.integer "score" t.text "comment" t.integer "reviewer_role" - 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 "appeal_status", :default => 0 end add_index "student_works_scores", ["student_work_id"], :name => "student_work_id" add_index "student_works_scores", ["user_id"], :name => "user_id" + create_table "student_works_scores_appeals", :force => true do |t| + t.integer "student_works_score_id" + t.integer "user_id" + t.text "comment" + t.integer "appeal_status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "students_for_courses", :force => true do |t| t.integer "student_id" t.integer "course_id" @@ -2004,8 +2105,8 @@ ActiveRecord::Schema.define(:version => 20161208015939) do t.string "title" t.text "description" t.integer "user_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.string "eng_name" t.integer "syllabus_type" t.integer "credit" @@ -2014,8 +2115,9 @@ ActiveRecord::Schema.define(:version => 20161208015939) do t.integer "practice_hours" t.string "applicable_major" t.string "pre_course" - t.integer "visits", :default => 0 - t.integer "des_status", :default => 0 + t.integer "visits", :default => 0 + t.integer "des_status", :default => 0 + t.integer "professional_level_id", :limit => 1 end add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" @@ -2379,6 +2481,17 @@ ActiveRecord::Schema.define(:version => 20161208015939) do add_index "wikis", ["project_id"], :name => "wikis_project_id" + create_table "work_detail_groups", :force => true do |t| + t.integer "work_id" + t.integer "min_num" + t.integer "max_num" + t.boolean "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "work_detail_groups", ["work_id"], :name => "index_work_detail_groups_on_work_id" + create_table "workflows", :force => true do |t| t.integer "tracker_id", :default => 0, :null => false t.integer "old_status_id", :default => 0, :null => false @@ -2396,6 +2509,25 @@ ActiveRecord::Schema.define(:version => 20161208015939) do add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" + create_table "works", :force => true do |t| + t.string "name" + t.integer "user_id" + t.text "description" + t.date "publish_time" + t.date "end_time" + t.integer "work_type" + t.integer "contest_id" + t.boolean "is_delete", :default => false + t.boolean "score_open", :default => true + t.boolean "is_open", :default => false + t.integer "work_status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "works", ["contest_id"], :name => "index_works_on_contest_id" + add_index "works", ["user_id"], :name => "index_works_on_user_id" + create_table "works_categories", :force => true do |t| t.string "category" t.datetime "created_at", :null => false diff --git a/public/images/game/banner-game.jpg b/public/images/game/banner-game.jpg new file mode 100644 index 000000000..cd1f3bbc2 Binary files /dev/null and b/public/images/game/banner-game.jpg differ diff --git a/public/images/game/banner-game.png b/public/images/game/banner-game.png new file mode 100644 index 000000000..c5265ba1e Binary files /dev/null and b/public/images/game/banner-game.png differ diff --git a/public/stylesheets/css/contest.css b/public/stylesheets/css/contest.css new file mode 100644 index 000000000..ffa63ac64 --- /dev/null +++ b/public/stylesheets/css/contest.css @@ -0,0 +1,16 @@ +/* 竞赛设置tab*/ +.game-setting-tab{border:1px solid #fff; } +#game-setting-tab-nav {border-bottom:1px solid #d0d0d0;} +#game-setting-tab-nav li {float:left; padding:10px 15px; text-align:center; } +#game-setting-tab-nav li a{font-size:14px; color:#444;} +.game-setting-nav-hover{border-bottom:3px solid #3498db; font-weight:bold; } +.game-setting-nav-nomall {border-bottom:none; } +.undis {display:none;} +.dis {display:block;} +/* 竞赛*/ +.banner-game { width: 968px; height: 110px;} +.game-text-right{ text-align: right;} +.game-text-left{ text-align: left;} +.game-setting-h3{ width: 100%; height: 40px; line-height: 40px; font-size: 14px; color: #666; font-weight: normal; background: #fff; border-bottom: 10px solid #eaebec;} +.w695{width: 695px; } +.w625{width: 625px; }