Commit 915f2250f7b18a74a28d3c3146b75e6bbc4ad844
1 parent
b2dc6bdc
Exists in
master
and in
22 other branches
Cleaner theme selection screen
Showing
14 changed files
with
23 additions
and
27 deletions
Show diff stats
app/models/theme.rb
| ... | ... | @@ -2,10 +2,10 @@ class Theme |
| 2 | 2 | |
| 3 | 3 | class << self |
| 4 | 4 | def system_themes |
| 5 | - Dir.glob(File.join(system_themes_dir, '*')).map do |item| | |
| 6 | - File.basename(item) | |
| 7 | - end.map do |item| | |
| 8 | - new(item) | |
| 5 | + Dir.glob(File.join(system_themes_dir, '*')).map do |path| | |
| 6 | + config_file = File.join(path, 'theme.yml') | |
| 7 | + config = File.exists?(config_file) ? YAML.load_file(config_file) : {} | |
| 8 | + new(File.basename(path), config) | |
| 9 | 9 | end |
| 10 | 10 | end |
| 11 | 11 | |
| ... | ... | @@ -61,7 +61,7 @@ class Theme |
| 61 | 61 | @id = id |
| 62 | 62 | load_config |
| 63 | 63 | attributes.each do |k,v| |
| 64 | - self.send("#{k}=", v) | |
| 64 | + self.send("#{k}=", v) if self.respond_to?("#{k}=") | |
| 65 | 65 | end |
| 66 | 66 | config['id'] = id |
| 67 | 67 | end | ... | ... |
app/views/themes/index.rhtml
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | :class => 'template-opt list-opt selected') |
| 22 | 22 | else # Not selected |
| 23 | 23 | link_to( |
| 24 | - base_content + content_tag('span', _('Use this template') ) +'</div>', | |
| 24 | + base_content +'</div>', | |
| 25 | 25 | { :action => 'set_layout_template', :id => template.id }, |
| 26 | 26 | :class => 'template-opt list-opt') |
| 27 | 27 | end |
| ... | ... | @@ -46,7 +46,7 @@ |
| 46 | 46 | if theme |
| 47 | 47 | |
| 48 | 48 | base_content = image_tag( |
| 49 | - "/designs/themes/#{theme.name}/preview.png", | |
| 49 | + "/designs/themes/#{theme.id}/preview.png", | |
| 50 | 50 | :alt => (_('The "%s" theme.') % theme.name)) + |
| 51 | 51 | '<div class="opt-info">' + |
| 52 | 52 | content_tag('strong', theme.name, :class => 'name') + |
| ... | ... | @@ -58,7 +58,7 @@ |
| 58 | 58 | :class => 'theme-opt list-opt selected') |
| 59 | 59 | else # Not selected |
| 60 | 60 | link_to( |
| 61 | - base_content + content_tag('span', _('Use this theme') ) +'</div>', | |
| 61 | + base_content + '</div>', | |
| 62 | 62 | { :action => 'set', :id => theme.id }, |
| 63 | 63 | :class => 'theme-opt list-opt') |
| 64 | 64 | end | ... | ... |
public/designs/themes/aluminium/theme.yml
public/designs/themes/base/theme.yml
public/designs/themes/butter/theme.yml
public/designs/themes/chameleon/theme.yml
public/designs/themes/chocolate/theme.yml
public/designs/themes/noosfero/theme.yml
public/designs/themes/orange/theme.yml
public/designs/themes/plum/theme.yml
public/designs/themes/profile-base/theme.yml
public/designs/themes/scarletred/theme.yml
public/designs/themes/skyblue/theme.yml
public/stylesheets/application.css
| ... | ... | @@ -4101,10 +4101,10 @@ h1#agenda-title { |
| 4101 | 4101 | -webkit-border-radius: 10px; |
| 4102 | 4102 | } |
| 4103 | 4103 | .list-opt:hover { |
| 4104 | - background: #FE0; | |
| 4104 | + background: #eeeeec; | |
| 4105 | 4105 | } |
| 4106 | 4106 | .list-opt.selected { |
| 4107 | - background: #F8F0A0; | |
| 4107 | + background: #fcf5c0; | |
| 4108 | 4108 | } |
| 4109 | 4109 | |
| 4110 | 4110 | #theme-options .list-opt { |
| ... | ... | @@ -4123,7 +4123,7 @@ h1#agenda-title { |
| 4123 | 4123 | |
| 4124 | 4124 | .opt-info { |
| 4125 | 4125 | position: absolute; |
| 4126 | - top: 15px; | |
| 4126 | + top: 0px; | |
| 4127 | 4127 | left: 75px; |
| 4128 | 4128 | width: 130px; |
| 4129 | 4129 | } |
| ... | ... | @@ -4135,16 +4135,12 @@ h1#agenda-title { |
| 4135 | 4135 | top: 2px; |
| 4136 | 4136 | } |
| 4137 | 4137 | |
| 4138 | -.list-opt span { | |
| 4139 | - text-decoration: underline; | |
| 4140 | -} | |
| 4141 | - | |
| 4142 | 4138 | .list-opt big { |
| 4143 | 4139 | opacity: 0.5; |
| 4144 | 4140 | } |
| 4145 | 4141 | |
| 4146 | 4142 | .list-opt .name { |
| 4147 | - font-size: 20px; | |
| 4143 | + font-size: 16px; | |
| 4148 | 4144 | } |
| 4149 | 4145 | #user-themes .list-opt .name { |
| 4150 | 4146 | font-size: 18px; | ... | ... |