Initial version of landing page and support for non-logged-in client home.

This commit is contained in:
Jonathon Wilson 2012-11-17 15:03:06 -06:00
parent 1099720911
commit 2c8fb48e53
8 changed files with 85 additions and 31 deletions

View File

@ -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));

View File

@ -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();

View File

@ -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.

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,15 @@
<div class="curtain"></div>
<div layout="header" class="header">
<div class="curtain" style="width:100%; height:100%; z-index:9999; background-color:#ffffff;"></div>
<!-- Shown to users who are not logged in -->
<div layout="landing" class="landing" style="display:none;">
<h1>Welcome to JamKazam!</h1>
<p>This is a landing page for users who haven't registered or signed-in. Marketing text to convince you how great it would be to use the service goes here.</p>
<p>No account? <a href="signup">Register!</a></p>
<p>or <a href="/signin">Sign In</a></p>
</div>
<!-- Normal signed-in user content -->
<div layout="header" class="header" style="display:none;">
<h1>JamKazam</h1>
<div class="search">
<input type="text" class="searchtextinput" placeholder="Search for Bands, Musicians and Fans"/>
@ -28,9 +38,9 @@
</script>
<div class="userinfo">
<%= gravatar_for current_user, size: 52, hclass: "avatar medium" %>
<!-- gravatar_for current_user, size: 52, hclass: "avatar medium" -->
<div class="username">
<h2><%= "#{current_user.first_name} #{current_user.last_name}" %></h2>
<h2>User Name Here with Template </h2>
<%= image_tag "down_arrow.png", :class=> "profile-toggle" %>
<ul>
<li><a layout-link="account">Profile</a></li>
@ -66,7 +76,7 @@
</div>
</div>
<div layout="sidebar" class="sidebar">
<div layout="sidebar" class="sidebar" style="display:none;">
<div layout-sidebar-expander="visible" class="expander visible">
<p>&gt;&gt; Hide</p>
</div>
@ -562,29 +572,41 @@
<script type="text/javascript">
$(function() {
JK = JK || {};
var jk = JK.JamKazam();
jk.initialize();
<% if current_user %>
JK.currentUserId = '<%= current_user.id %>';
<% else %>
JK.currentUserId = null;
<% end %>
JK.currentUserId = '<%= current_user.id %>';
if (JK.currentUserId) {
var header = new JK.Header(jk);
header.initialize();
var jk = JK.JamKazam();
jk.initialize();
var homeScreen = new JK.HomeScreen(jk);
homeScreen.initialize();
var header = new JK.Header(jk);
header.initialize();
var createSessionScreen = new JK.CreateSessionScreen(jk);
createSessionScreen.initialize();
var homeScreen = new JK.HomeScreen(jk);
homeScreen.initialize();
var findSessionScreen = new JK.FindSessionScreen(jk);
findSessionScreen.initialize();
var createSessionScreen = new JK.CreateSessionScreen(jk);
createSessionScreen.initialize();
var sessionScreen = new JK.SessionScreen(jk);
sessionScreen.initialize();
var findSessionScreen = new JK.FindSessionScreen(jk);
findSessionScreen.initialize();
var jam_server = JK.JamServer;
jam_server.connect();
var sessionScreen = new JK.SessionScreen(jk);
sessionScreen.initialize();
var jam_server = JK.JamServer;
jam_server.connect();
} else {
var landing = new JK.LandingPage(jk);
landing.initialize();
}
})
</script>

View File

@ -11,7 +11,8 @@ SampleApp::Application.routes.draw do
resources :sessions, only: [:new, :create, :destroy]
root to: 'static_pages#home'
#root to: 'static_pages#home'
root to: 'clients#index'
match '/signup', to: 'users#new'
match '/email_sent', to: 'users#email_sent'