Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
OHR Support
Commits
8cfe498b
Commit
8cfe498b
authored
14 years ago
by
Holger Just
Committed by
Eric Davis
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[
#230
] Make loadpath of themes configurable
Based on a987b74ed14 by meineerde
parent
f1878f4a
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/configuration.yml.example
+13
-1
13 additions, 1 deletion
config/configuration.yml.example
lib/redmine/themes.rb
+16
-5
16 additions, 5 deletions
lib/redmine/themes.rb
with
29 additions
and
6 deletions
config/configuration.yml.example
+
13
−
1
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: /)
...
...
This diff is collapsed.
Click to expand it.
lib/redmine/themes.rb
+
16
−
5
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment