From 76a23b5f0abcce7b339e3ab856c70ea41076f878 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Tue, 2 Sep 2008 03:26:24 +0000 Subject: [PATCH] ActionItem531: implementing change of template --- app/controllers/my_profile/themes_controller.rb | 11 ++++++++++- app/helpers/application_helper.rb | 8 ++++++++ app/models/layout_template.rb | 36 ++++++++++++++++++++++++++++++++++++ app/models/profile.rb | 6 ++++++ app/views/layouts/application.rhtml | 3 ++- app/views/themes/index.rhtml | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++--------- public/designs/templates/default/config.yml | 3 +++ public/designs/templates/default/default.yml | 3 --- public/designs/templates/default/thumbnail.jpg | Bin 4937 -> 0 bytes public/designs/templates/default/thumbnail.png | Bin 0 -> 658 bytes public/designs/templates/default/thumbnail.svg | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ public/designs/templates/leftbar/config.yml | 3 +++ public/designs/templates/leftbar/images/bg_bgheader.png | Bin 192 -> 0 bytes public/designs/templates/leftbar/images/bg_content.png | Bin 183 -> 0 bytes public/designs/templates/leftbar/images/bg_footer.png | Bin 162 -> 0 bytes public/designs/templates/leftbar/images/bg_header.png | Bin 3339 -> 0 bytes public/designs/templates/leftbar/leftbar.yml | 3 --- public/designs/templates/leftbar/source/bluestyle.png | Bin 29918 -> 0 bytes public/designs/templates/leftbar/source/bluestyle.svg | 376 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- public/designs/templates/leftbar/source/tmpimg.png | Bin 19381 -> 0 bytes public/designs/templates/leftbar/stylesheets/cms.css | 128 -------------------------------------------------------------------------------------------------------------------------------- public/designs/templates/leftbar/stylesheets/style.css | 123 ++++++++++++++------------------------------------------------------------------------------------------------------------- public/designs/templates/leftbar/thumbnail.jpg | Bin 5709 -> 0 bytes public/designs/templates/leftbar/thumbnail.png | Bin 0 -> 635 bytes public/designs/templates/leftbar/thumbnail.svg | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ public/designs/templates/onecolumn/images/bg_bgheader.png | Bin 248 -> 0 bytes public/designs/templates/onecolumn/images/bg_content.png | Bin 225 -> 0 bytes public/designs/templates/onecolumn/images/bg_footer.png | Bin 168 -> 0 bytes public/designs/templates/onecolumn/images/bg_header.png | Bin 8172 -> 0 bytes public/designs/templates/onecolumn/images/fbes.png | Bin 4869 -> 0 bytes public/designs/templates/onecolumn/onecolumn.yml | 2 -- public/designs/templates/onecolumn/stylesheets/cms.css | 128 -------------------------------------------------------------------------------------------------------------------------------- public/designs/templates/onecolumn/stylesheets/style.css | 137 ----------------------------------------------------------------------------------------------------------------------------------------- public/designs/templates/onecolumn/thumbnail.jpg | Bin 5199 -> 0 bytes public/designs/templates/raw/raw.yml | 3 --- public/designs/templates/raw/stylesheets/style.css | 4 ---- public/designs/templates/raw/thumbnail.jpg | Bin 4625 -> 0 bytes public/designs/templates/rightbar/config.yml | 3 +++ public/designs/templates/rightbar/stylesheets/style.css | 24 ++++++++++++++++++++++++ public/designs/templates/rightbar/thumbnail.png | Bin 0 -> 626 bytes public/designs/templates/rightbar/thumbnail.svg | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ public/designs/templates/rightcolumn/images/add.png | Bin 489 -> 0 bytes public/designs/templates/rightcolumn/images/bgblue.jpg | Bin 11651 -> 0 bytes public/designs/templates/rightcolumn/images/bgblue.png | Bin 44095 -> 0 bytes public/designs/templates/rightcolumn/images/bggreen.jpg | Bin 11390 -> 0 bytes public/designs/templates/rightcolumn/images/bggreen.png | Bin 43417 -> 0 bytes public/designs/templates/rightcolumn/images/bgorange.jpg | Bin 11636 -> 0 bytes public/designs/templates/rightcolumn/images/bgorange.png | Bin 43014 -> 0 bytes public/designs/templates/rightcolumn/images/bgpurple.jpg | Bin 11418 -> 0 bytes public/designs/templates/rightcolumn/images/bgpurple.png | Bin 44091 -> 0 bytes public/designs/templates/rightcolumn/images/bgred.jpg | Bin 12073 -> 0 bytes public/designs/templates/rightcolumn/images/bgred.png | Bin 42306 -> 0 bytes public/designs/templates/rightcolumn/images/editor.png | Bin 439 -> 0 bytes public/designs/templates/rightcolumn/images/enterprisesblock.png | Bin 3793 -> 0 bytes public/designs/templates/rightcolumn/images/peopleblock.png | Bin 4459 -> 0 bytes public/designs/templates/rightcolumn/rightcolumn.yml | 3 --- public/designs/templates/rightcolumn/stylesheets/cms.css | 128 -------------------------------------------------------------------------------------------------------------------------------- public/designs/templates/rightcolumn/stylesheets/contentblocks.css | 104 -------------------------------------------------------------------------------------------------------- public/designs/templates/rightcolumn/stylesheets/editor.css | 94 ---------------------------------------------------------------------------------------------- public/designs/templates/rightcolumn/stylesheets/style.css | 107 ----------------------------------------------------------------------------------------------------------- public/designs/templates/rightcolumn/thumbnail.jpg | Bin 5127 -> 0 bytes public/designs/templates/threecolumn/images/bg_bgheader.png | Bin 283 -> 0 bytes public/designs/templates/threecolumn/images/bg_content.png | Bin 260 -> 0 bytes public/designs/templates/threecolumn/images/bg_footer.png | Bin 196 -> 0 bytes public/designs/templates/threecolumn/images/bg_header.png | Bin 6690 -> 0 bytes public/designs/templates/threecolumn/images/fbes.png | Bin 4869 -> 0 bytes public/designs/templates/threecolumn/source/bluestyle.png | Bin 29918 -> 0 bytes public/designs/templates/threecolumn/source/bluestyle.svg | 383 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- public/designs/templates/threecolumn/source/tmpimg.png | Bin 19381 -> 0 bytes public/designs/templates/threecolumn/stylesheets/cms.css | 128 -------------------------------------------------------------------------------------------------------------------------------- public/designs/templates/threecolumn/stylesheets/style.css | 155 ----------------------------------------------------------------------------------------------------------------------------------------------------------- public/designs/templates/threecolumn/threecolumn.yml | 3 --- public/designs/templates/threecolumn/thumbnail.jpg | Bin 6210 -> 0 bytes public/stylesheets/controller_themes.css | 5 +++++ test/functional/themes_controller_test.rb | 47 +++++++++++++++++++++++++++++++++++++++++++++++ test/unit/application_helper_test.rb | 20 ++++++++++++++++++++ test/unit/layout_template_test.rb | 22 ++++++++++++++++++++++ test/unit/profile_test.rb | 17 +++++++++++++++++ 78 files changed, 531 insertions(+), 2009 deletions(-) create mode 100644 app/models/layout_template.rb create mode 100644 public/designs/templates/default/config.yml delete mode 100644 public/designs/templates/default/default.yml delete mode 100644 public/designs/templates/default/thumbnail.jpg create mode 100644 public/designs/templates/default/thumbnail.png create mode 100644 public/designs/templates/default/thumbnail.svg create mode 100644 public/designs/templates/leftbar/config.yml delete mode 100644 public/designs/templates/leftbar/images/bg_bgheader.png delete mode 100644 public/designs/templates/leftbar/images/bg_content.png delete mode 100644 public/designs/templates/leftbar/images/bg_footer.png delete mode 100644 public/designs/templates/leftbar/images/bg_header.png delete mode 100644 public/designs/templates/leftbar/leftbar.yml delete mode 100644 public/designs/templates/leftbar/source/bluestyle.png delete mode 100644 public/designs/templates/leftbar/source/bluestyle.svg delete mode 100644 public/designs/templates/leftbar/source/tmpimg.png delete mode 100644 public/designs/templates/leftbar/stylesheets/cms.css delete mode 100644 public/designs/templates/leftbar/thumbnail.jpg create mode 100644 public/designs/templates/leftbar/thumbnail.png create mode 100644 public/designs/templates/leftbar/thumbnail.svg delete mode 100644 public/designs/templates/onecolumn/images/bg_bgheader.png delete mode 100644 public/designs/templates/onecolumn/images/bg_content.png delete mode 100644 public/designs/templates/onecolumn/images/bg_footer.png delete mode 100644 public/designs/templates/onecolumn/images/bg_header.png delete mode 100644 public/designs/templates/onecolumn/images/fbes.png delete mode 100644 public/designs/templates/onecolumn/onecolumn.yml delete mode 100644 public/designs/templates/onecolumn/stylesheets/cms.css delete mode 100644 public/designs/templates/onecolumn/stylesheets/style.css delete mode 100644 public/designs/templates/onecolumn/thumbnail.jpg delete mode 100644 public/designs/templates/raw/raw.yml delete mode 100644 public/designs/templates/raw/stylesheets/style.css delete mode 100644 public/designs/templates/raw/thumbnail.jpg create mode 100644 public/designs/templates/rightbar/config.yml create mode 100644 public/designs/templates/rightbar/stylesheets/style.css create mode 100644 public/designs/templates/rightbar/thumbnail.png create mode 100644 public/designs/templates/rightbar/thumbnail.svg delete mode 100644 public/designs/templates/rightcolumn/images/add.png delete mode 100644 public/designs/templates/rightcolumn/images/bgblue.jpg delete mode 100644 public/designs/templates/rightcolumn/images/bgblue.png delete mode 100644 public/designs/templates/rightcolumn/images/bggreen.jpg delete mode 100644 public/designs/templates/rightcolumn/images/bggreen.png delete mode 100644 public/designs/templates/rightcolumn/images/bgorange.jpg delete mode 100644 public/designs/templates/rightcolumn/images/bgorange.png delete mode 100644 public/designs/templates/rightcolumn/images/bgpurple.jpg delete mode 100644 public/designs/templates/rightcolumn/images/bgpurple.png delete mode 100644 public/designs/templates/rightcolumn/images/bgred.jpg delete mode 100644 public/designs/templates/rightcolumn/images/bgred.png delete mode 100644 public/designs/templates/rightcolumn/images/editor.png delete mode 100644 public/designs/templates/rightcolumn/images/enterprisesblock.png delete mode 100644 public/designs/templates/rightcolumn/images/peopleblock.png delete mode 100644 public/designs/templates/rightcolumn/rightcolumn.yml delete mode 100644 public/designs/templates/rightcolumn/stylesheets/cms.css delete mode 100644 public/designs/templates/rightcolumn/stylesheets/contentblocks.css delete mode 100644 public/designs/templates/rightcolumn/stylesheets/editor.css delete mode 100644 public/designs/templates/rightcolumn/stylesheets/style.css delete mode 100644 public/designs/templates/rightcolumn/thumbnail.jpg delete mode 100644 public/designs/templates/threecolumn/images/bg_bgheader.png delete mode 100644 public/designs/templates/threecolumn/images/bg_content.png delete mode 100644 public/designs/templates/threecolumn/images/bg_footer.png delete mode 100644 public/designs/templates/threecolumn/images/bg_header.png delete mode 100644 public/designs/templates/threecolumn/images/fbes.png delete mode 100644 public/designs/templates/threecolumn/source/bluestyle.png delete mode 100644 public/designs/templates/threecolumn/source/bluestyle.svg delete mode 100644 public/designs/templates/threecolumn/source/tmpimg.png delete mode 100644 public/designs/templates/threecolumn/stylesheets/cms.css delete mode 100644 public/designs/templates/threecolumn/stylesheets/style.css delete mode 100644 public/designs/templates/threecolumn/threecolumn.yml delete mode 100644 public/designs/templates/threecolumn/thumbnail.jpg create mode 100644 test/unit/layout_template_test.rb diff --git a/app/controllers/my_profile/themes_controller.rb b/app/controllers/my_profile/themes_controller.rb index 27c8c59..9cfeeb0 100644 --- a/app/controllers/my_profile/themes_controller.rb +++ b/app/controllers/my_profile/themes_controller.rb @@ -10,7 +10,10 @@ class ThemesController < MyProfileController def index @themes = Theme.system_themes - @selected_theme = profile.theme + @current_theme = profile.theme + + @layout_templates = LayoutTemplate.all + @current_template = profile.layout_template end def new @@ -75,4 +78,10 @@ class ThemesController < MyProfileController redirect_to :action => 'index' end + def set_layout_template + profile.layout_template = params[:id] + profile.save! + redirect_to :action => 'index' + end + end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d2efefa..4115e30 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -699,4 +699,12 @@ module ApplicationHelper title end + def template_stylesheet_tag + if profile.nil? + stylesheet_link_tag '/designs/templates/default/stylesheets/style.css' + else + stylesheet_link_tag "/designs/templates/#{profile.layout_template}/stylesheets/style.css" + end + end + end diff --git a/app/models/layout_template.rb b/app/models/layout_template.rb new file mode 100644 index 0000000..991faf6 --- /dev/null +++ b/app/models/layout_template.rb @@ -0,0 +1,36 @@ +class LayoutTemplate + + def self.find(id) + t = new(id) + t.send(:read_config) + t + end + + def self.all + Dir.glob(File.join(RAILS_ROOT, 'public', 'designs', 'templates', '*')).map {|item| find(File.basename(item)) } + end + + attr_reader :id + def initialize(id) + @id = id + end + + def title + @config['title'] + end + + def description + @config['description'] + end + + def number_of_boxes + @config['number_of_boxes'] + end + + protected + + def read_config + @config = YAML.load_file(File.join(RAILS_ROOT, 'public', 'designs', 'templates', id, 'config.yml')) + end + +end diff --git a/app/models/profile.rb b/app/models/profile.rb index 74775d5..9d1c54c 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -460,4 +460,10 @@ class Profile < ActiveRecord::Base themes.find { |item| item.id == the_id } end + settings_items :layout_template, :type => String, :default => 'default' + + def boxes_limit + LayoutTemplate.find(layout_template).number_of_boxes + end + end diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml index 6d51b28..e6de041 100644 --- a/app/views/layouts/application.rhtml +++ b/app/views/layouts/application.rhtml @@ -45,8 +45,9 @@ stylesheet_import( "controller_"+ @controller.controller_name(), :themed_source => true ) %> + <%= template_stylesheet_tag %> + <%# FIXME %> - <%= stylesheet_link_tag '/designs/templates/default/stylesheets/style.css' %> <%= stylesheet_link_tag '/designs/icons/default/style.css' %> diff --git a/app/views/themes/index.rhtml b/app/views/themes/index.rhtml index f32c306..532c408 100644 --- a/app/views/themes/index.rhtml +++ b/app/views/themes/index.rhtml @@ -1,18 +1,60 @@

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

