Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:ftorghele/swap_io into active_admin
Conflicts: db/schema.rb
- Loading branch information
Showing
44 changed files
with
960 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,4 @@ | |
// | ||
//= require jquery | ||
//= require jquery_ujs | ||
//= require twitter/bootstrap | ||
//= require_tree . |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,37 @@ | ||
// Place all the styles related to the pages controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: http://sass-lang.com/ | ||
@import "bootstrap.css.scss"; | ||
|
||
.with-margin { | ||
margin: 10px 0; | ||
} | ||
|
||
#welcome-page { | ||
|
||
#logo { | ||
margin: 0 auto; | ||
width: 450px; | ||
height: 343px; | ||
} | ||
|
||
#newsletter-box { | ||
form { | ||
@extend .well; | ||
@extend .form-inline; | ||
#newsletter-center { | ||
margin: 5px auto; | ||
width: 500px; | ||
} | ||
} | ||
.submit_btn { | ||
@extend .btn-success; | ||
} | ||
|
||
.help-inline { | ||
text-align:center; | ||
width: 500px; | ||
margin: 10px auto 0 auto; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.copyright { | ||
text-align: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class NewsletterSubscribersController < ApplicationController | ||
|
||
require 'hash' | ||
|
||
def create | ||
email = params[:newsletter_subscriber][:email] | ||
|
||
@subscriber = NewsletterSubscriber.new(:email => email, :signout_hash => Hash.create_token(email) ) | ||
|
||
if @subscriber.valid? | ||
@subscriber.save! | ||
flash[:info] = I18n.t('newsletter_subscriber.create.success') | ||
redirect_to welcome_path | ||
|
||
else | ||
flash[:error] = I18n.t('newsletter_subscriber.create.fail') | ||
render 'pages/welcome', :layout => 'welcome' | ||
end | ||
end | ||
|
||
def unsubscribe | ||
if NewsletterSubscriber.unsubscribe(params[:token]) | ||
flash[:info] = I18n.t('newsletter_subscriber.unsubscribe.success') | ||
redirect_to 'home' | ||
else | ||
flash[:error] = I18n.t('newsletter_subscriber.unsubscribe.fail') | ||
redirect_to 'home' | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
class PagesController < ApplicationController | ||
def overview | ||
render :home unless signed_in? and return | ||
|
||
redirect_to :welcome unless signed_in? and return | ||
|
||
end | ||
|
||
def welcome | ||
@subscriber = NewsletterSubscriber.new | ||
render :layout => 'welcome' | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module NewsletterSubscribersHelper | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class NewsletterSubscriber < ActiveRecord::Base | ||
|
||
validates_presence_of :email, :signout_hash | ||
validates :email, :presence => true, :email => true | ||
validates_uniqueness_of :email | ||
|
||
def self.unsubscribe(token) | ||
subscriber = self.find_by_signout_hash(token) | ||
subscriber.destroy | ||
end | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
!!! 5 | ||
%html{:lang => "de"} | ||
%head | ||
%meta{:charset => "utf-8"}/ | ||
%title= content_for?(:title) ? yield(:title) : I18n.t('app.headline') | ||
= stylesheet_link_tag :application | ||
= csrf_meta_tags | ||
/[if lt IE 9] | ||
= javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js" | ||
%body | ||
.container | ||
.content | ||
.row | ||
.span12 | ||
.pull-right.with-margin | ||
= link_to I18n.t('app.sign_up_link'), new_user_registration_path, :class => 'btn' | ||
= link_to I18n.t('app.sign_in_link'), new_user_session_path, :class => 'btn' | ||
= link_to I18n.t('app.sign_in_with_link', :provider => "Facebook"), user_omniauth_authorize_path(:facebook), :class => 'btn' | ||
|
||
.row | ||
.span12 | ||
- flash.each do |name, msg| | ||
= content_tag :div, msg, :class => "alert alert-#{name}" if msg.is_a?(String) | ||
.row | ||
.span12 | ||
= yield | ||
|
||
= render('layouts/footer') | ||
|
||
= javascript_include_tag :application |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#welcome-page | ||
#logo | ||
= image_tag 'logo.jpg' | ||
|
||
#newsletter-box | ||
=form_for @subscriber do |f| | ||
#newsletter-center | ||
= f.label :email, I18n.t('pages.welcome.newsletter_sign_up_label'), :class => 'control-label' | ||
%span.control-group{ :class => form_status(@subscriber, :email) } | ||
= f.email_field :email, :placeholder=> I18n.t('pages.welcome.newsletter_sign_up_placeholder') | ||
= submit_tag I18n.t('pages.welcome.newsletter_sign_up_button'), :class => "submit_btn" | ||
- if @subscriber.errors.any? | ||
%span.help-inline= form_status_msg(@subscriber, :email) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.