kilt-cms 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. checksums.yaml +7 -0
  2. data/README.rdoc +28 -0
  3. data/Rakefile +7 -0
  4. data/app/assets/images/kilt/animated-overlay.gif +0 -0
  5. data/app/assets/images/kilt/ui-bg_flat_0_000_40x100.png +0 -0
  6. data/app/assets/images/kilt/ui-bg_flat_0_fff_40x100.png +0 -0
  7. data/app/assets/images/kilt/ui-bg_flat_100_fff_40x100.png +0 -0
  8. data/app/assets/images/kilt/ui-bg_flat_100_ffffff_40x100.png +0 -0
  9. data/app/assets/images/kilt/ui-bg_glass_100_fff_1x400.png +0 -0
  10. data/app/assets/images/kilt/ui-bg_glass_100_ffffff_1x400.png +0 -0
  11. data/app/assets/images/kilt/ui-bg_highlight-soft_100_fff_1x100.png +0 -0
  12. data/app/assets/images/kilt/ui-icons_404040_256x240.png +0 -0
  13. data/app/assets/images/kilt/ui-icons_e74c3c_256x240.png +0 -0
  14. data/app/assets/javascripts/kilt/application.js +17 -0
  15. data/app/assets/javascripts/kilt/kilt.js +39 -0
  16. data/app/assets/stylesheets/kilt/application.scss +1 -0
  17. data/app/assets/stylesheets/kilt/config.rb +10 -0
  18. data/app/assets/stylesheets/kilt/sass/_base.scss +25 -0
  19. data/app/assets/stylesheets/kilt/sass/_buttons.scss +58 -0
  20. data/app/assets/stylesheets/kilt/sass/_form.scss +73 -0
  21. data/app/assets/stylesheets/kilt/sass/_layout.scss +85 -0
  22. data/app/assets/stylesheets/kilt/sass/_mixins.scss +6 -0
  23. data/app/assets/stylesheets/kilt/sass/_tables.scss +65 -0
  24. data/app/assets/stylesheets/kilt/sass/_typography.scss +79 -0
  25. data/app/assets/stylesheets/kilt/sass/modules/_codemirror.scss +262 -0
  26. data/app/assets/stylesheets/kilt/sass/modules/_jquery_ui.scss +659 -0
  27. data/app/assets/stylesheets/kilt/sass/screen.scss +1 -0
  28. data/app/assets/stylesheets/kilt/stylesheets/modules/codemirror.css +1 -0
  29. data/app/assets/stylesheets/kilt/stylesheets/modules/jquery-ui.css +5 -0
  30. data/app/assets/stylesheets/kilt/stylesheets/print.css +0 -0
  31. data/app/assets/stylesheets/kilt/stylesheets/screen.css +5 -0
  32. data/app/controllers/kilt/kilt_controller.rb +122 -0
  33. data/app/views/kilt/form/_default.html.erb +4 -0
  34. data/app/views/kilt/form/boolean.html.erb +4 -0
  35. data/app/views/kilt/form/datetime.html.erb +4 -0
  36. data/app/views/kilt/form/file.html.erb +59 -0
  37. data/app/views/kilt/form/html.html.erb +4 -0
  38. data/app/views/kilt/form/image.html.erb +72 -0
  39. data/app/views/kilt/form/longtext.html.erb +4 -0
  40. data/app/views/kilt/form/number.html.erb +23 -0
  41. data/app/views/kilt/form/text.html.erb +4 -0
  42. data/app/views/kilt/form/vimeo.html.erb +100 -0
  43. data/app/views/kilt/form/youtube.html.erb +98 -0
  44. data/app/views/kilt/kilt/_form.html.erb +30 -0
  45. data/app/views/kilt/kilt/edit.html.erb +2 -0
  46. data/app/views/kilt/kilt/index.html.erb +9 -0
  47. data/app/views/kilt/kilt/list.html.erb +67 -0
  48. data/app/views/kilt/kilt/new.html.erb +2 -0
  49. data/app/views/layouts/kilt/cms.html.erb +41 -0
  50. data/config/routes.rb +13 -0
  51. data/lib/generators/kilt/backend_generator.rb +19 -0
  52. data/lib/generators/kilt/frontend_generator.rb +33 -0
  53. data/lib/generators/kilt/install_generator.rb +13 -0
  54. data/lib/generators/kilt/object_generator.rb +23 -0
  55. data/lib/generators/kilt/templates/backend/config.yml.erb +16 -0
  56. data/lib/generators/kilt/templates/backend/creds.yml.example +8 -0
  57. data/lib/generators/kilt/templates/backend/kilt.rb +11 -0
  58. data/lib/generators/kilt/templates/frontend/application.html.erb +24 -0
  59. data/lib/generators/kilt/templates/frontend/assets/images/sprite/empty +0 -0
  60. data/lib/generators/kilt/templates/frontend/assets/images/sprite/retina/empty +0 -0
  61. data/lib/generators/kilt/templates/frontend/assets/javascripts/application.js +14 -0
  62. data/lib/generators/kilt/templates/frontend/assets/javascripts/html5shiv.js +2 -0
  63. data/lib/generators/kilt/templates/frontend/assets/javascripts/mediaqueries.js +1 -0
  64. data/lib/generators/kilt/templates/frontend/assets/stylesheets/config.rb +24 -0
  65. data/lib/generators/kilt/templates/frontend/assets/stylesheets/sass/modules/_mixins.scss +81 -0
  66. data/lib/generators/kilt/templates/frontend/assets/stylesheets/sass/modules/_reset_custom.scss +31 -0
  67. data/lib/generators/kilt/templates/frontend/assets/stylesheets/sass/modules/_typography.scss +35 -0
  68. data/lib/generators/kilt/templates/frontend/assets/stylesheets/sass/screen.scss +13 -0
  69. data/lib/generators/kilt/templates/frontend/assets/stylesheets/sass/views/_layout.scss +7 -0
  70. data/lib/generators/kilt/templates/frontend/assets/stylesheets/stylesheets/screen.css +160 -0
  71. data/lib/generators/kilt/templates/frontend/dummy.js.erb +11 -0
  72. data/lib/generators/kilt/templates/frontend/home_controller.rb.erb +4 -0
  73. data/lib/generators/kilt/templates/frontend/index.html.erb +5 -0
  74. data/lib/kilt/base.rb +12 -0
  75. data/lib/kilt/engine.rb +17 -0
  76. data/lib/kilt/exceptions.rb +10 -0
  77. data/lib/kilt/form.rb +28 -0
  78. data/lib/kilt/object.rb +66 -0
  79. data/lib/kilt/object_collection.rb +52 -0
  80. data/lib/kilt/upload.rb +54 -0
  81. data/lib/kilt/utils.rb +166 -0
  82. data/lib/kilt.rb +125 -0
  83. data/lib/tasks/kilt_tasks.rake +6 -0
  84. data/test/dummy/Rakefile +6 -0
  85. data/test/dummy/app/assets/images/sprite/empty +0 -0
  86. data/test/dummy/app/assets/images/sprite/retina/empty +0 -0
  87. data/test/dummy/app/assets/javascripts/application.js +14 -0
  88. data/test/dummy/app/assets/javascripts/dummy.js +11 -0
  89. data/test/dummy/app/assets/javascripts/html5shiv.js +2 -0
  90. data/test/dummy/app/assets/javascripts/mediaqueries.js +1 -0
  91. data/test/dummy/app/assets/stylesheets/config.rb +24 -0
  92. data/test/dummy/app/assets/stylesheets/sass/modules/_mixins.scss +81 -0
  93. data/test/dummy/app/assets/stylesheets/sass/modules/_reset_custom.scss +31 -0
  94. data/test/dummy/app/assets/stylesheets/sass/modules/_typography.scss +35 -0
  95. data/test/dummy/app/assets/stylesheets/sass/screen.scss +13 -0
  96. data/test/dummy/app/assets/stylesheets/sass/views/_layout.scss +7 -0
  97. data/test/dummy/app/assets/stylesheets/stylesheets/screen.css +160 -0
  98. data/test/dummy/app/controllers/application_controller.rb +5 -0
  99. data/test/dummy/app/controllers/dummy_controller.rb +4 -0
  100. data/test/dummy/app/views/dummy/index.html.erb +5 -0
  101. data/test/dummy/app/views/layouts/application.html.erb +24 -0
  102. data/test/dummy/bin/bundle +3 -0
  103. data/test/dummy/bin/rails +4 -0
  104. data/test/dummy/bin/rake +4 -0
  105. data/test/dummy/config/application.rb +27 -0
  106. data/test/dummy/config/boot.rb +5 -0
  107. data/test/dummy/config/environment.rb +5 -0
  108. data/test/dummy/config/environments/development.rb +23 -0
  109. data/test/dummy/config/environments/test.rb +23 -0
  110. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  111. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  112. data/test/dummy/config/initializers/inflections.rb +16 -0
  113. data/test/dummy/config/initializers/kilt.rb +14 -0
  114. data/test/dummy/config/initializers/mime_types.rb +5 -0
  115. data/test/dummy/config/initializers/secret_token.rb +12 -0
  116. data/test/dummy/config/initializers/session_store.rb +3 -0
  117. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  118. data/test/dummy/config/kilt/config.yml +40 -0
  119. data/test/dummy/config/kilt/creds.yml +8 -0
  120. data/test/dummy/config/routes.rb +7 -0
  121. data/test/dummy/config.ru +4 -0
  122. data/test/dummy/log/development.log +68163 -0
  123. data/test/dummy/log/test.log +36 -0
  124. data/test/dummy/public/favicon.ico +0 -0
  125. data/test/dummy/public/uploads/file/Gemfile +3 -0
  126. data/test/dummy/public/uploads/file/Gemfile.lock +139 -0
  127. data/test/dummy/public/uploads/file/README.rdoc +28 -0
  128. data/test/dummy/public/uploads/file/Rakefile +6 -0
  129. data/test/dummy/public/uploads/file/barcelona.jpg +0 -0
  130. data/test/dummy/public/uploads/file/dodgerstadiumpix.jpg +0 -0
  131. data/test/dummy/public/uploads/file/field.jpg +0 -0
  132. data/test/dummy/public/uploads/file/fob-elton-john-08.jpg +0 -0
  133. data/test/dummy/public/uploads/file/kilt.gemspec +32 -0
  134. data/test/dummy/public/uploads/file/kilt.rb +100 -0
  135. data/test/dummy/public/uploads/image/2960116125_1158ba3c59_o.jpg +0 -0
  136. data/test/dummy/public/uploads/image/JT.jpg +0 -0
  137. data/test/dummy/public/uploads/image/barcelona.jpg +0 -0
  138. data/test/dummy/public/uploads/image/dodgerstadiumpix.jpg +0 -0
  139. data/test/dummy/public/uploads/image/field.jpg +0 -0
  140. data/test/dummy/spec/kilt_spec.rb +31 -0
  141. data/test/dummy/spec/spec_helper.rb +12 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/03cdc43618f8bef3dfc725a1886c40ed +0 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/0d8e5c7178ebdb79e5b9cc4ef439eae8 +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/13a3d23d13c1459a86283c4fe577a775 +0 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/18837248cb3274df9b7c6b0a5dcd56a5 +0 -0
  146. data/test/dummy/tmp/cache/assets/development/sprockets/1c198a7e1d4ae808a6adf4c4809061eb +0 -0
  147. data/test/dummy/tmp/cache/assets/development/sprockets/2e57def2c82ce30227eefea2360d5f50 +0 -0
  148. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  149. data/test/dummy/tmp/cache/assets/development/sprockets/36f9a7f6f43adb582ac6eec43b58eb30 +0 -0
  150. data/test/dummy/tmp/cache/assets/development/sprockets/36fff19076c588427464432f563a8d2d +0 -0
  151. data/test/dummy/tmp/cache/assets/development/sprockets/3878e0f19bbd21176b1bcc46160a3df3 +0 -0
  152. data/test/dummy/tmp/cache/assets/development/sprockets/3cee919b5b764629fbb01de361ad1b99 +0 -0
  153. data/test/dummy/tmp/cache/assets/development/sprockets/3d69f4783ceef2f5455635de03e6c62a +0 -0
  154. data/test/dummy/tmp/cache/assets/development/sprockets/3d8ca1585ee95c5efb388645d66cf377 +0 -0
  155. data/test/dummy/tmp/cache/assets/development/sprockets/3e0acde4cdc501f590a21ede6fac0b97 +0 -0
  156. data/test/dummy/tmp/cache/assets/development/sprockets/413be9c73d25c7febe933f4619da7cf8 +0 -0
  157. data/test/dummy/tmp/cache/assets/development/sprockets/4b5c4a1edd3823a6a6c39e06b6eb230a +0 -0
  158. data/test/dummy/tmp/cache/assets/development/sprockets/4c5736bf0bd429296d1a32930364897e +0 -0
  159. data/test/dummy/tmp/cache/assets/development/sprockets/542fc810f9cd36e7bed9a3e5e9670995 +0 -0
  160. data/test/dummy/tmp/cache/assets/development/sprockets/56f1e7d57d31bf3315e1e33732d57faa +0 -0
  161. data/test/dummy/tmp/cache/assets/development/sprockets/5bea4c2d87ec725262213ed51575b485 +0 -0
  162. data/test/dummy/tmp/cache/assets/development/sprockets/5eb5178b706a9b8bd0362b7ed487339a +0 -0
  163. data/test/dummy/tmp/cache/assets/development/sprockets/5fa6492da1cba5232b9e9799b5e2bf8f +0 -0
  164. data/test/dummy/tmp/cache/assets/development/sprockets/5fe3d26a30497da82978c9f7ee53068b +0 -0
  165. data/test/dummy/tmp/cache/assets/development/sprockets/66f697b8e4167ad9ebefbd8b5fc65b23 +0 -0
  166. data/test/dummy/tmp/cache/assets/development/sprockets/6b6e86e81f5e8f80bb2b3d1e8f7ed7f3 +0 -0
  167. data/test/dummy/tmp/cache/assets/development/sprockets/6caab0d3b759107ab41492546763aaf0 +0 -0
  168. data/test/dummy/tmp/cache/assets/development/sprockets/6d83c6efd2bf1080ba1dead9fcfdd0db +0 -0
  169. data/test/dummy/tmp/cache/assets/development/sprockets/70d4b3b9e59d0e01e90eebf94dbc2c47 +0 -0
  170. data/test/dummy/tmp/cache/assets/development/sprockets/8127282074e6ffd457b72c228a69f0c0 +0 -0
  171. data/test/dummy/tmp/cache/assets/development/sprockets/8ffacb4ba6e6ca3da12ac1100f664b30 +0 -0
  172. data/test/dummy/tmp/cache/assets/development/sprockets/9dd98bca318fb820a8451cafce020588 +0 -0
  173. data/test/dummy/tmp/cache/assets/development/sprockets/b259805c84c81064f20700498328f109 +0 -0
  174. data/test/dummy/tmp/cache/assets/development/sprockets/b7e1f059a53a1e79df01a336fb1f50f0 +0 -0
  175. data/test/dummy/tmp/cache/assets/development/sprockets/c0671678b70011547b80da0669d031cc +0 -0
  176. data/test/dummy/tmp/cache/assets/development/sprockets/c1006115f345f87cc152b851154e9e34 +0 -0
  177. data/test/dummy/tmp/cache/assets/development/sprockets/cf0d5ad037fbf541c6b982abf73b9938 +0 -0
  178. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  179. data/test/dummy/tmp/cache/assets/development/sprockets/da31523b2e8cf32dd8db9f304d5b7395 +0 -0
  180. data/test/dummy/tmp/cache/assets/development/sprockets/dc676330961fd22be77c48cb77ec065f +0 -0
  181. data/test/dummy/tmp/cache/assets/development/sprockets/ddc29f2c13cd99d017fd526b61dcb951 +0 -0
  182. data/test/dummy/tmp/cache/assets/development/sprockets/de45247cb814cafe20e9e46c79e470fe +0 -0
  183. data/test/dummy/tmp/cache/assets/development/sprockets/e22d705d0c889ec4837f183a9beec0f3 +0 -0
  184. data/test/dummy/tmp/cache/assets/development/sprockets/e7ba95a61b1b9381906a88610dceb6dd +0 -0
  185. data/test/dummy/tmp/cache/assets/development/sprockets/ef7c8ce46dfc9e9087ce84dbdfdd0011 +0 -0
  186. data/test/dummy/tmp/cache/assets/development/sprockets/f3e1a8ba304f70dccefd77356c900ebc +0 -0
  187. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  188. data/test/dummy/tmp/data/meta_request/2ff92b3b-2e2c-438e-a687-d2900c8722e3.json +1 -0
  189. data/test/dummy/tmp/data/meta_request/4a2f197b-3f28-4ade-962e-0337d56878b1.json +1 -0
  190. data/test/dummy/tmp/data/meta_request/7eb04de5-6edf-4ea2-a4cf-994e6173b529.json +1 -0
  191. data/test/dummy/tmp/data/meta_request/96ec6abc-1da4-45e1-a397-79e849741501.json +1 -0
  192. data/test/dummy/tmp/data/meta_request/a9566f73-bde1-4346-b254-011381243ddc.json +1 -0
  193. data/test/dummy/tmp/data/meta_request/a9eb2875-930e-49ed-ab2f-40aba11bb132.json +1 -0
  194. data/test/dummy/tmp/data/meta_request/bcd27bed-9cac-4c32-8030-2699415e91a1.json +1 -0
  195. data/test/dummy/tmp/data/meta_request/e6152727-3e54-4858-ad8f-6e57e247a8a5.json +1 -0
  196. data/test/dummy/tmp/data/meta_request/e7db6149-e316-4ad1-a3a8-c014d0e7092b.json +1 -0
  197. data/test/dummy/tmp/data/meta_request/fc793f84-b287-4459-b902-705b1d2b1141.json +1 -0
  198. metadata +536 -0