-

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

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

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

+
+ <% if template %> + <%= image_tag("/designs/templates/#{template.id}/thumbnail.png", :alt => _('The "%s" template')) %> + <% end %> + > + <% if template %> + <%= template.id %> <%= _('(current)') if selected %> +
+ <%= link_to(_('Use this template'), :action => 'set_layout_template', :id => template.id) unless selected %> + <% end %> +
+      +
+

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

+
<%# FIXME add proper thumbnails %> - <%= image_tag('/images/icons-app/design-editor.png', :alt => (_('The "%s" theme.') % theme.name)) if theme %> + <% if theme %> + <%= image_tag('/images/icons-app/design-editor.png', :alt => (_('The "%s" theme.') % theme.name)) %> + <% end %> - <%= theme.name if theme%>
- <%= link_to(_('Use this theme'), :action => 'set', :id => theme.id) if theme %> +
> + <% if theme %> + <%= theme.name %> <%= _('(current)') if selected %>
+ <%= link_to(_('Use this theme'), :action => 'set', :id => theme.id) unless selected %> + <% end %>
     @@ -21,11 +63,13 @@
 
-

<%= _('My themes') %>

- + + + <% for themes in profile.themes.in_groups_of(3) %> <% for theme in themes %> diff --git a/public/designs/templates/default/config.yml b/public/designs/templates/default/config.yml new file mode 100644 index 0000000..3ad2eaf --- /dev/null +++ b/public/designs/templates/default/config.yml @@ -0,0 +1,3 @@ +title: "Default Style 3 columns" +description: "A theme default with 3 columns" +number_of_boxes: 3 diff --git a/public/designs/templates/default/default.yml b/public/designs/templates/default/default.yml deleted file mode 100644 index 3ad2eaf..0000000 --- a/public/designs/templates/default/default.yml +++ /dev/null @@ -1,3 +0,0 @@ -title: "Default Style 3 columns" -description: "A theme default with 3 columns" -number_of_boxes: 3 diff --git a/public/designs/templates/default/thumbnail.jpg b/public/designs/templates/default/thumbnail.jpg deleted file mode 100644 index 252f8ba..0000000 Binary files a/public/designs/templates/default/thumbnail.jpg and /dev/null differ diff --git a/public/designs/templates/default/thumbnail.png b/public/designs/templates/default/thumbnail.png new file mode 100644 index 0000000..45cb84b Binary files /dev/null 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 new file mode 100644 index 0000000..ed98b35 --- /dev/null +++ b/public/designs/templates/default/thumbnail.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/public/designs/templates/leftbar/config.yml b/public/designs/templates/leftbar/config.yml new file mode 100644 index 0000000..5349b13 --- /dev/null +++ b/public/designs/templates/leftbar/config.yml @@ -0,0 +1,3 @@ +title: "Left bar" +description: "A template with the menu bar at the left" +number_of_boxes: 2 diff --git a/public/designs/templates/leftbar/images/bg_bgheader.png b/public/designs/templates/leftbar/images/bg_bgheader.png deleted file mode 100644 index e9e5b8e..0000000 Binary files a/public/designs/templates/leftbar/images/bg_bgheader.png and /dev/null differ diff --git a/public/designs/templates/leftbar/images/bg_content.png b/public/designs/templates/leftbar/images/bg_content.png deleted file mode 100644 index b6ec69c..0000000 Binary files a/public/designs/templates/leftbar/images/bg_content.png and /dev/null differ diff --git a/public/designs/templates/leftbar/images/bg_footer.png b/public/designs/templates/leftbar/images/bg_footer.png deleted file mode 100644 index 09093a6..0000000 Binary files a/public/designs/templates/leftbar/images/bg_footer.png and /dev/null differ diff --git a/public/designs/templates/leftbar/images/bg_header.png b/public/designs/templates/leftbar/images/bg_header.png deleted file mode 100644 index 97a89e8..0000000 Binary files a/public/designs/templates/leftbar/images/bg_header.png and /dev/null differ diff --git a/public/designs/templates/leftbar/leftbar.yml b/public/designs/templates/leftbar/leftbar.yml deleted file mode 100644 index 66ca237..0000000 --- a/public/designs/templates/leftbar/leftbar.yml +++ /dev/null @@ -1,3 +0,0 @@ -title: "LeftBar 2 columns" -description: "A theme with 2 columns" -number_of_boxes: 2 diff --git a/public/designs/templates/leftbar/source/bluestyle.png b/public/designs/templates/leftbar/source/bluestyle.png deleted file mode 100644 index 9c188b6..0000000 Binary files a/public/designs/templates/leftbar/source/bluestyle.png and /dev/null differ diff --git a/public/designs/templates/leftbar/source/bluestyle.svg b/public/designs/templates/leftbar/source/bluestyle.svg deleted file mode 100644 index def5aee..0000000 --- a/public/designs/templates/leftbar/source/bluestyle.svg +++ /dev/null @@ -1,376 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - Barra de Ferramentas - - - - - - - - - - Itens para Adicionar - - - diff --git a/public/designs/templates/leftbar/source/tmpimg.png b/public/designs/templates/leftbar/source/tmpimg.png deleted file mode 100644 index fdae50d..0000000 Binary files a/public/designs/templates/leftbar/source/tmpimg.png and /dev/null differ diff --git a/public/designs/templates/leftbar/stylesheets/cms.css b/public/designs/templates/leftbar/stylesheets/cms.css deleted file mode 100644 index abb8b70..0000000 --- a/public/designs/templates/leftbar/stylesheets/cms.css +++ /dev/null @@ -1,128 +0,0 @@ - -/************************************ - * listing stuff - ************************************/ -#content .handle, #content .do-reorder UL LI .handle { - display: none; -} -#content .do-reorder LI .handle { - display: inline; - background: gray; - color: white; - padding: 1px 3px; - cursor: move; -} - -ul.page-list li { - list-style: none; -} - -ul.page-list li table, -ul.page-list li td { - border: none; - padding: 3px; -} - -ul.page-list a.page { - font-weight: bold; -} - -ul.page-list a:visited, ul.page-list a:link { - color: #000; -} - -ul.page-list a:hover { - background: #aa9; -} - -#content .page-list .hover { - background: #F1F0DB; -} - -#content .page-list .commands A.delete-page:hover { - color: white; - background: black; -} -#content .page-list .hover-delete { - background: red; - color: #FF8E90; -} -#content .page-list .hover-delete A, -#content .page-list .hover-delete .commands A { - color: #FF8E90; -} -#content .page-list .hover-delete A.page { - color: white; - border-bottom: 0px; -} -#content .page-list .hover-delete UL LI A.page { - color: red; - border-bottom: 0px; -} - -/*********************************** - * from stuff - ***********************************/ -div.comatose_field { -} -div.comatose_field label { - display: block; - font-weight: bold; -} - -div.comatose_field textarea { - width: 90%; -} -div.comatose_field textarea, -div.comatose_field input, -div.comatose_field select { - border: 1px solid gray; -} - -/**************************************** - * revisions page stuff - ****************************************/ - -.older-content { - float: right; -} -.current-content { - float: left; -} - -.revisions { - width: 47%; - border: 1px solid gray; - padding: 0.25em; -} - -.revisions .header { - font-weight: bold; - border-bottom: 1px solid black; - margin-bottom: 10px; - height: 40px; -} - -.revisions .meta { - border-bottom: 1px solid black; - margin-bottom: 10px; -} - -.revisions .footer { - border-top: 1px solid black; - margin-top: 10px; - padding: 0.25em; -} - -.revisions .meta label span { - font-weight: bold; -} - -.revisions .meta label { - font-weight: normal; - display: block; -} - -.collapsed { - display: none; -} diff --git a/public/designs/templates/leftbar/stylesheets/style.css b/public/designs/templates/leftbar/stylesheets/style.css index e2cefa6..235d85e 100644 --- a/public/designs/templates/leftbar/stylesheets/style.css +++ b/public/designs/templates/leftbar/stylesheets/style.css @@ -1,119 +1,24 @@ -body { -margin: 0px; -padding: 0px; -font-family: Verdana, Sans-Serif; -font-size: 14px; -} - -#wrap { -background: url("../images/bg_content.png") top center repeat-y; -} - -#frame { - background: url("../images/bg_bgheader.png") top left repeat-x; -} - -#header { -background: url("../images/bg_header.png") top center no-repeat; -height: 135px; -} - -#design_boxes { -position: relative; -width: 780px; -left: 50%; -margin-left: -390px; -padding-top: 1em; -} -#design_box_2 { -float: left; -width: 200px; +#boxes { + /* none */ } -#design_box_1 { -margin-left: 205px; +.box-1 { + margin: 0px 30px 0px 260px; } - -#spinner { - z-index: 1000; - position: absolute; - left: 50%; - margin-left: -16px; - top: 200px; -} - - -#footer_content { -clear: both; -} - -#footer { -margin: 0px; -padding: 5px; -text-align: center; -clear: both; -background: #c5d0df url("../images/bg_footer.png") top left repeat-x; -} - - -/* Edition Mode */ - -#design_editor .block_list { -list-style: none; -margin: 0px; -padding: 3px; -} - -#design_editor .design_blocks { - border: 2px dotted green; -} - -#design_editor .design_box { -border: 2px solid transparent; -} - -#design_editor .hover { -border: 2px dotted red; -background: #ff6; -} - -#design_editor_toolbar { -padding: 5px; -} - -#design_editor_toolbar h3 { -font-size: 10px; -background: #dfdfdf; -margin: 0px; -padding: 1px; -text-align: right; -color: #545454; -} - -#design_editor_toolbar a { -font-size: 10px; -padding: 5px; -background: #dfdfdf; -color: black; -} - -.design_editor_box_toolbar { -text-align: center; -margin: 5px; -background: #dfdfdf; +.box-1 .blocks { + width: 100%; + float: left; } -.design_editor_box_toolbar a { -display: inline; -width: 30px; -font-size: 10px; -padding: 2px; -background: #dfdfdf; +.box-2 { + float: left; + width: 230px; } -#design_editor_toolbar a:hover, .design_editor_box_toolbar a:hover { -background: #545454; -color: #ffffff; +.block { + position: relative; + padding: 10px 0px; + float: none; } diff --git a/public/designs/templates/leftbar/thumbnail.jpg b/public/designs/templates/leftbar/thumbnail.jpg deleted file mode 100644 index c11845a..0000000 Binary files a/public/designs/templates/leftbar/thumbnail.jpg and /dev/null differ diff --git a/public/designs/templates/leftbar/thumbnail.png b/public/designs/templates/leftbar/thumbnail.png new file mode 100644 index 0000000..a202357 Binary files /dev/null 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 new file mode 100644 index 0000000..021f758 --- /dev/null +++ b/public/designs/templates/leftbar/thumbnail.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/public/designs/templates/onecolumn/images/bg_bgheader.png b/public/designs/templates/onecolumn/images/bg_bgheader.png deleted file mode 100644 index 045325a..0000000 Binary files a/public/designs/templates/onecolumn/images/bg_bgheader.png and /dev/null differ diff --git a/public/designs/templates/onecolumn/images/bg_content.png b/public/designs/templates/onecolumn/images/bg_content.png deleted file mode 100644 index ae4d548..0000000 Binary files a/public/designs/templates/onecolumn/images/bg_content.png and /dev/null differ diff --git a/public/designs/templates/onecolumn/images/bg_footer.png b/public/designs/templates/onecolumn/images/bg_footer.png deleted file mode 100644 index a7ea6b1..0000000 Binary files a/public/designs/templates/onecolumn/images/bg_footer.png and /dev/null differ diff --git a/public/designs/templates/onecolumn/images/bg_header.png b/public/designs/templates/onecolumn/images/bg_header.png deleted file mode 100644 index 7218f10..0000000 Binary files a/public/designs/templates/onecolumn/images/bg_header.png and /dev/null differ diff --git a/public/designs/templates/onecolumn/images/fbes.png b/public/designs/templates/onecolumn/images/fbes.png deleted file mode 100644 index 2cc6b1c..0000000 Binary files a/public/designs/templates/onecolumn/images/fbes.png and /dev/null differ diff --git a/public/designs/templates/onecolumn/onecolumn.yml b/public/designs/templates/onecolumn/onecolumn.yml deleted file mode 100644 index 58bbd55..0000000 --- a/public/designs/templates/onecolumn/onecolumn.yml +++ /dev/null @@ -1,2 +0,0 @@ -title: "Auto Resize 1 colum" -number_of_boxes: 1 diff --git a/public/designs/templates/onecolumn/stylesheets/cms.css b/public/designs/templates/onecolumn/stylesheets/cms.css deleted file mode 100644 index abb8b70..0000000 --- a/public/designs/templates/onecolumn/stylesheets/cms.css +++ /dev/null @@ -1,128 +0,0 @@ - -/************************************ - * listing stuff - ************************************/ -#content .handle, #content .do-reorder UL LI .handle { - display: none; -} -#content .do-reorder LI .handle { - display: inline; - background: gray; - color: white; - padding: 1px 3px; - cursor: move; -} - -ul.page-list li { - list-style: none; -} - -ul.page-list li table, -ul.page-list li td { - border: none; - padding: 3px; -} - -ul.page-list a.page { - font-weight: bold; -} - -ul.page-list a:visited, ul.page-list a:link { - color: #000; -} - -ul.page-list a:hover { - background: #aa9; -} - -#content .page-list .hover { - background: #F1F0DB; -} - -#content .page-list .commands A.delete-page:hover { - color: white; - background: black; -} -#content .page-list .hover-delete { - background: red; - color: #FF8E90; -} -#content .page-list .hover-delete A, -#content .page-list .hover-delete .commands A { - color: #FF8E90; -} -#content .page-list .hover-delete A.page { - color: white; - border-bottom: 0px; -} -#content .page-list .hover-delete UL LI A.page { - color: red; - border-bottom: 0px; -} - -/*********************************** - * from stuff - ***********************************/ -div.comatose_field { -} -div.comatose_field label { - display: block; - font-weight: bold; -} - -div.comatose_field textarea { - width: 90%; -} -div.comatose_field textarea, -div.comatose_field input, -div.comatose_field select { - border: 1px solid gray; -} - -/**************************************** - * revisions page stuff - ****************************************/ - -.older-content { - float: right; -} -.current-content { - float: left; -} - -.revisions { - width: 47%; - border: 1px solid gray; - padding: 0.25em; -} - -.revisions .header { - font-weight: bold; - border-bottom: 1px solid black; - margin-bottom: 10px; - height: 40px; -} - -.revisions .meta { - border-bottom: 1px solid black; - margin-bottom: 10px; -} - -.revisions .footer { - border-top: 1px solid black; - margin-top: 10px; - padding: 0.25em; -} - -.revisions .meta label span { - font-weight: bold; -} - -.revisions .meta label { - font-weight: normal; - display: block; -} - -.collapsed { - display: none; -} diff --git a/public/designs/templates/onecolumn/stylesheets/style.css b/public/designs/templates/onecolumn/stylesheets/style.css deleted file mode 100644 index c8f4296..0000000 --- a/public/designs/templates/onecolumn/stylesheets/style.css +++ /dev/null @@ -1,137 +0,0 @@ -body { - font-family: Verdana, Sans-Serif; - font-size: 14px; -} - -#wrap { -} - -#frame { -background: url("../images/bg_bgheader.png") top left repeat-x; -} - -#header { -height: 55px; -} - -#design_boxes { - position: relative; - width: auto; - margin: 20px; - padding: 10px; -} - -#design_box_1 { -} - -#spinner { - z-index: 1000; - position: absolute; - left: 50%; - margin-left: -16px; - top: 200px; -} - -#footer { - clear: both; - text-align: center; - font-size: smaller; - color: #333; - margin: 0px; - padding: 5px; - background: #c5d0df url("../images/bg_footer.png") top left repeat-x; -} - - -/* Edition Mode */ - -#design_editor .block_list { - list-style: none; - margin: 0px; - padding: 3px; -} - - -#design_editor .design_blocks { - border: 2px dotted green; -} - -#design_editor .design_box { - border: 2px solid transparent; -} - -#design_editor .hover { - border: 2px dotted red; - background: #ff6; -} - -#design_editor_toolbar { - padding: 5px; -} - -#design_editor_toolbar h3 { - font-size: 10px; - background: #dfdfdf; - margin: 0px; - padding: 1px; - text-align: right; - color: #545454; -} - -#design_editor_toolbar a { - font-size: 10px; - padding: 5px; - background: #dfdfdf; - color: black; -} - -.design_editor_box_toolbar { - text-align: center; - margin: 5px; - background: #dfdfdf; -} - -.design_editor_box_toolbar a { - display: inline; - width: 30px; - font-size: 10px; - padding: 2px; - background: #dfdfdf; -} - -#design_editor_toolbar a:hover, .design_editor_box_toolbar a:hover { - background: #545454; - color: #ffffff; -} - -div#notice { - z-index: 4000; - position: absolute; - top: 100px; - left: 50%; - margin-left: -200px; - width: 400px; - border: 1px solid black; - background: #efefef; - padding: 0.5em; -} - -div#notice .button { - text-align: center; - margin-top: 1em; - margin-bottom: 0.25em; -} - -div#notice .button a { - border: 1px solid gray; - background: #ddd; - color: black; - padding: 4px; - padding-left: 28px; - background-image: url(../../../icons/default/cancel.png); - background-position: top left; - background-repeat: no-repeat; -} -div#notice .button a:hover { - background-color: #ffd; -} diff --git a/public/designs/templates/onecolumn/thumbnail.jpg b/public/designs/templates/onecolumn/thumbnail.jpg deleted file mode 100644 index 2e98c98..0000000 Binary files a/public/designs/templates/onecolumn/thumbnail.jpg and /dev/null differ diff --git a/public/designs/templates/raw/raw.yml b/public/designs/templates/raw/raw.yml deleted file mode 100644 index 48962cf..0000000 --- a/public/designs/templates/raw/raw.yml +++ /dev/null @@ -1,3 +0,0 @@ -title: "Raw Layout 1 column" -description: "Mode Raw 1 column" -number_of_boxes: 1 diff --git a/public/designs/templates/raw/stylesheets/style.css b/public/designs/templates/raw/stylesheets/style.css deleted file mode 100644 index 8ab0ebf..0000000 --- a/public/designs/templates/raw/stylesheets/style.css +++ /dev/null @@ -1,4 +0,0 @@ -#frame { -margin-top: 50px; -padding: 10px; -} diff --git a/public/designs/templates/raw/thumbnail.jpg b/public/designs/templates/raw/thumbnail.jpg deleted file mode 100644 index 80d2755..0000000 Binary files a/public/designs/templates/raw/thumbnail.jpg and /dev/null differ diff --git a/public/designs/templates/rightbar/config.yml b/public/designs/templates/rightbar/config.yml new file mode 100644 index 0000000..2dbe092 --- /dev/null +++ b/public/designs/templates/rightbar/config.yml @@ -0,0 +1,3 @@ +title: "Right bar" +description: "A template with the menu bar at the right" +number_of_boxes: 2 diff --git a/public/designs/templates/rightbar/stylesheets/style.css b/public/designs/templates/rightbar/stylesheets/style.css new file mode 100644 index 0000000..23de095 --- /dev/null +++ b/public/designs/templates/rightbar/stylesheets/style.css @@ -0,0 +1,24 @@ + +#boxes { + /* none */ +} + +.box-1 { + margin: 0px 260px 0px 30px; +} +.box-1 .blocks { + width: 100%; + float: right; +} + +.box-2 { + float: right; + width: 230px; +} + +.block { + position: relative; + padding: 10px 0px; + float: none; +} + diff --git a/public/designs/templates/rightbar/thumbnail.png b/public/designs/templates/rightbar/thumbnail.png new file mode 100644 index 0000000..2db2d50 Binary files /dev/null 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 new file mode 100644 index 0000000..5dcdc96 --- /dev/null +++ b/public/designs/templates/rightbar/thumbnail.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/public/designs/templates/rightcolumn/images/add.png b/public/designs/templates/rightcolumn/images/add.png deleted file mode 100644 index 62a929a..0000000 Binary files a/public/designs/templates/rightcolumn/images/add.png and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/bgblue.jpg b/public/designs/templates/rightcolumn/images/bgblue.jpg deleted file mode 100644 index d37b70a..0000000 Binary files a/public/designs/templates/rightcolumn/images/bgblue.jpg and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/bgblue.png b/public/designs/templates/rightcolumn/images/bgblue.png deleted file mode 100644 index 8e2f803..0000000 Binary files a/public/designs/templates/rightcolumn/images/bgblue.png and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/bggreen.jpg b/public/designs/templates/rightcolumn/images/bggreen.jpg deleted file mode 100644 index 7441922..0000000 Binary files a/public/designs/templates/rightcolumn/images/bggreen.jpg and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/bggreen.png b/public/designs/templates/rightcolumn/images/bggreen.png deleted file mode 100644 index bf8bc78..0000000 Binary files a/public/designs/templates/rightcolumn/images/bggreen.png and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/bgorange.jpg b/public/designs/templates/rightcolumn/images/bgorange.jpg deleted file mode 100644 index ac21eb7..0000000 Binary files a/public/designs/templates/rightcolumn/images/bgorange.jpg and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/bgorange.png b/public/designs/templates/rightcolumn/images/bgorange.png deleted file mode 100644 index df393bc..0000000 Binary files a/public/designs/templates/rightcolumn/images/bgorange.png and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/bgpurple.jpg b/public/designs/templates/rightcolumn/images/bgpurple.jpg deleted file mode 100644 index bb901e0..0000000 Binary files a/public/designs/templates/rightcolumn/images/bgpurple.jpg and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/bgpurple.png b/public/designs/templates/rightcolumn/images/bgpurple.png deleted file mode 100644 index 3745b84..0000000 Binary files a/public/designs/templates/rightcolumn/images/bgpurple.png and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/bgred.jpg b/public/designs/templates/rightcolumn/images/bgred.jpg deleted file mode 100644 index ad9339d..0000000 Binary files a/public/designs/templates/rightcolumn/images/bgred.jpg and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/bgred.png b/public/designs/templates/rightcolumn/images/bgred.png deleted file mode 100644 index 50c8493..0000000 Binary files a/public/designs/templates/rightcolumn/images/bgred.png and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/editor.png b/public/designs/templates/rightcolumn/images/editor.png deleted file mode 100644 index 3155f7e..0000000 Binary files a/public/designs/templates/rightcolumn/images/editor.png and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/enterprisesblock.png b/public/designs/templates/rightcolumn/images/enterprisesblock.png deleted file mode 100644 index 08d5c5a..0000000 Binary files a/public/designs/templates/rightcolumn/images/enterprisesblock.png and /dev/null differ diff --git a/public/designs/templates/rightcolumn/images/peopleblock.png b/public/designs/templates/rightcolumn/images/peopleblock.png deleted file mode 100644 index ee1a089..0000000 Binary files a/public/designs/templates/rightcolumn/images/peopleblock.png and /dev/null differ diff --git a/public/designs/templates/rightcolumn/rightcolumn.yml b/public/designs/templates/rightcolumn/rightcolumn.yml deleted file mode 100644 index 9855c1d..0000000 --- a/public/designs/templates/rightcolumn/rightcolumn.yml +++ /dev/null @@ -1,3 +0,0 @@ -title: "Right Column Style" -description: "A theme based default with 2 columns" -number_of_boxes: 2 diff --git a/public/designs/templates/rightcolumn/stylesheets/cms.css b/public/designs/templates/rightcolumn/stylesheets/cms.css deleted file mode 100644 index abb8b70..0000000 --- a/public/designs/templates/rightcolumn/stylesheets/cms.css +++ /dev/null @@ -1,128 +0,0 @@ - -/************************************ - * listing stuff - ************************************/ -#content .handle, #content .do-reorder UL LI .handle { - display: none; -} -#content .do-reorder LI .handle { - display: inline; - background: gray; - color: white; - padding: 1px 3px; - cursor: move; -} - -ul.page-list li { - list-style: none; -} - -ul.page-list li table, -ul.page-list li td { - border: none; - padding: 3px; -} - -ul.page-list a.page { - font-weight: bold; -} - -ul.page-list a:visited, ul.page-list a:link { - color: #000; -} - -ul.page-list a:hover { - background: #aa9; -} - -#content .page-list .hover { - background: #F1F0DB; -} - -#content .page-list .commands A.delete-page:hover { - color: white; - background: black; -} -#content .page-list .hover-delete { - background: red; - color: #FF8E90; -} -#content .page-list .hover-delete A, -#content .page-list .hover-delete .commands A { - color: #FF8E90; -} -#content .page-list .hover-delete A.page { - color: white; - border-bottom: 0px; -} -#content .page-list .hover-delete UL LI A.page { - color: red; - border-bottom: 0px; -} - -/*********************************** - * from stuff - ***********************************/ -div.comatose_field { -} -div.comatose_field label { - display: block; - font-weight: bold; -} - -div.comatose_field textarea { - width: 90%; -} -div.comatose_field textarea, -div.comatose_field input, -div.comatose_field select { - border: 1px solid gray; -} - -/**************************************** - * revisions page stuff - ****************************************/ - -.older-content { - float: right; -} -.current-content { - float: left; -} - -.revisions { - width: 47%; - border: 1px solid gray; - padding: 0.25em; -} - -.revisions .header { - font-weight: bold; - border-bottom: 1px solid black; - margin-bottom: 10px; - height: 40px; -} - -.revisions .meta { - border-bottom: 1px solid black; - margin-bottom: 10px; -} - -.revisions .footer { - border-top: 1px solid black; - margin-top: 10px; - padding: 0.25em; -} - -.revisions .meta label span { - font-weight: bold; -} - -.revisions .meta label { - font-weight: normal; - display: block; -} - -.collapsed { - display: none; -} diff --git a/public/designs/templates/rightcolumn/stylesheets/contentblocks.css b/public/designs/templates/rightcolumn/stylesheets/contentblocks.css deleted file mode 100644 index c6bb602..0000000 --- a/public/designs/templates/rightcolumn/stylesheets/contentblocks.css +++ /dev/null @@ -1,104 +0,0 @@ -ul.enterprises_list_block { -margin: 0px; -padding: 0px; -list-style: none; -} - -ul.enterprises_list_block li a { -display: block; -height: 95px; -width: 80px; -text-decoration: none; -} - -ul.enterprises_list_block li a span { -display: none; -} - -ul.enterprises_list_block li a:hover span { -display: block; -line-height: 95px; -text-align: center; -background: #ffffff; -vertical-align: middle; -} - -ul.enterprises_list_block li { -display: block; -float: left; -height: 95px; -width: 80px; -border: 1px solid #dfdfdf; -background: #ffffff url("../images/enterprisesblock.png") no-repeat; -margin: 2px; -overflow: hidden; -} - - -ul.people_list_block { -margin: 0px; -padding: 0px; -list-style: none; -} - -ul.people_list_block li a { -display: block; -height: 95px; -width: 80px; -text-decoration: none; -} - -ul.people_list_block li a span { -display: none; -} - -ul.people_list_block li a:hover span { -display: block; -line-height: 95px; -text-align: center; -background: #ffffff; -vertical-align: middle; -} - -ul.people_list_block li { -display: block; -float: left; -height: 95px; -width: 80px; -border: 1px solid #dfdfdf; -background: #ffffff url("../images/peopleblock.png") no-repeat; -margin: 2px; -overflow: hidden; -} - -div.block_footer { -clear: both; -} - -/* Artigos */ - -div.recentdocumentsblock ul { -margin: 0px; -padding: 0px; -list-style: none; -} - -div.recentdocumentsblock div.block_content li a { -text-decoration: none; -color: #545454; -border-bottom: 1px dotted #545454; -} - -div.recentdocumentsblock div.block_content li a:hover { -text-decoration: none; -color: #000000; -border: none; -} - -div.recentdocumentsblock div.block_content li { -display: block; -height: 20px; -background: #ffffff url("../images/editor.png") no-repeat; -background-position: 2px 0px; -padding-left: 20px; -} diff --git a/public/designs/templates/rightcolumn/stylesheets/editor.css b/public/designs/templates/rightcolumn/stylesheets/editor.css deleted file mode 100644 index 98df8db..0000000 --- a/public/designs/templates/rightcolumn/stylesheets/editor.css +++ /dev/null @@ -1,94 +0,0 @@ -#design_editor_blocksbar { - list-style: none; - position: relative; - width: 760px; - left: 50%; - margin-left: -380px; - padding: 0em; - height: 30px; -} - -#design_editor_blocksbar li { -float: left; -margin: 4px; -} - -#design_editor_blocksbar a { -background: url("../images/add.png") no-repeat; -background-position: 0px 3px; -display: block; -padding: 5px; -padding-left: 28px; -border: 1px outset #545454; -text-decoration: none; -color: black; -font-weight: bold; -} - -#design_editor .design_blocks { - border: 2px dotted green; -} - -#design_editor_blocksbar a:hover { -border: 1px inset #545454; -} - -#design_editor ul.block_list { - list-style: none; - margin: 0px; - padding: 3px; - border: 2px dotted #dfdfdf; -} - -#design_editor ul:hover.block_list { - border: 2px dotted #545454; -} - -#design_editor .design_box { - border: 2px solid transparent; -} - -#design_editor .hover { - border: 2px dotted red; - background: #ff6; -} - -#design_editor_toolbar { - padding: 5px; -} - -#design_editor_toolbar h3 { - font-size: 10px; - background: #dfdfdf; - margin: 0px; - padding: 1px; - text-align: right; - color: #545454; -} - -#design_editor_toolbar a { - font-size: 10px; - padding: 5px; - background: #dfdfdf; - color: black; -} - -.design_editor_box_toolbar { - text-align: center; - margin: 5px; - background: #dfdfdf; -} - -.design_editor_box_toolbar a { - display: inline; - width: 30px; - font-size: 10px; - padding: 2px; - background: #dfdfdf; -} - -#design_editor_toolbar a:hover, .design_editor_box_toolbar a:hover { - background: #545454; - color: #ffffff; -} - diff --git a/public/designs/templates/rightcolumn/stylesheets/style.css b/public/designs/templates/rightcolumn/stylesheets/style.css deleted file mode 100644 index 842cdb6..0000000 --- a/public/designs/templates/rightcolumn/stylesheets/style.css +++ /dev/null @@ -1,107 +0,0 @@ -@import url("editor.css"); - -@import url("contentblocks.css"); - -body { - font-family: Verdana, Sans-Serif; - font-size: 14px; -} - -#wrap.category { - background-attachment: fixed; - background: url("../images/bgblue.png") top left no-repeat; -} - -#wrap.category1 { - background-attachment: fixed; - background: url("../images/bgorange.png") top left no-repeat; - } - -#wrap.category2 { - background-attachment: fixed; - background: url("../images/bggreen.png") top left no-repeat; - } - -#wrap.category3 { - background-attachment: fixed; - background: url("../images/bgpurple.png") top left no-repeat; - } - -#wrap.category4 { - background-attachment: fixed; - background: url("../images/bgred.png") top left no-repeat; -} - -#header { -height: 145px; -} - -#design_boxes { - position: relative; - margin-left: 10px; - margin-right: 10px; - padding: 0em; -} - -#design_box_2 { - width: 280px; - float: right; -} - -#design_box_1 { - margin-right: 285px; -} - -#spinner { - z-index: 1000; - position: absolute; - left: 50%; - margin-left: -16px; - top: 200px; -} - -#footer_content { -clear: both; -} - -#footer { - clear: both; - text-align: center; - font-size: smaller; - color: #333; - margin: 0px; - padding: 5px; -} - -/* Notice */ - -div#notice { - z-index: 4000; - position: absolute; - top: 100px; - left: 50%; - margin-left: -200px; - width: 400px; - border: 1px solid black; - background: #efefef; - padding: 0.5em; -} - -div#notice .button { - text-align: center; - margin-top: 1em; - margin-bottom: 0.25em; -} - -div#notice .button a { - border: 1px solid gray; - background: #ddd; - color: black; - padding: 4px; - padding-left: 28px; - background-position: top left; - background-repeat: no-repeat; -} -div#notice .button a:hover { - background-color: #ffd; -} diff --git a/public/designs/templates/rightcolumn/thumbnail.jpg b/public/designs/templates/rightcolumn/thumbnail.jpg deleted file mode 100644 index 6909db5..0000000 Binary files a/public/designs/templates/rightcolumn/thumbnail.jpg and /dev/null differ diff --git a/public/designs/templates/threecolumn/images/bg_bgheader.png b/public/designs/templates/threecolumn/images/bg_bgheader.png deleted file mode 100644 index 842e1f2..0000000 Binary files a/public/designs/templates/threecolumn/images/bg_bgheader.png and /dev/null differ diff --git a/public/designs/templates/threecolumn/images/bg_content.png b/public/designs/templates/threecolumn/images/bg_content.png deleted file mode 100644 index 8fa8c3b..0000000 Binary files a/public/designs/templates/threecolumn/images/bg_content.png and /dev/null differ diff --git a/public/designs/templates/threecolumn/images/bg_footer.png b/public/designs/templates/threecolumn/images/bg_footer.png deleted file mode 100644 index 230ea04..0000000 Binary files a/public/designs/templates/threecolumn/images/bg_footer.png and /dev/null differ diff --git a/public/designs/templates/threecolumn/images/bg_header.png b/public/designs/templates/threecolumn/images/bg_header.png deleted file mode 100644 index b539e40..0000000 Binary files a/public/designs/templates/threecolumn/images/bg_header.png and /dev/null differ diff --git a/public/designs/templates/threecolumn/images/fbes.png b/public/designs/templates/threecolumn/images/fbes.png deleted file mode 100644 index 2cc6b1c..0000000 Binary files a/public/designs/templates/threecolumn/images/fbes.png and /dev/null differ diff --git a/public/designs/templates/threecolumn/source/bluestyle.png b/public/designs/templates/threecolumn/source/bluestyle.png deleted file mode 100644 index 9c188b6..0000000 Binary files a/public/designs/templates/threecolumn/source/bluestyle.png and /dev/null differ diff --git a/public/designs/templates/threecolumn/source/bluestyle.svg b/public/designs/templates/threecolumn/source/bluestyle.svg deleted file mode 100644 index 2395494..0000000 --- a/public/designs/templates/threecolumn/source/bluestyle.svg +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - Barra de Ferramentas - - - - - - - - - - Itens para Adicionar - - - - diff --git a/public/designs/templates/threecolumn/source/tmpimg.png b/public/designs/templates/threecolumn/source/tmpimg.png deleted file mode 100644 index fdae50d..0000000 Binary files a/public/designs/templates/threecolumn/source/tmpimg.png and /dev/null differ diff --git a/public/designs/templates/threecolumn/stylesheets/cms.css b/public/designs/templates/threecolumn/stylesheets/cms.css deleted file mode 100644 index abb8b70..0000000 --- a/public/designs/templates/threecolumn/stylesheets/cms.css +++ /dev/null @@ -1,128 +0,0 @@ - -/************************************ - * listing stuff - ************************************/ -#content .handle, #content .do-reorder UL LI .handle { - display: none; -} -#content .do-reorder LI .handle { - display: inline; - background: gray; - color: white; - padding: 1px 3px; - cursor: move; -} - -ul.page-list li { - list-style: none; -} - -ul.page-list li table, -ul.page-list li td { - border: none; - padding: 3px; -} - -ul.page-list a.page { - font-weight: bold; -} - -ul.page-list a:visited, ul.page-list a:link { - color: #000; -} - -ul.page-list a:hover { - background: #aa9; -} - -#content .page-list .hover { - background: #F1F0DB; -} - -#content .page-list .commands A.delete-page:hover { - color: white; - background: black; -} -#content .page-list .hover-delete { - background: red; - color: #FF8E90; -} -#content .page-list .hover-delete A, -#content .page-list .hover-delete .commands A { - color: #FF8E90; -} -#content .page-list .hover-delete A.page { - color: white; - border-bottom: 0px; -} -#content .page-list .hover-delete UL LI A.page { - color: red; - border-bottom: 0px; -} - -/*********************************** - * from stuff - ***********************************/ -div.comatose_field { -} -div.comatose_field label { - display: block; - font-weight: bold; -} - -div.comatose_field textarea { - width: 90%; -} -div.comatose_field textarea, -div.comatose_field input, -div.comatose_field select { - border: 1px solid gray; -} - -/**************************************** - * revisions page stuff - ****************************************/ - -.older-content { - float: right; -} -.current-content { - float: left; -} - -.revisions { - width: 47%; - border: 1px solid gray; - padding: 0.25em; -} - -.revisions .header { - font-weight: bold; - border-bottom: 1px solid black; - margin-bottom: 10px; - height: 40px; -} - -.revisions .meta { - border-bottom: 1px solid black; - margin-bottom: 10px; -} - -.revisions .footer { - border-top: 1px solid black; - margin-top: 10px; - padding: 0.25em; -} - -.revisions .meta label span { - font-weight: bold; -} - -.revisions .meta label { - font-weight: normal; - display: block; -} - -.collapsed { - display: none; -} diff --git a/public/designs/templates/threecolumn/stylesheets/style.css b/public/designs/templates/threecolumn/stylesheets/style.css deleted file mode 100644 index 83e623d..0000000 --- a/public/designs/templates/threecolumn/stylesheets/style.css +++ /dev/null @@ -1,155 +0,0 @@ -body { - font-family: Verdana, Sans-Serif; - font-size: 14px; -} - -#wrap { -background: url("../images/bg_content.png") top center repeat-y; -} - -#frame { -background: url("../images/bg_bgheader.png") top left repeat-x; -} - -#header { -background: url("../images/bg_header.png") top center no-repeat; -height: 135px; -} - -#design_boxes { - position: relative; - width: 760px; - left: 50%; - margin-left: -380px; - padding: 0em; -} - -#design_box_3 { - width: 200px; - float: right; -} - -#design_box_2 { - float: left; - width: 200px; -} - -#design_box_1 { - margin-left: 205px; - margin-right: 205px; -} - -#spinner { - z-index: 1000; - position: absolute; - left: 50%; - margin-left: -16px; - top: 200px; -} - -#footer_content { -clear: both; -} - -#footer { - clear: both; - text-align: center; - font-size: smaller; - color: #333; - margin: 0px; - padding: 5px; - background: #c5d0df url("../images/bg_footer.png") top left repeat-x; -} - - -/* Edition Mode */ - -#design_editor .block_list { - list-style: none; - margin: 0px; - padding: 3px; -} - -#design_editor .design_blocks { - border: 2px dotted green; -} - -#design_editor .design_box { - border: 2px solid transparent; -} - -#design_editor .hover { - border: 2px dotted red; - background: #ff6; -} - -#design_editor_toolbar { - padding: 5px; -} - -#design_editor_toolbar h3 { - font-size: 10px; - background: #dfdfdf; - margin: 0px; - padding: 1px; - text-align: right; - color: #545454; -} - -#design_editor_toolbar a { - font-size: 10px; - padding: 5px; - background: #dfdfdf; - color: black; -} - -.design_editor_box_toolbar { - text-align: center; - margin: 5px; - background: #dfdfdf; -} - -.design_editor_box_toolbar a { - display: inline; - width: 30px; - font-size: 10px; - padding: 2px; - background: #dfdfdf; -} - -#design_editor_toolbar a:hover, .design_editor_box_toolbar a:hover { - background: #545454; - color: #ffffff; -} - -div#notice { - z-index: 4000; - position: absolute; - top: 100px; - left: 50%; - margin-left: -200px; - width: 400px; - border: 1px solid black; - background: #efefef; - padding: 0.5em; -} - -div#notice .button { - text-align: center; - margin-top: 1em; - margin-bottom: 0.25em; -} - -div#notice .button a { - border: 1px solid gray; - background: #ddd; - color: black; - padding: 4px; - padding-left: 28px; - background-image: url(../../../icons/default/cancel.png); - background-position: top left; - background-repeat: no-repeat; -} -div#notice .button a:hover { - background-color: #ffd; -} diff --git a/public/designs/templates/threecolumn/threecolumn.yml b/public/designs/templates/threecolumn/threecolumn.yml deleted file mode 100644 index 70dfdc8..0000000 --- a/public/designs/templates/threecolumn/threecolumn.yml +++ /dev/null @@ -1,3 +0,0 @@ -title: "Blue Style 3 columns" -description: "A theme blue with 3 columns" -number_of_boxes: 3 diff --git a/public/designs/templates/threecolumn/thumbnail.jpg b/public/designs/templates/threecolumn/thumbnail.jpg deleted file mode 100644 index 678e4ca..0000000 Binary files a/public/designs/templates/threecolumn/thumbnail.jpg and /dev/null differ diff --git a/public/stylesheets/controller_themes.css b/public/stylesheets/controller_themes.css index 050559f..d983329 100644 --- a/public/stylesheets/controller_themes.css +++ b/public/stylesheets/controller_themes.css @@ -113,3 +113,8 @@ .msie6 #css-code textarea { width: 500px; } + +td.selected { + background: #ff9; + font-style: italic; +} diff --git a/test/functional/themes_controller_test.rb b/test/functional/themes_controller_test.rb index ca609a9..7f94f8b 100644 --- a/test/functional/themes_controller_test.rb +++ b/test/functional/themes_controller_test.rb @@ -32,6 +32,15 @@ class ThemesControllerTest < Test::Unit::TestCase end end + should 'highlight current theme' do + profile.update_attributes(:theme => 'first') + Theme.expects(:system_themes).returns([Theme.new('first'), Theme.new('second')]) + get :index, :profile => 'testinguser' + + assert_tag :attributes => { :class => 'selected theme' }, :descendant => { :content => /(current)/ } + assert_no_tag :attributes => { :class => 'selected theme' }, :descendant => { :tag => 'a', :attributes => { :href => "/myprofile/testinguser/themes/set/first" } } + end + should 'display list of my themes for edition' do Theme.create('first', :owner => profile) Theme.create('second', :owner => profile) @@ -191,4 +200,42 @@ class ThemesControllerTest < Test::Unit::TestCase assert_redirected_to :action => 'index' end + should 'list templates' do + all = LayoutTemplate.all + + LayoutTemplate.expects(:all).returns(all) + get :index, :profile => 'testinguser' + assert_same all, assigns(:layout_templates) + end + + should 'display links to set template' do + profile.update_attributes!(:layout_template => 'rightbar') + t1 = LayoutTemplate.find('default') + t2 = LayoutTemplate.find('leftbar') + LayoutTemplate.expects(:all).returns([t1, t2]) + + get :index, :profile => 'testinguser' + assert_tag :tag => 'a', :attributes => { :href => "/myprofile/testinguser/themes/set_layout_template/default"} + assert_tag :tag => 'a', :attributes => { :href => "/myprofile/testinguser/themes/set_layout_template/leftbar"} + end + + should 'highlight current template' do + profile.update_attributes!(:layout_template => 'default') + + t1 = LayoutTemplate.find('default') + t2 = LayoutTemplate.find('leftbar') + LayoutTemplate.expects(:all).returns([t1, t2]) + + get :index, :profile => 'testinguser' + assert_tag :tag => 'td', :attributes => { :class => 'selected template' }, :descendant => { :content => /(current)/ } + assert_no_tag :tag => 'td', :attributes => { :class => 'selected template' }, :descendant => { :tag => 'a', :attributes => { :href => "/myprofile/testinguser/themes/set_layout_template/default"} } + end + + should 'set template' do + post :set_layout_template, :profile => 'testinguser', :id => 'leftbar' + profile.reload + assert_equal 'leftbar', profile.layout_template + assert_redirected_to :action => 'index' + end + end diff --git a/test/unit/application_helper_test.rb b/test/unit/application_helper_test.rb index 727d054..d30748c 100644 --- a/test/unit/application_helper_test.rb +++ b/test/unit/application_helper_test.rb @@ -201,6 +201,26 @@ class ApplicationHelperTest < Test::Unit::TestCase assert_equal 'sampleuser', theme_owner end + should 'use default template when no profile' do + stubs(:profile).returns(nil) + + foo = mock + expects(:stylesheet_link_tag).with('/designs/templates/default/stylesheets/style.css').returns(foo) + + assert_same foo, template_stylesheet_tag + end + + should 'use template from profile' do + profile = mock + profile.expects(:layout_template).returns('mytemplate') + stubs(:profile).returns(profile) + + foo = mock + expects(:stylesheet_link_tag).with('/designs/templates/mytemplate/stylesheets/style.css').returns(foo) + + assert_same foo, template_stylesheet_tag + end + protected def content_tag(tag, content, options = {}) diff --git a/test/unit/layout_template_test.rb b/test/unit/layout_template_test.rb new file mode 100644 index 0000000..7c2fbae --- /dev/null +++ b/test/unit/layout_template_test.rb @@ -0,0 +1,22 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class LayoutTemplateTest < ActiveSupport::TestCase + + should 'read configuration' do + YAML.expects(:load_file).with(RAILS_ROOT + '/public/designs/templates/default/config.yml').returns({'number_of_boxes' => 3, 'description' => 'my description', 'title' => 'my title'}) + t = LayoutTemplate.find('default') + assert_equal 3, t.number_of_boxes + assert_equal 'my description', t.description + assert_equal 'my title', t.title + end + + should 'list all' do + Dir.expects(:glob).with(RAILS_ROOT + '/public/designs/templates/*').returns([RAILS_ROOT + '/public/designs/templates/one', RAILS_ROOT + '/public/designs/templates/two']) + YAML.expects(:load_file).with(RAILS_ROOT + '/public/designs/templates/one/config.yml').returns({}) + YAML.expects(:load_file).with(RAILS_ROOT + '/public/designs/templates/two/config.yml').returns({}) + + all = LayoutTemplate.all + assert_equivalent [ 'one', 'two' ], all.map(&:id) + end + +end diff --git a/test/unit/profile_test.rb b/test/unit/profile_test.rb index eb3f365..d095337 100644 --- a/test/unit/profile_test.rb +++ b/test/unit/profile_test.rb @@ -881,6 +881,23 @@ class ProfileTest < Test::Unit::TestCase end end + should 'have a layout template' do + p = Profile.create!(:identifier => 'mytestprofile', :name => 'My test profile', :environment => Environment.default) + assert_equal 'default', p.layout_template + end + + should 'get boxes limit from template' do + p = Profile.create!(:identifier => 'mytestprofile', :name => 'My test profile', :environment => Environment.default) + + layout = mock + layout.expects(:number_of_boxes).returns(6) + + p.expects(:layout_template).returns('mylayout') + LayoutTemplate.expects(:find).with('mylayout').returns(layout) + + assert_equal 6, p.boxes_limit + end + private def assert_invalid_identifier(id) -- libgit2 0.21.2
+

<%= _('My themes') %>

+