Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
8cfe498b
Commit
8cfe498b
authored
Mar 23, 2011
by
Holger Just
Committed by
Eric Davis
Mar 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
#230
] Make loadpath of themes configurable
Based on a987b74ed14 by meineerde
parent
f1878f4a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
configuration.yml.example
config/configuration.yml.example
+13
-1
themes.rb
lib/redmine/themes.rb
+16
-5
No files found.
config/configuration.yml.example
View file @
8cfe498b
...
...
@@ -98,7 +98,19 @@ default:
# attachments_storage_path: /var/chiliproject/files
# attachments_storage_path: D:/chiliproject/files
attachments_storage_path:
# Path to the directories where themes are stored.
# Can be an absolute path or one relative to your ChiliProject instance.
# You can configure multiple paths.
# The default is the 'public/themes' directory in your ChiliProject instance.
# Examples:
# themes_storage_paths: public/themes
# themes_storage_paths:
# - public/themes
# - /opt/themes
# - D:/chiliproject/themes
themes_storage_path:
# Configuration of the autologin cookie.
# autologin_cookie_name: the name of the cookie (default: autologin)
# autologin_cookie_path: the cookie path (default: /)
...
...
lib/redmine/themes.rb
View file @
8cfe498b
...
...
@@ -89,11 +89,22 @@ module Redmine
private
def
self
.
scan_themes
dirs
=
Dir
.
glob
(
"
#{
Rails
.
public_path
}
/themes/*"
).
select
do
|
f
|
# A theme should at least override application.css
File
.
directory?
(
f
)
&&
File
.
exist?
(
"
#{
f
}
/stylesheets/application.css"
)
end
dirs
.
collect
{
|
dir
|
Theme
.
new
(
dir
)}.
sort
theme_paths
.
inject
([])
do
|
themes
,
path
|
dirs
=
Dir
.
glob
(
File
.
join
(
path
,
'*'
)).
select
do
|
f
|
# A theme should at least override application.css
File
.
directory?
(
f
)
&&
File
.
exist?
(
"
#{
f
}
/stylesheets/application.css"
)
end
themes
+=
dirs
.
collect
{
|
dir
|
Theme
.
new
(
dir
)
}
end
.
sort
end
def
self
.
theme_paths
paths
=
Redmine
::
Configuration
[
'themes_storage_path'
]
paths
=
[
paths
]
unless
paths
.
is_a?
(
Array
)
paths
.
flatten!
;
paths
.
compact!
paths
=
[
"
#{
Rails
.
public_path
}
/themes"
]
if
paths
.
empty?
paths
.
collect
{
|
p
|
File
.
expand_path
(
p
,
Rails
.
root
)
}
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment