Skip to content

Commit

Permalink
Merge pull request #6 from acrogenesis/master
Browse files Browse the repository at this point in the history
Allow sites to be removed
  • Loading branch information
romainbutteaud committed Apr 5, 2015
2 parents 4ee5b9e + 203b3f5 commit ddf0236
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 114 deletions.
9 changes: 6 additions & 3 deletions Gemfile
@@ -1,8 +1,11 @@
source 'https://rubygems.org'
source 'https://rails-assets.org' do
gem 'rails-assets-css-modal'
end

ruby '2.1.2'
ruby '2.2.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.0'
gem 'rails', '4.1.9'
gem 'rake'
# Use sqlite3 as the database for Active Record
gem 'pg'
Expand Down Expand Up @@ -42,4 +45,4 @@ gem 'quiet_assets', :group => :development
gem 'rails_12factor', :group => :production
gem 'font-awesome-rails'
gem 'figaro'
gem 'typhoeus'
gem 'typhoeus'
140 changes: 68 additions & 72 deletions Gemfile.lock
@@ -1,27 +1,28 @@
GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
specs:
actionmailer (4.1.0)
actionpack (= 4.1.0)
actionview (= 4.1.0)
mail (~> 2.5.4)
actionpack (4.1.0)
actionview (= 4.1.0)
activesupport (= 4.1.0)
actionmailer (4.1.9)
actionpack (= 4.1.9)
actionview (= 4.1.9)
mail (~> 2.5, >= 2.5.4)
actionpack (4.1.9)
actionview (= 4.1.9)
activesupport (= 4.1.9)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
actionview (4.1.0)
activesupport (= 4.1.0)
actionview (4.1.9)
activesupport (= 4.1.9)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.0)
activesupport (= 4.1.0)
activemodel (4.1.9)
activesupport (= 4.1.9)
builder (~> 3.1)
activerecord (4.1.0)
activemodel (= 4.1.0)
activesupport (= 4.1.0)
activerecord (4.1.9)
activemodel (= 4.1.9)
activesupport (= 4.1.9)
arel (~> 5.0.0)
activesupport (4.1.0)
activesupport (4.1.9)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
Expand All @@ -32,97 +33,91 @@ GEM
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.2.0)
coffee-script (2.3.0)
coffee-script-source
execjs
coffee-script-source (1.7.0)
coffee-script-source (1.9.1)
erubis (2.7.0)
ethon (0.7.1)
ethon (0.7.2)
ffi (>= 1.3.0)
execjs (2.0.2)
execjs (2.3.0)
ffi (1.9.6)
figaro (0.7.0)
bundler (~> 1.0)
rails (>= 3, < 5)
font-awesome-rails (4.0.3.1)
figaro (1.1.0)
thor (~> 0.14)
font-awesome-rails (4.3.0.0)
railties (>= 3.2, < 5.0)
hike (1.2.3)
i18n (0.6.9)
jbuilder (2.0.6)
i18n (0.7.0)
jbuilder (2.2.7)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
jquery-rails (3.1.0)
jquery-rails (3.1.2)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
minitest (5.3.3)
multi_json (1.9.2)
pg (0.17.1)
polyglot (0.3.4)
quiet_assets (1.0.2)
json (1.8.2)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mime-types (2.4.3)
minitest (5.5.1)
multi_json (1.10.1)
pg (0.18.1)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.5.2)
rack-test (0.6.2)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.1.0)
actionmailer (= 4.1.0)
actionpack (= 4.1.0)
actionview (= 4.1.0)
activemodel (= 4.1.0)
activerecord (= 4.1.0)
activesupport (= 4.1.0)
rails (4.1.9)
actionmailer (= 4.1.9)
actionpack (= 4.1.9)
actionview (= 4.1.9)
activemodel (= 4.1.9)
activerecord (= 4.1.9)
activesupport (= 4.1.9)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.0)
railties (= 4.1.9)
sprockets-rails (~> 2.0)
rails_12factor (0.0.2)
rails-assets-css-modal (1.3.0)
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.2)
rails_serve_static_assets (0.0.4)
rails_stdout_logging (0.0.3)
railties (4.1.0)
actionpack (= 4.1.0)
activesupport (= 4.1.0)
railties (4.1.9)
actionpack (= 4.1.9)
activesupport (= 4.1.9)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.2.2)
rdoc (4.1.1)
json (~> 1.4)
rake (10.4.2)
rdoc (4.2.0)
sass (3.2.19)
sass-rails (4.0.3)
sass-rails (4.0.5)
railties (>= 4.0.0, < 5.0)
sass (~> 3.2.0)
sprockets (~> 2.8, <= 2.11.0)
sass (~> 3.2.2)
sprockets (~> 2.8, < 3.0)
sprockets-rails (~> 2.0)
sdoc (0.4.0)
json (~> 1.8)
rdoc (~> 4.0, < 5.0)
spring (1.1.2)
sprockets (2.11.0)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
spring (1.3.2)
sprockets (2.12.3)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.1.3)
sprockets-rails (2.2.4)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
sprockets (>= 2.8, < 4.0)
thor (0.19.1)
thread_safe (0.3.3)
thread_safe (0.3.4)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.2.2)
turbolinks (2.5.3)
coffee-rails
typhoeus (0.6.9)
typhoeus (0.7.1)
ethon (>= 0.7.1)
tzinfo (1.1.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.5.0)
uglifier (2.7.0)
execjs (>= 0.3.0)
json (>= 1.8.0)

