index.rhtml
3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<h1><%= _('Editing Appearance') %></h1>
<div id="template-options" class="list-options">
<h2><%= _('Select template') %></h2>
<% for templates in @layout_templates.in_groups_of(3) %>
<div class="list-group">
<% for template in templates %><%=
if template
base_content = image_tag(
"/designs/templates/#{template.id}/thumbnail.png",
:alt => _('The "%s" template')) +
'<div class="opt-info">'.html_safe +
content_tag('strong', template.id, :class => 'name') +
' <br/> '.html_safe
if @current_template == template.id # selected
content_tag( 'div',
base_content + content_tag('big', _('(current)') ) +'</div>'.html_safe,
:class => 'template-opt list-opt selected')
else # Not selected
link_to(
base_content +'</div>'.html_safe,
{ :action => 'set_layout_template', :id => template.id },
:class => 'template-opt list-opt')
end
end
%><% end %>
</div>
<% end %>
</div><!-- end id="template-options" -->
<% if !@themes.empty? %>
<div id="theme-options" class="list-options">
<h2><%= _('Select theme') %></h2>
<%= 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) %>
<div class="list-group">
<% for theme in themes %><%=
if theme
base_content = image_tag(
"/designs/themes/#{theme.id}/preview.png",
:alt => (_('The "%s" theme.') % theme.name)) +
'<div class="opt-info">'.html_safe +
content_tag('strong', theme.name, :class => 'name') +
' <br/> '.html_safe
if theme.id == @current_theme # selected
content_tag( 'div',
base_content + content_tag('big', _('(current)') ) +'</div>'.html_safe,
:class => 'theme-opt list-opt selected')
else # Not selected
link_to(
base_content + '</div>'.html_safe,
{ :action => 'set', :id => theme.id },
:class => 'theme-opt list-opt')
end
end
%><% end %>
</div>
<% end %>
</div><!-- end id="theme-options" -->
<% end %>
<% if environment.enabled?('user_themes') %>
<div id="user-themes" class="list-options">
<h2><%= _('My themes') %></h2>
<% for themes in profile.themes.in_groups_of(3) %>
<div class="list-group">
<% 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)) +
'<div class="opt-info">' +
content_tag('strong', theme.name, :class => 'name') +
' <br/> '+ sel_html +' <br/> ' +
link_to(_('Edit this theme'), :action => 'edit', :id => theme.id) +
' <br/> ' +
link_to(_('Test this theme'), :action => 'start_test', :id => theme.id) +
'</div>',
:class => 'theme-opt list-opt' + (selected ? ' selected' : '')
)
end
%><% end %>
</div>
<% end %>
</div><!-- end id="user-themes" -->
<% end %>
<br style="clear:both" />
<% button_bar do %>
<% if environment.enabled?('user_themes') %>
<%= lightbox_button(:add, _('New theme ...'), :action => 'new') %>
<% end %>
<%= button(:back, _('Back'), :controller => 'profile_editor', :action => 'index') %>
<% end %>