@@ -0,0 +1,31 @@
1
+ *,
2
+ *:before,
3
+ *:after {
4
+ outline: none;
5
+ box-sizing: border-box;
6
+ -moz-box-sizing: border-box;
7
+ -webkit-box-sizing: border-box;
8
+ -webkit-font-smoothing: antialiased;
9
+ font-smoothing: antialiased;
10
+ }
11
+ a,
12
+ input[type="submit"] {
13
+ cursor: pointer;
14
+ }
15
+ input,
16
+ select,
17
+ textarea {
18
+ -webkit-appearance: none;
19
+ border-radius: 0;
20
+ }
21
+ strong,
22
+ b {
23
+ font-weight: bold;
24
+ }
25
+ em,
26
+ i {
27
+ font-style: italic;
28
+ }
29
+ iframe {
30
+ display: block;
31
+ }
@@ -0,0 +1,35 @@
1
+ *,
2
+ *:before,
3
+ *:after {
4
+ outline: none;
5
+ box-sizing: border-box;
6
+ -moz-box-sizing: border-box;
7
+ -webkit-box-sizing: border-box;
8
+ -webkit-font-smoothing: antialiased;
9
+ font-smoothing: antialiased;
10
+ }
11
+
12
+ body {
13
+ font-family: 'Open Sans', sans-serif;
14
+ font-weight: 300;
15
+ font-size: 18px;
16
+ line-height: 1.5;
17
+ }
18
+
19
+ h1,h2,h3,h4,h5,h6,p,table {
20
+ margin: 0 0 30px;
21
+ }
22
+
23
+ h1 {
24
+ font-size: 48px;
25
+ font-weight: 300;
26
+ }
27
+
28
+ h2 {
29
+ font-size: 36px;
30
+ margin: 30px 0;
31
+ }
32
+
33
+ h3,h4,h5,h6 {
34
+ font-size: 24px;
35
+ }
@@ -0,0 +1,13 @@
1
+ //uncomment the following if using sprites
2
+ //$sprites: sprite-map("sprite/*.png", $spacing: 5px);
3
+ //$retina_sprites: sprite-map("sprite/retina/*.png", $spacing: 5px);
4
+ //@import "compass/utilities/sprites/base";
5
+
6
+ @import "compass/reset";
7
+ @import "compass/css3";
8
+
9
+ @import "modules/mixins";
10
+ @import "modules/reset_custom";
11
+ @import "modules/typography";
12
+
13
+ @import "views/layout";
@@ -0,0 +1,7 @@
1
+ .body {
2
+ font-family: 'OpenSans';
3
+ }
4
+ .wrapper {
5
+ width: 1000px;
6
+ margin: 0 auto;
7
+ }
@@ -0,0 +1,160 @@
1
+ /* line 17, ../../../../../../../../../../Users/benwalker/.rvm/gems/ruby-2.0.0-p353/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
2
+ html, body, div, span, applet, object, iframe,
3
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
4
+ a, abbr, acronym, address, big, cite, code,
5
+ del, dfn, em, img, ins, kbd, q, s, samp,
6
+ small, strike, strong, sub, sup, tt, var,
7
+ b, u, i, center,
8
+ dl, dt, dd, ol, ul, li,
9
+ fieldset, form, label, legend,
10
+ table, caption, tbody, tfoot, thead, tr, th, td,
11
+ article, aside, canvas, details, embed,
12
+ figure, figcaption, footer, header, hgroup,
13
+ menu, nav, output, ruby, section, summary,
14
+ time, mark, audio, video {
15
+ margin: 0;
16
+ padding: 0;
17
+ border: 0;
18
+ font: inherit;
19
+ font-size: 100%;
20
+ vertical-align: baseline;
21
+ }
22
+
23
+ /* line 22, ../../../../../../../../../../Users/benwalker/.rvm/gems/ruby-2.0.0-p353/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
24
+ html {
25
+ line-height: 1;
26
+ }
27
+
28
+ /* line 24, ../../../../../../../../../../Users/benwalker/.rvm/gems/ruby-2.0.0-p353/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
29
+ ol, ul {
30
+ list-style: none;
31
+ }
32
+
33
+ /* line 26, ../../../../../../../../../../Users/benwalker/.rvm/gems/ruby-2.0.0-p353/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
34
+ table {
35
+ border-collapse: collapse;
36
+ border-spacing: 0;
37
+ }
38
+
39
+ /* line 28, ../../../../../../../../../../Users/benwalker/.rvm/gems/ruby-2.0.0-p353/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
40
+ caption, th, td {
41
+ text-align: left;
42
+ font-weight: normal;
43
+ vertical-align: middle;
44
+ }
45
+
46
+ /* line 30, ../../../../../../../../../../Users/benwalker/.rvm/gems/ruby-2.0.0-p353/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
47
+ q, blockquote {
48
+ quotes: none;
49
+ }
50
+ /* line 103, ../../../../../../../../../../Users/benwalker/.rvm/gems/ruby-2.0.0-p353/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
51
+ q:before, q:after, blockquote:before, blockquote:after {
52
+ content: "";
53
+ content: none;
54
+ }
55
+
56
+ /* line 32, ../../../../../../../../../../Users/benwalker/.rvm/gems/ruby-2.0.0-p353/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
57
+ a img {
58
+ border: none;
59
+ }
60
+
61
+ /* line 116, ../../../../../../../../../../Users/benwalker/.rvm/gems/ruby-2.0.0-p353/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
62
+ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary {
63
+ display: block;
64
+ }
65
+
66
+ /* line 3, ../sass/modules/_reset_custom.scss */
67
+ *,
68
+ *:before,
69
+ *:after {
70
+ outline: none;
71
+ box-sizing: border-box;
72
+ -moz-box-sizing: border-box;
73
+ -webkit-box-sizing: border-box;
74
+ -webkit-font-smoothing: antialiased;
75
+ font-smoothing: antialiased;
76
+ }
77
+
78
+ /* line 12, ../sass/modules/_reset_custom.scss */
79
+ a,
80
+ input[type="submit"] {
81
+ cursor: pointer;
82
+ }
83
+
84
+ /* line 17, ../sass/modules/_reset_custom.scss */
85
+ input,
86
+ select,
87
+ textarea {
88
+ -webkit-appearance: none;
89
+ border-radius: 0;
90
+ }
91
+
92
+ /* line 22, ../sass/modules/_reset_custom.scss */
93
+ strong,
94
+ b {
95
+ font-weight: bold;
96
+ }
97
+
98
+ /* line 26, ../sass/modules/_reset_custom.scss */
99
+ em,
100
+ i {
101
+ font-style: italic;
102
+ }
103
+
104
+ /* line 29, ../sass/modules/_reset_custom.scss */
105
+ iframe {
106
+ display: block;
107
+ }
108
+
109
+ /* line 3, ../sass/modules/_typography.scss */
110
+ *,
111
+ *:before,
112
+ *:after {
113
+ outline: none;
114
+ box-sizing: border-box;
115
+ -moz-box-sizing: border-box;
116
+ -webkit-box-sizing: border-box;
117
+ -webkit-font-smoothing: antialiased;
118
+ font-smoothing: antialiased;
119
+ }
120
+
121
+ /* line 12, ../sass/modules/_typography.scss */
122
+ body {
123
+ font-family: 'Open Sans', sans-serif;
124
+ font-weight: 300;
125
+ font-size: 18px;
126
+ line-height: 1.5;
127
+ }
128
+
129
+ /* line 19, ../sass/modules/_typography.scss */
130
+ h1, h2, h3, h4, h5, h6, p, table {
131
+ margin: 0 0 30px;
132
+ }
133
+
134
+ /* line 23, ../sass/modules/_typography.scss */
135
+ h1 {
136
+ font-size: 48px;
137
+ font-weight: 300;
138
+ }
139
+
140
+ /* line 28, ../sass/modules/_typography.scss */
141
+ h2 {
142
+ font-size: 36px;
143
+ margin: 30px 0;
144
+ }
145
+
146
+ /* line 33, ../sass/modules/_typography.scss */
147
+ h3, h4, h5, h6 {
148
+ font-size: 24px;
149
+ }
150
+
151
+ /* line 1, ../sass/views/_layout.scss */
152
+ .body {
153
+ font-family: 'OpenSans';
154
+ }
155
+
156
+ /* line 4, ../sass/views/_layout.scss */
157
+ .wrapper {
158
+ width: 1000px;
159
+ margin: 0 auto;
160
+ }
@@ -0,0 +1,11 @@
1
+ var <%= class_name %> = (function(){
2
+ var self;
3
+ return {
4
+ init: function(){
5
+ self = this;
6
+ }
7
+ };
8
+ })();
9
+ $(document).ready(function(){
10
+ <%= class_name %>.init();
11
+ });
@@ -0,0 +1,4 @@
1
+ class <%= class_name %>Controller < ApplicationController
2
+ def index
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ <%= link_to "Admin", "/admin" %>
2
+
3
+ <pre>
4
+ <%= Kilt::Utils.tips %>
5
+ </pre>
data/lib/kilt/base.rb ADDED
@@ -0,0 +1,12 @@
1
+ require "kilt/engine"
2
+ require "kilt/exceptions"
3
+
4
+ require "kilt/object"
5
+ require "kilt/object_collection"
6
+
7
+ require 'kilt/upload'
8
+
9
+ require "kilt/utils"
10
+ require "kilt/form"
11
+
12
+ r = RethinkDB::RQL.new
@@ -0,0 +1,17 @@
1
+ require 'rubygems'
2
+ require 'rethinkdb'
3
+ require 'rails_config'
4
+ require 'jquery-rails'
5
+ require 'jquery-ui-rails'
6
+ require 'aws/s3'
7
+
8
+ module Kilt
9
+ class Engine < ::Rails::Engine
10
+
11
+ isolate_namespace Kilt
12
+
13
+ config.generators.integration_tool :rspec
14
+ config.generators.test_framework :rspec
15
+
16
+ end
17
+ end
@@ -0,0 +1,10 @@
1
+ module Kilt
2
+ class ConfigError < StandardError; end
3
+ class DatabaseError < StandardError; end
4
+
5
+ class NoConfigError < ConfigError; end
6
+
7
+ class NoDatabaseConfigError < DatabaseError; end
8
+ class CantConnectToDatabaseError < DatabaseError; end
9
+ class CantSetupDatabaseError < DatabaseError; end
10
+ end
data/lib/kilt/form.rb ADDED
@@ -0,0 +1,28 @@
1
+ module Kilt
2
+ module Form
3
+
4
+ TEMPLATES_DIR = "#{Kilt::Engine.root}/app/views/kilt/form"
5
+
6
+ def self.method_missing(method, *args)
7
+ begin
8
+
9
+ # Get the method name
10
+ name = method.to_s
11
+
12
+ # Get the object type and field name
13
+ object = args[0]
14
+ field_name = args[1]
15
+ index = args[2]
16
+
17
+ # Render the corresponding form field, or fall back to the default if we have an issue
18
+ begin
19
+ ActionView::Base.new(TEMPLATES_DIR).render(:file => "#{name}.html.erb", :locals => {:object => object, :field_name => field_name, :index => index})
20
+ rescue
21
+ ActionView::Base.new(TEMPLATES_DIR).render(:file => "_default.html.erb", :locals => {:object => object, :field_name => field_name, :index => index})
22
+ end
23
+
24
+ end
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,66 @@
1
+ module Kilt
2
+ class Object
3
+ attr_accessor :type, :fields, :values, :slug
4
+
5
+ def initialize(type, values = {})
6
+ @type = type
7
+ @values = values
8
+
9
+ assemble_fields
10
+ end
11
+
12
+ def fill(params)
13
+ puts params
14
+ # Take the params passed in and match them up to the fields
15
+ @fields.each do |key, value|
16
+ if params[key] || params["#{key}-hidden"]
17
+ field_type = value.downcase
18
+ if ['file', 'image'].include? field_type
19
+ if params["#{key}-hidden"] && params["#{key}-hidden"] == 'clear' && !params[key]
20
+ @values[key.to_s] = ''
21
+ elsif params[key]
22
+ @values[key.to_s] = Kilt::Upload.send(field_type, params[key])
23
+ end
24
+ else
25
+ @values[key.to_s] = params[key]
26
+ end
27
+ end
28
+ end
29
+
30
+ # Add some extra fields
31
+ if !@slug
32
+ @values['slug'] = Utils.slugify(@values['name'])
33
+ end
34
+
35
+ @values['type'] = @type
36
+
37
+ end
38
+
39
+ def [](key)
40
+ # Return the values of the object as a hash
41
+ @values[key.to_s].html_safe if @values[key.to_s]
42
+ end
43
+
44
+ def []=(key, value)
45
+ @values[key.to_s] = value
46
+ end
47
+
48
+ def slug
49
+ @values['slug']
50
+ end
51
+
52
+ def empty?
53
+ @values.length == 0
54
+ end
55
+
56
+ private
57
+
58
+ def assemble_fields
59
+ # Get the fields from the config, and add the name field
60
+ @fields = Kilt.send(@type).fields.map { |key, value| [key, value] }
61
+ if !Kilt.send(@type).fields.to_h.has_key? :name
62
+ @fields.insert(0, ['name', 'text'])
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,52 @@
1
+ require 'forwardable'
2
+
3
+ module Kilt
4
+ class ObjectCollection
5
+ include Enumerable
6
+ extend Forwardable
7
+ attr_accessor :values
8
+
9
+ def_delegators :@values, :each, :<<
10
+
11
+ def initialize(values = [])
12
+ @values = values
13
+ end
14
+
15
+ def [](key)
16
+ @values[key]
17
+ end
18
+
19
+ def order(key = 'name', direction = 'ASC')
20
+ values = @values.sort_by { |hash| hash[key] }
21
+ direction == 'DESC' ? values.reverse! : values
22
+ end
23
+
24
+ def group(key)
25
+ # create an empty hash
26
+ ret = {}
27
+
28
+ # loop through all items in @values
29
+ @values.each do |object|
30
+ # for each item, check to see if the hash already has a value for this key
31
+ if ret[object[key]]
32
+ # if it does, add it to the value, which should be an array
33
+ a = ret[object[key]]
34
+ a << object
35
+ else
36
+ # if it doesn't, create an array first, add this loop item to it, and add the
37
+ # array as the value for that hash key
38
+ a = []
39
+ a << object
40
+ ret[object[key]] = a
41
+ end
42
+ end
43
+
44
+ # return the hash
45
+ ret
46
+ end
47
+
48
+ def empty?
49
+ @values.empty?
50
+ end
51
+ end
52
+ end