Skip to content

Commit

Permalink
Merge commit 'HEAD'; branch 'new_design'
Browse files Browse the repository at this point in the history
  • Loading branch information
fd committed Jun 9, 2009
2 parents 3f3bd48 + 89fe9bd commit 412b55f
Show file tree
Hide file tree
Showing 25 changed files with 378 additions and 58 deletions.
28 changes: 28 additions & 0 deletions app/controllers/invitation_requests_controller.rb
@@ -0,0 +1,28 @@
class InvitationRequestsController < ApplicationController

before_filter :only_if_invitations_allowed

def new
@invitation = InvitationRequest.new
end

def create
@invitation = InvitationRequest.new(params[:invitation_request])
if @invitation.save
flash[:notice] = "Invitation send!"
redirect_to root_url
else
render :action => :new
end
end

private

def only_if_invitations_allowed
unless FAILTALE[:allow_invitations]
redirect_to root_path
return false
end
end

end
16 changes: 16 additions & 0 deletions app/models/invitation_request.rb
@@ -0,0 +1,16 @@
class InvitationRequest
attr_accessor :email

def new_record?
true
end

def initialize(params={})
@email = params.delete(:email)
end

def save
Notifier.deliver_invitation_request(@email)
true
end
end
9 changes: 9 additions & 0 deletions app/models/notifier.rb
Expand Up @@ -9,6 +9,15 @@ def invitation(invitation, sent_at = Time.now)
body :invitation => invitation
end

def invitation_request(email, sent_at = Time.now)
subject 'A new Failtale invitation!'
recipients 'failtale@mrhenry.be'
from 'donotreply@failtale.be'
sent_on sent_at

body :email => email
end

def occurence_report(user, occurence, sent_at = Time.now)
subject "[#{occurence.error.project.name}] An error occured (@#{occurence.error_id})"
recipients user.email
Expand Down
144 changes: 116 additions & 28 deletions app/views/layouts/home.html.haml
Expand Up @@ -7,38 +7,126 @@
%body#home

#wrapper
#container

#header.clearfix
%ul.clearfix
%li.login
%a{ :href => "#", :title => "Login" }
Login
%li.request
%a{ :href => "#", :title => "Request invitation", :rel => "content5" }
Request invitation

%h1
Failtale
%sup Beta
\- Telling you more about failing applications.

%a{ :href => "/", :title => "Failtale (beta) - Telling you more about failing applications." }
Failtale
%sup Beta
\- Telling you more about failing applications.

