From 08c64d2ac7528c6657c5705a8d85963e7e42a810 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Sep 2016 15:38:01 +0800 Subject: [PATCH 01/29] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E5=8F=8A=E5=A4=8D=E5=88=B6issue=E6=97=B6=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=B2=A1=E5=8F=8D=E5=BA=94=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_form.html.erb | 9 +- db/schema.rb | 424 +++++++++++++++++++++++++++++++- 2 files changed, 419 insertions(+), 14 deletions(-) diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index c0b933e2a..51a6c3b9e 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -79,4 +79,11 @@ <%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %> <% end %> 确定 - 取消 +<% if params[:action] == "new" %> + <% if @copy_from %> + <%= link_to "取消", issue_path(@copy_from), :class => "grey_btn fl mr50 ml10" %> + <% end %> +<% else %> + 取消 +<% end %> + diff --git a/db/schema.rb b/db/schema.rb index b8f931eed..ed06b709c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -52,6 +52,28 @@ ActiveRecord::Schema.define(:version => 20160905084821) do add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" + create_table "application_settings", :force => true do |t| + t.integer "default_projects_limit" + t.boolean "signup_enabled" + t.boolean "signin_enabled" + t.boolean "gravatar_enabled" + t.text "sign_in_text" + t.datetime "created_at" + t.datetime "updated_at" + t.string "home_page_url" + t.integer "default_branch_protection", :default => 2 + t.boolean "twitter_sharing_enabled", :default => true + t.text "restricted_visibility_levels" + t.boolean "version_check_enabled", :default => true + t.integer "max_attachment_size", :default => 10, :null => false + t.integer "default_project_visibility" + t.integer "default_snippet_visibility" + t.text "restricted_signup_domains" + t.boolean "user_oauth_applications", :default => true + t.string "after_sign_out_path" + t.integer "session_expire_delay", :default => 10080, :null => false + end + create_table "applied_messages", :force => true do |t| t.integer "user_id" t.integer "applied_id" @@ -60,16 +82,17 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.integer "status", :default => 0 t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "name" t.integer "applied_user_id" t.integer "role" t.integer "project_id" + t.string "name" end create_table "applied_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "role", :default => 0 + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.integer "role", :default => 0 + t.integer "applied_user_id" end create_table "apply_add_schools", :force => true do |t| @@ -184,6 +207,20 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.string "typeName", :limit => 50 end + create_table "audit_events", :force => true do |t| + t.integer "author_id", :null => false + t.string "type", :null => false + t.integer "entity_id", :null => false + t.string "entity_type", :null => false + t.text "details" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "audit_events", ["author_id"], :name => "index_audit_events_on_author_id" + add_index "audit_events", ["entity_id", "entity_type"], :name => "index_audit_events_on_entity_id_and_entity_type" + add_index "audit_events", ["type"], :name => "index_audit_events_on_type" + create_table "auth_sources", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 60, :default => "", :null => false @@ -281,6 +318,17 @@ ActiveRecord::Schema.define(:version => 20160905084821) do add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" add_index "boards", ["project_id"], :name => "boards_project_id" + create_table "broadcast_messages", :force => true do |t| + t.text "message", :null => false + t.datetime "starts_at" + t.datetime "ends_at" + t.integer "alert_type" + t.datetime "created_at" + t.datetime "updated_at" + t.string "color" + t.string "font" + end + create_table "bug_to_osps", :force => true do |t| t.integer "osp_id" t.integer "relative_memo_id" @@ -310,14 +358,16 @@ ActiveRecord::Schema.define(:version => 20160905084821) 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" @@ -597,8 +647,11 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.string "qrcode" end + add_index "courses", ["id"], :name => "id", :unique => true add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" + add_index "courses", ["tea_id"], :name => "tea_id" + add_index "courses", ["visits"], :name => "visits" create_table "custom_fields", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false @@ -661,6 +714,15 @@ ActiveRecord::Schema.define(:version => 20160905084821) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + create_table "deploy_keys_projects", :force => true do |t| + t.integer "deploy_key_id", :null => false + t.integer "project_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "deploy_keys_projects", ["project_id"], :name => "index_deploy_keys_projects_on_project_id" + create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -710,6 +772,16 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.datetime "created_at" end + create_table "emails", :force => true do |t| + t.integer "user_id", :null => false + t.string "email", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "emails", ["email"], :name => "index_emails_on_email", :unique => true + add_index "emails", ["user_id"], :name => "index_emails_on_user_id" + create_table "enabled_modules", :force => true do |t| t.integer "project_id" t.string "name", :null => false @@ -732,6 +804,25 @@ ActiveRecord::Schema.define(:version => 20160905084821) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + create_table "events", :force => true do |t| + t.string "target_type" + t.integer "target_id" + t.string "title" + t.text "data" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "action" + t.integer "author_id" + end + + add_index "events", ["action"], :name => "index_events_on_action" + add_index "events", ["author_id"], :name => "index_events_on_author_id" + add_index "events", ["created_at"], :name => "index_events_on_created_at" + add_index "events", ["project_id"], :name => "index_events_on_project_id" + add_index "events", ["target_id"], :name => "index_events_on_target_id" + add_index "events", ["target_type"], :name => "index_events_on_target_type" + create_table "exercise_answers", :force => true do |t| t.integer "user_id" t.integer "exercise_question_id" @@ -834,6 +925,15 @@ ActiveRecord::Schema.define(:version => 20160905084821) do add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" + create_table "forked_project_links", :force => true do |t| + t.integer "forked_to_project_id", :null => false + t.integer "forked_from_project_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "forked_project_links", ["forked_to_project_id"], :name => "index_forked_project_links_on_forked_to_project_id", :unique => true + create_table "forums", :force => true do |t| t.string "name", :null => false t.text "description" @@ -963,6 +1063,17 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.datetime "updated_at", :null => false end + create_table "identities", :force => true do |t| + t.string "extern_uid" + t.string "provider" + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "identities", ["created_at", "id"], :name => "index_identities_on_created_at_and_id" + add_index "identities", ["user_id"], :name => "index_identities_on_user_id" + create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1109,6 +1220,20 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.integer "private", :default => 0 end + create_table "keys", :force => true do |t| + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.text "key" + t.string "title" + t.string "type" + t.string "fingerprint" + t.boolean "public", :default => false, :null => false + end + + add_index "keys", ["created_at", "id"], :name => "index_keys_on_created_at_and_id" + add_index "keys", ["user_id"], :name => "index_keys_on_user_id" + create_table "kindeditor_assets", :force => true do |t| t.string "asset" t.integer "file_size" @@ -1120,6 +1245,27 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.integer "owner_type", :default => 0 end + create_table "label_links", :force => true do |t| + t.integer "label_id" + t.integer "target_id" + t.string "target_type" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "label_links", ["label_id"], :name => "index_label_links_on_label_id" + add_index "label_links", ["target_id", "target_type"], :name => "index_label_links_on_target_id_and_target_type" + + create_table "labels", :force => true do |t| + t.string "title" + t.string "color" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "labels", ["project_id"], :name => "index_labels_on_project_id" + create_table "member_roles", :force => true do |t| t.integer "member_id", :null => false t.integer "role_id", :null => false @@ -1172,6 +1318,47 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.integer "viewed_count", :default => 0 end + create_table "merge_request_diffs", :force => true do |t| + t.string "state" + t.text "st_commits", :limit => 2147483647 + t.text "st_diffs", :limit => 2147483647 + t.integer "merge_request_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "merge_request_diffs", ["merge_request_id"], :name => "index_merge_request_diffs_on_merge_request_id", :unique => true + + create_table "merge_requests", :force => true do |t| + t.string "target_branch", :null => false + t.string "source_branch", :null => false + t.integer "source_project_id", :null => false + t.integer "author_id" + t.integer "assignee_id" + t.string "title" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "milestone_id" + t.string "state" + t.string "merge_status" + t.integer "target_project_id", :null => false + t.integer "iid" + t.text "description" + t.integer "position", :default => 0 + t.datetime "locked_at" + end + + add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id" + add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id" + add_index "merge_requests", ["created_at", "id"], :name => "index_merge_requests_on_created_at_and_id" + add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at" + add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id" + add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch" + add_index "merge_requests", ["source_project_id"], :name => "index_merge_requests_on_source_project_id" + add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch" + add_index "merge_requests", ["target_project_id", "iid"], :name => "index_merge_requests_on_target_project_id_and_iid", :unique => true + add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title" + create_table "message_alls", :force => true do |t| t.integer "user_id" t.integer "message_id" @@ -1206,6 +1393,39 @@ ActiveRecord::Schema.define(:version => 20160905084821) do add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" + create_table "milestones", :force => true do |t| + t.string "title", :null => false + t.integer "project_id", :null => false + t.text "description" + t.date "due_date" + t.datetime "created_at" + t.datetime "updated_at" + t.string "state" + t.integer "iid" + end + + add_index "milestones", ["created_at", "id"], :name => "index_milestones_on_created_at_and_id" + add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date" + add_index "milestones", ["project_id", "iid"], :name => "index_milestones_on_project_id_and_iid", :unique => true + add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id" + + create_table "namespaces", :force => true do |t| + t.string "name", :null => false + t.string "path", :null => false + t.integer "owner_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "type" + t.string "description", :default => "", :null => false + t.string "avatar" + end + + add_index "namespaces", ["created_at", "id"], :name => "index_namespaces_on_created_at_and_id" + add_index "namespaces", ["name"], :name => "index_namespaces_on_name", :unique => true + add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id" + add_index "namespaces", ["path"], :name => "index_namespaces_on_path", :unique => true + add_index "namespaces", ["type"], :name => "index_namespaces_on_type" + create_table "news", :force => true do |t| t.integer "project_id" t.string "title", :limit => 60, :default => "", :null => false @@ -1231,6 +1451,31 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.datetime "updated_at", :null => false end + create_table "notes", :force => true do |t| + t.text "note" + t.string "noteable_type" + t.integer "author_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "project_id" + t.string "attachment" + t.string "line_code" + t.string "commit_id" + t.integer "noteable_id" + t.boolean "system", :default => false, :null => false + t.text "st_diff", :limit => 2147483647 + end + + add_index "notes", ["author_id"], :name => "index_notes_on_author_id" + add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id" + add_index "notes", ["created_at", "id"], :name => "index_notes_on_created_at_and_id" + add_index "notes", ["created_at"], :name => "index_notes_on_created_at" + add_index "notes", ["noteable_id", "noteable_type"], :name => "index_notes_on_noteable_id_and_noteable_type" + add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type" + add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type" + add_index "notes", ["project_id"], :name => "index_notes_on_project_id" + add_index "notes", ["updated_at"], :name => "index_notes_on_updated_at" + create_table "notificationcomments", :force => true do |t| t.string "notificationcommented_type" t.integer "notificationcommented_id" @@ -1240,6 +1485,49 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.datetime "updated_at", :null => false end + create_table "oauth_access_grants", :force => true do |t| + t.integer "resource_owner_id", :null => false + t.integer "application_id", :null => false + t.string "token", :null => false + t.integer "expires_in", :null => false + t.text "redirect_uri", :null => false + t.datetime "created_at", :null => false + t.datetime "revoked_at" + t.string "scopes" + end + + add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true + + create_table "oauth_access_tokens", :force => true do |t| + t.integer "resource_owner_id" + t.integer "application_id" + t.string "token", :null => false + t.string "refresh_token" + t.integer "expires_in" + t.datetime "revoked_at" + t.datetime "created_at", :null => false + t.string "scopes" + end + + add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true + add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id" + add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true + + create_table "oauth_applications", :force => true do |t| + t.string "name", :null => false + t.string "uid", :null => false + t.string "secret", :null => false + t.text "redirect_uri", :null => false + t.string "scopes", :default => "", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "owner_id" + t.string "owner_type" + end + + add_index "oauth_applications", ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type" + add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true + create_table "onclick_times", :force => true do |t| t.integer "user_id" t.datetime "onclick_time" @@ -1397,6 +1685,23 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.integer "allow_teacher", :default => 0 end + create_table "permissions", :force => true do |t| + t.string "controller", :limit => 30, :default => "", :null => false + t.string "action", :limit => 30, :default => "", :null => false + t.string "description", :limit => 60, :default => "", :null => false + t.boolean "is_public", :default => false, :null => false + t.integer "sort", :default => 0, :null => false + t.boolean "mail_option", :default => false, :null => false + t.boolean "mail_enabled", :default => false, :null => false + end + + create_table "permissions_roles", :id => false, :force => true do |t| + t.integer "permission_id", :default => 0, :null => false + t.integer "role_id", :default => 0, :null => false + end + + add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id" + create_table "phone_app_versions", :force => true do |t| t.string "version" t.text "description" @@ -1479,6 +1784,11 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.datetime "updated_at", :null => false end + create_table "project_import_data", :force => true do |t| + t.integer "project_id" + t.text "data" + end + create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1571,6 +1881,16 @@ ActiveRecord::Schema.define(:version => 20160905084821) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" + create_table "protected_branches", :force => true do |t| + t.integer "project_id", :null => false + t.string "name", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "developers_can_push", :default => false, :null => false + end + + add_index "protected_branches", ["project_id"], :name => "index_protected_branches_on_project_id" + create_table "pull_requests", :force => true do |t| t.integer "pull_request_id" t.integer "gpid" @@ -1727,6 +2047,25 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.integer "is_teacher_score", :default => 0 end + create_table "services", :force => true do |t| + t.string "type" + t.string "title" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "active", :default => false, :null => false + t.text "properties" + t.boolean "template", :default => false + t.boolean "push_events", :default => true + t.boolean "issues_events", :default => true + t.boolean "merge_requests_events", :default => true + t.boolean "tag_push_events", :default => true + t.boolean "note_events", :default => true, :null => false + end + + add_index "services", ["created_at", "id"], :name => "index_services_on_created_at_and_id" + add_index "services", ["project_id"], :name => "index_services_on_project_id" + create_table "settings", :force => true do |t| t.string "name", :default => "", :null => false t.text "value" @@ -1765,6 +2104,26 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.datetime "updated_at", :null => false end + create_table "snippets", :force => true do |t| + t.string "title" + t.text "content", :limit => 2147483647 + t.integer "author_id", :null => false + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "file_name" + t.datetime "expires_at" + t.string "type" + t.integer "visibility_level", :default => 0, :null => false + end + + add_index "snippets", ["author_id"], :name => "index_snippets_on_author_id" + add_index "snippets", ["created_at", "id"], :name => "index_snippets_on_created_at_and_id" + add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at" + add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at" + add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id" + add_index "snippets", ["visibility_level"], :name => "index_snippets_on_visibility_level" + create_table "softapplications", :force => true do |t| t.string "name" t.text "description" @@ -1845,9 +2204,9 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.integer "absence_penalty", :default => 0 t.float "system_score", :default => 0.0 t.boolean "is_test", :default => false + t.float "work_score" t.integer "simi_id" t.integer "simi_value" - t.float "work_score" t.integer "work_status", :default => 0 t.datetime "commit_time" end @@ -1897,13 +2256,13 @@ ActiveRecord::Schema.define(:version => 20160905084821) do create_table "sub_domains", :force => true do |t| t.integer "org_subfield_id" - t.integer "priority", :default => 0 + t.integer "priority" t.string "name" t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "hide" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "subfield_subdomain_dirs", :force => true do |t| @@ -1913,6 +2272,17 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.datetime "updated_at", :null => false end + create_table "subscriptions", :force => true do |t| + t.integer "user_id" + t.integer "subscribable_id" + t.string "subscribable_type" + t.boolean "subscribed" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], :name => "subscriptions_user_id_and_ref_fields", :unique => true + create_table "syllabuses", :force => true do |t| t.string "title" t.text "description" @@ -2174,6 +2544,17 @@ ActiveRecord::Schema.define(:version => 20160905084821) do add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" add_index "users", ["type"], :name => "index_users_on_type" + create_table "users_star_projects", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "users_star_projects", ["project_id"], :name => "index_users_star_projects_on_project_id" + add_index "users_star_projects", ["user_id", "project_id"], :name => "index_users_star_projects_on_user_id_and_project_id", :unique => true + add_index "users_star_projects", ["user_id"], :name => "index_users_star_projects_on_user_id" + create_table "versions", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "name", :default => "", :null => false @@ -2225,6 +2606,23 @@ ActiveRecord::Schema.define(:version => 20160905084821) do t.datetime "updated_at", :null => false end + create_table "web_hooks", :force => true do |t| + t.string "url" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "type", :default => "ProjectHook" + t.integer "service_id" + t.boolean "push_events", :default => true, :null => false + t.boolean "issues_events", :default => false, :null => false + t.boolean "merge_requests_events", :default => false, :null => false + t.boolean "tag_push_events", :default => false + t.boolean "note_events", :default => false, :null => false + end + + add_index "web_hooks", ["created_at", "id"], :name => "index_web_hooks_on_created_at_and_id" + add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id" + create_table "wechat_logs", :force => true do |t| t.string "openid", :null => false t.text "request_raw" From 6dbb2e4e94414906eac61c0b81de251b44238561 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 8 Sep 2016 16:03:32 +0800 Subject: [PATCH 02/29] =?UTF-8?q?Pull=20request=E6=95=B0=E9=87=8F=E4=B8=BA?= =?UTF-8?q?0=E7=9A=84=E6=97=B6=E5=80=99=E6=98=BE=E7=A4=BA=E5=9C=A8?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 8 +++++++- app/views/projects/_development_group.html.erb | 2 +- app/views/projects/_tools_expand.html.erb | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3c125a185..b08b777df 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -832,7 +832,13 @@ module ApplicationHelper atts.count > 0 ? true :false end - # 必须是项目成,项目必须提交过代码 + # 如果Pull Request数量为0就显示在更多中 + def allow_show_pull_request project + g = Gitlab.client + count = g.merge_requests(project.gpid).count + end + + # 必须是项目成员,项目必须提交过代码 def allow_pull_request project return false if project.gpid.nil? g = Gitlab.client diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb index 17742f023..e6f3ad3da 100644 --- a/app/views/projects/_development_group.html.erb +++ b/app/views/projects/_development_group.html.erb @@ -41,7 +41,7 @@ <% end %> -<% if allow_pull_request(@project) %> +<% if allow_pull_request(@project) > 0 && allow_show_pull_request(@project) > 0 %>
-
{{r.filename}}发送
+
{{r.filename}}发送

