From c298adda7c2ddd61bbc47a1e9b29497e98e55fa9 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 14 Jan 2016 20:37:56 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E5=AD=90=E5=9F=9F=E5=90=8D=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/subdomain.rb | 9 +++++++++ config/routes.rb | 7 ++----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 config/initializers/subdomain.rb diff --git a/config/initializers/subdomain.rb b/config/initializers/subdomain.rb new file mode 100644 index 000000000..b868e7e0b --- /dev/null +++ b/config/initializers/subdomain.rb @@ -0,0 +1,9 @@ +class Subdomain + + def matches?(request) + o = Organization.where(domain: request.subdomain).first + request.path_parameters[:id] = o.id if o + !o.nil? + end + +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 133203a8b..7d746f9e0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -72,12 +72,9 @@ RedmineApp::Application.routes.draw do end end - Organization.where("domain is not null").each do |org| - get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: {subdomain: org.domain} + constraints(Subdomain.new) do + get '/', to: 'organizations#show' end - get '/', to: 'organizations#show', defaults: { id: 5 }, constraints: {subdomain: 'micros'} - get '/', to: 'organizations#show', defaults: { id: 23 }, constraints: {subdomain: 'nubot'} - get '/', to: 'organizations#show', defaults: { id: 1 }, constraints: {subdomain: 'team'} resources :org_member do member do From 64f972770fce3a99931c9f69589d65ba4885fc52 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 Jan 2016 10:41:34 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E6=B7=BB=E5=8A=A0board=E5=92=8Cattachmen?= =?UTF-8?q?t=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160115023749_update_boards_attach.rb | 32 +++++++++++++++++++ db/schema.rb | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20160115023749_update_boards_attach.rb diff --git a/db/migrate/20160115023749_update_boards_attach.rb b/db/migrate/20160115023749_update_boards_attach.rb new file mode 100644 index 000000000..06f5097f8 --- /dev/null +++ b/db/migrate/20160115023749_update_boards_attach.rb @@ -0,0 +1,32 @@ +class UpdateBoardsAttach < ActiveRecord::Migration + def up + project_count = Project.all.count / 30 + 2 + transaction do + for i in 1 ... project_count do i + Project.page(i).per(30).each do |project| + puts project.id + if ProjectScore.where("project_id=?", project.id).first.nil? + puts "create project ==>#{project.id}" + ProjectScore.create(:project_id => project.id, :score => false) + end + unless project.project_score.nil? + # update boards + unless project.boards.first.nil? + boards_count = project.boards.first.topics.count + project.project_score.update_attribute(:board_num, boards_count) + end + # update attach + unless project.attachments.nil? + attachments_count = project.attachments.count + project.project_score.update_attribute(:attach_num, attachments_count) + end + + end + end + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 045455bb7..d27ee5da3 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 => 20160114131753) do +ActiveRecord::Schema.define(:version => 20160115023749) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From 18bc8215e3ca487346c229a38ec00aae21735d16 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 Jan 2016 11:35:27 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/routes.rb b/config/routes.rb index 6afd5e011..ed1913c28 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -76,6 +76,9 @@ RedmineApp::Application.routes.draw do constraints(Subdomain.new) do get '/', to: 'organizations#show' end + get '/', to: 'organizations#show', defaults: { id: 5 }, constraints: {subdomain: 'micros'} + get '/', to: 'organizations#show', defaults: { id: 23 }, constraints: {subdomain: 'nubot'} + get '/', to: 'organizations#show', defaults: { id: 1 }, constraints: {subdomain: 'team'} resources :org_member do member do From 81b32ea6437ef0f07e4b444a2b60192fb17326e2 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 Jan 2016 12:39:38 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E7=82=B9=E5=87=BB=E9=93=83=E9=93=9B?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=96=B0tab=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_logined_header.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index b28e6843f..48cd4ab53 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -102,9 +102,9 @@ From b6ae14a1cee982a4a020cc7303a8a7ff73380f1c Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 Jan 2016 12:51:50 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E5=AD=97=E4=BD=9312?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_tool_expand.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/courses/_tool_expand.html.erb b/app/views/courses/_tool_expand.html.erb index 50854cf23..3ded0cb1d 100644 --- a/app/views/courses/_tool_expand.html.erb +++ b/app/views/courses/_tool_expand.html.erb @@ -2,19 +2,19 @@ <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> <% if show_nav?(@course.homework_commons.count) %> <% end %> <% if show_nav?(@course.news.count) %> <% end %> <% if show_nav?(course_file_num) %>
- - - - - - - +
组织URL: +
http:// + + .trustie.net申请 +

+ +
公开 : class="ml3" /> @@ -115,15 +115,15 @@

新增栏目

<%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %> - - - - - - - - - +
+

域名目录(用户自定义url,可选)