- numbers=("%07d" % Occurence.count).split(//)
%div.counter-holder.clearfix
%div.counter
%span
= numbers[0]
%img{ :src =>"/images/splash/separator.gif", :alt =>""}
%span.dot
\.
%img{ :src =>"/images/splash/separator.gif", :alt =>""}
%span
= numbers[1]
%img{ :src =>"/images/splash/separator.gif", :alt =>""}
%span
= numbers[2]
%img{ :src =>"/images/splash/separator.gif", :alt =>""}
%span
= numbers[3]
%img{ :src =>"/images/splash/separator.gif", :alt =>""}
%span.dot
\.
%img{ :src =>"/images/splash/separator.gif", :alt =>""}
%span
= numbers[4]
%img{ :src =>"/images/splash/separator.gif", :alt =>""}
%span
= numbers[5]
%img{ :src =>"/images/splash/separator.gif", :alt =>""}
%span
= numbers[6]
%img{ :src =>"/images/splash/separator.gif", :alt =>""}


#container
%ul.features
%li.restfull-api RESTful API
%li.open-source Open Source &amp; Free
%li.platform-agnostic Platform Agnostic
%li.and-more And More ...
%li.restfull-api
%a.active{:href => "#", :title =>"RESTful API", :rel => "content1"}
RESTful API
%li.open-source
%a{:href => "#", :title =>"Open Source &amp; Free", :rel => "content2"}
Open Source &amp; Free
%li.platform-agnostic
%a{:href => "#", :title =>"Platform Agnostic", :rel => "content3"}
Platform Agnostic
%li.and-more
%a{:href => "#", :title =>"And More ...", :rel => "content4"}
And More ...
%li.request-invitation
%a{ :href => "mailto:failtale@mrhenry.be?subject=I%20would%20love%20to%20get%20an%20invitation%20for%20this%20sexy%20developer%20toy!", :title => "Request invitation" }
%a{ :href => "#", :title => "Request invitation", :rel => "content5" }
Request Invitation

%hr

#footer
%ul.links
%li.updates
%a{ :href => "http://twitter.com/failtale", :title => "Updates" }
Updates
%li.report-a-bug
%a{ :href => "http://mrhenry.lighthouseapp.com/projects/24526-failtale/overview", :title => "Report a bug" }
Report a bug
%li.source-code
%a{ :href => "http://github.com/mrhenry/failtale", :title => "Source code" }
Source code
%li.mr-henry
%a{ :href => "http://www.mrhenry.be", :title => "Mr. Henry" }
Mr. Henry

#contentBlock
#content1.contentItem
%p
Alice replied eagerly, for she was always ready to talk about her pet: 'Dinah's our cat. And she's such a capital one for catching mice you can't think! And oh, I wish you could see her after the birds! Why, she'll eat a little bird as soon as look at it!'
%p
This speech caused a remarkable sensation among the party. Some of the birds hurried off at once: one old Magpie began wrapping itself up very carefully, remarking, 'I really must be getting home; the night-air doesn't suit my throat!' and a Canary called out in a trembling voice to its children, 'Come

#content2.contentItem{:style => "display:none;"}
%p
Content2
#content3.contentItem{:style => "display:none;"}
%p
Content3
#content4.contentItem{:style => "display:none;"}
%p
Content4
#content5.contentItem{:style => "display:none;"}
%p
Request your invitation
- form_for InvitationRequest.new, :html => {:class => 'emailForm'} do |f|
%p
= f.text_field :email, :class => 'text long', :value => 'Email'
%span.valid{:style => "display:none;"}
%span.invalid{:style => "display:none;"}
%p
= f.submit "Request invitation", :class => 'button request'

#login{:style => "display:none;"}
- form_for UserSession.new, :url => user_session_path, :html => {:class => 'form'} do |f|
%p
= f.text_field :login, :class => 'text', :value => 'Login'
= f.password_field :password, :class => 'text', :value => 'Password'
= f.submit "Login", :class => 'button'
%p.remember
= f.check_box :remember_me, :class => 'checkbox'
= f.label :remember_me, nil, :class => 'checkbox'


%ul#shots
%li
%img{:src => "/images/splash/screen1.jpg", :alt => "Failtale screenshot"}
%li
%img{:src => "/images/splash/screen2.jpg", :alt => "Failtale screenshot"}
%li
%img{:src => "/images/splash/screen1.jpg", :alt => "Failtale screenshot"}

%a.forkMe{:href => "http://github.com/mrhenry/failtale/", :title => "Fork me on GitHub"}
Fork me on GitHub

#footer
%p
a
%a{:href => "http://www.mrhenry.be", :title => "Mr. Henry"}
%img{:src => "/images/splash/logo_mrhenry.png", :title => "Mr. Henry", :alt => "Mr. Henry"}
webapplication, with love &copy; 2009

= render_shared :google if FAILTALE[:google_analytics]

1 change: 1 addition & 0 deletions app/views/notifier/invitation_request.erb
@@ -0,0 +1 @@
<%=@email%>
2 changes: 1 addition & 1 deletion app/views/shared/_home_assets.html.haml
@@ -1,2 +1,2 @@
= stylesheet_link_tag 'reset.css', 'general.css'
= javascript_include_tag 'jquery-1.3.min.js', 'application.js'
= javascript_include_tag 'jquery-1.3.min.js','jquery.scrollTo-min.js', 'application.js'
2 changes: 1 addition & 1 deletion config/initializers/app.rb
@@ -1,4 +1,4 @@
FAILTALE = {
:allow_registration => false,
:allow_invitations => false
:allow_invitations => true
}
1 change: 1 addition & 0 deletions config/routes.rb
Expand Up @@ -3,6 +3,7 @@
map.resource :user_session, :only => [:new, :show, :create, :destroy]
map.resource :account, :only => [:new, :edit, :create, :update], :controller => 'users'
map.resources :invitations, :only => [:new, :create]
map.resources :invitation_requests, :only => [:new, :create]

map.resource :reports, :only => :create
map.resources :errors, :only => :index
Expand Down
Binary file added public/images/splash/bg-counter.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/bg-counter2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/bg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/bg_login.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/bg_robot.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/bg_robot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/button_request.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/forkme.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/logo_mrhenry.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/screen1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/screen2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/separator.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/splash/sprite_features.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 83 additions & 2 deletions public/javascripts/application.js
@@ -1,5 +1,17 @@
var currentContent ="content1";
var switching = false;

$(document).ready(function() {

//borrowed from jQuery easing plugin
//http://gsgd.co.uk/sandbox/jquery.easing.php
$.easing.easeOutQuad = function(x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
};

/*var email = new LiveValidation('invitation_request_email');
email.add(Validate.Presence);
email.add(Validate.Email);*/

$("#footer .links a").mouseover(function(){
$(this).stop();
$(this).animate( { opacity: 1 }, 200 );
Expand All @@ -14,4 +26,73 @@ $(document).ready(function() {
$("td input[type='checkbox']").attr('checked', $('#selectAll').is(':checked'));
}
)
});

$("ul.features a,#header ul li.request a").each(function(){
$(this).attr("href","javascript:;");
});

$("ul.features a").click(function(){
switchContent(this);
}
);

$("#header ul li.login a").toggle(
function(){
$("#header ul li.login a").html("Hide");
$("#header ul li.request").hide();
$("#login").fadeIn(1000);
},
function(){
$("#header ul li.login a").html("Login");
$("#header ul li.request").show();
$("#login").fadeOut(500);

}
);

$("#header ul li.request a").click(function(){
switchContent(this);
$.scrollTo( $("#container"), 1500,{easing:'easeOutQuad'});
});

$("form.emailForm").submit(function(){
var email = $("#invitation_request_email").attr("value");
var authentity = $("input[name='authenticity_token']").attr("value");
$("span.valid").hide();
$("span.invalid").hide();
if(validateEmail(email)){
$.post("/invitation_requests.js",{ "invitation_request[email]": email, authenticity_token: authentity }, function(data){
$("span.valid").html("Thank you for your request. You will receive an e-mail very soon!");
$("span.valid").attr("style","display:block;");
});
}else{
$("span.invalid").html("Please enter a valid e-mail address.");
$("span.invalid").attr("style","display:block;");
}
return false;
});
});



function switchContent(sender){
var contentBlock = $(sender).attr("rel");
if(!switching && contentBlock!=currentContent){
switching = true;
$("ul.features a").removeClass("active");
$("#"+currentContent).fadeOut(500,function(){
$("#"+contentBlock).fadeIn(1000,function(){
switching = false;
});
});
$("a[rel='"+contentBlock+"']").addClass("active");
currentContent = contentBlock;
}
}
function validateEmail(address) {
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if(reg.test(address) == false) {
return false;
}
return true;
}
11 changes: 11 additions & 0 deletions public/javascripts/jquery.scrollTo-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 412b55f

Please sign in to comment.