diff --git a/app/controllers/my_profile/themes_controller.rb b/app/controllers/my_profile/themes_controller.rb index 457c111..f5a4570 100644 --- a/app/controllers/my_profile/themes_controller.rb +++ b/app/controllers/my_profile/themes_controller.rb @@ -23,7 +23,7 @@ class ThemesController < MyProfileController def new if !request.xhr? - id = params[:name].to_slug + id = params[:name] ? params[:name].to_slug : 'my-theme' t = Theme.new(id, :name => params[:name], :owner => profile, :public => false) t.save redirect_to :action => 'index' diff --git a/app/views/themes/index.rhtml b/app/views/themes/index.rhtml index 5b7fa76..0abf232 100644 --- a/app/views/themes/index.rhtml +++ b/app/views/themes/index.rhtml @@ -1,107 +1,116 @@

<%= _('Editing Appearance') %>

- - - - - - <% for templates in @layout_templates.in_groups_of(3) %> - - <% for template in templates %> - <% - selected = (!template.nil? && (@current_template == template.id)) - %> - - - - <% end %> - - <% end %> +
+

<%= _('Select template') %>

- <% if !@themes.empty? %> -
- - - <% for themes in @themes.in_groups_of(3) %> - - <% for theme in themes %> - <% - selected = (!theme.nil? && (theme.id == @current_theme)) - %> - - - - <% 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') %> - - - - <% for themes in profile.themes.in_groups_of(3) %> - - <% for theme in themes %> - - - - <% 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 %> -
-

<%= _('Select template') %>

-
- <% 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 %> -
-      -
-

<%= _('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 %> -
- <% 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 %> -
-      -
 
-

<%= _('My 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 %> + +
<% button_bar do %> <% if environment.enabled?('user_themes') %> diff --git a/public/designs/templates/default/thumbnail.png b/public/designs/templates/default/thumbnail.png index 45cb84b..32e27b3 100644 Binary files a/public/designs/templates/default/thumbnail.png and b/public/designs/templates/default/thumbnail.png differ diff --git a/public/designs/templates/default/thumbnail.svg b/public/designs/templates/default/thumbnail.svg index ed98b35..4b5d63d 100644 --- a/public/designs/templates/default/thumbnail.svg +++ b/public/designs/templates/default/thumbnail.svg @@ -6,6 +6,7 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="64px" @@ -15,11 +16,46 @@ inkscape:version="0.46" sodipodi:docname="thumbnail.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="/home/terceiro/src/noosfero/public/designs/templates/default/thumbnail.png" + inkscape:export-filename="thumbnail.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> + + + + + + + + + + + + + + + + + + + + + + inkscape:window-y="0" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10"> + + @@ -61,32 +154,87 @@ id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer"> + + + + + - + style="opacity:1;fill:url(#linearGradient3251);fill-opacity:1;fill-rule:nonzero;stroke:#204a87;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + ry="2" /> + + + + + style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + id="rect3164" + width="10" + height="57" + x="50.5" + y="2.5" + ry="1" /> diff --git a/public/designs/templates/leftbar/thumbnail.png b/public/designs/templates/leftbar/thumbnail.png index a202357..28a44af 100644 Binary files a/public/designs/templates/leftbar/thumbnail.png and b/public/designs/templates/leftbar/thumbnail.png differ diff --git a/public/designs/templates/leftbar/thumbnail.svg b/public/designs/templates/leftbar/thumbnail.svg index 021f758..12cb397 100644 --- a/public/designs/templates/leftbar/thumbnail.svg +++ b/public/designs/templates/leftbar/thumbnail.svg @@ -6,6 +6,7 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="64px" @@ -15,11 +16,46 @@ inkscape:version="0.46" sodipodi:docname="thumbnail.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="/home/terceiro/src/noosfero/public/designs/templates/leftbar/thumbnail.png" + inkscape:export-filename="thumbnail.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> + + + + + + + + + + + + + + + + + + + + + + inkscape:window-y="0" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10"> + + @@ -61,23 +156,66 @@ id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer"> + + + + - + style="opacity:1;fill:url(#linearGradient3251);fill-opacity:1;fill-rule:nonzero;stroke:#204a87;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + ry="2" + rx="2" /> + + + diff --git a/public/designs/templates/rightbar/thumbnail.png b/public/designs/templates/rightbar/thumbnail.png index 2db2d50..ad3734b 100644 Binary files a/public/designs/templates/rightbar/thumbnail.png and b/public/designs/templates/rightbar/thumbnail.png differ diff --git a/public/designs/templates/rightbar/thumbnail.svg b/public/designs/templates/rightbar/thumbnail.svg index 5dcdc96..30c71c7 100644 --- a/public/designs/templates/rightbar/thumbnail.svg +++ b/public/designs/templates/rightbar/thumbnail.svg @@ -6,6 +6,7 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="64px" @@ -15,11 +16,46 @@ inkscape:version="0.46" sodipodi:docname="thumbnail.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="/home/terceiro/src/noosfero/public/designs/templates/rightbar/thumbnail.png" + inkscape:export-filename="thumbnail.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> + + + + + + + + + + + + + + + + + + + inkscape:window-y="0" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10"> + + @@ -61,23 +148,66 @@ id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer"> + + + + + y="1.5" + x="49.5" + height="59" + width="11" + id="rect2395" + style="opacity:1;fill:url(#linearGradient3251);fill-opacity:1;fill-rule:nonzero;stroke:#204a87;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + ry="2" + rx="2" /> + y="1.5" + x="3.5" + height="59" + width="43" + id="rect3156" + style="opacity:1;fill:url(#linearGradient3253);fill-opacity:1;fill-rule:nonzero;stroke:#204a87;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + ry="2" + rx="2" /> + + diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 70da224..804041b 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -4070,7 +4070,92 @@ h1#agenda-title { } /* ==> public/stylesheets/controller_themes.css <== */ -/* common stuff */ + +.action-themes-index .button-bar { + padding-top: 20px; +} + +.list-options { + width: 800px; + margin: auto; + clear: left; + padding-top: 20px; +} + +#theme-options .list-group { + clear: left; + padding-top: 7px; +} + +.list-opt { + position: relative; + display: block; + width: 200px; + padding: 5px 2px 4px 5px; + margin: 0px 35px 0px 20px; + float: left; + color: #000; + text-decoration: none; + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; +} +.list-opt:hover { + background: #FE0; +} +.list-opt.selected { + background: #F8F0A0; +} + +#theme-options .list-opt { + width: 240px; + padding: 5px 2px 5px 5px; + margin: 0px 5px 0px 10px; +} +#user-themes .list-opt { + width: 220px; + margin: 0px 15px 0px 20px; +} + +#theme-options img { + border: 1px solid #BBB; +} + +.opt-info { + position: absolute; + top: 15px; + left: 75px; + width: 130px; +} +#theme-options .opt-info { + left: 115px; + width: 130px; +} +#user-themes .opt-info { + top: 2px; +} + +.list-opt span { + text-decoration: underline; +} + +.list-opt big { + opacity: 0.5; +} + +.list-opt .name { + font-size: 20px; +} +#user-themes .list-opt .name { + font-size: 18px; +} + +#user-themes a { + text-decoration: none; +} +#user-themes a:hover { + text-decoration: underline; +} .controller-themes .template-preview-cell { text-align: center; -- libgit2 0.21.2