暂无课件,
请登录Trustie网站,在PC浏览器中上传课件。

diff --git a/public/assets/wechat/myresource.html b/public/assets/wechat/myresource.html index 8bfa818de..718e3c278 100644 --- a/public/assets/wechat/myresource.html +++ b/public/assets/wechat/myresource.html @@ -12,7 +12,7 @@
- {{r.filename}}发送
+ {{r.filename}}发送
大小:{{r.attafile_size}}
diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js index 1e9fbcb0e..ea394a1ff 100644 --- a/public/javascripts/wechat/controllers/class.js +++ b/public/javascripts/wechat/controllers/class.js @@ -6,6 +6,9 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location }; var vm = $scope; + + vm.g_localhost = window.g_localhost; + var courseid = $routeParams.id; var tag = $routeParams.tag; diff --git a/public/javascripts/wechat/controllers/myresource.js b/public/javascripts/wechat/controllers/myresource.js index d920b376a..f6bb1bb00 100644 --- a/public/javascripts/wechat/controllers/myresource.js +++ b/public/javascripts/wechat/controllers/myresource.js @@ -3,6 +3,9 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l var vm = $scope; // vm.menus = ['课件', '作业', '测验']; + + vm.g_localhost = window.g_localhost; + vm.menus = ['课件', '作业']; vm.resources = []; From 96dfa4281de7c3e19b6da96c4c607aab8e3e00bc Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Sep 2016 15:03:46 +0800 Subject: [PATCH 11/29] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=B7=A6?= =?UTF-8?q?=E4=BE=A7=E7=BC=96=E8=BE=91=E4=B8=AA=E4=BA=BA=E8=B5=84=E6=96=99?= =?UTF-8?q?=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/new_base_user_show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/new_base_user_show.html.erb b/app/views/layouts/new_base_user_show.html.erb index b92218241..94c5c8a30 100644 --- a/app/views/layouts/new_base_user_show.html.erb +++ b/app/views/layouts/new_base_user_show.html.erb @@ -147,7 +147,7 @@
- 编辑个人资料 + <%= link_to "编辑个人资料", my_account_path(:tip => 1), :class => "user_editinfo"%>
From 9997de0d9626ad8dd3acd78c7f9536ef40085e56 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 9 Sep 2016 15:14:24 +0800 Subject: [PATCH 12/29] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E8=AF=BE=E4=BB=B6?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E4=B8=8D=E9=9C=80=E8=A6=81=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 7 ++++++- public/assets/wechat/class.html | 2 +- public/assets/wechat/myresource.html | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 5d1345f24..2e85d8a72 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -130,7 +130,12 @@ class AttachmentsController < ApplicationController def download # modify by nwb # 下载添加权限设置 - candown = attachment_candown @attachment + if params[:type] == "wechat" + candown = true + else + candown = attachment_candown @attachment + end + if candown || User.current.admin? || User.current.id == @attachment.author_id if stale?(:etag => @attachment.digest) if params[:preview] == 'true' diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html index 88ef967e9..836575b90 100644 --- a/public/assets/wechat/class.html +++ b/public/assets/wechat/class.html @@ -230,7 +230,7 @@
-
{{r.filename}}发送
+
{{r.filename}}发送

