From 2c8fb48e53512218c0f96cf884f153c231243f7d Mon Sep 17 00:00:00 2001 From: Jonathon Wilson Date: Sat, 17 Nov 2012 15:03:06 -0600 Subject: [PATCH 1/2] Initial version of landing page and support for non-logged-in client home. --- app/assets/javascripts/landing.js | 23 +++++++ app/assets/javascripts/layout.js | 8 +-- app/assets/javascripts/utils.js | 6 ++ .../stylesheets/client/jamkazam.css.scss | 6 ++ app/controllers/clients_controller.rb | 2 +- app/controllers/sessions_controller.rb | 6 +- app/views/clients/index.html.erb | 62 +++++++++++++------ config/routes.rb | 3 +- 8 files changed, 85 insertions(+), 31 deletions(-) create mode 100644 app/assets/javascripts/landing.js diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/landing.js new file mode 100644 index 000000000..8efdb9929 --- /dev/null +++ b/app/assets/javascripts/landing.js @@ -0,0 +1,23 @@ +/** +* Javascript for controlling the landing page. +* This is the page you'll see when you visit the +* client home page without being logged in. +*/ +(function(context,$) { + + context.JK = context.JK || {}; + + context.JK.LandingPage = function() { + var logger = context.JK.logger; + logger.debug("Landing Page TODO"); + + this.initialize = function() { + $('div[layout="landing"]').show(); + JK.hideCurtain(400); + }; + + return this; + + }; + + }(window,jQuery)); \ No newline at end of file diff --git a/app/assets/javascripts/layout.js b/app/assets/javascripts/layout.js index 0e6bbadd5..228283a19 100644 --- a/app/assets/javascripts/layout.js +++ b/app/assets/javascripts/layout.js @@ -49,19 +49,13 @@ $('[layout="sidebar"]').show(); $('[layout="panel"]').show(); layout(); - hideCurtain(); + JK.hideCurtain(opts.animationDuration); } function setInitialExpandedSidebarPanel() { expandedPanel = $('[layout="panel"]').first().attr("layout-id"); } - function hideCurtain() { - setTimeout(function() { - $('.curtain').fadeOut(2*opts.animationDuration); - }, opts.animationDuration); - } - function layout() { width = $(window).width(); height = $(window).height(); diff --git a/app/assets/javascripts/utils.js b/app/assets/javascripts/utils.js index 0698d6d67..a34b9f405 100644 --- a/app/assets/javascripts/utils.js +++ b/app/assets/javascripts/utils.js @@ -16,6 +16,12 @@ }; + context.JK.hideCurtain = function(duration) { + setTimeout(function() { + $('.curtain').fadeOut(2*duration); + }, duration); + }; + /* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. diff --git a/app/assets/stylesheets/client/jamkazam.css.scss b/app/assets/stylesheets/client/jamkazam.css.scss index c105e9bbe..bdc1311ad 100644 --- a/app/assets/stylesheets/client/jamkazam.css.scss +++ b/app/assets/stylesheets/client/jamkazam.css.scss @@ -82,6 +82,7 @@ label { } .notify { + display:none; background-color: $color8; color:#000; overflow:auto; @@ -92,6 +93,7 @@ label { } .dialog { + display:none; background-color:$color8; border: #666; color:#000; @@ -158,6 +160,10 @@ label { background: scale-lightness($color7, 10%); } +.screen { + display:none; +} + .screen.secondary { } .buttonrow, .screen.secondary .footer { diff --git a/app/controllers/clients_controller.rb b/app/controllers/clients_controller.rb index fad1d3213..cc745520c 100644 --- a/app/controllers/clients_controller.rb +++ b/app/controllers/clients_controller.rb @@ -3,7 +3,7 @@ class ClientsController < ApplicationController include UsersHelper # have to be signed in currently to see this screen - before_filter :signed_in_user + # before_filter :signed_in_user def index # use gon to pass variables into javascript diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index e5e5f6b6f..c45f7bd46 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -59,12 +59,14 @@ class SessionsController < ApplicationController def complete_sign_in(user) sign_in user - redirect_back_or music_sessions_url + #redirect_back_or music_sessions_url + redirect_back_or client_url end def destroy sign_out - redirect_to root_url + #redirect_to root_url + redirect_to client_url end def failure diff --git a/app/views/clients/index.html.erb b/app/views/clients/index.html.erb index b52d70c06..5a0aaf3a0 100644 --- a/app/views/clients/index.html.erb +++ b/app/views/clients/index.html.erb @@ -1,5 +1,15 @@ -
-
+
+ + + + + +