+ <% if @organization.domain %> + <%= @organization.domain %>.trustie.net/ + <% else %> + 您还没有子域名,请先在左侧信息栏申请子域名 + <% end %> +
+
  • 栏目类型
  • From c9363043145e7801b9bfd364c28e365affcaad54 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 Jan 2016 15:37:17 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=94=B6=E8=B5=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_courses.html.erb | 2 +- public/javascripts/course.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index cb5c2502f..bef5b7f4a 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -126,7 +126,7 @@ <%# 工具栏展开 %> <% if @course.homework_commons.count == 0 || @course.news.count == 0 || course_file_num == 0 || course_poll_count == 0 || @course.exercises.count == 0 || course_feedback_count == 0 || @course.exercises.count == 0 || (@course.boards.first ? @course.boards.first.topics.count : 0) == 0 %> - + diff --git a/public/javascripts/course.js b/public/javascripts/course.js index df04d857b..6c2f0af71 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -1389,7 +1389,7 @@ $(function(){ var personalized_map = cookieget(personalized_expand_key); if(personalized_map!=false){ personalized_map = JSON.parse(personalized_map); - $("*[nhtype='toggle4cookie']").each(function(){ + $("*[nhtype='toggle4cookiecourse']").each(function(){ var personalized_id=$(this).data('id'); var val = personalized_map[personalized_id]; if(val!=undefined && val!=$(this).data('val')){ @@ -1415,7 +1415,7 @@ $(function(){ cookiesave(personalized_expand_key,JSON.stringify(personalized_map)); target.toggle(timeout); } - $("*[nhtype='toggle4cookie']").on('click',function(){ + $("*[nhtype='toggle4cookiecourse']").on('click',function(){ personalized_click($(this),500); }); @@ -1428,3 +1428,7 @@ function submit_course_feedback() { var flag = true } } + +function show_more_tool(){ + $('#navContentCourse').css('display', 'block'); +} From f52e74da61dea80ed6c6a544e2821d593a2faf33 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 Jan 2016 16:11:26 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9issues=E6=80=BB?= =?UTF-8?q?=E6=95=B0=E8=AF=BB=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index cf0428c27..4217ca44e 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -71,7 +71,7 @@ 清空
<%#= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %> -

<%= l(:label_issues_sum) %>:<%= @project.issues.visible.all.count %> +

<%= l(:label_issues_sum) %>:<%= @project.project_score.issue_num %> <%= l(:lable_issues_undo) %>:<%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %>

