SphereSoftware / easy_agile

Easy Agile is a Redmine plugin for agile project management.
MIT License
51 stars 15 forks source link

Wrong context path for url's to assets #16

Closed maichler closed 13 years ago

maichler commented 13 years ago

Hi,

Our redmine installation sits behind an apache instance that is proxying requests to a context path of "/redmine". The redmine instance is started through mongrel which is configured to use the same context path as the apache server (commandline option --prefix=/redmine).

Now the problem is that some images cannot be loaded due to a missing context path, e.g. the generated url is "https://domain/plugin_assets/easy_agile/images/arrow_large_left_highlighted.png" instead of "https://domain/redmine/plugin_assets/easy_agile/images/arrow_large_left_highlighted.png".

msorc commented 13 years ago

What is your redmine version? Check this: http://www.redmine.org/issues/3935 Or try this: in RAILS_ROOT/config/environments/production.rb config.action_controller.relative_url_root = '/redmine'

Please report. Thanks.

maichler commented 13 years ago

redmine version is 1.1.2. however, the issue in this very case wasn't redmine but absolute urls defined in 2 css files. i forgot to update and comment on this issue, sorry for that!

the following two patches fixed the problem for me:

diff --git a/assets/stylesheets/application/colours.css b/assets/stylesheets/application/colours.css
index b1a9ed9..bc58788 100644
--- a/assets/stylesheets/application/colours.css
+++ b/assets/stylesheets/application/colours.css
@@ -53,7 +53,7 @@

 /* #footer, #footer a { color:#666 } */

-#actions a { color:#444; display:block; background:url(/plugin_assets/easy_agile/images/button_background.png) no-repeat }
+#actions a { color:#444; display:block; background:url(../../images/button_background.png) no-repeat }

 div.section, div.section h3 { border:2px solid #e4e5f3 }
 div.section .errorExplanation h3 { border: none }
diff --git a/assets/stylesheets/iteration_planning/colours.css b/assets/stylesheets/iteration_planning/colours.css
index ff606e0..f441fe3 100644
--- a/assets/stylesheets/iteration_planning/colours.css
+++ b/assets/stylesheets/iteration_planning/colours.css
@@ -1,5 +1,5 @@
 div.iteration_planning .include a{ background-repeat:no-repeat }
-div.iteration_planning #stories_available .include a { background-image:url(/plugin_assets/easy_agile/images/arrow_large_left_highlighted.png) }
-div.iteration_planning #stories_iteration .include a { background-image:url(/plugin_assets/easy_agile/images/arrow_large_right_highlighted.png) }
+div.iteration_planning #stories_available .include a { background-image:url(../../images/arrow_large_left_highlighted.png) }
+div.iteration_planning #stories_iteration .include a { background-image:url(../../images/arrow_large_right_highlighted.png) }
 div.iteration_planning .display .content { background:#fff }
 div.iteration_planning .story .estimate { border:none }
msorc commented 13 years ago

Committed