backtastic 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +10 -0
- data/Gemfile +4 -0
- data/README.md +72 -0
- data/Rakefile +1 -0
- data/backtastic.gemspec +28 -0
- data/example/.gitignore +15 -0
- data/example/Gemfile +44 -0
- data/example/README.rdoc +261 -0
- data/example/Rakefile +7 -0
- data/example/app/assets/images/rails.png +0 -0
- data/example/app/assets/javascripts/application.js.coffee +22 -0
- data/example/app/assets/javascripts/backbone/example.js.coffee +15 -0
- data/example/app/assets/javascripts/backbone/models/.gitkeep +0 -0
- data/example/app/assets/javascripts/backbone/models/occupation.coffee +7 -0
- data/example/app/assets/javascripts/backbone/models/people.coffee +7 -0
- data/example/app/assets/javascripts/backbone/models/thing.coffee +1 -0
- data/example/app/assets/javascripts/backbone/routers/.gitkeep +0 -0
- data/example/app/assets/javascripts/backbone/routers/people_router.coffee +27 -0
- data/example/app/assets/javascripts/backbone/templates/.gitkeep +0 -0
- data/example/app/assets/javascripts/backbone/views/.gitkeep +0 -0
- data/example/app/assets/javascripts/backbone/views/edit_person_view.coffee +21 -0
- data/example/app/assets/javascripts/backbone/views/example_form_view.coffee +2 -0
- data/example/app/assets/javascripts/backbone/views/people_view.coffee +6 -0
- data/example/app/assets/javascripts/bootstrap.js.coffee +4 -0
- data/example/app/assets/stylesheets/application.css +13 -0
- data/example/app/assets/stylesheets/bootstrap_and_overrides.css.less +30 -0
- data/example/app/assets/templates/edit_person_view_template.jst.hamlc +13 -0
- data/example/app/assets/templates/example_form_view_template.jst.hamlc +2 -0
- data/example/app/assets/templates/people_view_template.jst.hamlc +6 -0
- data/example/app/controllers/application_controller.rb +3 -0
- data/example/app/controllers/occupations_controller.rb +3 -0
- data/example/app/controllers/people_controller.rb +3 -0
- data/example/app/helpers/application_helper.rb +2 -0
- data/example/app/mailers/.gitkeep +0 -0
- data/example/app/models/.gitkeep +0 -0
- data/example/app/models/occupation.rb +2 -0
- data/example/app/models/person.rb +5 -0
- data/example/app/views/layouts/application.html.erb +75 -0
- data/example/app/views/people/index.html.erb +7 -0
- data/example/config.ru +4 -0
- data/example/config/application.rb +59 -0
- data/example/config/boot.rb +6 -0
- data/example/config/database.yml +25 -0
- data/example/config/environment.rb +5 -0
- data/example/config/environments/development.rb +37 -0
- data/example/config/environments/production.rb +67 -0
- data/example/config/environments/test.rb +37 -0
- data/example/config/initializers/backtrace_silencers.rb +7 -0
- data/example/config/initializers/inflections.rb +15 -0
- data/example/config/initializers/mime_types.rb +5 -0
- data/example/config/initializers/secret_token.rb +7 -0
- data/example/config/initializers/session_store.rb +8 -0
- data/example/config/initializers/wrap_parameters.rb +14 -0
- data/example/config/locales/en.yml +5 -0
- data/example/config/routes.rb +62 -0
- data/example/db/migrate/20120429172946_create_people.rb +12 -0
- data/example/db/migrate/20120526164853_create_occupations.rb +9 -0
- data/example/db/schema.rb +31 -0
- data/example/db/seeds.rb +7 -0
- data/example/doc/README_FOR_APP +2 -0
- data/example/lib/assets/.gitkeep +0 -0
- data/example/lib/tasks/.gitkeep +0 -0
- data/example/log/.gitkeep +0 -0
- data/example/public/404.html +26 -0
- data/example/public/422.html +26 -0
- data/example/public/500.html +25 -0
- data/example/public/favicon.ico +0 -0
- data/example/public/index.html +241 -0
- data/example/public/robots.txt +5 -0
- data/example/script/rails +6 -0
- data/example/spec/javascripts/spec.js.coffee +7 -0
- data/example/spec/javascripts/views/edit_person_view_spec.coffee +39 -0
- data/example/spec/javascripts/views/example_form_view_spec.coffee +12 -0
- data/example/spec/javascripts/views/select_field_view_spec.coffee +28 -0
- data/example/spec/javascripts/views/text_field_view_spec.coffee +17 -0
- data/example/vendor/assets/javascripts/.gitkeep +0 -0
- data/example/vendor/assets/stylesheets/.gitkeep +0 -0
- data/example/vendor/plugins/.gitkeep +0 -0
- data/lib/assets/javascripts/backtastic.coffee +13 -0
- data/lib/assets/javascripts/templates/select_field_template.jst.hamlc +4 -0
- data/lib/assets/javascripts/templates/text_field_template.jst.hamlc +2 -0
- data/lib/assets/javascripts/views/backtastic_view.coffee +12 -0
- data/lib/assets/javascripts/views/date_field_view.coffee +12 -0
- data/lib/assets/javascripts/views/form_field_view.coffee +23 -0
- data/lib/assets/javascripts/views/form_view.coffee +38 -0
- data/lib/assets/javascripts/views/select_field_view.coffee +8 -0
- data/lib/assets/javascripts/views/text_field_view.coffee +4 -0
- data/lib/backtastic.rb +9 -0
- data/lib/backtastic/version.rb +3 -0
- data/vendor/assets/javascripts/bootstrap-datepicker.js +401 -0
- data/vendor/assets/javascripts/jquery.serializeObject.js.coffee +19 -0
- data/vendor/assets/stylesheets/datepicker.less +122 -0
- metadata +182 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
jQuery.fn.serializeObject = ->
|
2
|
+
arrayData = @serializeArray()
|
3
|
+
objectData = {}
|
4
|
+
|
5
|
+
jQuery.each arrayData, ->
|
6
|
+
if @value?
|
7
|
+
value = @value
|
8
|
+
else
|
9
|
+
value = ''
|
10
|
+
|
11
|
+
if objectData[@name]?
|
12
|
+
unless objectData[@name].push
|
13
|
+
objectData[@name] = [objectData[@name]]
|
14
|
+
|
15
|
+
objectData[@name].push value
|
16
|
+
else
|
17
|
+
objectData[@name] = value
|
18
|
+
|
19
|
+
return objectData
|
@@ -0,0 +1,122 @@
|
|
1
|
+
/*!
|
2
|
+
* Datepicker for Bootstrap
|
3
|
+
*
|
4
|
+
* Copyright 2012 Stefan Petre
|
5
|
+
* Licensed under the Apache License v2.0
|
6
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
|
10
|
+
.datepicker {
|
11
|
+
top: 0;
|
12
|
+
left: 0;
|
13
|
+
padding: 4px;
|
14
|
+
margin-top: 1px;
|
15
|
+
.border-radius(4px);
|
16
|
+
&:before {
|
17
|
+
content: '';
|
18
|
+
display: inline-block;
|
19
|
+
border-left: 7px solid transparent;
|
20
|
+
border-right: 7px solid transparent;
|
21
|
+
border-bottom: 7px solid #ccc;
|
22
|
+
border-bottom-color: rgba(0,0,0,.2);
|
23
|
+
position: absolute;
|
24
|
+
top: -7px;
|
25
|
+
left: 6px;
|
26
|
+
}
|
27
|
+
&:after {
|
28
|
+
content: '';
|
29
|
+
display: inline-block;
|
30
|
+
border-left: 6px solid transparent;
|
31
|
+
border-right: 6px solid transparent;
|
32
|
+
border-bottom: 6px solid @white;
|
33
|
+
position: absolute;
|
34
|
+
top: -6px;
|
35
|
+
left: 7px;
|
36
|
+
}
|
37
|
+
>div {
|
38
|
+
display: none;
|
39
|
+
}
|
40
|
+
&.days div.datepicker-days {
|
41
|
+
display: block;
|
42
|
+
}
|
43
|
+
&.months div.datepicker-months {
|
44
|
+
display: block;
|
45
|
+
}
|
46
|
+
&.years div.datepicker-years {
|
47
|
+
display: block;
|
48
|
+
}
|
49
|
+
table{
|
50
|
+
width: 100%;
|
51
|
+
margin: 0;
|
52
|
+
}
|
53
|
+
td,
|
54
|
+
th{
|
55
|
+
text-align: center;
|
56
|
+
width: 20px;
|
57
|
+
height: 20px;
|
58
|
+
.border-radius(4px);
|
59
|
+
}
|
60
|
+
td {
|
61
|
+
&.day:hover {
|
62
|
+
background: @grayLighter;
|
63
|
+
cursor: pointer;
|
64
|
+
}
|
65
|
+
&.old,
|
66
|
+
&.new {
|
67
|
+
color: @grayLight;
|
68
|
+
}
|
69
|
+
&.active,
|
70
|
+
&.active:hover {
|
71
|
+
.buttonBackground(@primaryButtonBackground, spin(@primaryButtonBackground, 20));
|
72
|
+
color: #fff;
|
73
|
+
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
74
|
+
}
|
75
|
+
span {
|
76
|
+
display: block;
|
77
|
+
width: 47px;
|
78
|
+
height: 54px;
|
79
|
+
line-height: 54px;
|
80
|
+
float: left;
|
81
|
+
margin: 2px;
|
82
|
+
cursor: pointer;
|
83
|
+
.border-radius(4px);
|
84
|
+
&:hover {
|
85
|
+
background: @grayLighter;
|
86
|
+
}
|
87
|
+
&.active {
|
88
|
+
.buttonBackground(@primaryButtonBackground, spin(@primaryButtonBackground, 20));
|
89
|
+
color: #fff;
|
90
|
+
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
91
|
+
}
|
92
|
+
&.old {
|
93
|
+
color: @grayLight;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
th.switch {
|
99
|
+
width: 145px;
|
100
|
+
}
|
101
|
+
|
102
|
+
thead tr:first-child th {
|
103
|
+
cursor: pointer;
|
104
|
+
&:hover{
|
105
|
+
background: @grayLighter;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
/*.dow {
|
109
|
+
border-top: 1px solid #ddd !important;
|
110
|
+
}*/
|
111
|
+
}
|
112
|
+
.input-append,
|
113
|
+
.input-prepend {
|
114
|
+
&.date {
|
115
|
+
.add-on i {
|
116
|
+
display: block;
|
117
|
+
cursor: pointer;
|
118
|
+
width: 16px;
|
119
|
+
height: 16px;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
metadata
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: backtastic
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Chris Nelson
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-30 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: haml_coffee_assets
|
16
|
+
requirement: &70340299040540 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70340299040540
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rails-backbone
|
27
|
+
requirement: &70340299039500 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70340299039500
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: inflection-js-rails
|
38
|
+
requirement: &70340299037740 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70340299037740
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: twitter-bootstrap-rails
|
49
|
+
requirement: &70340299036860 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70340299036860
|
58
|
+
description: ! "Create backbone twitter bootstrap form views easily using helpers.
|
59
|
+
Handle and display\n validation failures from rails.\n "
|
60
|
+
email:
|
61
|
+
- superchrisnelson@gmail.com
|
62
|
+
executables: []
|
63
|
+
extensions: []
|
64
|
+
extra_rdoc_files: []
|
65
|
+
files:
|
66
|
+
- .gitignore
|
67
|
+
- Gemfile
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- backtastic.gemspec
|
71
|
+
- example/.gitignore
|
72
|
+
- example/Gemfile
|
73
|
+
- example/README.rdoc
|
74
|
+
- example/Rakefile
|
75
|
+
- example/app/assets/images/rails.png
|
76
|
+
- example/app/assets/javascripts/application.js.coffee
|
77
|
+
- example/app/assets/javascripts/backbone/example.js.coffee
|
78
|
+
- example/app/assets/javascripts/backbone/models/.gitkeep
|
79
|
+
- example/app/assets/javascripts/backbone/models/occupation.coffee
|
80
|
+
- example/app/assets/javascripts/backbone/models/people.coffee
|
81
|
+
- example/app/assets/javascripts/backbone/models/thing.coffee
|
82
|
+
- example/app/assets/javascripts/backbone/routers/.gitkeep
|
83
|
+
- example/app/assets/javascripts/backbone/routers/people_router.coffee
|
84
|
+
- example/app/assets/javascripts/backbone/templates/.gitkeep
|
85
|
+
- example/app/assets/javascripts/backbone/views/.gitkeep
|
86
|
+
- example/app/assets/javascripts/backbone/views/edit_person_view.coffee
|
87
|
+
- example/app/assets/javascripts/backbone/views/example_form_view.coffee
|
88
|
+
- example/app/assets/javascripts/backbone/views/people_view.coffee
|
89
|
+
- example/app/assets/javascripts/bootstrap.js.coffee
|
90
|
+
- example/app/assets/stylesheets/application.css
|
91
|
+
- example/app/assets/stylesheets/bootstrap_and_overrides.css.less
|
92
|
+
- example/app/assets/templates/edit_person_view_template.jst.hamlc
|
93
|
+
- example/app/assets/templates/example_form_view_template.jst.hamlc
|
94
|
+
- example/app/assets/templates/people_view_template.jst.hamlc
|
95
|
+
- example/app/controllers/application_controller.rb
|
96
|
+
- example/app/controllers/occupations_controller.rb
|
97
|
+
- example/app/controllers/people_controller.rb
|
98
|
+
- example/app/helpers/application_helper.rb
|
99
|
+
- example/app/mailers/.gitkeep
|
100
|
+
- example/app/models/.gitkeep
|
101
|
+
- example/app/models/occupation.rb
|
102
|
+
- example/app/models/person.rb
|
103
|
+
- example/app/views/layouts/application.html.erb
|
104
|
+
- example/app/views/people/index.html.erb
|
105
|
+
- example/config.ru
|
106
|
+
- example/config/application.rb
|
107
|
+
- example/config/boot.rb
|
108
|
+
- example/config/database.yml
|
109
|
+
- example/config/environment.rb
|
110
|
+
- example/config/environments/development.rb
|
111
|
+
- example/config/environments/production.rb
|
112
|
+
- example/config/environments/test.rb
|
113
|
+
- example/config/initializers/backtrace_silencers.rb
|
114
|
+
- example/config/initializers/inflections.rb
|
115
|
+
- example/config/initializers/mime_types.rb
|
116
|
+
- example/config/initializers/secret_token.rb
|
117
|
+
- example/config/initializers/session_store.rb
|
118
|
+
- example/config/initializers/wrap_parameters.rb
|
119
|
+
- example/config/locales/en.yml
|
120
|
+
- example/config/routes.rb
|
121
|
+
- example/db/migrate/20120429172946_create_people.rb
|
122
|
+
- example/db/migrate/20120526164853_create_occupations.rb
|
123
|
+
- example/db/schema.rb
|
124
|
+
- example/db/seeds.rb
|
125
|
+
- example/doc/README_FOR_APP
|
126
|
+
- example/lib/assets/.gitkeep
|
127
|
+
- example/lib/tasks/.gitkeep
|
128
|
+
- example/log/.gitkeep
|
129
|
+
- example/public/404.html
|
130
|
+
- example/public/422.html
|
131
|
+
- example/public/500.html
|
132
|
+
- example/public/favicon.ico
|
133
|
+
- example/public/index.html
|
134
|
+
- example/public/robots.txt
|
135
|
+
- example/script/rails
|
136
|
+
- example/spec/javascripts/spec.js.coffee
|
137
|
+
- example/spec/javascripts/views/edit_person_view_spec.coffee
|
138
|
+
- example/spec/javascripts/views/example_form_view_spec.coffee
|
139
|
+
- example/spec/javascripts/views/select_field_view_spec.coffee
|
140
|
+
- example/spec/javascripts/views/text_field_view_spec.coffee
|
141
|
+
- example/vendor/assets/javascripts/.gitkeep
|
142
|
+
- example/vendor/assets/stylesheets/.gitkeep
|
143
|
+
- example/vendor/plugins/.gitkeep
|
144
|
+
- lib/assets/javascripts/backtastic.coffee
|
145
|
+
- lib/assets/javascripts/templates/select_field_template.jst.hamlc
|
146
|
+
- lib/assets/javascripts/templates/text_field_template.jst.hamlc
|
147
|
+
- lib/assets/javascripts/views/backtastic_view.coffee
|
148
|
+
- lib/assets/javascripts/views/date_field_view.coffee
|
149
|
+
- lib/assets/javascripts/views/form_field_view.coffee
|
150
|
+
- lib/assets/javascripts/views/form_view.coffee
|
151
|
+
- lib/assets/javascripts/views/select_field_view.coffee
|
152
|
+
- lib/assets/javascripts/views/text_field_view.coffee
|
153
|
+
- lib/backtastic.rb
|
154
|
+
- lib/backtastic/version.rb
|
155
|
+
- vendor/assets/javascripts/bootstrap-datepicker.js
|
156
|
+
- vendor/assets/javascripts/jquery.serializeObject.js.coffee
|
157
|
+
- vendor/assets/stylesheets/datepicker.less
|
158
|
+
homepage: ''
|
159
|
+
licenses: []
|
160
|
+
post_install_message:
|
161
|
+
rdoc_options: []
|
162
|
+
require_paths:
|
163
|
+
- lib
|
164
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
165
|
+
none: false
|
166
|
+
requirements:
|
167
|
+
- - ! '>='
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
|
+
none: false
|
172
|
+
requirements:
|
173
|
+
- - ! '>='
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '0'
|
176
|
+
requirements: []
|
177
|
+
rubyforge_project:
|
178
|
+
rubygems_version: 1.8.17
|
179
|
+
signing_key:
|
180
|
+
specification_version: 3
|
181
|
+
summary: Formtastic meets backbone.. ish.
|
182
|
+
test_files: []
|