Expand All @@ -137,7 +132,8 @@ DEPENDENCIES
jquery-rails
pg
quiet_assets
rails (= 4.1.0)
rails (= 4.1.9)
rails-assets-css-modal!
rails_12factor
rake
sass-rails (~> 4.0.3)
Expand Down
40 changes: 40 additions & 0 deletions app/assets/javascripts/home.js.coffee
Expand Up @@ -3,6 +3,46 @@
# You can use CoffeeScript in this file: http://coffeescript.org/

jQuery ->
$(document).on('click', '#unregister', ( ->
$('.info').hide()
regex = /^[a-zA-Z0-9\-]+$/
name = $('#unregister-input').val().toLowerCase().trim();
if name.length > 30
ga('send', 'event', 'Error', 'Name', name)
$('#failure-name').fadeIn()
$('#unregister-input').addClass('regex-error')
else if !regex.test(name)
ga('send', 'event', 'Error', 'Name', name)
$('#failure-regex').fadeIn()
$('#unregister-input').addClass('regex-error')
else
$('#loader').show()
$('#unregister-input').removeClass('regex-error')
ga('send', 'event', 'Unregister', 'Name', name)
$.ajax '/decaf/',
type: 'POST'
data:
name: name
'_method': 'delete'
error: (jqXHR) ->
$('#loader').fadeOut()
$('#failure').fadeIn()
ga('send', 'event', 'Unregister', 'Error')
success: (data, textStatus, jqXHR) ->
$('#loader').fadeOut()
if jqXHR.status == 201
$('#already-removed').fadeIn()
else
$('#success-removed').fadeIn()
new_count = $('#count').data('count') - 1
$('#count').data('count', new_count)
$('#count').fadeOut(500).fadeIn(500, ->
$('#count').html(new_count)
$('#count').addClass('count-change')
)
ga('send', 'event', 'Unregister', 'Success')
))

$(document).on('click', '#register', ( ->
$('.info').hide()
regex = /^[a-zA-Z0-9\-]+$/
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.css.scss
Expand Up @@ -16,3 +16,4 @@
*/

@import "font-awesome";
@import "css-modal/modal";
73 changes: 39 additions & 34 deletions app/assets/stylesheets/home.css.scss
Expand Up @@ -47,7 +47,7 @@ a:visited {}
font-weight: 600;
}

#url {
.url {
font-weight: 200;
margin-top:30px;
font-size:2em;
Expand All @@ -73,48 +73,53 @@ a:visited {}
}
}

#register:active {
margin-bottom: -1px;
padding-top: 15px;
}

#register {
margin-top: 30px;
padding: 14px 26px;
.button {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
-moz-transition: background .1s ease-in-out;
-ms-transition: background .1s ease-in-out;
-o-transition: background .1s ease-in-out;
-webkit-transition: background .1s ease-in-out;
transition: background .1s ease-in-out;
background-color: #3fb8e8;
box-shadow: 0 3px 0 0 #3293ba;
color: #fff;
cursor: pointer;
display: inline-block;
font-size: 16px;
line-height: 100%;
display:inline-block;
cursor: pointer;
color: #fff;
margin-top: 30px;
outline: 0 none;
padding: 14px 26px;
text-decoration: none;

transition: background 0.1s ease-in-out;
-webkit-transition: background 0.1s ease-in-out;
-moz-transition: background 0.1s ease-in-out;
-ms-transition: background 0.1s ease-in-out;
-o-transition: background 0.1s ease-in-out;
&:hover {
background-color: #1baae3;
}

-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
&:active {
box-shadow: 0 1px 0 0 #3293ba;
}
}

#register:active {
padding-top: 15px;
margin-bottom: -1px;
}
.alert {
background-color: #ff3e15;
box-shadow: 0 3px 0 0 #a41d00;

#register, #register:hover, #register:active {
outline: 0 none;
text-decoration: none;
}
&:hover {
background-color: #eb2900;
}

.button {
background-color: #3fb8e8;
box-shadow: 0px 3px 0px 0px #3293ba;
}
.button:hover {
background-color: #1baae3;
}
.button:active {
box-shadow: 0px 1px 0px 0px #3293ba;
&:active {
box-shadow: 0 1px 0 0 #a41d00;
}
}

#information {
height:60px;
margin-top:30px;
Expand Down Expand Up @@ -157,4 +162,4 @@ a:visited {}
}
}
}
}
}

0 comments on commit ddf0236

Please sign in to comment.