diff --git a/app/models/theme.rb b/app/models/theme.rb
index 56a3c55..59f1e42 100644
--- a/app/models/theme.rb
+++ b/app/models/theme.rb
@@ -2,10 +2,10 @@ class Theme
class << self
def system_themes
- Dir.glob(File.join(system_themes_dir, '*')).map do |item|
- File.basename(item)
- end.map do |item|
- new(item)
+ Dir.glob(File.join(system_themes_dir, '*')).map do |path|
+ config_file = File.join(path, 'theme.yml')
+ config = File.exists?(config_file) ? YAML.load_file(config_file) : {}
+ new(File.basename(path), config)
end
end
@@ -61,7 +61,7 @@ class Theme
@id = id
load_config
attributes.each do |k,v|
- self.send("#{k}=", v)
+ self.send("#{k}=", v) if self.respond_to?("#{k}=")
end
config['id'] = id
end
diff --git a/app/views/themes/index.rhtml b/app/views/themes/index.rhtml
index 0abf232..38c1327 100644
--- a/app/views/themes/index.rhtml
+++ b/app/views/themes/index.rhtml
@@ -21,7 +21,7 @@
:class => 'template-opt list-opt selected')
else # Not selected
link_to(
- base_content + content_tag('span', _('Use this template') ) +'',
+ base_content +'',
{ :action => 'set_layout_template', :id => template.id },
:class => 'template-opt list-opt')
end
@@ -46,7 +46,7 @@
if theme
base_content = image_tag(
- "/designs/themes/#{theme.name}/preview.png",
+ "/designs/themes/#{theme.id}/preview.png",
:alt => (_('The "%s" theme.') % theme.name)) +
'
' +
content_tag('strong', theme.name, :class => 'name') +
@@ -58,7 +58,7 @@
:class => 'theme-opt list-opt selected')
else # Not selected
link_to(
- base_content + content_tag('span', _('Use this theme') ) +'
',
+ base_content + '',
{ :action => 'set', :id => theme.id },
:class => 'theme-opt list-opt')
end
diff --git a/public/designs/themes/aluminium/theme.yml b/public/designs/themes/aluminium/theme.yml
index cee7b81..add506a 100644
--- a/public/designs/themes/aluminium/theme.yml
+++ b/public/designs/themes/aluminium/theme.yml
@@ -1,3 +1,3 @@
-theme: "Aluminium theme"
+name: "Aluminium"
layout: "application-ng"
icon_theme: [default, pidgin]
diff --git a/public/designs/themes/base/theme.yml b/public/designs/themes/base/theme.yml
index e30cdc1..dbaab28 100644
--- a/public/designs/themes/base/theme.yml
+++ b/public/designs/themes/base/theme.yml
@@ -1,3 +1,3 @@
-theme: "Noosfero base theme"
+name: "Noosfero base theme"
layout: "application-ng"
icon_theme: [default, pidgin]
diff --git a/public/designs/themes/butter/theme.yml b/public/designs/themes/butter/theme.yml
index 56ae4a4..5abfcd7 100644
--- a/public/designs/themes/butter/theme.yml
+++ b/public/designs/themes/butter/theme.yml
@@ -1,3 +1,3 @@
-theme: "Butter theme"
+name: "Butter"
layout: "application-ng"
icon_theme: [default, pidgin]
diff --git a/public/designs/themes/chameleon/theme.yml b/public/designs/themes/chameleon/theme.yml
index fd0c583..f83a977 100644
--- a/public/designs/themes/chameleon/theme.yml
+++ b/public/designs/themes/chameleon/theme.yml
@@ -1,3 +1,3 @@
-theme: "Chameleon theme"
+name: "Chameleon"
layout: "application-ng"
icon_theme: [default, pidgin]
diff --git a/public/designs/themes/chocolate/theme.yml b/public/designs/themes/chocolate/theme.yml
index e9c5894..12b3bcc 100644
--- a/public/designs/themes/chocolate/theme.yml
+++ b/public/designs/themes/chocolate/theme.yml
@@ -1,3 +1,3 @@
-theme: "Chocolate theme"
+name: "Chocolate"
layout: "application-ng"
icon_theme: [default, pidgin]
diff --git a/public/designs/themes/noosfero/theme.yml b/public/designs/themes/noosfero/theme.yml
index 68ae402..661d923 100644
--- a/public/designs/themes/noosfero/theme.yml
+++ b/public/designs/themes/noosfero/theme.yml
@@ -1,4 +1,4 @@
-theme: "Noosfero default theme"
+name: "Noosfero"
layout: "application-ng"
jquery_theme: "smoothness_mod"
icon_theme: [default, pidgin]
diff --git a/public/designs/themes/orange/theme.yml b/public/designs/themes/orange/theme.yml
index 80adb93..d0559ee 100644
--- a/public/designs/themes/orange/theme.yml
+++ b/public/designs/themes/orange/theme.yml
@@ -1,3 +1,3 @@
-theme: "Orange Red theme"
+name: "Orange"
layout: "application-ng"
icon_theme: [default, pidgin]
diff --git a/public/designs/themes/plum/theme.yml b/public/designs/themes/plum/theme.yml
index c71f4ec..5ea8497 100644
--- a/public/designs/themes/plum/theme.yml
+++ b/public/designs/themes/plum/theme.yml
@@ -1,3 +1,3 @@
-theme: "Plum theme"
+name: "Plum"
layout: "application-ng"
icon_theme: [default, pidgin]
diff --git a/public/designs/themes/profile-base/theme.yml b/public/designs/themes/profile-base/theme.yml
index 0d14a1d..48720f5 100644
--- a/public/designs/themes/profile-base/theme.yml
+++ b/public/designs/themes/profile-base/theme.yml
@@ -1,3 +1,3 @@
-theme: "Noosfero base theme for profiles"
+name: "Noosfero base theme for profiles"
layout: "application-ng"
icon_theme: [default, pidgin]
diff --git a/public/designs/themes/scarletred/theme.yml b/public/designs/themes/scarletred/theme.yml
index e9d2683..9371b3c 100644
--- a/public/designs/themes/scarletred/theme.yml
+++ b/public/designs/themes/scarletred/theme.yml
@@ -1,3 +1,3 @@
-theme: "Scarlet Red theme"
+name: "Scarlet Red"
layout: "application-ng"
icon_theme: [default, pidgin]
diff --git a/public/designs/themes/skyblue/theme.yml b/public/designs/themes/skyblue/theme.yml
index 74e33a3..ed399c4 100644
--- a/public/designs/themes/skyblue/theme.yml
+++ b/public/designs/themes/skyblue/theme.yml
@@ -1,3 +1,3 @@
-theme: "Skyblue theme"
+name: "Sky Blue"
layout: "application-ng"
icon_theme: [default, pidgin]
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 804041b..bbf2dfb 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -4101,10 +4101,10 @@ h1#agenda-title {
-webkit-border-radius: 10px;
}
.list-opt:hover {
- background: #FE0;
+ background: #eeeeec;
}
.list-opt.selected {
- background: #F8F0A0;
+ background: #fcf5c0;
}
#theme-options .list-opt {
@@ -4123,7 +4123,7 @@ h1#agenda-title {
.opt-info {
position: absolute;
- top: 15px;
+ top: 0px;
left: 75px;
width: 130px;
}
@@ -4135,16 +4135,12 @@ h1#agenda-title {
top: 2px;
}
-.list-opt span {
- text-decoration: underline;
-}
-
.list-opt big {
opacity: 0.5;
}
.list-opt .name {
- font-size: 20px;
+ font-size: 16px;
}
#user-themes .list-opt .name {
font-size: 18px;
--
libgit2 0.21.2