mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 16:31:38 -04:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
517950c42c |
@@ -10,5 +10,3 @@ public/extjs
|
||||
public/assets
|
||||
public/images/icons
|
||||
config/database.yml
|
||||
vendor/
|
||||
.sass-cache/
|
||||
+1
-1
@@ -1 +1 @@
|
||||
2.1.1
|
||||
ruby-1.9.3-p374
|
||||
|
||||
@@ -1,50 +1,51 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'rails', '3.2.19'
|
||||
gem 'rails', '3.2.13'
|
||||
|
||||
gem 'netzke-cancan'
|
||||
gem 'netzke-core'
|
||||
gem 'netzke-basepack'
|
||||
gem 'netzke-core', '~>0.8.0'
|
||||
gem 'netzke-basepack', '~>0.8.0'
|
||||
|
||||
|
||||
gem 'acts_as_loggable', :git => 'https://github.com/spacemunkay/acts_as_loggable.git'
|
||||
gem 'bootstrap-will_paginate'
|
||||
gem 'bootstrap-will_paginate', '~> 0.0.6'
|
||||
gem 'cancan'
|
||||
gem 'decent_exposure', '~> 1.0.1'
|
||||
gem 'devise', '~> 2.0.4'
|
||||
gem 'haml-rails'
|
||||
gem 'jquery-rails'
|
||||
gem 'haml-rails', '~> 0.3.4'
|
||||
gem 'jquery-rails', '~> 2.0'
|
||||
gem 'pg', '~> 0.17.1'
|
||||
gem 'will_paginate'
|
||||
gem 'jbuilder'
|
||||
gem 'will_paginate', '~> 3.0.3'
|
||||
gem 'jbuilder', '~> 2.0.3'
|
||||
|
||||
# Gems used only for assets and not required
|
||||
# in production environments by default.
|
||||
group :assets do
|
||||
gem 'coffee-rails'
|
||||
gem 'sprockets-rails', '=2.0.0.backport1'
|
||||
gem 'sprockets', '=2.2.2.backport2'
|
||||
gem 'sass-rails', github: 'guilleiguaran/sass-rails', branch: 'backport'
|
||||
gem 'bootstrap-sass'
|
||||
gem 'uglifier'
|
||||
gem 'coffee-rails', '~> 3.2.1'
|
||||
gem "twitter-bootstrap-rails", "~> 2.0.3"
|
||||
|
||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||
# gem 'therubyracer'
|
||||
|
||||
gem 'uglifier', '>= 1.0.3'
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
gem 'rspec-rails'
|
||||
gem 'factory_girl_rails'
|
||||
gem 'pry'
|
||||
gem 'faker'
|
||||
gem 'rspec-rails', '~> 2.14.0'
|
||||
gem 'factory_girl_rails', '~> 1.2'
|
||||
gem 'pry', '~> 0.9.8'
|
||||
gem 'faker', '~> 1.2.0'
|
||||
end
|
||||
|
||||
group :test do
|
||||
# gem 'shoulda-matchers', '~> 1.0.0'
|
||||
gem 'shoulda-matchers', '~> 1.0.0'
|
||||
gem 'capybara', '~> 2.2.1'
|
||||
gem 'poltergeist', '~> 1.5.0'
|
||||
gem 'database_cleaner', '~> 1.2.0'
|
||||
gem 'launchy', '~> 2.4.2'
|
||||
gem 'spork'
|
||||
gem 'spork', '~> 0.9.2'
|
||||
#guard dependency for Mac OS 10
|
||||
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
|
||||
gem 'guard-spork'
|
||||
gem 'guard-rspec'
|
||||
gem 'guard-spork', '~> 1.5.1'
|
||||
gem 'guard-rspec', '~> 4.2.6'
|
||||
end
|
||||
|
||||
+120
-131
@@ -1,13 +1,3 @@
|
||||
GIT
|
||||
remote: git://github.com/guilleiguaran/sass-rails.git
|
||||
revision: 0393d9e1a6e4a776e61f16fb75f97971b9f4abd2
|
||||
branch: backport
|
||||
specs:
|
||||
sass-rails (4.0.1)
|
||||
railties (>= 3.2.0, < 5.0)
|
||||
sass (>= 3.2.0)
|
||||
sprockets-rails (~> 2.0.0.backport1)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/spacemunkay/acts_as_loggable.git
|
||||
revision: 8484dc1f7a58699705c5ffb593ebdf700a9f374a
|
||||
@@ -19,12 +9,12 @@ GIT
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
actionmailer (3.2.19)
|
||||
actionpack (= 3.2.19)
|
||||
mail (~> 2.5.4)
|
||||
actionpack (3.2.19)
|
||||
activemodel (= 3.2.19)
|
||||
activesupport (= 3.2.19)
|
||||
actionmailer (3.2.13)
|
||||
actionpack (= 3.2.13)
|
||||
mail (~> 2.5.3)
|
||||
actionpack (3.2.13)
|
||||
activemodel (= 3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
builder (~> 3.0.0)
|
||||
erubis (~> 2.7.0)
|
||||
journey (~> 1.0.4)
|
||||
@@ -32,27 +22,23 @@ GEM
|
||||
rack-cache (~> 1.2)
|
||||
rack-test (~> 0.6.1)
|
||||
sprockets (~> 2.2.1)
|
||||
activemodel (3.2.19)
|
||||
activesupport (= 3.2.19)
|
||||
activemodel (3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
builder (~> 3.0.0)
|
||||
activerecord (3.2.19)
|
||||
activemodel (= 3.2.19)
|
||||
activesupport (= 3.2.19)
|
||||
activerecord (3.2.13)
|
||||
activemodel (= 3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
arel (~> 3.0.2)
|
||||
tzinfo (~> 0.3.29)
|
||||
activeresource (3.2.19)
|
||||
activemodel (= 3.2.19)
|
||||
activesupport (= 3.2.19)
|
||||
activesupport (3.2.19)
|
||||
i18n (~> 0.6, >= 0.6.4)
|
||||
activeresource (3.2.13)
|
||||
activemodel (= 3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
activesupport (3.2.13)
|
||||
i18n (= 0.6.1)
|
||||
multi_json (~> 1.0)
|
||||
addressable (2.3.6)
|
||||
addressable (2.3.5)
|
||||
arel (3.0.3)
|
||||
bcrypt (3.1.7)
|
||||
bcrypt-ruby (3.1.5)
|
||||
bcrypt (>= 3.1.3)
|
||||
bootstrap-sass (3.2.0.1)
|
||||
sass (~> 3.2)
|
||||
bcrypt-ruby (3.1.2)
|
||||
bootstrap-will_paginate (0.0.10)
|
||||
will_paginate
|
||||
builder (3.0.4)
|
||||
@@ -65,17 +51,18 @@ GEM
|
||||
xpath (~> 2.0)
|
||||
celluloid (0.15.2)
|
||||
timers (~> 1.1.0)
|
||||
childprocess (0.5.3)
|
||||
childprocess (0.4.0)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
cliver (0.3.2)
|
||||
coderay (1.1.0)
|
||||
coffee-rails (3.2.2)
|
||||
coffee-script (>= 2.2.0)
|
||||
railties (~> 3.2.0)
|
||||
coffee-script (2.3.0)
|
||||
coffee-script (2.2.0)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.7.1)
|
||||
coffee-script-source (1.7.0)
|
||||
commonjs (0.2.7)
|
||||
database_cleaner (1.2.0)
|
||||
decent_exposure (1.0.2)
|
||||
devise (2.0.6)
|
||||
@@ -85,156 +72,160 @@ GEM
|
||||
warden (~> 1.1.1)
|
||||
diff-lcs (1.2.5)
|
||||
erubis (2.7.0)
|
||||
execjs (2.2.1)
|
||||
factory_girl (4.4.0)
|
||||
activesupport (>= 3.0.0)
|
||||
factory_girl_rails (4.4.1)
|
||||
factory_girl (~> 4.4.0)
|
||||
execjs (2.0.2)
|
||||
factory_girl (2.6.4)
|
||||
activesupport (>= 2.3.9)
|
||||
factory_girl_rails (1.7.0)
|
||||
factory_girl (~> 2.6.0)
|
||||
railties (>= 3.0.0)
|
||||
faker (1.4.3)
|
||||
faker (1.2.0)
|
||||
i18n (~> 0.5)
|
||||
ffi (1.9.3)
|
||||
formatador (0.2.5)
|
||||
guard (2.6.1)
|
||||
formatador (0.2.4)
|
||||
guard (2.4.0)
|
||||
formatador (>= 0.2.4)
|
||||
listen (~> 2.7)
|
||||
listen (~> 2.1)
|
||||
lumberjack (~> 1.0)
|
||||
pry (>= 0.9.12)
|
||||
thor (>= 0.18.1)
|
||||
guard-rspec (4.3.1)
|
||||
guard-rspec (4.2.6)
|
||||
guard (~> 2.1)
|
||||
rspec (>= 2.14, < 4.0)
|
||||
guard-spork (1.5.1)
|
||||
childprocess (>= 0.2.3)
|
||||
guard (>= 1.1)
|
||||
spork (>= 0.8.4)
|
||||
haml (4.0.5)
|
||||
tilt
|
||||
haml-rails (0.4)
|
||||
haml (3.1.8)
|
||||
haml-rails (0.3.5)
|
||||
actionpack (>= 3.1, < 4.1)
|
||||
activesupport (>= 3.1, < 4.1)
|
||||
haml (>= 3.1, < 4.1)
|
||||
haml (~> 3.1)
|
||||
railties (>= 3.1, < 4.1)
|
||||
hike (1.2.3)
|
||||
i18n (0.6.11)
|
||||
jbuilder (2.1.3)
|
||||
activesupport (>= 3.0.0, < 5)
|
||||
multi_json (~> 1.2)
|
||||
i18n (0.6.1)
|
||||
jbuilder (2.0.3)
|
||||
activesupport (>= 3.0.0)
|
||||
multi_json (>= 1.2.0)
|
||||
journey (1.0.4)
|
||||
jquery-rails (3.1.1)
|
||||
jquery-rails (2.3.0)
|
||||
railties (>= 3.0, < 5.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
json (1.8.1)
|
||||
launchy (2.4.2)
|
||||
addressable (~> 2.3)
|
||||
listen (2.7.9)
|
||||
less (2.2.2)
|
||||
commonjs (~> 0.2.6)
|
||||
less-rails (2.2.6)
|
||||
actionpack (>= 3.1)
|
||||
less (~> 2.2.0)
|
||||
libv8 (3.3.10.4)
|
||||
listen (2.4.1)
|
||||
celluloid (>= 0.15.2)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
lumberjack (1.0.9)
|
||||
lumberjack (1.0.4)
|
||||
mail (2.5.4)
|
||||
mime-types (~> 1.16)
|
||||
treetop (~> 1.4.8)
|
||||
method_source (0.8.2)
|
||||
mime-types (1.25.1)
|
||||
mini_portile (0.6.0)
|
||||
multi_json (1.10.1)
|
||||
netzke-basepack (0.10.1)
|
||||
netzke-core (~> 0.10.0)
|
||||
mini_portile (0.5.2)
|
||||
multi_json (1.8.4)
|
||||
netzke-basepack (0.8.4)
|
||||
netzke-core (~> 0.8.2)
|
||||
netzke-cancan (0.8.2)
|
||||
cancan
|
||||
netzke-core
|
||||
netzke-core (0.10.1)
|
||||
netzke-core (0.8.4)
|
||||
execjs
|
||||
uglifier
|
||||
nokogiri (1.6.3.1)
|
||||
mini_portile (= 0.6.0)
|
||||
nokogiri (1.6.1)
|
||||
mini_portile (~> 0.5.0)
|
||||
orm_adapter (0.0.7)
|
||||
pg (0.17.1)
|
||||
poltergeist (1.5.1)
|
||||
poltergeist (1.5.0)
|
||||
capybara (~> 2.1)
|
||||
cliver (~> 0.3.1)
|
||||
multi_json (~> 1.0)
|
||||
websocket-driver (>= 0.2.0)
|
||||
polyglot (0.3.5)
|
||||
pry (0.10.1)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.8.1)
|
||||
polyglot (0.3.3)
|
||||
pry (0.9.12.6)
|
||||
coderay (~> 1.0)
|
||||
method_source (~> 0.8)
|
||||
slop (~> 3.4)
|
||||
rack (1.4.5)
|
||||
rack-cache (1.2)
|
||||
rack (>= 0.4)
|
||||
rack-ssl (1.3.4)
|
||||
rack-ssl (1.3.3)
|
||||
rack
|
||||
rack-test (0.6.2)
|
||||
rack (>= 1.0)
|
||||
rails (3.2.19)
|
||||
actionmailer (= 3.2.19)
|
||||
actionpack (= 3.2.19)
|
||||
activerecord (= 3.2.19)
|
||||
activeresource (= 3.2.19)
|
||||
activesupport (= 3.2.19)
|
||||
rails (3.2.13)
|
||||
actionmailer (= 3.2.13)
|
||||
actionpack (= 3.2.13)
|
||||
activerecord (= 3.2.13)
|
||||
activeresource (= 3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
bundler (~> 1.0)
|
||||
railties (= 3.2.19)
|
||||
railties (3.2.19)
|
||||
actionpack (= 3.2.19)
|
||||
activesupport (= 3.2.19)
|
||||
railties (= 3.2.13)
|
||||
railties (3.2.13)
|
||||
actionpack (= 3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
rack-ssl (~> 1.3.2)
|
||||
rake (>= 0.8.7)
|
||||
rdoc (~> 3.4)
|
||||
thor (>= 0.14.6, < 2.0)
|
||||
rake (10.3.2)
|
||||
rake (10.1.1)
|
||||
rb-fsevent (0.9.4)
|
||||
rb-inotify (0.9.5)
|
||||
rb-inotify (0.9.3)
|
||||
ffi (>= 0.5.0)
|
||||
rdoc (3.12.2)
|
||||
json (~> 1.4)
|
||||
rspec (3.0.0)
|
||||
rspec-core (~> 3.0.0)
|
||||
rspec-expectations (~> 3.0.0)
|
||||
rspec-mocks (~> 3.0.0)
|
||||
rspec-core (3.0.4)
|
||||
rspec-support (~> 3.0.0)
|
||||
rspec-expectations (3.0.4)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.0.0)
|
||||
rspec-mocks (3.0.4)
|
||||
rspec-support (~> 3.0.0)
|
||||
rspec-rails (3.0.2)
|
||||
rspec (2.14.1)
|
||||
rspec-core (~> 2.14.0)
|
||||
rspec-expectations (~> 2.14.0)
|
||||
rspec-mocks (~> 2.14.0)
|
||||
rspec-core (2.14.7)
|
||||
rspec-expectations (2.14.5)
|
||||
diff-lcs (>= 1.1.3, < 2.0)
|
||||
rspec-mocks (2.14.5)
|
||||
rspec-rails (2.14.1)
|
||||
actionpack (>= 3.0)
|
||||
activemodel (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
railties (>= 3.0)
|
||||
rspec-core (~> 3.0.0)
|
||||
rspec-expectations (~> 3.0.0)
|
||||
rspec-mocks (~> 3.0.0)
|
||||
rspec-support (~> 3.0.0)
|
||||
rspec-support (3.0.4)
|
||||
sass (3.4.0)
|
||||
slop (3.6.0)
|
||||
rspec-core (~> 2.14.0)
|
||||
rspec-expectations (~> 2.14.0)
|
||||
rspec-mocks (~> 2.14.0)
|
||||
shoulda-matchers (1.0.0)
|
||||
slop (3.4.7)
|
||||
spork (0.9.2)
|
||||
sprockets (2.2.2.backport2)
|
||||
sprockets (2.2.2)
|
||||
hike (~> 1.2)
|
||||
multi_json (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
sprockets-rails (2.0.0.backport1)
|
||||
actionpack (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
sprockets (~> 2.2.2.backport2)
|
||||
thor (0.19.1)
|
||||
therubyracer (0.10.2)
|
||||
libv8 (~> 3.3.10)
|
||||
thor (0.18.1)
|
||||
tilt (1.4.1)
|
||||
timers (1.1.0)
|
||||
treetop (1.4.15)
|
||||
polyglot
|
||||
polyglot (>= 0.3.1)
|
||||
tzinfo (0.3.41)
|
||||
uglifier (2.5.3)
|
||||
twitter-bootstrap-rails (2.0.9)
|
||||
actionpack (>= 3.1)
|
||||
less-rails (~> 2.2.2)
|
||||
railties (>= 3.1)
|
||||
therubyracer (~> 0.10.1)
|
||||
tzinfo (0.3.38)
|
||||
uglifier (2.4.0)
|
||||
execjs (>= 0.3.0)
|
||||
json (>= 1.8.0)
|
||||
warden (1.1.1)
|
||||
rack (>= 1.0)
|
||||
websocket-driver (0.3.4)
|
||||
will_paginate (3.0.7)
|
||||
websocket-driver (0.3.2)
|
||||
will_paginate (3.0.5)
|
||||
xpath (2.0.0)
|
||||
nokogiri (~> 1.3)
|
||||
|
||||
@@ -243,34 +234,32 @@ PLATFORMS
|
||||
|
||||
DEPENDENCIES
|
||||
acts_as_loggable!
|
||||
bootstrap-sass
|
||||
bootstrap-will_paginate
|
||||
bootstrap-will_paginate (~> 0.0.6)
|
||||
cancan
|
||||
capybara (~> 2.2.1)
|
||||
coffee-rails
|
||||
coffee-rails (~> 3.2.1)
|
||||
database_cleaner (~> 1.2.0)
|
||||
decent_exposure (~> 1.0.1)
|
||||
devise (~> 2.0.4)
|
||||
factory_girl_rails
|
||||
faker
|
||||
guard-rspec
|
||||
guard-spork
|
||||
haml-rails
|
||||
jbuilder
|
||||
jquery-rails
|
||||
factory_girl_rails (~> 1.2)
|
||||
faker (~> 1.2.0)
|
||||
guard-rspec (~> 4.2.6)
|
||||
guard-spork (~> 1.5.1)
|
||||
haml-rails (~> 0.3.4)
|
||||
jbuilder (~> 2.0.3)
|
||||
jquery-rails (~> 2.0)
|
||||
launchy (~> 2.4.2)
|
||||
netzke-basepack
|
||||
netzke-basepack (~> 0.8.0)
|
||||
netzke-cancan
|
||||
netzke-core
|
||||
netzke-core (~> 0.8.0)
|
||||
pg (~> 0.17.1)
|
||||
poltergeist (~> 1.5.0)
|
||||
pry
|
||||
rails (= 3.2.19)
|
||||
pry (~> 0.9.8)
|
||||
rails (= 3.2.13)
|
||||
rb-fsevent
|
||||
rspec-rails
|
||||
sass-rails!
|
||||
spork
|
||||
sprockets (= 2.2.2.backport2)
|
||||
sprockets-rails (= 2.0.0.backport1)
|
||||
uglifier
|
||||
will_paginate
|
||||
rspec-rails (~> 2.14.0)
|
||||
shoulda-matchers (~> 1.0.0)
|
||||
spork (~> 0.9.2)
|
||||
twitter-bootstrap-rails (~> 2.0.3)
|
||||
uglifier (>= 1.0.3)
|
||||
will_paginate (~> 3.0.3)
|
||||
|
||||
@@ -12,7 +12,7 @@ To add a user, a user must sign themselves up from the initial login screen. An
|
||||
How to add a bike to the database: https://www.youtube.com/watch?v=1IchWUdMQ90.
|
||||
|
||||
## Views
|
||||
The app has two different views. One for "core" volunteers which I consider admins, and another for "customer" volunteers which I consider users. Because of the Netzke/ExtJS framework I used, the current UI is non-intuitive and I feel like is only adequate for admins who can take the time to learn the system. I'm in the process of designing a simpler mobile friendly UI with the essential functionality that's intended for users. You can see those changes on this [branch]( https://github.com/spacemunkay/BikeShed/tree/mobile-ui)
|
||||
The app has two different views. One for "core" volunteers which I consider admins, and another for "customer" volunteers which I consider users. Because of the Netzke/ExtJS framework I used, the current UI is non-intuitive and I feel like is only adequate for admins who can take the time to learn the system. I'm in the process of designing a simpler mobile friendly UI with the essential functionality that's intended for users.
|
||||
|
||||
## Deployment
|
||||
Currently, at the Velocipede collective we have it running on a computer in the shop on the local network. The reason for this, is so that it's only accessible from within the shop. I'm weighing out different methods for ensuring that users can only log in from within the shop (and not from home), such as a shop password that only admins can see and would make visible from within the physical bike shop. I also don't have to worry about security issues while the app is in development. In the future, I'd like to see the app hosted much like http://freehub.bikekitchen.org/.
|
||||
@@ -43,7 +43,6 @@ At Velocipede, with a mobile friendly UI for users, I'm hoping we can get donati
|
||||
1. Start Postgres `pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start`
|
||||
1. Create your PG user `createuser -d -P velocipede`
|
||||
1. Create your database `createdb -U velocipede --owner=velocipede velocipede`
|
||||
1. Create your test database `createdb -U velocipede --owner=velocipede velocipede_test`
|
||||
|
||||
# Testing
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.7 KiB |
@@ -12,9 +12,8 @@
|
||||
//
|
||||
//= require jquery
|
||||
//= require jquery_ujs
|
||||
// require twitter/bootstrap/bootstrap-button
|
||||
// require twitter/bootstrap/bootstrap-modal
|
||||
//= require twitter/bootstrap/bootstrap-button
|
||||
//= require twitter/bootstrap/bootstrap-modal
|
||||
//= require utils
|
||||
//= require bootstrap-datepicker
|
||||
//= require bootstrap-timepicker
|
||||
//= require jquery-date-format
|
||||
|
||||
-445
@@ -1,445 +0,0 @@
|
||||
var DateFormat = {};
|
||||
|
||||
(function($) {
|
||||
var daysInWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
||||
var shortMonthsInYear = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
||||
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
var longMonthsInYear = ['January', 'February', 'March', 'April', 'May', 'June',
|
||||
'July', 'August', 'September', 'October', 'November', 'December'];
|
||||
var shortMonthsToNumber = { 'Jan': '01', 'Feb': '02', 'Mar': '03', 'Apr': '04', 'May': '05', 'Jun': '06',
|
||||
'Jul': '07', 'Aug': '08', 'Sep': '09', 'Oct': '10', 'Nov': '11', 'Dec': '12' };
|
||||
|
||||
var YYYYMMDD_MATCHER = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.?\d{0,3}[Z\-+]?(\d{2}:?\d{2})?/;
|
||||
|
||||
$.format = (function() {
|
||||
function numberToLongDay(value) {
|
||||
// 0 to Sunday
|
||||
// 1 to Monday
|
||||
return daysInWeek[parseInt(value, 10)] || value;
|
||||
}
|
||||
|
||||
function numberToShortMonth(value) {
|
||||
// 1 to Jan
|
||||
// 2 to Feb
|
||||
var monthArrayIndex = parseInt(value, 10) - 1;
|
||||
return shortMonthsInYear[monthArrayIndex] || value;
|
||||
}
|
||||
|
||||
function numberToLongMonth(value) {
|
||||
// 1 to January
|
||||
// 2 to February
|
||||
var monthArrayIndex = parseInt(value, 10) - 1;
|
||||
return longMonthsInYear[monthArrayIndex] || value;
|
||||
}
|
||||
|
||||
function shortMonthToNumber(value) {
|
||||
// Jan to 01
|
||||
// Feb to 02
|
||||
return shortMonthsToNumber[value] || value;
|
||||
}
|
||||
|
||||
function parseTime(value) {
|
||||
// 10:54:50.546
|
||||
// => hour: 10, minute: 54, second: 50, millis: 546
|
||||
// 10:54:50
|
||||
// => hour: 10, minute: 54, second: 50, millis: ''
|
||||
var time = value,
|
||||
values,
|
||||
subValues,
|
||||
hour,
|
||||
minute,
|
||||
second,
|
||||
millis = '',
|
||||
delimited,
|
||||
timeArray;
|
||||
|
||||
if(time.indexOf('.') !== -1) {
|
||||
delimited = time.split('.');
|
||||
// split time and milliseconds
|
||||
time = delimited[0];
|
||||
millis = delimited[1];
|
||||
}
|
||||
|
||||
timeArray = time.split(':');
|
||||
|
||||
if(timeArray.length === 3) {
|
||||
hour = timeArray[0];
|
||||
minute = timeArray[1];
|
||||
// '20 GMT-0200 (BRST)'.replace(/\s.+/, '').replace(/[a-z]/gi, '');
|
||||
// => 20
|
||||
// '20Z'.replace(/\s.+/, '').replace(/[a-z]/gi, '');
|
||||
// => 20
|
||||
second = timeArray[2].replace(/\s.+/, '').replace(/[a-z]/gi, '');
|
||||
// '01:10:20 GMT-0200 (BRST)'.replace(/\s.+/, '').replace(/[a-z]/gi, '');
|
||||
// => 01:10:20
|
||||
// '01:10:20Z'.replace(/\s.+/, '').replace(/[a-z]/gi, '');
|
||||
// => 01:10:20
|
||||
time = time.replace(/\s.+/, '').replace(/[a-z]/gi, '');
|
||||
return {
|
||||
time: time,
|
||||
hour: hour,
|
||||
minute: minute,
|
||||
second: second,
|
||||
millis: millis
|
||||
};
|
||||
}
|
||||
|
||||
return { time : '', hour : '', minute : '', second : '', millis : '' };
|
||||
}
|
||||
|
||||
|
||||
function padding(value, length) {
|
||||
var paddingCount = length - String(value).length;
|
||||
for(var i = 0; i < paddingCount; i++) {
|
||||
value = '0' + value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
parseDate: function(value) {
|
||||
var parsedDate = {
|
||||
date: null,
|
||||
year: null,
|
||||
month: null,
|
||||
dayOfMonth: null,
|
||||
dayOfWeek: null,
|
||||
time: null
|
||||
};
|
||||
|
||||
if(typeof value == 'number') {
|
||||
return this.parseDate(new Date(value));
|
||||
} else if(typeof value.getFullYear == 'function') {
|
||||
parsedDate.year = String(value.getFullYear());
|
||||
// d = new Date(1900, 1, 1) // 1 for Feb instead of Jan.
|
||||
// => Thu Feb 01 1900 00:00:00
|
||||
parsedDate.month = String(value.getMonth() + 1);
|
||||
parsedDate.dayOfMonth = String(value.getDate());
|
||||
parsedDate.time = parseTime(value.toTimeString());
|
||||
} else if(value.search(YYYYMMDD_MATCHER) != -1) {
|
||||
/* 2009-04-19T16:11:05+02:00 || 2009-04-19T16:11:05Z */
|
||||
values = value.split(/[T\+-]/);
|
||||
parsedDate.year = values[0];
|
||||
parsedDate.month = values[1];
|
||||
parsedDate.dayOfMonth = values[2];
|
||||
parsedDate.time = parseTime(values[3].split('.')[0]);
|
||||
} else {
|
||||
values = value.split(' ');
|
||||
switch (values.length) {
|
||||
case 6:
|
||||
/* Wed Jan 13 10:43:41 CET 2010 */
|
||||
parsedDate.year = values[5];
|
||||
parsedDate.month = shortMonthToNumber(values[1]);
|
||||
parsedDate.dayOfMonth = values[2];
|
||||
parsedDate.time = parseTime(values[3]);
|
||||
break;
|
||||
case 2:
|
||||
/* 2009-12-18 10:54:50.546 */
|
||||
subValues = values[0].split('-');
|
||||
parsedDate.year = subValues[0];
|
||||
parsedDate.month = subValues[1];
|
||||
parsedDate.dayOfMonth = subValues[2];
|
||||
parsedDate.time = parseTime(values[1]);
|
||||
break;
|
||||
case 7:
|
||||
/* Tue Mar 01 2011 12:01:42 GMT-0800 (PST) */
|
||||
case 9:
|
||||
/* added by Larry, for Fri Apr 08 2011 00:00:00 GMT+0800 (China Standard Time) */
|
||||
case 10:
|
||||
/* added by Larry, for Fri Apr 08 2011 00:00:00 GMT+0200 (W. Europe Daylight Time) */
|
||||
parsedDate.year = values[3];
|
||||
parsedDate.month = shortMonthToNumber(values[1]);
|
||||
parsedDate.dayOfMonth = values[2];
|
||||
parsedDate.time = parseTime(values[4]);
|
||||
break;
|
||||
case 1:
|
||||
/* added by Jonny, for 2012-02-07CET00:00:00 (Doctrine Entity -> Json Serializer) */
|
||||
subValues = values[0].split('');
|
||||
parsedDate.year = subValues[0] + subValues[1] + subValues[2] + subValues[3];
|
||||
parsedDate.month = subValues[5] + subValues[6];
|
||||
parsedDate.dayOfMonth = subValues[8] + subValues[9];
|
||||
parsedDate.time = parseTime(subValues[13] + subValues[14] + subValues[15] + subValues[16] + subValues[17] + subValues[18] + subValues[19] + subValues[20]);
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
parsedDate.date = new Date(parsedDate.year, parsedDate.month - 1, parsedDate.dayOfMonth);
|
||||
parsedDate.dayOfWeek = String(parsedDate.date.getDay());
|
||||
|
||||
return parsedDate;
|
||||
},
|
||||
|
||||
date : function(value, format) {
|
||||
try {
|
||||
var parsedDate = this.parseDate(value);
|
||||
|
||||
if(parsedDate === null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
var date = parsedDate.date,
|
||||
year = parsedDate.year,
|
||||
month = parsedDate.month,
|
||||
dayOfMonth = parsedDate.dayOfMonth,
|
||||
dayOfWeek = parsedDate.dayOfWeek,
|
||||
time = parsedDate.time;
|
||||
|
||||
var pattern = '',
|
||||
retValue = '',
|
||||
unparsedRest = '',
|
||||
inQuote = false;
|
||||
|
||||
/* Issue 1 - variable scope issue in format.date (Thanks jakemonO) */
|
||||
for(var i = 0; i < format.length; i++) {
|
||||
var currentPattern = format.charAt(i);
|
||||
// Look-Ahead Right (LALR)
|
||||
var nextRight = format.charAt(i + 1);
|
||||
|
||||
if (inQuote) {
|
||||
if (currentPattern == "'") {
|
||||
retValue += (pattern === '') ? "'" : pattern;
|
||||
pattern = '';
|
||||
inQuote = false;
|
||||
} else {
|
||||
pattern += currentPattern;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
pattern += currentPattern;
|
||||
unparsedRest = '';
|
||||
switch (pattern) {
|
||||
case 'ddd':
|
||||
retValue += numberToLongDay(dayOfWeek);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'dd':
|
||||
if(nextRight === 'd') {
|
||||
break;
|
||||
}
|
||||
retValue += padding(dayOfMonth, 2);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'd':
|
||||
if(nextRight === 'd') {
|
||||
break;
|
||||
}
|
||||
retValue += parseInt(dayOfMonth, 10);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'D':
|
||||
if(dayOfMonth == 1 || dayOfMonth == 21 || dayOfMonth == 31) {
|
||||
dayOfMonth = parseInt(dayOfMonth, 10) + 'st';
|
||||
} else if(dayOfMonth == 2 || dayOfMonth == 22) {
|
||||
dayOfMonth = parseInt(dayOfMonth, 10) + 'nd';
|
||||
} else if(dayOfMonth == 3 || dayOfMonth == 23) {
|
||||
dayOfMonth = parseInt(dayOfMonth, 10) + 'rd';
|
||||
} else {
|
||||
dayOfMonth = parseInt(dayOfMonth, 10) + 'th';
|
||||
}
|
||||
retValue += dayOfMonth;
|
||||
pattern = '';
|
||||
break;
|
||||
case 'MMMM':
|
||||
retValue += numberToLongMonth(month);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'MMM':
|
||||
if(nextRight === 'M') {
|
||||
break;
|
||||
}
|
||||
retValue += numberToShortMonth(month);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'MM':
|
||||
if(nextRight === 'M') {
|
||||
break;
|
||||
}
|
||||
retValue += padding(month, 2);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'M':
|
||||
if(nextRight === 'M') {
|
||||
break;
|
||||
}
|
||||
retValue += parseInt(month, 10);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'y':
|
||||
case 'yyy':
|
||||
if(nextRight === 'y') {
|
||||
break;
|
||||
}
|
||||
retValue += pattern;
|
||||
pattern = '';
|
||||
break;
|
||||
case 'yy':
|
||||
if(nextRight === 'y') {
|
||||
break;
|
||||
}
|
||||
retValue += String(year).slice(-2);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'yyyy':
|
||||
retValue += year;
|
||||
pattern = '';
|
||||
break;
|
||||
case 'HH':
|
||||
retValue += padding(time.hour, 2);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'H':
|
||||
if(nextRight === 'H') {
|
||||
break;
|
||||
}
|
||||
retValue += parseInt(time.hour, 10);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'hh':
|
||||
/* time.hour is '00' as string == is used instead of === */
|
||||
hour = (parseInt(time.hour, 10) === 0 ? 12 : time.hour < 13 ? time.hour
|
||||
: time.hour - 12);
|
||||
retValue += padding(hour, 2);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'h':
|
||||
if(nextRight === 'h') {
|
||||
break;
|
||||
}
|
||||
hour = (parseInt(time.hour, 10) === 0 ? 12 : time.hour < 13 ? time.hour
|
||||
: time.hour - 12);
|
||||
retValue += parseInt(hour, 10);
|
||||
// Fixing issue https://github.com/phstc/jquery-dateFormat/issues/21
|
||||
// retValue = parseInt(retValue, 10);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'mm':
|
||||
retValue += padding(time.minute, 2);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'm':
|
||||
if(nextRight === 'm') {
|
||||
break;
|
||||
}
|
||||
retValue += time.minute;
|
||||
pattern = '';
|
||||
break;
|
||||
case 'ss':
|
||||
/* ensure only seconds are added to the return string */
|
||||
retValue += padding(time.second.substring(0, 2), 2);
|
||||
pattern = '';
|
||||
break;
|
||||
case 's':
|
||||
if(nextRight === 's') {
|
||||
break;
|
||||
}
|
||||
retValue += time.second;
|
||||
pattern = '';
|
||||
break;
|
||||
case 'S':
|
||||
case 'SS':
|
||||
if(nextRight === 'S') {
|
||||
break;
|
||||
}
|
||||
retValue += pattern;
|
||||
pattern = '';
|
||||
break;
|
||||
case 'SSS':
|
||||
retValue += time.millis.substring(0, 3);
|
||||
pattern = '';
|
||||
break;
|
||||
case 'a':
|
||||
retValue += time.hour >= 12 ? 'PM' : 'AM';
|
||||
pattern = '';
|
||||
break;
|
||||
case 'p':
|
||||
retValue += time.hour >= 12 ? 'p.m.' : 'a.m.';
|
||||
pattern = '';
|
||||
break;
|
||||
case "'":
|
||||
pattern = '';
|
||||
inQuote = true;
|
||||
break;
|
||||
default:
|
||||
retValue += currentPattern;
|
||||
pattern = '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
retValue += unparsedRest;
|
||||
return retValue;
|
||||
} catch (e) {
|
||||
if(console && console.log) {
|
||||
console.log(e);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
/*
|
||||
* JavaScript Pretty Date
|
||||
* Copyright (c) 2011 John Resig (ejohn.org)
|
||||
* Licensed under the MIT and GPL licenses.
|
||||
*
|
||||
* Takes an ISO time and returns a string representing how long ago the date
|
||||
* represents
|
||||
*
|
||||
* ('2008-01-28T20:24:17Z') // => '2 hours ago'
|
||||
* ('2008-01-27T22:24:17Z') // => 'Yesterday'
|
||||
* ('2008-01-26T22:24:17Z') // => '2 days ago'
|
||||
* ('2008-01-14T22:24:17Z') // => '2 weeks ago'
|
||||
* ('2007-12-15T22:24:17Z') // => 'more than 5 weeks ago'
|
||||
*
|
||||
*/
|
||||
prettyDate : function(time) {
|
||||
var date;
|
||||
var diff;
|
||||
var day_diff;
|
||||
|
||||
if(typeof time === 'string' || typeof time === 'number') {
|
||||
date = new Date(time);
|
||||
}
|
||||
|
||||
if(typeof time === 'object') {
|
||||
date = new Date(time.toString());
|
||||
}
|
||||
|
||||
diff = (((new Date()).getTime() - date.getTime()) / 1000);
|
||||
|
||||
day_diff = Math.floor(diff / 86400);
|
||||
|
||||
if(isNaN(day_diff) || day_diff < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(diff < 60) {
|
||||
return 'just now';
|
||||
} else if(diff < 120) {
|
||||
return '1 minute ago';
|
||||
} else if(diff < 3600) {
|
||||
return Math.floor(diff / 60) + ' minutes ago';
|
||||
} else if(diff < 7200) {
|
||||
return '1 hour ago';
|
||||
} else if(diff < 86400) {
|
||||
return Math.floor(diff / 3600) + ' hours ago';
|
||||
} else if(day_diff === 1) {
|
||||
return 'Yesterday';
|
||||
} else if(day_diff < 7) {
|
||||
return day_diff + ' days ago';
|
||||
} else if(day_diff < 31) {
|
||||
return Math.ceil(day_diff / 7) + ' weeks ago';
|
||||
} else if(day_diff >= 31) {
|
||||
return 'more than 5 weeks ago';
|
||||
}
|
||||
},
|
||||
toBrowserTimeZone : function(value, format) {
|
||||
return this.date(new Date(value), format || 'MM/dd/yyyy HH:mm:ss');
|
||||
}
|
||||
};
|
||||
}());
|
||||
}(DateFormat));
|
||||
;// require dateFormat.js
|
||||
// please check `dist/jquery.dateFormat.js` for a complete version
|
||||
(function($) {
|
||||
$.format = DateFormat.format;
|
||||
}(jQuery));
|
||||
@@ -22,6 +22,7 @@ Ext.define('Ext.ux.form.field.DateTime', {
|
||||
dateSubmitFormat: 'Y-m-d',
|
||||
timeFormat: 'H:i:s',
|
||||
timeSubmitFormat: 'H:i:s',
|
||||
submitFormat: 'c',
|
||||
dateConfig:{},
|
||||
timeConfig:{},
|
||||
|
||||
@@ -184,8 +185,10 @@ Ext.define('Ext.ux.form.field.DateTime', {
|
||||
var me = this
|
||||
,format = me.getFormat()
|
||||
,value = me.getValue();
|
||||
|
||||
return value ? Ext.Date.format(value, format) : null;
|
||||
console.log(value);
|
||||
console.log(format);
|
||||
console.log("formatted: " + Ext.Date.format(value, this.submitFormat));
|
||||
return value ? Ext.Date.format(value, this.submitFormat) : null;
|
||||
},
|
||||
|
||||
setValue: function(value){
|
||||
|
||||
@@ -23,13 +23,9 @@ $(document).ready(function(){
|
||||
forward = "/task_lists/" + bike_id + "/edit";
|
||||
}
|
||||
|
||||
//FIXME: Ideally, we'd submit the dates as ISO, but I can't figure out
|
||||
// how to get Netzke to render UTC dates correctly (it calls to_json
|
||||
// somewhere and drops off the timezone). For the time being, save dates
|
||||
// in locale like Netzke.
|
||||
json_data = { time_entries: [{
|
||||
start_date: $.format.date(start_date, "dd-MM-yyyy hh:mm a"),
|
||||
end_date: $.format.date(end_date, "dd-MM-yyyy hh:mm a"),
|
||||
start_date: start_date.toISOString(),
|
||||
end_date: end_date.toISOString(),
|
||||
log_action_id: parseInt($('input[name=action_id]:checked').val()),
|
||||
bike_id: bike_id,
|
||||
description: $("#description_id").val(),
|
||||
@@ -48,7 +44,6 @@ $(document).ready(function(){
|
||||
displayFormErrors(data.responseJSON);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".work_entry-delete-btn").click(function(){
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
||||
* listed below.
|
||||
*
|
||||
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
||||
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
||||
*
|
||||
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
||||
* compiled file, but it's generally better to create a new file per style scope.
|
||||
*
|
||||
*= require_self
|
||||
*= require datepicker
|
||||
*= require bootstrap-timepicker
|
||||
*= require bootstrap_and_overrides
|
||||
*/
|
||||
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
||||
* listed below.
|
||||
*
|
||||
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
||||
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
||||
*
|
||||
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
||||
* compiled file, but it's generally better to create a new file per style scope.
|
||||
*
|
||||
*= require_self
|
||||
*= require bootstrap
|
||||
*= require datepicker
|
||||
*= require bootstrap-timepicker
|
||||
*= require bootstrap_and_overrides
|
||||
*/
|
||||
|
||||
@import 'bootstrap-sprockets';
|
||||
@import 'bootstrap';
|
||||
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.x-boundlist-item {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 940px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.container img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
p {
|
||||
text-align: center;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.check_box {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: x-large;
|
||||
}
|
||||
|
||||
/* navigation styling */
|
||||
|
||||
.navbar-default {
|
||||
background-color: #428bca;
|
||||
border-color: #428bca;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
.navbar > .container-fluid .navbar-brand {
|
||||
margin-left: -15px;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-brand {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-nav > li > a {
|
||||
color: #ffffff;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
float: left;
|
||||
padding: 15px 15px;
|
||||
font-size: 18px;
|
||||
line-height: 20px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.navbar-default a:hover {
|
||||
color: #d1b84a !important;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
@import "twitter/bootstrap/bootstrap";
|
||||
body {
|
||||
padding-top: 60px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
@import "twitter/bootstrap/responsive";
|
||||
|
||||
// Set the correct sprite paths
|
||||
@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
|
||||
@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
|
||||
|
||||
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
|
||||
// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not
|
||||
// have the proper paths. So for now we use the absolute path.
|
||||
@fontAwesomeEotPath: '/assets/fontawesome-webfont.eot';
|
||||
@fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff';
|
||||
@fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf';
|
||||
@fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg';
|
||||
|
||||
// Font Awesome
|
||||
@import "fontawesome";
|
||||
|
||||
// Your custom LESS stylesheets goes here
|
||||
//
|
||||
// Since bootstrap was imported above you have access to its mixins which
|
||||
// you may use and inherit here
|
||||
//
|
||||
// If you'd like to override bootstrap's own variables, you can do so here as well
|
||||
// See http://twitter.github.com/bootstrap/less.html for their names and documentation
|
||||
//
|
||||
// Example:
|
||||
// @linkColor: #ff0000;
|
||||
|
||||
[data-toggle="buttons-radio"] > .btn > input[type="radio"],
|
||||
[data-toggle="buttons"] > .btn > input[type="checkbox"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.inline-block {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.control-group.error .btn-group > .btn {
|
||||
color: #b94a48;
|
||||
border-color: #b94a48;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
// Set the correct sprite paths
|
||||
$iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
|
||||
$iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
|
||||
|
||||
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
|
||||
// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not
|
||||
// have the proper paths. So for now we use the absolute path.
|
||||
$fontAwesomeEotPath: '/assets/fontawesome-webfont.eot';
|
||||
$fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff';
|
||||
$fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf';
|
||||
$fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg';
|
||||
|
||||
[data-toggle="buttons-radio"] > .btn > input[type="radio"],
|
||||
[data-toggle="buttons"] > .btn > input[type="checkbox"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.inline-block {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.control-group.error .btn-group > .btn {
|
||||
color: #b94a48;
|
||||
border-color: #b94a48;
|
||||
}
|
||||
@@ -19,6 +19,6 @@
|
||||
});
|
||||
},
|
||||
onChangeAccountInfo: function(){
|
||||
window.location.href="/users/edit";
|
||||
window.location.href="users/edit";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
before_filter :authenticate_user!
|
||||
protect_from_forgery
|
||||
|
||||
layout 'application'
|
||||
|
||||
end
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
class AuthenticatedController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
|
||||
before_filter :get_user_bike
|
||||
|
||||
def get_user_bike
|
||||
@bike = current_user.bike
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class SiteController < ApplicationController
|
||||
|
||||
def index
|
||||
@bike = current_user.bike
|
||||
end
|
||||
end
|
||||
@@ -23,7 +23,7 @@ class Ability
|
||||
|
||||
def user
|
||||
can :read, :all
|
||||
can :manage, @current_user.bike unless @current_user.bike.nil?
|
||||
can :manage, Bike, :id => @current_user.bike_id unless @current_user.bike.nil?
|
||||
can :manage, ::ActsAsLoggable::Log, :loggable_type => "Bike", :loggable_id => @current_user.bike_id
|
||||
can :manage, ::ActsAsLoggable::Log, :loggable_type => "User", :loggable_id => @current_user.id
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
%a{ class: "btn btn-default btn-lg", href: root_path}
|
||||
%span{ class:"icon-home"}
|
||||
%h2 Add Bike
|
||||
|
||||
%p
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
%p
|
||||
%a{class: "btn btn-lg btn-block btn-info", href: new_bike_path} Add Another Bike?
|
||||
|
||||
%a{ class: "btn btn-default btn-lg", href: root_path}
|
||||
%span{ class:"icon-home"}
|
||||
%h2 #{@bike.shop_id}: #{@bike.bike_brand}
|
||||
%h2 #{@bike.model}
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
|
||||
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
||||
<p>
|
||||
<%= link_to "Sign up", new_registration_path(resource_name), class: "btn btn-block btn-default btn-lg" %><br />
|
||||
<%= link_to "Sign up", new_registration_path(resource_name), class: "btn btn-block btn-default" %><br />
|
||||
</p>
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
|
||||
<p>
|
||||
<%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn btn-block btn-default btn-lg" %><br />
|
||||
<%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn btn-block btn-default" %><br />
|
||||
</p>
|
||||
<% end -%>
|
||||
|
||||
|
||||
@@ -1,52 +1,48 @@
|
||||
<%= stylesheet_link_tag "bootstrap", :media => "all" %>
|
||||
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||
<div class="container">
|
||||
<%= image_tag 'velo_logo.png' %>
|
||||
<p><a href="http://madewithloveinbaltimore.org" class="made">Made with ♥ in Baltimore</a></p>
|
||||
<br>
|
||||
<br>
|
||||
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<%= f.text_field :username, placeholder: "Username", class: "form-control input-lg", autofocus: true %>
|
||||
</div>
|
||||
<%= stylesheet_link_tag "bootstrap_and_overrides", :media => "all" %>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.password_field :password, placeholder: "Password", class: "form-control input-lg" %>
|
||||
</div>
|
||||
<h2>Velocipede</h2>
|
||||
<a href="http://madewithloveinbaltimore.org">Made with ♥ in Baltimore</a>
|
||||
<br>
|
||||
<br>
|
||||
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.text_field :username, placeholder: "Username", class: "form-control input-lg"%>
|
||||
</div>
|
||||
|
||||
<div class="form-group remember">
|
||||
<% if devise_mapping.rememberable? -%>
|
||||
<label>
|
||||
<%= f.check_box :remember_me, class: 'check_box' %> Remember Me
|
||||
</label>
|
||||
<% end -%>
|
||||
</div>
|
||||
</div> <!-- end column -->
|
||||
</div> <!-- end row -->
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<p>
|
||||
<%= f.submit "Sign in", class:"btn btn-lg btn-primary col-xs-12 col-sm-12 col-md-12" %>
|
||||
</p>
|
||||
</div>
|
||||
</div> <!-- end column -->
|
||||
</div> <!-- end row -->
|
||||
<% end %>
|
||||
<div class="form-group">
|
||||
<%= f.password_field :password, placeholder: "Password", class: "form-control input-lg" %>
|
||||
</div>
|
||||
|
||||
<%= render "links" %>
|
||||
<div class="form-group">
|
||||
<% if devise_mapping.rememberable? -%>
|
||||
<label>
|
||||
<%= f.check_box :remember_me %> Remember Me
|
||||
</label>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<% if Rails.env.development? %>
|
||||
<div class="form-group">
|
||||
<p>
|
||||
<% User.all.each do |user| %>
|
||||
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
||||
<%= f.hidden_field :username, :value => user.username%>
|
||||
<%= f.hidden_field :password, :value => 'password' %>
|
||||
<%= f.submit "Sign in as #{user.username}", class:"btn btn-info" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= f.submit "Sign in", class:"btn btn-lg btn-primary" %>
|
||||
</p>
|
||||
<p> Or quickly... </p>
|
||||
<div class="btn-group">
|
||||
<input id="checkin" name="checkin" type="button" value="CHECK IN" class="btn btn-lg btn-success">
|
||||
<input id="checkout" name="checkout" type="button" value="CHECK OUT" class="btn btn-lg btn-danger">
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render "links" %>
|
||||
|
||||
<% if Rails.env.development? %>
|
||||
<p>
|
||||
<% User.all.each do |user| %>
|
||||
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
||||
<%= f.hidden_field :username, :value => user.username%>
|
||||
<%= f.hidden_field :password, :value => 'password' %>
|
||||
<%= f.submit "Sign in as #{user.username}", class:"btn btn-info" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
@@ -5,48 +5,31 @@
|
||||
%meta{ name: "viewport", content: "width=device-width", "initial-scale" => "1.0"}
|
||||
%title= content_for?(:title) ? yield(:title) : "Velocipede"
|
||||
= csrf_meta_tags
|
||||
= stylesheet_link_tag "bootstrap", "application", :media => "all"
|
||||
= stylesheet_link_tag "bootstrap_and_overrides", "datepicker", "bootstrap-timepicker", :media => "all"
|
||||
/[if lt IE 9]
|
||||
= javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js"
|
||||
|
||||
:css
|
||||
body {
|
||||
padding-top: 5px;
|
||||
}
|
||||
.x-boundlist-item {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
%body
|
||||
%nav{class: "navbar navbar-default", role: "navigation"}
|
||||
%div{class: "container-fluid"}
|
||||
/[Brand and toggle get grouped for better mobile display]
|
||||
%div{class: "navbar-header"}
|
||||
%button{type: "button", class: "navbar-toggle", 'data-toggle' => "collapse", 'data-target' => "#bs-example-navbar-collapse-1"}
|
||||
%span{class: "sr-only"} Toggle navigation
|
||||
%span.icon-bar
|
||||
%span.icon-bar
|
||||
%span.icon-bar
|
||||
%a{class:"navbar-brand", href:"/"}
|
||||
= image_tag 'velo_logo.png'
|
||||
|
||||
- if user_signed_in?
|
||||
/[Collect the nav links, forms, and other content for toggling]
|
||||
#bs-example-navbar-collapse-1.collapse.navbar-collapse
|
||||
%ul{class: "nav navbar-nav"}
|
||||
%li
|
||||
%a{href: new_time_entry_path} Add Time Entry
|
||||
%li
|
||||
%a{href: time_entries_path} View Timesheet
|
||||
%li
|
||||
%a{href: new_bike_path} Add Bike
|
||||
%li
|
||||
%a{href: bike_path(@bike)} View Your Bike
|
||||
%ul{class: "nav navbar-nav navbar-right"}
|
||||
%li
|
||||
%a{href: destroy_user_session_path } Log Out
|
||||
|
||||
.container
|
||||
- if flash[:notice]
|
||||
%p{:class => 'notice'}= flash[:notice]
|
||||
- if flash[:alert]
|
||||
%p{:class => 'alert'}= flash[:alert]
|
||||
= yield
|
||||
|
||||
%footer
|
||||
%p © BikeShed #{Time.now.year}
|
||||
.content
|
||||
- if flash[:notice]
|
||||
%p{:class => 'notice'}= flash[:notice]
|
||||
- if flash[:alert]
|
||||
%p{:class => 'alert'}= flash[:alert]
|
||||
.row
|
||||
.span12
|
||||
= yield
|
||||
|
||||
%footer
|
||||
%p © BikeShed #{Time.now.year}
|
||||
|
||||
= javascript_include_tag "application"
|
||||
= javascript_include_tag params[:controller]
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
= stylesheet_link_tag "bootstrap_and_overrides", :media => "all"
|
||||
%h2 Dashboard
|
||||
|
||||
%p
|
||||
%p
|
||||
%a{class: "btn btn-lg btn-block btn-primary", href: new_time_entry_path} Add Time Entry
|
||||
%p
|
||||
%a{class: "btn btn-lg btn-block btn-primary", href: time_entries_path} View Timesheet
|
||||
%p
|
||||
%a{class: "btn btn-lg btn-block btn-primary", href: new_bike_path} Add Bike
|
||||
|
||||
- if !@bike.nil?
|
||||
%p
|
||||
%a{class: "btn btn-lg btn-block btn-primary", href: bike_path(@bike)} View Your Bike
|
||||
|
||||
|
||||
%p
|
||||
%p
|
||||
%a{class: "btn btn-lg btn-block btn-primary hidden-xs", href: admin_index_path} Admin View
|
||||
%p
|
||||
%input{id: "index_logout", value: "Logout", type: "button", class: "btn btn-lg btn-block btn-danger", "data-url" => destroy_user_session_path }
|
||||
@@ -1,3 +1,5 @@
|
||||
%a{ class: "btn btn-default btn-lg", href: root_path}
|
||||
%span{ class:"icon-home"}
|
||||
%h2 Task List
|
||||
%h3
|
||||
%a{ href: bike_path(@task_list.item)}#{@task_list.item.shop_id} #{@task_list.item.bike_brand}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
%a{ class: "btn btn-default btn-lg", href: root_path}
|
||||
%span{ class:"icon-home"}
|
||||
%h2 Your Timesheet
|
||||
|
||||
%dl.dl-horizontal
|
||||
|
||||
@@ -1,32 +1,33 @@
|
||||
%a{ class: "btn btn-default btn-lg", href: root_path}
|
||||
%span{ class:"icon-home"}
|
||||
%h2 Add Time Entry
|
||||
|
||||
%p
|
||||
.control-group
|
||||
.controls.bootstrap-timepicker.col-xs-12.col-sm-12.col-md-12.input-group
|
||||
.span{ class: "input-group-addon", style: "min-width: 100px; font-size: large"} Date
|
||||
%input{id: "date_id", placeholder: "Date", type: "text", class: "datepicker input-large col-xs-12 col-sm-12 col-md-12 form-control" }
|
||||
.controls
|
||||
%input{id: "date_id", placeholder: "Date", type: "text", class: "datepicker input-small" }
|
||||
.help-block
|
||||
.control-group
|
||||
.controls{ class: "bootstrap-timepicker col-xs-12 col-sm-12 col-md-12 input-group"}
|
||||
.span{ class: "input-group-addon", style: "min-width: 100px; font-size: large"} Start
|
||||
%input{id: "start_time_id", placeholder: "Time ID", type: "text", class: "input-large col-xs-12 col-sm-12 col-md-12 form-control" }
|
||||
.controls{ class: "bootstrap-timepicker"}
|
||||
%label Start
|
||||
%input{id: "start_time_id", placeholder: "Time ID", type: "text", class: "input-small" }
|
||||
.hidden{ id: "start_date" }
|
||||
.help-block
|
||||
.control-group
|
||||
.controls{ class: "bootstrap-timepicker col-xs-12 col-sm-12 col-md-12 input-group"}
|
||||
.span{ class: "input-group-addon", style: "min-width: 100px; font-size: large"} End
|
||||
%input{id: "end_time_id", placeholder: "Time ID", type: "text", class: "input-large col-xs-9 col-sm-9 col-md-9 form-control"}
|
||||
.controls
|
||||
%label End
|
||||
%input{id: "end_time_id", placeholder: "Time ID", type: "text", class: "input-small" }
|
||||
.hidden{ id: "end_date" }
|
||||
.help-block
|
||||
.control-group{ class: "col-xs-12 col-sm-12 col-md-12"}
|
||||
.control-group
|
||||
.controls
|
||||
.btn-group{ "data-toggle" => "buttons-radio", class: "btn-group btn-group-justified"}
|
||||
%label{ class: "btn-lg col-xs-4 col-sm-4 col-md-4"}
|
||||
%input{ type: "radio", name: "action_id", value: 1, radius: 20} Volunteer
|
||||
%label{ class: "btn-lg col-xs-4 col-sm-4 col-md-4"}
|
||||
%input{ type: "radio", name: "action_id", value: 2, radius: 20} Personal
|
||||
%label{ class: "btn-lg col-xs-4 col-sm-4 col-md-4"}
|
||||
%input{ type: "radio", name: "action_id", value: 3, radius: 20} Staff
|
||||
.btn-group{ "data-toggle" => "buttons-radio"}
|
||||
%label{ class: "btn btn-default"}
|
||||
%input{ type: "radio", name: "action_id", value: 1} Volunteer
|
||||
%label{ class: "btn btn-default"}
|
||||
%input{ type: "radio", name: "action_id", value: 2} Personal
|
||||
%label{ class: "btn btn-default"}
|
||||
%input{ type: "radio", name: "action_id", value: 3} Staff
|
||||
.hidden{ id: "log_action_id" }
|
||||
.help-block
|
||||
.control-group
|
||||
@@ -35,7 +36,7 @@
|
||||
= select_tag(:bike_id, options_for_select(@bikes))
|
||||
.control-group
|
||||
.controls
|
||||
%textarea{id: "description_id", placeholder: "Work description", class: "input-lg col-xs-12 col-sm-12 col-md-12" }
|
||||
%textarea{id: "description_id", placeholder: "Work description", class: "input-lg" }
|
||||
.control-group
|
||||
.controls
|
||||
%input{id: "add_time_entry_submit", value: "Add Time Entry", type: "button", class: "btn btn-lg btn-block btn-primary", "data-url" => "#{api_create_time_entry_path}", "data-forward" => "#{"."}"}
|
||||
|
||||
@@ -3,7 +3,10 @@ require File.expand_path('../boot', __FILE__)
|
||||
require 'rails/all'
|
||||
|
||||
if defined?(Bundler)
|
||||
Bundler.require(*Rails.groups)
|
||||
# If you precompile assets before deploying to production, use this line
|
||||
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
||||
# If you want your assets lazily compiled in production, use this line
|
||||
# Bundler.require(:default, :assets, Rails.env)
|
||||
end
|
||||
|
||||
module Velocipede
|
||||
|
||||
+1
-2
@@ -3,8 +3,7 @@ Velocipede::Application.routes.draw do
|
||||
devise_for :users
|
||||
netzke
|
||||
|
||||
root :to => 'time_entries#new'
|
||||
|
||||
root :to => 'site#index'
|
||||
get 'admin/index', to: 'panel#index', as: "admin_index"
|
||||
|
||||
get 'bikes/new', to: 'bikes#new', as: "new_bike"
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
class AddTimezonesToLogs < ActiveRecord::Migration
|
||||
def up
|
||||
change_table :logs do |t|
|
||||
t.change :start_date, :timestamptz
|
||||
t.change :end_date, :timestamptz
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
change_table :logs do |t|
|
||||
t.change :start_date, :timestamp
|
||||
t.change :end_date, :timestamp
|
||||
end
|
||||
end
|
||||
end
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20131019170248) do
|
||||
ActiveRecord::Schema.define(:version => 20140504154355) do
|
||||
|
||||
create_table "bike_actions", :force => true do |t|
|
||||
t.string "action", :limit => 128, :null => false
|
||||
|
||||
+16
-15
@@ -16,21 +16,22 @@ FactoryGirl.define do
|
||||
value 200
|
||||
bike_condition { FactoryGirl.create(:bike_condition) }
|
||||
bike_purpose { FactoryGirl.create(:bike_purpose) }
|
||||
factory :seed_bike do
|
||||
sequence(:shop_id) {|n| n}
|
||||
sequence :serial_number do |n|
|
||||
"#{Faker::Code.isbn}-#{n}"
|
||||
end
|
||||
bike_brand_id { BikeBrand.all.sample.id }
|
||||
model { Faker::Commerce.product_name }
|
||||
color { sprintf("%06X", Random.rand(16777215) ) }
|
||||
bike_style_id { BikeStyle.all.sample.id }
|
||||
seat_tube_height { Random.rand(25) }
|
||||
top_tube_length { Random.rand(25) }
|
||||
bike_wheel_size_id { BikeWheelSize.all.sample.id }
|
||||
value { Random.rand(200) }
|
||||
bike_condition_id { BikeCondition.all.sample.id }
|
||||
bike_purpose_id { BikePurpose.all.sample.id }
|
||||
end
|
||||
|
||||
factory :seed_bike do
|
||||
sequence(:shop_id) {|n| n}
|
||||
sequence :serial_number do |n|
|
||||
"#{Faker::Code.isbn}-#{n}"
|
||||
end
|
||||
bike_brand_id { BikeBrand.all.sample.id }
|
||||
model { Faker::Commerce.product_name }
|
||||
color { sprintf("%06X", Random.rand(16777215) ) }
|
||||
bike_style_id { BikeStyle.all.sample.id }
|
||||
seat_tube_height { Random.rand(25) }
|
||||
top_tube_length { Random.rand(25) }
|
||||
bike_wheel_size_id { BikeWheelSize.all.sample.id }
|
||||
value { Random.rand(200) }
|
||||
bike_condition_id { BikeCondition.all.sample.id }
|
||||
bike_purpose_id { BikePurpose.all.sample.id }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,14 +8,14 @@ FactoryGirl.define do
|
||||
first_name 'Michael'
|
||||
last_name 'Scott'
|
||||
sequence(:bike_id) { |n| n }
|
||||
after(:build) do |r|
|
||||
after_build do |r|
|
||||
r.roles << (Role.find_by_role("user") || FactoryGirl.create(:role_user))
|
||||
end
|
||||
|
||||
factory :staff do
|
||||
username "staff"
|
||||
first_name 'Staff'
|
||||
after(:build) do |r|
|
||||
after_build do |r|
|
||||
r.roles << (Role.find_by_role("staff") || FactoryGirl.create(:role_staff))
|
||||
end
|
||||
end
|
||||
@@ -23,7 +23,7 @@ FactoryGirl.define do
|
||||
factory :admin do
|
||||
username "admin"
|
||||
first_name 'Admin'
|
||||
after(:build) do |r|
|
||||
after_build do |r|
|
||||
r.roles << (Role.find_by_role("admin") || FactoryGirl.create(:role_admin))
|
||||
end
|
||||
end
|
||||
@@ -31,7 +31,7 @@ FactoryGirl.define do
|
||||
factory :bike_admin do
|
||||
username "bike_admin"
|
||||
first_name 'BikeAdmin'
|
||||
after(:build) do |r|
|
||||
after_build do |r|
|
||||
r.roles << (Role.find_by_role("bike_admin") || FactoryGirl.create(:role_bike_admin))
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user