From 27adccb6e94bc7440086fd1ce94685b67a937e9b Mon Sep 17 00:00:00 2001 From: Stefan Hacker Date: Sun, 2 Sep 2012 14:19:42 +0200 Subject: [PATCH] Remove unused layout and clear up naming * scaffold.css is only used by login -> rename to login.css * standard.html.erb is the default application layout -> rename to application.html.erb * scaffold.html.erb is unused -> deleted --- .../stylesheets/{scaffold.css => login.css} | 0 app/controllers/application_controller.rb | 2 +- app/controllers/feedlist_controller.rb | 2 +- app/controllers/stats_controller.rb | 2 +- app/views/layouts/application.html.erb | 113 ++++++++++++++++-- app/views/layouts/login.html.erb | 2 +- app/views/layouts/scaffold.html.erb | 12 -- app/views/layouts/standard.html.erb | 103 ---------------- config/environments/production.rb | 2 +- 9 files changed, 105 insertions(+), 133 deletions(-) rename app/assets/stylesheets/{scaffold.css => login.css} (100%) delete mode 100644 app/views/layouts/scaffold.html.erb delete mode 100644 app/views/layouts/standard.html.erb diff --git a/app/assets/stylesheets/scaffold.css b/app/assets/stylesheets/login.css similarity index 100% rename from app/assets/stylesheets/scaffold.css rename to app/assets/stylesheets/login.css diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 34513f9c..38539b9b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -12,7 +12,7 @@ class ApplicationController < ActionController::Base include LoginSystem helper_method :current_user, :prefs, :format_date, :markdown - layout proc{ |controller| controller.mobile? ? "mobile" : "standard" } + layout proc{ |controller| controller.mobile? ? "mobile" : "application" } # exempt_from_layout /\.js\.erb$/ before_filter :check_for_deprecated_password_hash diff --git a/app/controllers/feedlist_controller.rb b/app/controllers/feedlist_controller.rb index f0e0e991..bb069f7e 100644 --- a/app/controllers/feedlist_controller.rb +++ b/app/controllers/feedlist_controller.rb @@ -20,7 +20,7 @@ class FeedlistController < ApplicationController @hidden_contexts = current_user.contexts.hidden respond_to do |format| - format.html { render :layout => 'standard' } + format.html { render :layout => 'application' } format.m end end diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 95fa8b6f..cd9d49e2 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -16,7 +16,7 @@ class StatsController < ApplicationController get_stats_projects get_stats_tags - render :layout => 'standard' + render :layout => 'application' end def actions_done_last12months_data diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 60e1c98b..2822122f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,16 +1,103 @@ - - - - Tracksapp - <%= stylesheet_link_tag "application", :media => "all" %> - <%= javascript_include_tag "application" %> - <%= csrf_meta_tags %> - <%= favicon_link_tag 'favicon.ico' %> - <%= favicon_link_tag 'apple-touch-icon.png', :rel => 'apple-touch-icon', :type => 'image/png' %> - - + + + + + <%= stylesheet_link_tag "application", :media => "all" %> + <%= stylesheet_link_tag "print", :media => "print" %> + <%= javascript_include_tag "application" %> + <%= csrf_meta_tag %> + + <%= favicon_link_tag 'favicon.ico' %> + <%= favicon_link_tag 'apple-touch-icon.png', :rel => 'apple-touch-icon', :type => 'image/png' %> + <%= auto_discovery_link_tag(:rss, {:controller => "todos", :action => "index", :format => 'rss', :token => "#{current_user.token}"}, {:title => t('layouts.next_actions_rss_feed')}) %> + + <%= @page_title %> + -<%= yield %> + - +
+ <%= NOTIFY_BAR.html_safe %> + +
+

+ <% if @count -%> + <%= @count %> + <% end -%> + <%= l(Date.today, :format => current_user.prefs.title_date_format) %> +

+
+ + + <%= render_flash %> +
+ +
+ <%= yield %> +
+ + <%= render :partial => "shared/footer" %> + diff --git a/app/views/layouts/login.html.erb b/app/views/layouts/login.html.erb index 1322dd08..d09bd531 100644 --- a/app/views/layouts/login.html.erb +++ b/app/views/layouts/login.html.erb @@ -2,7 +2,7 @@ - <%= stylesheet_link_tag "scaffold" %> + <%= stylesheet_link_tag "login" %> <%= favicon_link_tag 'favicon.ico' %> <%= favicon_link_tag 'apple-touch-icon.png', :rel => 'apple-touch-icon', :type => 'image/png' %> <%= @page_title -%> diff --git a/app/views/layouts/scaffold.html.erb b/app/views/layouts/scaffold.html.erb deleted file mode 100644 index 031d8a03..00000000 --- a/app/views/layouts/scaffold.html.erb +++ /dev/null @@ -1,12 +0,0 @@ - - - - Login - <%= stylesheet_link_tag "scaffold" %> - <%= favicon_link_tag 'favicon.ico' %> - <%= favicon_link_tag 'apple-touch-icon.png', :rel => 'apple-touch-icon', :type => 'image/png' %> - - -<%= yield %> - - diff --git a/app/views/layouts/standard.html.erb b/app/views/layouts/standard.html.erb deleted file mode 100644 index 2822122f..00000000 --- a/app/views/layouts/standard.html.erb +++ /dev/null @@ -1,103 +0,0 @@ - - - - - <%= stylesheet_link_tag "application", :media => "all" %> - <%= stylesheet_link_tag "print", :media => "print" %> - <%= javascript_include_tag "application" %> - <%= csrf_meta_tag %> - - <%= favicon_link_tag 'favicon.ico' %> - <%= favicon_link_tag 'apple-touch-icon.png', :rel => 'apple-touch-icon', :type => 'image/png' %> - <%= auto_discovery_link_tag(:rss, {:controller => "todos", :action => "index", :format => 'rss', :token => "#{current_user.token}"}, {:title => t('layouts.next_actions_rss_feed')}) %> - - <%= @page_title %> - - - - -
- <%= NOTIFY_BAR.html_safe %> - -
-

- <% if @count -%> - <%= @count %> - <% end -%> - <%= l(Date.today, :format => current_user.prefs.title_date_format) %> -

-
- - - <%= render_flash %> -
- -
- <%= yield %> -
- - <%= render :partial => "shared/footer" %> - - diff --git a/config/environments/production.rb b/config/environments/production.rb index b7f86010..0ea34297 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -46,7 +46,7 @@ Tracksapp::Application.configure do # config.action_controller.asset_host = "http://assets.example.com" # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) - config.assets.precompile += %w( print.css scaffold.css mobile.css ) + config.assets.precompile += %w( print.css login.css mobile.css ) # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false