Permalink
Browse files

Finished at last

  • Loading branch information...
1 parent 9cc14cf commit b57cfbf020b42b3a24dea4b68a12501299bcdd52 @ddemaree committed Nov 5, 2011
View
@@ -8,6 +8,8 @@ gem 'sprockets', '~> 2.0'
gem 'sass', '~> 3.1'
gem 'coffee-script'
+# gem 'primer', :path => '../primer'
+
group :development do
gem 'heroku'
gem 'shotgun'
@@ -17,6 +19,9 @@ group :development, :test do
gem 'sqlite3'
gem 'rspec'
gem 'rack-test', "~> 0.5.7"
+ gem 'capybara'
+ gem 'database_cleaner'
+ gem 'factory_girl'
end
group :production do
View
@@ -15,26 +15,41 @@ GEM
addressable (2.2.6)
arel (2.2.1)
builder (3.0.0)
+ capybara (1.0.1)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 2.0)
+ xpath (~> 0.1.4)
+ childprocess (0.2.2)
+ ffi (~> 1.0.6)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.2)
daemons (1.1.4)
+ database_cleaner (0.6.7)
diff-lcs (1.1.3)
eventmachine (0.12.10)
execjs (1.2.9)
multi_json (~> 1.0)
+ factory_girl (2.2.0)
+ activesupport
+ ffi (1.0.9)
heroku (2.11.0)
launchy (>= 0.3.2)
rest-client (~> 1.6.1)
rubyzip
term-ansicolor (~> 1.0.5)
hike (1.2.1)
i18n (0.6.0)
+ json_pure (1.6.1)
launchy (2.0.5)
addressable (~> 2.2.6)
mime-types (1.17.2)
multi_json (1.0.3)
+ nokogiri (1.5.0)
pg (0.11.0)
rack (1.3.5)
rack-protection (1.1.4)
@@ -53,6 +68,11 @@ GEM
rspec-mocks (2.7.0)
rubyzip (0.9.4)
sass (3.1.10)
+ selenium-webdriver (2.5.0)
+ childprocess (>= 0.2.1)
+ ffi (>= 1.0.7)
+ json_pure
+ rubyzip
shotgun (0.9)
rack (>= 1.0)
sinatra (1.3.1)
@@ -71,14 +91,19 @@ GEM
rack (>= 1.0.0)
tilt (1.3.3)
tzinfo (0.3.30)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
activerecord (~> 3.1)
activesupport (~> 3.1)
+ capybara
coffee-script
+ database_cleaner
+ factory_girl
heroku
pg
rack-test (~> 0.5.7)
View
@@ -2,11 +2,37 @@ task :environment do
require File.expand_path( "../config/environment", __FILE__ )
end
-# require 'rspec/core/rake_task'
-# RSpec::Core::RakeTask.new
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new
task :default => [:spec]
+namespace :assets do
+ def precompiled_assets
+ [].tap do |arr|
+ arr.concat Dir[File.join(APP_ROOT, "assets", "images", "*")].map { |f| File.basename(f) }
+ arr << "thirty_one.css"
+ arr << "application.js"
+ end
+ end
+
+ task :precompile => :environment do
+ target = File.join(APP_ROOT, "public", "assets")
+
+ @_env = ThirtyOne.sprockets_environment
+ @_env.each_logical_path do |logical_path|
+ next unless precompiled_assets.include?(logical_path)
+ if asset = @_env.find_asset(logical_path)
+ puts "Precompile #{logical_path}"
+ filename = File.join(target, asset.digest_path)
+ FileUtils.mkdir_p File.dirname(filename)
+ asset.write_to(filename)
+ # asset.write_to("#{filename}.gz") if filename.to_s =~ /\.(css|js)$/
+ end
+ end
+ end
+end
+
namespace :db do
desc "Migrate the database"
task :migrate => [:environment] do
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -3,36 +3,4 @@
#= require jquery-tmpl
#= require knockout
#= require_self
-#= require_tree
-
-$ ->
- # Get all the bits
- bitsJson = $('#bits_json').html()
- window.Bits = JSON.parse(bitsJson)
-
- # Get party bits data and make a party
- partyJson = $('#party_json').html()
- viewModel = new Party(JSON.parse(partyJson))
-
- $('label').each (i, label)->
- label = $(this)
- checkbox = $(this).find('input[type=checkbox]')
- checkbox.click (e)->
- console.log('Checkbox clicked')
-
- checkboxValue = checkbox.attr('value')
-
- link = $('<a href="#" class="label-trigger" />')
- link.data('bit', checkboxValue)
- link.attr('data-bind', "css: {'ko-enabled':true, 'checked':bitSelected('#{checkboxValue}')}")
- link.click (e)->
- console.log('Link clicked')
- e.preventDefault()
- e.stopPropagation()
- # checkbox.click()
- viewModel.toggleBit(checkboxValue)
-
- # label.wrap(link)
-
- # Bind the UI
- ko.applyBindings(viewModel)
+#= require_tree ./components
@@ -0,0 +1,74 @@
+window.PartyView =
+ init: ()->
+ # Get all the bits
+ bitsJson = $('#bits_json').html()
+ window.Bits = JSON.parse(bitsJson)
+
+ # Get party bits data and make a party
+ partyJson = $('#party_json').html()
+ viewModel = new Party(JSON.parse(partyJson))
+
+ $('label').each (i, label)->
+ label = $(this)
+ checkbox = $(this).find('input[type=checkbox]')
+ checkbox.click (e)->
+ console.log('Checkbox clicked')
+
+ checkboxValue = checkbox.attr('value')
+
+ link = $('<a href="#" class="label-trigger" />')
+ link.data('bit', checkboxValue)
+ link.attr('data-bind', "css: {'ko-enabled':true, 'checked':bitSelected('#{checkboxValue}')}")
+ link.click (e)->
+ console.log('Link clicked')
+ e.preventDefault()
+ e.stopPropagation()
+ # checkbox.click()
+ viewModel.toggleBit(checkboxValue)
+
+ # label.wrap(link)
+
+ # Bind the UI
+ ko.applyBindings(viewModel)
+
+class window.Party
+ constructor: (bits) ->
+ @bits = ko.observableArray(bits)
+
+ toggleAll: (namespace) ->
+ nsBits = window.Bits[namespace]
+ if @bitsInNamespace(namespace).length == nsBits.length
+ for bitPath in nsBits
+ do (bitPath) =>
+ index = @bits().indexOf(bitPath)
+ @bits.splice(index, 1)
+ else
+ for bitPath in nsBits
+ do (bitPath) =>
+ unless @bits().indexOf(bitPath) > -1
+ @bits.push(bitPath);
+
+ toggleLabel: (ns) ->
+ nsBits = window.Bits[ns]
+ if @bitsInNamespace(ns).length == nsBits.length
+ "Uncheck all"
+ else
+ "Select all"
+
+ bitSelected: (bit)->
+ @bits().indexOf(bit) > -1
+
+ toggleBit: (bit)->
+ console.log('Bit toggled')
+ if (idx = @bits().indexOf(bit)) > -1
+ @bits.splice(idx, 1)
+ else
+ @bits.push(bit)
+
+ bitsInNamespace: (ns) ->
+ @bits().filter (bit)->
+ return bit.match('^'+ns)
+
+ hasNamespace: (ns) ->
+ @bits().some (bit) ->
+ return bit.match('^'+ns)
@@ -1,41 +0,0 @@
-class window.Party
- constructor: (bits) ->
- @bits = ko.observableArray(bits)
-
- toggleAll: (namespace) ->
- nsBits = window.Bits[namespace]
- if @bitsInNamespace(namespace).length == nsBits.length
- for bitPath in nsBits
- do (bitPath) =>
- index = @bits().indexOf(bitPath)
- @bits.splice(index, 1)
- else
- for bitPath in nsBits
- do (bitPath) =>
- unless @bits().indexOf(bitPath) > -1
- @bits.push(bitPath);
-
- toggleLabel: (ns) ->
- nsBits = window.Bits[ns]
- if @bitsInNamespace(ns).length == nsBits.length
- "Uncheck all"
- else
- "Select all"
-
- bitSelected: (bit)->
- @bits().indexOf(bit) > -1
-
- toggleBit: (bit)->
- console.log('Bit toggled')
- if (idx = @bits().indexOf(bit)) > -1
- @bits.splice(idx, 1)
- else
- @bits.push(bit)
-
- bitsInNamespace: (ns) ->
- @bits().filter (bit)->
- return bit.match('^'+ns)
-
- hasNamespace: (ns) ->
- @bits().some (bit) ->
- return bit.match('^'+ns)
@@ -0,0 +1,5 @@
+.thanks {
+ .party-info {
+
+ }
+}
@@ -94,10 +94,10 @@ em {
}
:-moz-placeholder {
- color: lighten(#000, 75%);
+ color: lighten(#000, 85%);
}
::-webkit-input-placeholder {
- color: lighten(#000, 75%);
+ color: lighten(#000, 85%);
}
Oops, something went wrong.

0 comments on commit b57cfbf

Please sign in to comment.