暂无课件,
请登录Trustie网站,在PC浏览器中上传课件。

diff --git a/public/assets/wechat/myresource.html b/public/assets/wechat/myresource.html index 718e3c278..1848dad60 100644 --- a/public/assets/wechat/myresource.html +++ b/public/assets/wechat/myresource.html @@ -12,7 +12,7 @@
- {{r.filename}}发送
+ {{r.filename}}发送
大小:{{r.attafile_size}}
From de769454a7b6866ad9ebe6aebcf95b75ca89d9be Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Sep 2016 15:16:08 +0800 Subject: [PATCH 13/29] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E8=B4=B4=E5=90=A7=EF=BC=9A=E5=9B=9E=E5=A4=8D=E9=9D=9E=E6=B1=89?= =?UTF-8?q?=E5=AD=97=E7=B1=BB=E5=9E=8B=E5=86=85=E5=AE=B9=E8=B6=85=E5=87=BA?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 435fd0f9e..d684b4297 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -90,7 +90,7 @@
<%= reply.author.name%><%= format_date(reply.created_at) %>
-
<%= h reply.content.html_safe%>
+
<%= h reply.content.html_safe%>
From 1fe8b35fc9305bff968069ba8ef82aca4edabfb6 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 9 Sep 2016 17:58:21 +0800 Subject: [PATCH 28/29] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=EF=BC=8C=E7=8F=AD=E7=BA=A7=E5=90=8D=E7=A7=B0=E8=BF=87=E9=95=BF?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=9C=81=E7=95=A5=E5=8F=B7=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_user_courses.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb index 7e3249a55..754cfd10b 100644 --- a/app/views/layouts/_user_courses.html.erb +++ b/app/views/layouts/_user_courses.html.erb @@ -3,9 +3,9 @@ <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>

