- <% for template in templates %>
- <%
- selected = (!template.nil? && (@current_template == template.id))
- %>
-
- <% if template %>
- <%= image_tag("/designs/templates/#{template.id}/thumbnail.png",
- :class => 'template-preview',
- :alt => _('The "%s" template')) %>
- <% end %>
- |
- style='vertical-align: top;'>
- <% if template %>
- <%= template.id %> <%= _('(current)') if selected %>
-
- <%= link_to(_('Use this template'), :action => 'set_layout_template', :id => template.id) unless selected %>
- <% end %>
- |
-
-
- |
- <% end %>
-
- <% end %>
+
+
<%= _('Select template') %>
- <% if !@themes.empty? %>
-
-
- <%= _('Select theme') %>
- <% button_bar do %>
- <%= button :home, _('Use the default theme'), { :action => 'unset'}, :method => 'post', :confirm => _('Are you sure you want to use the environment default theme?') %>
- <% end %>
- |
-
- <% for themes in @themes.in_groups_of(3) %>
-
- <% for theme in themes %>
- <%
- selected = (!theme.nil? && (theme.id == @current_theme))
- %>
-
- <% if theme %>
- <%= image_tag("/designs/themes/#{theme.name}/preview.png",
- :class => 'theme-preview',
- :alt => (_('The "%s" theme.') % theme.name)) %>
- <% end %>
- |
- style='vertical-align: top'>
- <% if theme %>
- <%= theme.name %> <%= _('(current)') if selected %>
- <%= link_to(_('Use this theme'), :action => 'set', :id => theme.id) unless selected %>
- <% end %>
- |
-
-
- |
- <% end %>
-
-
|
- <% end %>
- <% end %>
+<% for templates in @layout_templates.in_groups_of(3) %>
+
+ <% for template in templates %><%=
+ if template
+ base_content = image_tag(
+ "/designs/templates/#{template.id}/thumbnail.png",
+ :alt => _('The "%s" template')) +
+ '
' +
+ content_tag('strong', template.id, :class => 'name') +
+ '
'
+ if @current_template == template.id # selected
+ content_tag( 'div',
+ base_content + content_tag('big', _('(current)') ) +'
',
+ :class => 'template-opt list-opt selected')
+ else # Not selected
+ link_to(
+ base_content + content_tag('span', _('Use this template') ) +'
',
+ { :action => 'set_layout_template', :id => template.id },
+ :class => 'template-opt list-opt')
+ end
- <% if environment.enabled?('user_themes') %>
-
-
- <%= _('My themes') %>
- |
-
- <% for themes in profile.themes.in_groups_of(3) %>
-
- <% for theme in themes %>
-
- <%# FIXME add proper thumbnails %>
- <%= image_tag('/images/icons-app/design-editor.png', :alt => (_('The "%s" theme.') % theme.name)) if theme %>
- |
-
- <%= theme.name if theme%>
- <%= link_to(_('Edit this theme'), :action => 'edit', :id => theme.id) if theme %>
-
- <%= link_to(_('Test this theme'), :action => 'start_test', :id => theme.id) if theme %>
- |
-
-
- |
- <% end %>
-
-
|
- <% end %>
+ end
+ %><% end %>
+
+<% end %>
+
+
+
+
+<% if !@themes.empty? %>
+
+
+
<%= _('Select theme') %>
+<%= button :home, _('Use the default theme'), { :action => 'unset'}, :method => 'post', :confirm => _('Are you sure you want to use the environment default theme?') %>
+
+<% for themes in @themes.in_groups_of(3) %>
+
+ <% for theme in themes %><%=
+ if theme
+
+ base_content = image_tag(
+ "/designs/themes/#{theme.name}/preview.png",
+ :alt => (_('The "%s" theme.') % theme.name)) +
+ '
' +
+ content_tag('strong', theme.name, :class => 'name') +
+ '
'
+
+ if theme.id == @current_theme # selected
+ content_tag( 'div',
+ base_content + content_tag('big', _('(current)') ) +'
',
+ :class => 'theme-opt list-opt selected')
+ else # Not selected
+ link_to(
+ base_content + content_tag('span', _('Use this theme') ) +'
',
+ { :action => 'set', :id => theme.id },
+ :class => 'theme-opt list-opt')
+ end
+
+ end
+ %><% end %>
+
+<% end %>
+
+
+<% end %>
+
+
+
+<% if environment.enabled?('user_themes') %>
+
+
+
<%= _('My themes') %>
+
+ <% for themes in profile.themes.in_groups_of(3) %>
+
+ <% for theme in themes %><%=
+ if theme
+
+ selected = theme.id == @current_theme
+ sel_html = selected ?
+ content_tag('big', _('(current)') ) :
+ link_to(_('Use this theme'), :action => 'set', :id => theme.id)
+
+ content_tag( 'div',
+ image_tag(
+ '/images/icons-app/design-editor.png',
+ :alt => (_('The "%s" theme.') % theme.name)) +
+ '
' +
+ content_tag('strong', theme.name, :class => 'name') +
+ '
'+ sel_html +'
' +
+ link_to(_('Edit this theme'), :action => 'edit', :id => theme.id) +
+ '
' +
+ link_to(_('Test this theme'), :action => 'start_test', :id => theme.id) +
+ '
',
+ :class => 'theme-opt list-opt' + (selected ? ' selected' : '')
+ )
+
+ end
+ %><% end %>
+
<% end %>
-