From b2746d0953824e3111f8e9cc94e5989c6c36c8e1 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 Jan 2016 16:30:17 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E6=80=BB=E6=95=B0=E8=AE=A1=E5=85=A5=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_courses.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index bef5b7f4a..254b24f01 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -98,7 +98,7 @@ <% unless show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %> <% end %> From ed26242f94aee7335ab3b6020d0aa9d7ea72a309 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 Jan 2016 21:19:52 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=AC=A1=E6=95=B0=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160115125217_update_rep_commits.rb | 32 +++++++++++++++++++ db/schema.rb | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20160115125217_update_rep_commits.rb diff --git a/db/migrate/20160115125217_update_rep_commits.rb b/db/migrate/20160115125217_update_rep_commits.rb new file mode 100644 index 000000000..ea8e3c815 --- /dev/null +++ b/db/migrate/20160115125217_update_rep_commits.rb @@ -0,0 +1,32 @@ +class UpdateRepCommits < ActiveRecord::Migration + def up + project_count = Project.all.count / 30 + 2 + transaction do + for i in 1 ... project_count do i + Project.page(i).per(30).each do |project| + puts project.id + if ProjectScore.where("project_id=?", project.id).first.nil? + puts "create project ==>#{project.id}" + ProjectScore.create(:project_id => project.id, :score => false) + end + unless project.project_score.nil? + # update boards + unless project.gpid.nil? + g = Gitlab.client + begin + puts project.id + count = g.project(project.gpid).commit_count + rescue + logger.error("The project's rep is not exit!") + end + project.project_score.update_attribute(:changeset_num, count) + end + end + end + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index d27ee5da3..bac1882c5 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 => 20160115023749) do +ActiveRecord::Schema.define(:version => 20160115125217) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From c6aaaff8d19d379fbe2fe3ab5b10c092890e2e60 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 18 Jan 2016 10:07:12 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E5=AF=B9=E6=9C=89=E5=AD=90=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E7=9A=84=E7=BB=84=E7=BB=87=EF=BC=8C=E6=A0=8F=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E9=93=BE=E6=8E=A5=E5=BA=94=E4=B8=8D=E5=90=AB=E6=9C=89?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8F=8A=E5=85=B6id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organizations/_org_left_subfield_list.html.erb | 12 ++++++++++-- config/routes.rb | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 7956af6d1..ffd86baa3 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -71,7 +71,11 @@
<% if field.field_type == "Post" %> <% if !field.subfield_subdomain_dir.nil? %> - <%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %> + <% if !request.local? and !organization.domain.nil? and Organization.where("domain is not null").map(&:domain).include?(request.subdomain) %> + <%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %> + <% else %> + <%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %> + <% end %> <% else %> <%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %> <% end %> @@ -80,7 +84,11 @@ <% end %> <% else %> <% if !field.subfield_subdomain_dir.nil? %> - <%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %> + <% if !request.local? and !organization.domain.nil? and Organization.where("domain is not null").map(&:domain).include?(request.subdomain) %> + <%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %> + <% else %> + <%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %> + <% end %> <% else %> <%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index ed1913c28..ce5b09aec 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -73,6 +73,7 @@ RedmineApp::Application.routes.draw do end end + get '/:sub_dir_name', :to => 'org_subfields#show', :as => 'show_subfield_without_id' constraints(Subdomain.new) do get '/', to: 'organizations#show' end From 03df9abfebb35fa5c780766e0d1c0cd1dd09bb9d Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 18 Jan 2016 10:43:22 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E5=94=AF=E4=B8=80=E6=80=A7=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_subfields_controller.rb | 6 ++++- app/controllers/organizations_controller.rb | 4 +++ .../organizations/check_uniq_domain.js.erb | 5 ++++ app/views/organizations/setting.html.erb | 25 +++++++++++++++---- config/routes.rb | 1 + 5 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 app/views/organizations/check_uniq_domain.js.erb diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index 9f1d964ef..d051a91f7 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -27,7 +27,11 @@ class OrgSubfieldsController < ApplicationController @sort = "" @order = "" @is_remote = false - @organization = Organization.find(params[:id]) + if params[:id] + @organization = Organization.find(params[:id]) + else + @organization = Organization.where("domain=?",request.subdomain).first + end @org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+ "subfield_subdomain_dirs where org_subfields.id = subfield_subdomain_dirs.org_subfield_id and "+ " org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir_name]}'").first diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index b431678af..39ece6fbe 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -136,6 +136,10 @@ class OrganizationsController < ApplicationController end end + def check_uniq_domain + @is_exist = (Organization.where("domain=?", params[:org_domain]).count > 0) + end + def find_organization @organization = Organization.find(params[:id]) end diff --git a/app/views/organizations/check_uniq_domain.js.erb b/app/views/organizations/check_uniq_domain.js.erb new file mode 100644 index 000000000..e49bb0cad --- /dev/null +++ b/app/views/organizations/check_uniq_domain.js.erb @@ -0,0 +1,5 @@ +<% if @is_exist %> + $is_exist = true; +<% else %> + $is_exist = false; +<% end %> \ No newline at end of file diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 962a7a497..45ac302ca 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -149,18 +149,33 @@ if ($("#subfield_name").val().trim() != "") $("#add_subfield_form").submit(); } + var $is_exist = false; function apply_subdomain(id, domain){ var reg = new RegExp("^[a-zA-Z0-9_]{1,}$"); if (reg.exec(domain)){ $.ajax({ - url:"<%= apply_subdomain_organization_path %>", - type:'post', + url: "<%= check_uniq_domain_organizations_path %>", + type: 'get', data:{ - id:id, - domain:domain + org_domain:domain }, success:function(){ - $("#apply_hint").text("您的申请已提交,系统会以消息的形式通知您结果"); + if(!$is_exist){ + $.ajax({ + url:"<%= apply_subdomain_organization_path %>", + type:'post', + data:{ + id:id, + domain:domain + }, + success:function(){ + $("#apply_hint").text("您的申请已提交,系统会以消息的形式通知您结果"); + } + }); + } + else{ + $("#apply_hint").text("您申请的子域名已存在,请重新输入"); + } } }); } diff --git a/config/routes.rb b/config/routes.rb index ce5b09aec..67694edb7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -66,6 +66,7 @@ RedmineApp::Application.routes.draw do end collection do get 'check_uniq' + get 'check_uniq_domain' get 'autocomplete_search' post 'hide_org_subfield' post 'show_org_subfield' From 5e102d24dd2f6d50dcc7ac51cd8991a3bbfca2d2 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 18 Jan 2016 11:01:04 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E6=8A=A5500=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/blogs/_article.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index 22df4499a..0516a431a 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -78,7 +78,7 @@ 发帖时间:<%= format_time(activity.created_on) %>
- 更新时间:<%= format_time(UserActivity.where("act_type='#{activity.class}' and act_id =#{activity.id}").first.updated_at) %> + 更新时间:<%= format_time(activity.updated_on) %>
From 909e0e846b09a0fa24f3ddfd34c2e0c3907cc9a1 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 18 Jan 2016 11:06:08 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index cdf715a0e..ccbe67004 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -74,7 +74,7 @@ RedmineApp::Application.routes.draw do end end - get '/:sub_dir_name', :to => 'org_subfields#show', :as => 'show_subfield_without_id' + constraints(Subdomain.new) do get '/', to: 'organizations#show' end @@ -1125,6 +1125,8 @@ RedmineApp::Application.routes.draw do resources :at + 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)