backtastic 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/.gitignore +10 -0
  2. data/Gemfile +4 -0
  3. data/README.md +72 -0
  4. data/Rakefile +1 -0
  5. data/backtastic.gemspec +28 -0
  6. data/example/.gitignore +15 -0
  7. data/example/Gemfile +44 -0
  8. data/example/README.rdoc +261 -0
  9. data/example/Rakefile +7 -0
  10. data/example/app/assets/images/rails.png +0 -0
  11. data/example/app/assets/javascripts/application.js.coffee +22 -0
  12. data/example/app/assets/javascripts/backbone/example.js.coffee +15 -0
  13. data/example/app/assets/javascripts/backbone/models/.gitkeep +0 -0
  14. data/example/app/assets/javascripts/backbone/models/occupation.coffee +7 -0
  15. data/example/app/assets/javascripts/backbone/models/people.coffee +7 -0
  16. data/example/app/assets/javascripts/backbone/models/thing.coffee +1 -0
  17. data/example/app/assets/javascripts/backbone/routers/.gitkeep +0 -0
  18. data/example/app/assets/javascripts/backbone/routers/people_router.coffee +27 -0
  19. data/example/app/assets/javascripts/backbone/templates/.gitkeep +0 -0
  20. data/example/app/assets/javascripts/backbone/views/.gitkeep +0 -0
  21. data/example/app/assets/javascripts/backbone/views/edit_person_view.coffee +21 -0
  22. data/example/app/assets/javascripts/backbone/views/example_form_view.coffee +2 -0
  23. data/example/app/assets/javascripts/backbone/views/people_view.coffee +6 -0
  24. data/example/app/assets/javascripts/bootstrap.js.coffee +4 -0
  25. data/example/app/assets/stylesheets/application.css +13 -0
  26. data/example/app/assets/stylesheets/bootstrap_and_overrides.css.less +30 -0
  27. data/example/app/assets/templates/edit_person_view_template.jst.hamlc +13 -0
  28. data/example/app/assets/templates/example_form_view_template.jst.hamlc +2 -0
  29. data/example/app/assets/templates/people_view_template.jst.hamlc +6 -0
  30. data/example/app/controllers/application_controller.rb +3 -0
  31. data/example/app/controllers/occupations_controller.rb +3 -0
  32. data/example/app/controllers/people_controller.rb +3 -0
  33. data/example/app/helpers/application_helper.rb +2 -0
  34. data/example/app/mailers/.gitkeep +0 -0
  35. data/example/app/models/.gitkeep +0 -0
  36. data/example/app/models/occupation.rb +2 -0
  37. data/example/app/models/person.rb +5 -0
  38. data/example/app/views/layouts/application.html.erb +75 -0
  39. data/example/app/views/people/index.html.erb +7 -0
  40. data/example/config.ru +4 -0
  41. data/example/config/application.rb +59 -0
  42. data/example/config/boot.rb +6 -0
  43. data/example/config/database.yml +25 -0
  44. data/example/config/environment.rb +5 -0
  45. data/example/config/environments/development.rb +37 -0
  46. data/example/config/environments/production.rb +67 -0
  47. data/example/config/environments/test.rb +37 -0
  48. data/example/config/initializers/backtrace_silencers.rb +7 -0
  49. data/example/config/initializers/inflections.rb +15 -0
  50. data/example/config/initializers/mime_types.rb +5 -0
  51. data/example/config/initializers/secret_token.rb +7 -0
  52. data/example/config/initializers/session_store.rb +8 -0
  53. data/example/config/initializers/wrap_parameters.rb +14 -0
  54. data/example/config/locales/en.yml +5 -0
  55. data/example/config/routes.rb +62 -0
  56. data/example/db/migrate/20120429172946_create_people.rb +12 -0
  57. data/example/db/migrate/20120526164853_create_occupations.rb +9 -0
  58. data/example/db/schema.rb +31 -0
  59. data/example/db/seeds.rb +7 -0
  60. data/example/doc/README_FOR_APP +2 -0
  61. data/example/lib/assets/.gitkeep +0 -0
  62. data/example/lib/tasks/.gitkeep +0 -0
  63. data/example/log/.gitkeep +0 -0
  64. data/example/public/404.html +26 -0
  65. data/example/public/422.html +26 -0
  66. data/example/public/500.html +25 -0
  67. data/example/public/favicon.ico +0 -0
  68. data/example/public/index.html +241 -0
  69. data/example/public/robots.txt +5 -0
  70. data/example/script/rails +6 -0
  71. data/example/spec/javascripts/spec.js.coffee +7 -0
  72. data/example/spec/javascripts/views/edit_person_view_spec.coffee +39 -0
  73. data/example/spec/javascripts/views/example_form_view_spec.coffee +12 -0
  74. data/example/spec/javascripts/views/select_field_view_spec.coffee +28 -0
  75. data/example/spec/javascripts/views/text_field_view_spec.coffee +17 -0
  76. data/example/vendor/assets/javascripts/.gitkeep +0 -0
  77. data/example/vendor/assets/stylesheets/.gitkeep +0 -0
  78. data/example/vendor/plugins/.gitkeep +0 -0
  79. data/lib/assets/javascripts/backtastic.coffee +13 -0
  80. data/lib/assets/javascripts/templates/select_field_template.jst.hamlc +4 -0
  81. data/lib/assets/javascripts/templates/text_field_template.jst.hamlc +2 -0
  82. data/lib/assets/javascripts/views/backtastic_view.coffee +12 -0
  83. data/lib/assets/javascripts/views/date_field_view.coffee +12 -0
  84. data/lib/assets/javascripts/views/form_field_view.coffee +23 -0
  85. data/lib/assets/javascripts/views/form_view.coffee +38 -0
  86. data/lib/assets/javascripts/views/select_field_view.coffee +8 -0
  87. data/lib/assets/javascripts/views/text_field_view.coffee +4 -0
  88. data/lib/backtastic.rb +9 -0
  89. data/lib/backtastic/version.rb +3 -0
  90. data/vendor/assets/javascripts/bootstrap-datepicker.js +401 -0
  91. data/vendor/assets/javascripts/jquery.serializeObject.js.coffee +19 -0
  92. data/vendor/assets/stylesheets/datepicker.less +122 -0
  93. 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: []