diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 581285b..baba889 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,6 @@ class ApplicationController < ActionController::Base protect_from_forgery + layout :layout_by_resource # Setup the locale based on the domain name used to access the website before_filter :set_locale @@ -12,4 +13,9 @@ class ApplicationController < ActionController::Base this_domain_ext = request.host.split('.').last I18n.locale = params[:locale] || DEFAULT_LANGUAGE_BY_DOMAIN[this_domain_ext] || 'en' end + + # Selects a layout different from layouts/application for some special pages. + def layout_by_resource + devise_controller? ? 'login' : 'application' + end end diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index d0d70c5..3a3befa 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,11 +1,3 @@ -
-
 
-
- -
-
 
-
-
 
diff --git a/app/views/layouts/login.html.erb b/app/views/layouts/login.html.erb new file mode 100644 index 0000000..3b9a463 --- /dev/null +++ b/app/views/layouts/login.html.erb @@ -0,0 +1,49 @@ + + + + + + Contact-o-Rama - <%= yield(:title) %> + <%= stylesheet_link_tag "reset.css", :media => "screen, projection" %> + <%= stylesheet_link_tag "1140" %> + + <%= stylesheet_link_tag "layout" %> + <%= javascript_include_tag :defaults %> + <%= csrf_meta_tag %> + + + + +
+
Contact-o-Rama
+
+ +
+ <% unless flash.empty? %> +
+
 
+
+ <%# examples: flash[:error] (:notice, ...), needs: respective css 'id' elements %> + <% flash.each do | key, msg | %> + <%= content_tag(:p, msg, :id => key) if flash[key] %> + <% end %> +
+
 
+
+ <% end %> + +<%= yield %> + +<%# Footer %> +
+ +
+
<%# end container %> + + diff --git a/public/stylesheets/layout.css b/public/stylesheets/layout.css index dd5a6cd..c936d93 100644 --- a/public/stylesheets/layout.css +++ b/public/stylesheets/layout.css @@ -183,7 +183,7 @@ font-weight: 400; /* Login form */ .login { - margin-top: 10px; + margin-top: 50px; } #user_new { background-attachment: scroll;