From f9add5f7d8e5ba5840d054b1409cd7924992ab4e Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Wed, 4 Aug 2010 15:41:20 -0300 Subject: [PATCH] Added scarletred theme to noosfero --- app/helpers/application_helper.rb | 18 ++++++++++++++++++ app/views/layouts/application-ng.rhtml | 4 ++-- public/designs/themes/noosfero/site_title.rhtml | 1 + public/designs/themes/noosfero/style.css | 11 ++++------- public/designs/themes/scarletred/header.rhtml | 19 +++++++++++++++++++ public/designs/themes/scarletred/imgs/comment-owner-bg-L.png | Bin 0 -> 188 bytes public/designs/themes/scarletred/imgs/comment-owner-bg-N.png | Bin 0 -> 222 bytes public/designs/themes/scarletred/imgs/comment-owner-bg-NL.png | Bin 0 -> 266 bytes public/designs/themes/scarletred/imgs/comment-owner-bg-NO.png | Bin 0 -> 525 bytes public/designs/themes/scarletred/imgs/comment-owner-bg-O.png | Bin 0 -> 198 bytes public/designs/themes/scarletred/imgs/comment-owner-bg-S.png | Bin 0 -> 210 bytes public/designs/themes/scarletred/imgs/comment-owner-bg.png | Bin 0 -> 189 bytes public/designs/themes/scarletred/site_title.rhtml | 1 + public/designs/themes/scarletred/style.css | 221 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ public/designs/themes/scarletred/theme.yml | 2 ++ test/fixtures/files/favicon.ico | Bin 0 -> 1406 bytes test/unit/application_helper_test.rb | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 17 files changed, 324 insertions(+), 9 deletions(-) create mode 100644 public/designs/themes/noosfero/site_title.rhtml create mode 100644 public/designs/themes/scarletred/header.rhtml create mode 100644 public/designs/themes/scarletred/imgs/comment-owner-bg-L.png create mode 100644 public/designs/themes/scarletred/imgs/comment-owner-bg-N.png create mode 100644 public/designs/themes/scarletred/imgs/comment-owner-bg-NL.png create mode 100644 public/designs/themes/scarletred/imgs/comment-owner-bg-NO.png create mode 100644 public/designs/themes/scarletred/imgs/comment-owner-bg-O.png create mode 100644 public/designs/themes/scarletred/imgs/comment-owner-bg-S.png create mode 100644 public/designs/themes/scarletred/imgs/comment-owner-bg.png create mode 100644 public/designs/themes/scarletred/site_title.rhtml create mode 100644 public/designs/themes/scarletred/style.css create mode 100644 public/designs/themes/scarletred/theme.yml create mode 100644 test/fixtures/files/favicon.ico diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b7fa836..5361191 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -371,6 +371,24 @@ module ApplicationHelper nil end + def theme_favicon + return '/designs/themes/' + current_theme + '/favicon.ico' if profile.nil? || profile.theme.nil? + if File.exists?(File.join(RAILS_ROOT, 'public', theme_path, 'favicon.ico')) + '/designs/themes/' + profile.theme + '/favicon.ico' + else + favicon = profile.articles.find_by_path('favicon.ico') + if favicon + favicon.public_filename + else + '/designs/themes/' + environment.theme + '/favicon.ico' + end + end + end + + def theme_site_title + theme_include('site_title') + end + def theme_header theme_include('header') end diff --git a/app/views/layouts/application-ng.rhtml b/app/views/layouts/application-ng.rhtml index f5c346d..8e1312a 100644 --- a/app/views/layouts/application-ng.rhtml +++ b/app/views/layouts/application-ng.rhtml @@ -6,7 +6,7 @@ - + <%= noosfero_javascript %> <%= stylesheet_link_tag noosfero_stylesheets, :cache => 'cache' %> <%= stylesheet_link_tag template_stylesheet_path %> @@ -73,7 +73,7 @@

- <%= link_to content_tag('span', environment.name), environment.top_url %> + <%= theme_site_title %>