- <%= link_to course.syllabus.title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:80px; display:inline-block;"%> + <%= link_to course.syllabus.title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%> · - <%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:80px; display:inline-block;"%> + <%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%>

<%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%> @@ -107,7 +107,7 @@ $(".course_list_menu").each(function(){ var courseWidth = $(this).children().eq(0).width(); - var classWidth = 160 -courseWidth; + var classWidth = 170 -courseWidth; console.log(courseWidth, classWidth); if(courseWidth < 80){ $(this).children().eq(2).css("max-width",classWidth + "px"); From 61836dbe937774316e3edb8cb05faa81924c7653 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 9 Sep 2016 18:02:47 +0800 Subject: [PATCH 29/29] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 56ffc77e2..2b31cae13 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -88,7 +88,7 @@ class OrganizationsController < ApplicationController shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id) shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id) project_ids = (@organization.projects.map(&:id) - shield_project_ids) << 0 - course_ids = (@organization.courses.map(&:id) - shield_course_ids) << 0 + course_ids = (@organization.courses.not_deleted.map(&:id) - shield_course_ids) << 0 course_types = "('Message','News','HomeworkCommon','Poll','Course')" @project_acts = get_project_activities_org @organization, project_ids @course_acts = get_course_activities_org @organization, course_ids @@ -140,7 +140,7 @@ class OrganizationsController < ApplicationController shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id) shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id) project_ids = (@organization.projects.map(&:id)-shield_project_ids) << 0 - course_ids = (@organization.courses.map(&:id)-shield_course_ids) << 0 + course_ids = (@organization.courses.not_deleted.map(&:id)-shield_course_ids) << 0 course_types = "('Message','News','HomeworkCommon','Poll','Course')" case params[:type] when nil