From 4021728fa4bcbd6a0f834ce87a74d9e52b44292b Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Fri, 29 Nov 2013 10:05:39 +0100 Subject: [PATCH 1/8] fixes asset path on timelines css --- .../{timelines.css => timelines.css.erb} | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename app/assets/stylesheets/{timelines.css => timelines.css.erb} (93%) diff --git a/app/assets/stylesheets/timelines.css b/app/assets/stylesheets/timelines.css.erb similarity index 93% rename from app/assets/stylesheets/timelines.css rename to app/assets/stylesheets/timelines.css.erb index a35d90b74d..48b0c9dfbd 100644 --- a/app/assets/stylesheets/timelines.css +++ b/app/assets/stylesheets/timelines.css.erb @@ -50,7 +50,7 @@ li.select2-result.select2-visible-selected-parent { } .tl-under-construction { - background: url("../../../assets/loadingAnimation.gif") no-repeat center; + background: url(<%= asset_path "loadingAnimation.gif" %>) no-repeat center; border: 1px solid #ddd; height: 48px; } @@ -208,31 +208,31 @@ not be applied in anything that is not display:table-cell */ .tl-icon-postponed { cursor: default; - background: url("../assets/bullet_red.png") no-repeat center; + background: url(<%= asset_path "bullet_red.png" %>) no-repeat center; } .tl-icon-preponed { cursor: default; - background: url("../assets/bullet_green.png") no-repeat center; + background: url(<%= asset_path "bullet_green.png" %>) no-repeat center; } .tl-icon-added { cursor: default; - background: url("../assets/added.png") no-repeat center; + background: url(<%= asset_path "added.png" %>) no-repeat center; display: inline; width: 16px; background-position: 2px 2px; } .tl-icon-deleted { cursor: default; - background: url("../assets/webalys/deleted.png") no-repeat center; + background: url(<%= asset_path "webalys/deleted.png" %>) no-repeat center; display: inline; width: 16px; background-position: 2px 2px; } .tl-icon-changed { cursor: default; - background: url("../assets/webalys/arrow_left_right.png") no-repeat center; + background: url(<%= asset_path "webalys/arrow_left_right.png" %>) no-repeat center; display: inline; width: 16px; background-position: 2px 2px; @@ -240,21 +240,21 @@ not be applied in anything that is not display:table-cell */ .tl-icon-calendar { cursor: default; - background: url("../assets/webalys/calendar.png") no-repeat center; + background: url(<%= asset_path "webalys/calendar.png" %>) no-repeat center; display: inline; width: 16px; } .tl-icon-zoomin { - background: url("../../../assets/webalys/zoom_in.png") no-repeat center; + background: url(<%= asset_path "webalys/zoom_in.png" %>) no-repeat center; } .tl-icon-zoomout { - background: url("../../../assets/webalys/zoom_out.png") no-repeat center; + background: url(<%= asset_path "webalys/zoom_out.png" %>) no-repeat center; } .tl-icon-outline { - background: url("../assets/webalys/outline.png") no-repeat center; + background: url(<%= asset_path "webalys/outline.png" %>) no-repeat center; } /* ╭───────────────────────────────────────────────────────────────────╮ * @@ -339,11 +339,11 @@ a.tl-discreet-link:hover, input.icon:hover { } .tl-expanded > a { - background: url("../assets/arrow_expanded.png") no-repeat center; + background: url(<%= asset_path "arrow_expanded.png" %>) no-repeat center; } .tl-collapsed > a { - background: url("../assets/arrow_collapsed.png") no-repeat center; + background: url(<%= asset_path "arrow_collapsed.png" %>) no-repeat center; } .tl-expanded > a, .tl-collapsed > a { @@ -584,7 +584,7 @@ a:hover.tl-project, a.tl-project, .tl-project { /* Icons for activity view */ dt.timelines\2F planning-element { - background-image: url(../assets/webalys/new_planning_element.png); + background-image: url(<%= asset_path 'webalys/new_planning_element.png' %>); } #history .journal { From bf9b70cc1b3b4a357425ec25c50311074822a316 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Fri, 29 Nov 2013 15:07:41 +0100 Subject: [PATCH 2/8] sets relative_url_root with instance variable value --- lib/redmine/utils.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/redmine/utils.rb b/lib/redmine/utils.rb index ec9c229348..e9eade0a8f 100644 --- a/lib/redmine/utils.rb +++ b/lib/redmine/utils.rb @@ -30,8 +30,10 @@ module Redmine module Utils class << self - attr_accessor :relative_url_root + end + + self.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT'] || "" end end From 25422517376fdbcd29c76457acb432241d0e8c4b Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Fri, 29 Nov 2013 15:18:30 +0100 Subject: [PATCH 3/8] fixes calling the work package description diff when in a sub uri --- lib/open_project/journal_formatter/diff.rb | 33 ++++++++++++++-------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/lib/open_project/journal_formatter/diff.rb b/lib/open_project/journal_formatter/diff.rb index 513e5d5585..ff21819da7 100644 --- a/lib/open_project/journal_formatter/diff.rb +++ b/lib/open_project/journal_formatter/diff.rb @@ -66,20 +66,15 @@ class OpenProject::JournalFormatter::Diff < JournalFormatter::Base # url_for wants to access the controller method, which we do not have in our Diff class. # see: http://stackoverflow.com/questions/3659455/is-there-a-new-syntax-for-url-for-in-rails-3 - def controller; @controller; end + def controller + nil + end def link(key, options) - url_attr = { :controller => '/journals', - :action => 'diff', - :id => @journal.id, - :field => key.downcase, - :only_path => options[:only_path], - :protocol => Setting.protocol, - # the link params should better be defined with the - # skip_relative_url_root => true - # option. But this method is flawed in 2.3 - # revise when on 3.2 - :host => Setting.host_name.gsub(Redmine::Utils.relative_url_root.to_s, "") } + url_attr = default_attributes(options).merge({ :controller => '/journals', + :action => 'diff', + :id => @journal.id, + :field => key.downcase }) if options[:no_html] url_for url_attr @@ -89,5 +84,19 @@ class OpenProject::JournalFormatter::Diff < JournalFormatter::Base :class => 'description-details') end end + + def default_attributes(options) + if options[:only_path] + { :only_path => options[:only_path], + # setting :script_name is a hack that allows for setting the sub uri. + # I am not yet sure why url_for normally returns the sub uri but does not within + # this class. + :script_name => ::Redmine::Utils::relative_url_root } + else + { :only_path => options[:only_path], + :protocol => Setting.protocol, + :host => Setting.host_name } + end + end end From 4f512dccd21df4fec61be0a4f54825b317487a53 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Fri, 29 Nov 2013 15:46:21 +0100 Subject: [PATCH 4/8] moves relative url root functionality into own module --- app/controllers/settings_controller.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/mailers/user_mailer.rb | 2 +- app/views/timelines/_timeline.html.erb | 2 +- lib/open_project/journal_formatter/diff.rb | 2 +- lib/{redmine/utils.rb => open_project/url_root.rb} | 8 ++++---- test/functional/user_mailer_test.rb | 6 +++--- test/integration/lib/redmine/themes_test.rb | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) rename lib/{redmine/utils.rb => open_project/url_root.rb} (90%) diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index 2c8bb5007d..e731c31241 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -53,7 +53,7 @@ class SettingsController < ApplicationController @options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] } @deliveries = ActionMailer::Base.perform_deliveries - @guessed_host_and_path = request.host_with_port.dup + Redmine::Utils.relative_url_root.to_s + @guessed_host_and_path = request.host_with_port.dup + OpenProject::UrlRoot.relative end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bd4f36bd5c..2cf5e81445 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -950,7 +950,7 @@ module ApplicationHelper tags = '' tags += javascript_tag(%Q{ window.openProject = new OpenProject({ - urlRoot : '#{Redmine::Utils.relative_url_root}', + urlRoot : '#{OpenProject::UrlRoot.relative}', loginUrl: '#{url_for :controller => "/account", :action => "login"}' }); I18n.defaultLocale = "#{I18n.default_locale}"; diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 037babe081..9255b347da 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -328,7 +328,7 @@ private end def self.host - if Redmine::Utils.relative_url_root.blank? + if OpenProject::UrlRoot.relative.blank? Setting.host_name else Setting.host_name.to_s.gsub(%r{\/.*\z}, '') diff --git a/app/views/timelines/_timeline.html.erb b/app/views/timelines/_timeline.html.erb index accca71230..d2a4feec64 100644 --- a/app/views/timelines/_timeline.html.erb +++ b/app/views/timelines/_timeline.html.erb @@ -80,7 +80,7 @@ See doc/COPYRIGHT.rdoc for more details. var config = jQuery.extend({ i18n: i18n, project_id: '<%= timeline.project.identifier %>', - url_prefix: '<%= Redmine::Utils.relative_url_root %>', + url_prefix: '<%= OpenProject::UrlRoot.relative %>', ui_root: jQuery("#<%= timeline_div_id %>") }, <%= timeline.json_options %>); jQuery(function(jQuery) { diff --git a/lib/open_project/journal_formatter/diff.rb b/lib/open_project/journal_formatter/diff.rb index ff21819da7..78acd232a3 100644 --- a/lib/open_project/journal_formatter/diff.rb +++ b/lib/open_project/journal_formatter/diff.rb @@ -91,7 +91,7 @@ class OpenProject::JournalFormatter::Diff < JournalFormatter::Base # setting :script_name is a hack that allows for setting the sub uri. # I am not yet sure why url_for normally returns the sub uri but does not within # this class. - :script_name => ::Redmine::Utils::relative_url_root } + :script_name => ::OpenProject::UrlRoot::relative } else { :only_path => options[:only_path], :protocol => Setting.protocol, diff --git a/lib/redmine/utils.rb b/lib/open_project/url_root.rb similarity index 90% rename from lib/redmine/utils.rb rename to lib/open_project/url_root.rb index e9eade0a8f..d6d36dfe37 100644 --- a/lib/redmine/utils.rb +++ b/lib/open_project/url_root.rb @@ -27,13 +27,13 @@ # See doc/COPYRIGHT.rdoc for more details. #++ -module Redmine - module Utils +module OpenProject + module UrlRoot class << self - attr_accessor :relative_url_root + attr_accessor :relative end - self.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT'] || "" + self.relative = ENV['RAILS_RELATIVE_URL_ROOT'] || "" end end diff --git a/test/functional/user_mailer_test.rb b/test/functional/user_mailer_test.rb index f6fe6729e3..e01e7d8e44 100644 --- a/test/functional/user_mailer_test.rb +++ b/test/functional/user_mailer_test.rb @@ -164,10 +164,10 @@ class UserMailerTest < ActionMailer::TestCase def test_generated_links_with_prefix_and_no_relative_url_root Setting.default_language = 'en' - relative_url_root = Redmine::Utils.relative_url_root + relative_url_root = OpenProject::UrlRoot.relative Setting.host_name = 'mydomain.foo/rdm' Setting.protocol = 'http' - Redmine::Utils.relative_url_root = nil + OpenProject::UrlRoot.relative = nil User.current = FactoryGirl.create(:admin) @@ -206,7 +206,7 @@ class UserMailerTest < ActionMailer::TestCase end ensure # restore it - Redmine::Utils.relative_url_root = relative_url_root + OpenProject::UrlRoot.relative = relative_url_root end def test_email_headers diff --git a/test/integration/lib/redmine/themes_test.rb b/test/integration/lib/redmine/themes_test.rb index 435156fa98..84801e4468 100644 --- a/test/integration/lib/redmine/themes_test.rb +++ b/test/integration/lib/redmine/themes_test.rb @@ -74,7 +74,7 @@ class ThemesTest < ActionDispatch::IntegrationTest should_eventually 'test_with_sub_uri' do begin - Redmine::Utils.relative_url_root = '/foo' + OpenProject::UrlRoot.relative = '/foo' @theme.javascripts << 'theme' get '/' @@ -84,7 +84,7 @@ class ThemesTest < ActionDispatch::IntegrationTest assert_tag :tag => 'script', :attributes => {:src => '/foo/assets/default.js'} ensure - Redmine::Utils.relative_url_root = '' + OpenProject::UrlRoot.relative = '' end end end From 8fe4e8ee28e1b08e9feab5a4550c89c997d3fab1 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Tue, 3 Dec 2013 18:51:54 +0100 Subject: [PATCH 5/8] uses the standard OpenProject way to set the prefix --- lib/open_project/configuration.rb | 4 +++- lib/open_project/url_root.rb | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/open_project/configuration.rb b/lib/open_project/configuration.rb index d80115d748..13ccd9d4c0 100644 --- a/lib/open_project/configuration.rb +++ b/lib/open_project/configuration.rb @@ -42,6 +42,8 @@ module OpenProject 'disable_browser_cache' => true, # default cache_store is :file_store in production and :memory_store in development 'rails_cache_store' => :default, + # url-path prefix + 'rails_relative_url_root' => "", # email configuration 'email_delivery_method' => nil, @@ -60,7 +62,7 @@ module OpenProject @config = nil class << self - # Loads the Redmine configuration file + # Loads the OpenProject configuration file # Valid options: # * :file: the configuration file to load (default: config/configuration.yml) # * :env: the environment to load the configuration for (default: Rails.env) diff --git a/lib/open_project/url_root.rb b/lib/open_project/url_root.rb index d6d36dfe37..a6a511979b 100644 --- a/lib/open_project/url_root.rb +++ b/lib/open_project/url_root.rb @@ -31,9 +31,8 @@ module OpenProject module UrlRoot class << self attr_accessor :relative - end - self.relative = ENV['RAILS_RELATIVE_URL_ROOT'] || "" + self.relative = OpenProject::Configuration['rails_relative_url_root'] end end From d57b56a53e2aed916a22b1ac1eb2016c1a9fd206 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Wed, 4 Dec 2013 14:48:16 +0100 Subject: [PATCH 6/8] streamlines configuration of relative_url_root * includes relative_url_root into OpenProject::Configuration * ensures loading in environment so that it is also used for asset precompiling --- app/controllers/settings_controller.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/mailers/user_mailer.rb | 2 +- app/views/timelines/_timeline.html.erb | 2 +- config/application.rb | 6 ++++ config/configuration.yml.example | 11 ++++++ lib/open_project/configuration.rb | 17 +++++++++ lib/open_project/journal_formatter/diff.rb | 2 +- lib/open_project/url_root.rb | 38 --------------------- test/functional/user_mailer_test.rb | 6 ++-- test/integration/lib/redmine/themes_test.rb | 4 +-- 11 files changed, 44 insertions(+), 48 deletions(-) delete mode 100644 lib/open_project/url_root.rb diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index e731c31241..83856de1c0 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -53,7 +53,7 @@ class SettingsController < ApplicationController @options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] } @deliveries = ActionMailer::Base.perform_deliveries - @guessed_host_and_path = request.host_with_port.dup + OpenProject::UrlRoot.relative + @guessed_host_and_path = request.host_with_port.dup + OpenProject::Configuration.rails_relative_url_root end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2cf5e81445..f46e5a55df 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -950,7 +950,7 @@ module ApplicationHelper tags = '' tags += javascript_tag(%Q{ window.openProject = new OpenProject({ - urlRoot : '#{OpenProject::UrlRoot.relative}', + urlRoot : '#{OpenProject::Configuration.rails_relative_url_root}', loginUrl: '#{url_for :controller => "/account", :action => "login"}' }); I18n.defaultLocale = "#{I18n.default_locale}"; diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 9255b347da..39997fa9e4 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -328,7 +328,7 @@ private end def self.host - if OpenProject::UrlRoot.relative.blank? + if OpenProject::Configuration.rails_relative_url_root.blank? Setting.host_name else Setting.host_name.to_s.gsub(%r{\/.*\z}, '') diff --git a/app/views/timelines/_timeline.html.erb b/app/views/timelines/_timeline.html.erb index d2a4feec64..fb5826dd27 100644 --- a/app/views/timelines/_timeline.html.erb +++ b/app/views/timelines/_timeline.html.erb @@ -80,7 +80,7 @@ See doc/COPYRIGHT.rdoc for more details. var config = jQuery.extend({ i18n: i18n, project_id: '<%= timeline.project.identifier %>', - url_prefix: '<%= OpenProject::UrlRoot.relative %>', + url_prefix: '<%= OpenProject::Configuration.rails_relative_url_root %>', ui_root: jQuery("#<%= timeline_div_id %>") }, <%= timeline.json_options %>); jQuery(function(jQuery) { diff --git a/config/application.rb b/config/application.rb index 8cbe443552..0aa79e3b53 100644 --- a/config/application.rb +++ b/config/application.rb @@ -55,6 +55,8 @@ if defined?(Bundler) end end +require File.dirname(__FILE__) + '/../lib/open_project/configuration' + module OpenProject class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. @@ -121,6 +123,10 @@ module OpenProject # initialize variable for register plugin tests config.plugins_to_test_paths = [] + # Configure the relative url root to be whatever the configuration is set to. + # This allows for setting the root either via config file or via environment variable. + config.action_controller.relative_url_root = OpenProject::Configuration['rails_relative_url_root'] + config.to_prepare do # Rails loads app/views paths of all plugin on each request and appends it to the view_paths. # Thus, they end up behind the core view path and core views are found before plugin views. diff --git a/config/configuration.yml.example b/config/configuration.yml.example index 40f92287da..9ba3948b27 100644 --- a/config/configuration.yml.example +++ b/config/configuration.yml.example @@ -111,6 +111,17 @@ default: smtp_user_name: "openproject@example.net" smtp_password: "my_openproject_password" + # Prefix to the url-path. This path is then prepended to all + # the routes and is used to correclty identify the path to the assets. + # Defaults to having no prefix. + # Examples: + # For OpenProject to be reachable as + # https://example.org/open_project + # the setting has o be: + # rails_relative_url_root: "/open_project" + # + # rails_relative_url_root: "" + # Absolute path to the directory where attachments are stored. # The default is the 'files' directory in your OpenProject instance. # Your OpenProject instance needs to have write permission on this diff --git a/lib/open_project/configuration.rb b/lib/open_project/configuration.rb index 13ccd9d4c0..089974a554 100644 --- a/lib/open_project/configuration.rb +++ b/lib/open_project/configuration.rb @@ -82,6 +82,8 @@ module OpenProject configure_action_mailer(@config) end + define_config_methods + @config end @@ -99,6 +101,12 @@ module OpenProject @config[name] end + # Sets configuration setting + def []=(name, value) + load unless @config + @config[name] = value + end + # Yields a block with the specified hash configuration settings def with(settings) settings.stringify_keys! @@ -188,6 +196,15 @@ module OpenProject filtered_hash end + def define_config_methods + @config.keys.each do |setting| + (class << self; self; end).class_eval do + define_method setting do + self[setting] + end + end + end + end end end end diff --git a/lib/open_project/journal_formatter/diff.rb b/lib/open_project/journal_formatter/diff.rb index 78acd232a3..5429d58ab1 100644 --- a/lib/open_project/journal_formatter/diff.rb +++ b/lib/open_project/journal_formatter/diff.rb @@ -91,7 +91,7 @@ class OpenProject::JournalFormatter::Diff < JournalFormatter::Base # setting :script_name is a hack that allows for setting the sub uri. # I am not yet sure why url_for normally returns the sub uri but does not within # this class. - :script_name => ::OpenProject::UrlRoot::relative } + :script_name => ::OpenProject::Configuration.rails_relative_url_root } else { :only_path => options[:only_path], :protocol => Setting.protocol, diff --git a/lib/open_project/url_root.rb b/lib/open_project/url_root.rb deleted file mode 100644 index a6a511979b..0000000000 --- a/lib/open_project/url_root.rb +++ /dev/null @@ -1,38 +0,0 @@ -#-- encoding: UTF-8 -#-- copyright -# OpenProject is a project management system. -# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# 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 to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See doc/COPYRIGHT.rdoc for more details. -#++ - -module OpenProject - module UrlRoot - class << self - attr_accessor :relative - end - - self.relative = OpenProject::Configuration['rails_relative_url_root'] - end -end diff --git a/test/functional/user_mailer_test.rb b/test/functional/user_mailer_test.rb index e01e7d8e44..3a12036621 100644 --- a/test/functional/user_mailer_test.rb +++ b/test/functional/user_mailer_test.rb @@ -164,10 +164,10 @@ class UserMailerTest < ActionMailer::TestCase def test_generated_links_with_prefix_and_no_relative_url_root Setting.default_language = 'en' - relative_url_root = OpenProject::UrlRoot.relative + relative_url_root = OpenProject::Configuration['rails_relative_url_root'] Setting.host_name = 'mydomain.foo/rdm' Setting.protocol = 'http' - OpenProject::UrlRoot.relative = nil + OpenProject::Configuration['rails_relative_url_root'] = nil User.current = FactoryGirl.create(:admin) @@ -206,7 +206,7 @@ class UserMailerTest < ActionMailer::TestCase end ensure # restore it - OpenProject::UrlRoot.relative = relative_url_root + OpenProject::Configuration['rails_relative_url_root'] = relative_url_root end def test_email_headers diff --git a/test/integration/lib/redmine/themes_test.rb b/test/integration/lib/redmine/themes_test.rb index 84801e4468..ac802427df 100644 --- a/test/integration/lib/redmine/themes_test.rb +++ b/test/integration/lib/redmine/themes_test.rb @@ -74,7 +74,7 @@ class ThemesTest < ActionDispatch::IntegrationTest should_eventually 'test_with_sub_uri' do begin - OpenProject::UrlRoot.relative = '/foo' + OpenProject::Configuration['rails_relative_url_root'] = '/foo' @theme.javascripts << 'theme' get '/' @@ -84,7 +84,7 @@ class ThemesTest < ActionDispatch::IntegrationTest assert_tag :tag => 'script', :attributes => {:src => '/foo/assets/default.js'} ensure - OpenProject::UrlRoot.relative = '' + OpenProject::Configuration['rails_relative_url_root'] = '' end end end From 2a61a5b65e5417026fa90bd64a4fef1951624083 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Wed, 4 Dec 2013 14:45:47 +0100 Subject: [PATCH 7/8] removes no longer necessary rake tasks --- lib/tasks/plugins.rake | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lib/tasks/plugins.rake b/lib/tasks/plugins.rake index 88df213241..3af00023ef 100644 --- a/lib/tasks/plugins.rake +++ b/lib/tasks/plugins.rake @@ -64,24 +64,6 @@ namespace :redmine do PluginSourceAnnotationExtractor.enumerate 'call_hook' end - desc 'Copies plugins assets into the public directory.' - task :assets => :environment do - name = ENV['NAME'] - - begin - Redmine::Plugin.mirror_assets(name) - rescue Redmine::PluginNotFound - abort "Plugin #{name} was not found." - end - end - - desc 'Runs the plugins tests.' - task :test do - Rake::Task["redmine:plugins:test:units"].invoke - Rake::Task["redmine:plugins:test:functionals"].invoke - Rake::Task["redmine:plugins:test:integration"].invoke - end - namespace :test do desc 'Runs the plugins unit tests.' Rake::TestTask.new :units => "db:test:prepare" do |t| From 59cf79360d018e3b024b547a4ebec6fc999422a8 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Tue, 3 Dec 2013 18:53:52 +0100 Subject: [PATCH 8/8] updates changelog --- doc/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 9027e55198..784cc075ae 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -29,6 +29,8 @@ See doc/COPYRIGHT.rdoc for more details. # Changelog +* `#2289` Fix: Deploying in a subdirectory + ## 3.0.0pre36 * `#3155` Icons from icon font in content area