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,30 @@
1
+
2
+ <div class="wr">
3
+
4
+ <h2><%= @object['name'] %> <small><%= @type.capitalize %></small></h2>
5
+
6
+ <div class="page-actions">
7
+ <%= link_to "← Back to #{@type.pluralize.capitalize}", list_path(@type), :class => 'button back' %>
8
+ </div>
9
+
10
+ <% if flash[:error] -%>
11
+ <p class="error"><%= flash[:error] %></p>
12
+ <% end %>
13
+
14
+ <% if flash[:notice] -%>
15
+ <p class="notice"><%= flash[:notice] %></p>
16
+ <% end %>
17
+
18
+ <%= form_tag @path, :method => "post", :multipart => true do %>
19
+
20
+ <% @object.fields.each_with_index do |(key, value), index| %>
21
+ <%= Kilt::Form.send(value, @object, key, index) %>
22
+ <% end %>
23
+
24
+ <div class="form-input actions">
25
+ <input type="submit" class="submit save" value="Save">
26
+ </div>
27
+
28
+ <% end%>
29
+
30
+ </div>
@@ -0,0 +1,2 @@
1
+ <% @path = update_object_path(@type.pluralize, @slug) %>
2
+ <%= render :partial => 'form' %>
@@ -0,0 +1,9 @@
1
+ <div class="wr">
2
+ <h2>Objects</h2>
3
+
4
+ <ul class="object-list">
5
+ <% @types.each do |type| %>
6
+ <li><%= link_to type.pluralize.capitalize, list_path(type.pluralize) %></li>
7
+ <% end %>
8
+ </ul>
9
+ </div>
@@ -0,0 +1,67 @@
1
+ <div class="wr">
2
+
3
+ <h2><%= @type.pluralize.capitalize %></h2>
4
+
5
+ <div class="page-actions">
6
+ <%= link_to "New #{@type.capitalize}", new_object_path(@type.singularize), :class => 'button' %>
7
+ </div>
8
+
9
+ <!-- todo: search by title -->
10
+
11
+ <% if flash[:error] -%>
12
+ <p class="error"><%= flash[:error] %></p>
13
+ <% end %>
14
+
15
+ <% if flash[:notice] -%>
16
+ <p class="notice"><%= flash[:notice] %></p>
17
+ <% end %>
18
+
19
+ <% if @objects.empty? %>
20
+
21
+ No <%= @type.pluralize.capitalize %> found.
22
+
23
+ <% else %>
24
+
25
+ <table>
26
+ <thead>
27
+ <tr>
28
+ <th class="title"><h4>Name</h4></th>
29
+ <th class="updated"><h4>Last Updated</h4></th>
30
+ <th class="created"><h4>Created</h4></th>
31
+ <th class="actions"></th>
32
+ </tr>
33
+ </thead>
34
+ <tbody>
35
+
36
+ <% @objects.each do |object| %>
37
+
38
+ <tr>
39
+ <td class="title">
40
+ <%= link_to object['name'], edit_object_path(@type.pluralize, object['slug']), :class => 'edit' %>
41
+ </td>
42
+ <td class="updated">
43
+ <% if object['updated_at'] %>
44
+ <%= distance_of_time_in_words_to_now(object['updated_at'].to_datetime) %> ago
45
+ <% end %>
46
+ </td>
47
+ <td class="created">
48
+ <% if object['created_at'] %>
49
+ <%= distance_of_time_in_words_to_now(object['created_at'].to_datetime) %> ago
50
+ <% end %>
51
+ </td>
52
+ <td class="actions">
53
+ <%= link_to 'Edit', edit_object_path(@type.pluralize, object['slug']), :class => 'button edit' %>
54
+ <%= link_to 'Delete', delete_object_path(@type.pluralize, object['slug']), :class => 'button delete', :method => 'delete', :data => {:confirm => "Are you sure you want to delete this #{@type.capitalize}?" } %>
55
+ </td>
56
+ </tr>
57
+ <% end %>
58
+
59
+ <!-- todo: pagination -->
60
+
61
+ </tbody>
62
+
63
+ </table>
64
+
65
+ <% end %>
66
+
67
+ </div>
@@ -0,0 +1,2 @@
1
+ <% @path = create_object_path(@type.pluralize) %>
2
+ <%= render :partial => 'form' %>
@@ -0,0 +1,41 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
5
+ <meta charset="utf-8">
6
+ <title><%= Kilt.config.name %></title>
7
+
8
+ <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,800,300" rel="stylesheet" type="text/css">
9
+ <%= stylesheet_link_tag "kilt/stylesheets/screen", :media => "all" %>
10
+
11
+ <%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.min.js" %>
12
+ <%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/codemirror/3.19.0/mode/xml/xml.min.js" %>
13
+ <%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/javascript/javascript.min.js" %>
14
+ <%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/codemirror/3.19.0/mode/css/css.min.js" %>
15
+ <%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/htmlmixed/htmlmixed.min.js" %>
16
+
17
+ <%= javascript_include_tag "kilt/application" %>
18
+ <%= csrf_meta_tags %>
19
+ </head>
20
+ <body>
21
+ <header class="hd">
22
+ <div class="wr">
23
+ <h6><a href="/admin"><%= Kilt.config.name %></a></h6>
24
+ <a class="button small dashboard" href="/admin">Dashboard</a>
25
+ <!--
26
+ <div class="user">
27
+ <span class="greeting">Hello, <span class="user-name">Decimus Meridius</span></span>
28
+ <a class="button log-out">Log out</a>
29
+ </div>
30
+ -->
31
+ </div>
32
+ </header>
33
+
34
+ <section class="body">
35
+ <%= yield %>
36
+ </section>
37
+
38
+
39
+
40
+ </body>
41
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,13 @@
1
+ Kilt::Engine.routes.draw do
2
+
3
+ root 'kilt#index'
4
+
5
+ get '/' => 'kilt#index', :as => 'home'
6
+ get '/:types' => 'kilt#list', :as => 'list'
7
+ get '/:types/new' => 'kilt#new', :as => 'new_object'
8
+ post '/:types' => 'kilt#create', :as => 'create_object'
9
+ get '/:types/:slug' => 'kilt#edit', :as => 'edit_object'
10
+ post '/:types/:slug' => 'kilt#update', :as => 'update_object'
11
+ delete '/:types/:slug' => 'kilt#delete', :as => 'delete_object'
12
+
13
+ end
@@ -0,0 +1,19 @@
1
+ module Kilt
2
+ module Generators
3
+ class BackendGenerator < Rails::Generators::Base
4
+ desc "Generates the Kilt backend"
5
+
6
+ source_root File.expand_path("../templates/backend", __FILE__)
7
+
8
+ def generate
9
+ #if using git, add creds config to .gitignore
10
+ append_file Rails.root.join('.gitignore'), '/config/kilt/creds.yml' if File.exists? Rails.root.join('.gitignore')
11
+ #copy files, templates for app-specific naming, inject engine mount to routes
12
+ template 'config.yml.erb', Rails.root.join('config', 'kilt', 'config.yml')
13
+ copy_file 'creds.yml.example', Rails.root.join('config', 'kilt', 'creds.yml.example')
14
+ copy_file 'kilt.rb', Rails.root.join('config', 'initializers', 'kilt.rb')
15
+ inject_into_file Rails.root.join('config', 'routes.rb'), "\n\tmount Kilt::Engine => '/admin'\n", :after => "#{Rails.application.class.parent_name.camelize}::Application.routes.draw do\n"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,33 @@
1
+ module Kilt
2
+ module Generators
3
+ class FrontendGenerator < Rails::Generators::Base
4
+ desc "Generates a bootstrap for the host application"
5
+
6
+ source_root File.expand_path("../templates/frontend",__FILE__)
7
+
8
+ def generate
9
+ #copy files, templates for app-specific naming, inject index action into routs
10
+ template 'home_controller.rb.erb', Rails.root.join('app', 'controllers', "#{file_name}_controller.rb")
11
+ copy_file 'application.html.erb', Rails.root.join('app','views','layouts','application.html.erb')
12
+ copy_file 'index.html.erb', Rails.root.join('app', 'views', "#{file_name}", 'index.html.erb')
13
+ inject_into_file Rails.root.join('config','routes.rb'),"\n\tget '/' => '#{file_name}#index'\n", :after => "mount Kilt::Engine => '/admin'\n"
14
+ #handle assets, sans named files
15
+ directory 'assets/images', Rails.root.join('app','assets','images')
16
+ directory 'assets/javascripts', Rails.root.join('app','assets','javascripts')
17
+ directory 'assets/stylesheets', Rails.root.join('app','assets','stylesheets')
18
+ #handle named files
19
+ template 'dummy.js.erb', Rails.root.join('app','assets','javascripts',"#{file_name}.js")
20
+ end
21
+
22
+ private
23
+
24
+ def file_name
25
+ Rails.application.class.parent_name.underscore
26
+ end
27
+
28
+ def class_name
29
+ Rails.application.class.parent_name.camelize
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,13 @@
1
+ module Kilt
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+
5
+ def install
6
+ #run all kilt generators
7
+ generate "kilt:backend"
8
+ generate "kilt:frontend"
9
+ end
10
+
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,23 @@
1
+ module Kilt
2
+ module Generators
3
+ class ObjectGenerator < Rails::Generators::Base
4
+ desc "adds objects and their properties to the configuration file"
5
+ argument :object_name, :type => :string, :required => true, :desc => "required"
6
+ argument :fields, :type => :array, :required => true, :desc => "required field_name:field_type"
7
+
8
+ def generate
9
+ if !Kilt.config.objects[self.object_name.singularize.underscore]
10
+ out = "\n\s\s#{self.object_name.singularize.underscore}:"
11
+ out = "#{out}\n\s\s\s\sfields:"
12
+ self.fields.each do |field|
13
+ field = field.gsub(':',': ')
14
+ out = "#{out}\n\s\s\s\s\s\s#{field.downcase}"
15
+ end
16
+ append_to_file Rails.root.join('config', 'kilt', 'config.yml'), out
17
+ else
18
+ puts "The #{self.object_name} object already exists"
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,16 @@
1
+ name: <%= Rails.application.class.parent_name.titleize %>
2
+ storage:
3
+ strategy: local
4
+ objects:
5
+ bagpipe:
6
+ fields:
7
+ name: text
8
+ weight: number
9
+ description: longtext
10
+ markup: html
11
+ birthday: datetime
12
+ has_stuff: boolean
13
+ image: image
14
+ vimeo_video: vimeo
15
+ youtube_video: youtube
16
+ other: file
@@ -0,0 +1,8 @@
1
+ db:
2
+ host: <DB URL>
3
+ port: <DB Port>
4
+ db: <DB Name>
5
+ s3:
6
+ key: <S3 Key>
7
+ secret: <S3 Secret>
8
+ bucket: <S3 Bucket>
@@ -0,0 +1,11 @@
1
+ RailsConfig.setup do |config|
2
+ config.const_name = "Settings"
3
+ end
4
+
5
+ # Pull in the database configs
6
+ Settings.add_source!("#{Rails.root}/config/kilt/config.yml")
7
+ Settings.add_source!("#{Rails.root}/config/kilt/creds.yml")
8
+ Settings.reload!
9
+
10
+ # Attach the Kilt config the content pulled in by RailsConfig
11
+ Kilt.config = Settings
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
5
+ <meta charset="utf-8">
6
+ <title><%= Kilt.config.name %></title>
7
+
8
+ <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,800,300" rel="stylesheet" type="text/css">
9
+ <%= stylesheet_link_tag "stylesheets/screen", :media => "all" %>
10
+
11
+ <%= javascript_include_tag "application" %>
12
+ </head>
13
+ <body>
14
+
15
+ <div class="wrapper">
16
+
17
+ <h1><%= Kilt.config.name %> app</h1>
18
+
19
+ <%= yield %>
20
+
21
+ </div>
22
+
23
+ </body>
24
+ </html>
@@ -0,0 +1,14 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require_tree .
@@ -0,0 +1,2 @@
1
+ // HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
2
+ (function(k,m){var g="3.7.0";var d=k.html5||{};var h=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;var c=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;var q;var i="_html5shiv";var a=0;var o={};var e;(function(){try{var t=m.createElement("a");t.innerHTML="<xyz></xyz>";q=("hidden" in t);e=t.childNodes.length==1||(function(){(m.createElement)("a");var v=m.createDocumentFragment();return(typeof v.cloneNode=="undefined"||typeof v.createDocumentFragment=="undefined"||typeof v.createElement=="undefined")}())}catch(u){q=true;e=true}}());function f(t,v){var w=t.createElement("p"),u=t.getElementsByTagName("head")[0]||t.documentElement;w.innerHTML="x<style>"+v+"</style>";return u.insertBefore(w.lastChild,u.firstChild)}function l(){var t=j.elements;return typeof t=="string"?t.split(" "):t}function p(t){var u=o[t[i]];if(!u){u={};a++;t[i]=a;o[a]=u}return u}function n(w,t,v){if(!t){t=m}if(e){return t.createElement(w)}if(!v){v=p(t)}var u;if(v.cache[w]){u=v.cache[w].cloneNode()}else{if(c.test(w)){u=(v.cache[w]=v.createElem(w)).cloneNode()}else{u=v.createElem(w)}}return u.canHaveChildren&&!h.test(w)?v.frag.appendChild(u):u}function r(v,x){if(!v){v=m}if(e){return v.createDocumentFragment()}x=x||p(v);var y=x.frag.cloneNode(),w=0,u=l(),t=u.length;for(;w<t;w++){y.createElement(u[w])}return y}function s(t,u){if(!u.cache){u.cache={};u.createElem=t.createElement;u.createFrag=t.createDocumentFragment;u.frag=u.createFrag()}t.createElement=function(v){if(!j.shivMethods){return u.createElem(v)}return n(v,t,u)};t.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/[\w\-]+/g,function(v){u.createElem(v);u.frag.createElement(v);return'c("'+v+'")'})+");return n}")(j,u.frag)}function b(t){if(!t){t=m}var u=p(t);if(j.shivCSS&&!q&&!u.hasCSS){u.hasCSS=!!f(t,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")}if(!e){s(t,u)}return t}var j={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:g,shivCSS:(d.shivCSS!==false),supportsUnknownElements:e,shivMethods:(d.shivMethods!==false),type:"default",shivDocument:b,createElement:n,createDocumentFragment:r};k.html5=j;b(m)}(this,document));
@@ -0,0 +1 @@
1
+ if(typeof Object.create!=="function"){Object.create=function(b){function a(){}a.prototype=b;return new a()}}var ua={toString:function(){return navigator.userAgent},test:function(a){return this.toString().toLowerCase().indexOf(a.toLowerCase())>-1}};ua.version=(ua.toString().toLowerCase().match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1];ua.webkit=ua.test("webkit");ua.gecko=ua.test("gecko")&&!ua.webkit;ua.opera=ua.test("opera");ua.ie=ua.test("msie")&&!ua.opera;ua.ie6=ua.ie&&document.compatMode&&typeof document.documentElement.style.maxHeight==="undefined";ua.ie7=ua.ie&&document.documentElement&&typeof document.documentElement.style.maxHeight!=="undefined"&&typeof XDomainRequest==="undefined";ua.ie8=ua.ie&&typeof XDomainRequest!=="undefined";var domReady=function(){var b=[];var a=function(){if(!arguments.callee.done){arguments.callee.done=true;for(var c=0;c<b.length;c++){b[c]()}}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)}if(ua.ie){(function(){try{document.documentElement.doScroll("left")}catch(c){setTimeout(arguments.callee,50);return}a()})();document.onreadystatechange=function(){if(document.readyState==="complete"){document.onreadystatechange=null;a()}}}if(ua.webkit&&document.readyState){(function(){if(document.readyState!=="loading"){a()}else{setTimeout(arguments.callee,10)}})()}window.onload=a;return function(c){if(typeof c==="function"){b[b.length]=c}return c}}();var cssHelper=function(){var n={BLOCKS:/[^\s{][^{]*\{(?:[^{}]*\{[^{}]*\}[^{}]*|[^{}]*)*\}/g,BLOCKS_INSIDE:/[^\s{][^{]*\{[^{}]*\}/g,DECLARATIONS:/[a-zA-Z\-]+[^;]*:[^;]+;/g,RELATIVE_URLS:/url\(['"]?([^\/\)'"][^:\)'"]+)['"]?\)/g,REDUNDANT_COMPONENTS:/(?:\/\*([^*\\\\]|\*(?!\/))+\*\/|@import[^;]+;)/g,REDUNDANT_WHITESPACE:/\s*(,|:|;|\{|\})\s*/g,MORE_WHITESPACE:/\s{2,}/g,FINAL_SEMICOLONS:/;\}/g,NOT_WHITESPACE:/\S+/g};var l,k=false;var i=[];var h=function(u){if(typeof u==="function"){i[i.length]=u}};var f=function(){for(var u=0;u<i.length;u++){i[u](l)}};var d={};var o=function(y,u){if(d[y]){var w=d[y].listeners;if(w){for(var x=0;x<w.length;x++){w[x](u)}}}};var m=function(v,u,z){if(ua.ie&&!window.XMLHttpRequest){window.XMLHttpRequest=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}if(!XMLHttpRequest){return""}var w=new XMLHttpRequest();try{w.open("get",v,true);w.setRequestHeader("X_REQUESTED_WITH","XMLHttpRequest")}catch(x){z();return}var y=false;setTimeout(function(){y=true},5000);document.documentElement.style.cursor="progress";w.onreadystatechange=function(){if(w.readyState===4&&!y){if(!w.status&&location.protocol==="file:"||(w.status>=200&&w.status<300)||w.status===304||navigator.userAgent.indexOf("Safari")>-1&&typeof w.status==="undefined"){u(w.responseText)}else{z()}document.documentElement.style.cursor="";w=null}};w.send("")};var j=function(u){u=u.replace(n.REDUNDANT_COMPONENTS,"");u=u.replace(n.REDUNDANT_WHITESPACE,"$1");u=u.replace(n.MORE_WHITESPACE," ");u=u.replace(n.FINAL_SEMICOLONS,"}");return u};var g={mediaQueryList:function(C){var u={};var B=C.indexOf("{");var y=C.substring(0,B);C=C.substring(B+1,C.length-1);var x=[],w=[];var v=y.toLowerCase().substring(7).split(",");for(var A=0;A<v.length;A++){x[x.length]=g.mediaQuery(v[A],u)}var z=C.match(n.BLOCKS_INSIDE);if(z!==null){for(A=0;A<z.length;A++){w[w.length]=g.rule(z[A],u)}}u.getMediaQueries=function(){return x};u.getRules=function(){return w};u.getListText=function(){return y};u.getCssText=function(){return C};return u},mediaQuery:function(D,C){D=D||"";var w=false,A;var z=[];var y=true;var x=D.match(n.NOT_WHITESPACE);for(var B=0;B<x.length;B++){var v=x[B];if(!A&&(v==="not"||v==="only")){if(v==="not"){w=true}}else{if(!A){A=v}else{if(v.charAt(0)==="("){var u=v.substring(1,v.length-1).split(":");z[z.length]={mediaFeature:u[0],value:u[1]||null}}}}}return{getList:function(){return C||null},getValid:function(){return y},getNot:function(){return w},getMediaType:function(){return A},getExpressions:function(){return z}}},rule:function(B,y){var u={};var z=B.indexOf("{");var A=B.substring(0,z);var C=A.split(",");var v=[];var w=B.substring(z+1,B.length-1).split(";");for(var x=0;x<w.length;x++){v[v.length]=g.declaration(w[x],u)}u.getMediaQueryList=function(){return y||null};u.getSelectors=function(){return C};u.getSelectorText=function(){return A};u.getDeclarations=function(){return v};u.getPropertyValue=function(E){for(var D=0;D<v.length;D++){if(v[D].getProperty()===E){return v[D].getValue()}}return null};return u},declaration:function(x,y){var u=x.indexOf(":");var z=x.substring(0,u);var w=x.substring(u+1);return{getRule:function(){return y||null},getProperty:function(){return z},getValue:function(){return w}}}};var a=function(x){if(typeof x.cssHelperText!=="string"){return}var w={mediaQueryLists:[],rules:[],selectors:{},declarations:[],properties:{}};var C=w.mediaQueryLists;var E=w.rules;var B=x.cssHelperText.match(n.BLOCKS);if(B!==null){for(var D=0;D<B.length;D++){if(B[D].substring(0,7)==="@media "){C[C.length]=g.mediaQueryList(B[D]);E=w.rules=E.concat(C[C.length-1].getRules())}else{E[E.length]=g.rule(B[D])}}}var u=w.selectors;var z=function(H){var G=H.getSelectors();for(var F=0;F<G.length;F++){var I=G[F];if(!u[I]){u[I]=[]}u[I][u[I].length]=H}};for(D=0;D<E.length;D++){z(E[D])}var A=w.declarations;for(D=0;D<E.length;D++){A=w.declarations=A.concat(E[D].getDeclarations())}var v=w.properties;for(D=0;D<A.length;D++){var y=A[D].getProperty();if(!v[y]){v[y]=[]}v[y][v[y].length]=A[D]}x.cssHelperParsed=w;l[l.length]=x;return w};var c=function(v,u){v.cssHelperText=j(u||v.innerHTML);return a(v)};var b=function(){k=true;l=[];var u=[];var v=function(){for(var D=0;D<u.length;D++){a(u[D])}var C=document.getElementsByTagName("style");for(D=0;D<C.length;D++){c(C[D])}k=false;f()};var B=document.getElementsByTagName("link");for(var w=0;w<B.length;w++){var z=B[w];if(z.getAttribute("rel").indexOf("style")>-1&&z.href&&z.href.length!==0&&!z.disabled){u[u.length]=z}}if(u.length>0){var A=0;var y=function(){A++;if(A===u.length){v()}};var x=function(D){var C=D.href;m(C,function(E){E=j(E).replace(n.RELATIVE_URLS,"url("+C.substring(0,C.lastIndexOf("/"))+"/$1)");D.cssHelperText=E;y()},y)};for(w=0;w<u.length;w++){x(u[w])}}else{v()}};var p={mediaQueryLists:"array",rules:"array",selectors:"object",declarations:"array",properties:"object"};var t={mediaQueryLists:null,rules:null,selectors:null,declarations:null,properties:null};var s=function(w,u){if(t[w]!==null){if(p[w]==="array"){return(t[w]=t[w].concat(u))}else{var y=t[w];for(var x in u){if(u.hasOwnProperty(x)){if(!y[x]){y[x]=u[x]}else{y[x]=y[x].concat(u[x])}}}return y}}};var r=function(u){t[u]=(p[u]==="array")?[]:{};for(var v=0;v<l.length;v++){s(u,l[v].cssHelperParsed[u])}return t[u]};domReady(function(){var v=document.body.getElementsByTagName("*");for(var u=0;u<v.length;u++){v[u].checkedByCssHelper=true}if(document.implementation.hasFeature("MutationEvents","2.0")||window.MutationEvent){document.body.addEventListener("DOMNodeInserted",function(x){var w=x.target;if(w.nodeType===1){o("DOMElementInserted",w);w.checkedByCssHelper=true}},false)}else{setInterval(function(){var x=document.body.getElementsByTagName("*");for(var w=0;w<x.length;w++){if(!x[w].checkedByCssHelper){o("DOMElementInserted",x[w]);x[w].checkedByCssHelper=true}}},1000)}});var q=function(u){if(typeof window.innerWidth!="undefined"){return window["inner"+u]}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){return document.documentElement["client"+u]}}};return{addStyle:function(w,u){var v=document.createElement("style");v.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(v);if(v.styleSheet){v.styleSheet.cssText=w}else{v.appendChild(document.createTextNode(w))}v.addedWithCssHelper=true;if(typeof u==="undefined"||u===true){cssHelper.parsed(function(x){var y=c(v,w);for(var z in y){if(y.hasOwnProperty(z)){s(z,y[z])}}o("newStyleParsed",v)})}else{v.parsingDisallowed=true}return v},removeStyle:function(u){return u.parentNode.removeChild(u)},parsed:function(u){if(k){h(u)}else{if(typeof l!=="undefined"){if(typeof u==="function"){u(l)}}else{h(u);b()}}},mediaQueryLists:function(u){cssHelper.parsed(function(v){u(t.mediaQueryLists||r("mediaQueryLists"))})},rules:function(u){cssHelper.parsed(function(v){u(t.rules||r("rules"))})},selectors:function(u){cssHelper.parsed(function(v){u(t.selectors||r("selectors"))})},declarations:function(u){cssHelper.parsed(function(v){u(t.declarations||r("declarations"))})},properties:function(u){cssHelper.parsed(function(v){u(t.properties||r("properties"))})},broadcast:o,addListener:function(v,u){if(typeof u==="function"){if(!d[v]){d[v]={listeners:[]}}d[v].listeners[d[v].listeners.length]=u}},removeListener:function(x,w){if(typeof w==="function"&&d[x]){var u=d[x].listeners;for(var v=0;v<u.length;v++){if(u[v]===w){u.splice(v,1);v-=1}}}},getViewportWidth:function(){return q("Width")},getViewportHeight:function(){return q("Height")}}}();domReady(function enableCssMediaQueries(){var k;var i={LENGTH_UNIT:/[0-9]+(em|ex|px|in|cm|mm|pt|pc)$/,RESOLUTION_UNIT:/[0-9]+(dpi|dpcm)$/,ASPECT_RATIO:/^[0-9]+\/[0-9]+$/,ABSOLUTE_VALUE:/^[0-9]*(\.[0-9]+)*$/};var h=[];var n=function(){var s="css3-mediaqueries-test";var q=document.createElement("div");q.id=s;var r=cssHelper.addStyle("@media all and (width) { #"+s+" { width: 1px !important; } }",false);document.body.appendChild(q);var p=q.offsetWidth===1;r.parentNode.removeChild(r);q.parentNode.removeChild(q);n=function(){return p};return p};var m=function(){k=document.createElement("div");k.style.cssText="position:absolute;top:-9999em;left:-9999em;margin:0;border:none;padding:0;width:1em;font-size:1em;";document.body.appendChild(k);if(k.offsetWidth!==16){k.style.fontSize=16/k.offsetWidth+"em"}k.style.width=""};var l=function(q){k.style.width=q;var p=k.offsetWidth;k.style.width="";return p};var j=function(z,y){var u=z.length;var x=(z.substring(0,4)==="min-");var B=(!x&&z.substring(0,4)==="max-");if(y!==null){var w;var v;if(i.LENGTH_UNIT.exec(y)){w="length";v=l(y)}else{if(i.RESOLUTION_UNIT.exec(y)){w="resolution";v=parseInt(y,10);var t=y.substring((v+"").length)}else{if(i.ASPECT_RATIO.exec(y)){w="aspect-ratio";v=y.split("/")}else{if(i.ABSOLUTE_VALUE){w="absolute";v=y}else{w="unknown"}}}}}var s,r;if("device-width"===z.substring(u-12,u)){s=screen.width;if(y!==null){if(w==="length"){return((x&&s>=v)||(B&&s<v)||(!x&&!B&&s===v))}else{return false}}else{return s>0}}else{if("device-height"===z.substring(u-13,u)){r=screen.height;if(y!==null){if(w==="length"){return((x&&r>=v)||(B&&r<v)||(!x&&!B&&r===v))}else{return false}}else{return r>0}}else{if("width"===z.substring(u-5,u)){s=document.documentElement.clientWidth||document.body.clientWidth;if(y!==null){if(w==="length"){return((x&&s>=v)||(B&&s<v)||(!x&&!B&&s===v))}else{return false}}else{return s>0}}else{if("height"===z.substring(u-6,u)){r=document.documentElement.clientHeight||document.body.clientHeight;if(y!==null){if(w==="length"){return((x&&r>=v)||(B&&r<v)||(!x&&!B&&r===v))}else{return false}}else{return r>0}}else{if("device-aspect-ratio"===z.substring(u-19,u)){return w==="aspect-ratio"&&screen.width*v[1]===screen.height*v[0]}else{if("color-index"===z.substring(u-11,u)){var q=Math.pow(2,screen.colorDepth);if(y!==null){if(w==="absolute"){return((x&&q>=v)||(B&&q<v)||(!x&&!B&&q===v))}else{return false}}else{return q>0}}else{if("color"===z.substring(u-5,u)){var p=screen.colorDepth;if(y!==null){if(w==="absolute"){return((x&&p>=v)||(B&&p<v)||(!x&&!B&&p===v))}else{return false}}else{return p>0}}else{if("resolution"===z.substring(u-10,u)){var A;if(t==="dpcm"){A=l("1cm")}else{A=l("1in")}if(y!==null){if(w==="resolution"){return((x&&A>=v)||(B&&A<v)||(!x&&!B&&A===v))}else{return false}}else{return A>0}}else{return false}}}}}}}}};var g=function(r){var u=r.getValid();var t=r.getExpressions();var p=t.length;if(p>0){for(var q=0;q<p&&u;q++){u=j(t[q].mediaFeature,t[q].value)}var s=r.getNot();return(u&&!s||s&&!u)}};var f=function(p){var u=p.getMediaQueries();var r={};for(var q=0;q<u.length;q++){if(g(u[q])){r[u[q].getMediaType()]=true}}var v=[],x=0;for(var w in r){if(r.hasOwnProperty(w)){if(x>0){v[x++]=","}v[x++]=w}}if(v.length>0){h[h.length]=cssHelper.addStyle("@media "+v.join("")+"{"+p.getCssText()+"}",false)}};var d=function(q){for(var p=0;p<q.length;p++){f(q[p])}if(ua.ie){document.documentElement.style.display="block";setTimeout(function(){document.documentElement.style.display=""},0);setTimeout(function(){cssHelper.broadcast("cssMediaQueriesTested")},100)}else{cssHelper.broadcast("cssMediaQueriesTested")}};var c=function(){for(var p=0;p<h.length;p++){cssHelper.removeStyle(h[p])}h=[];cssHelper.mediaQueryLists(d)};var b=0;var a=function(){var s=cssHelper.getViewportWidth();var r=cssHelper.getViewportHeight();if(ua.ie){var t=document.createElement("div");t.style.position="absolute";t.style.top="-9999em";t.style.overflow="scroll";document.body.appendChild(t);b=t.offsetWidth-t.clientWidth;document.body.removeChild(t)}var q;var p=function(){var u=cssHelper.getViewportWidth();var v=cssHelper.getViewportHeight();if(Math.abs(u-s)>b||Math.abs(v-r)>b){s=u;r=v;clearTimeout(q);q=setTimeout(function(){if(!n()){c()}else{cssHelper.broadcast("cssMediaQueriesTested")}},500)}};window.onresize=function(){var u=window.onresize||function(){};return function(){u();p()}}()};var o=document.documentElement;o.style.marginLeft="-32767px";setTimeout(function(){o.style.marginTop=""},20000);return function(){if(!n()){cssHelper.addListener("newStyleParsed",function(p){d(p.cssHelperParsed.mediaQueryLists)});cssHelper.addListener("cssMediaQueriesTested",function(){if(ua.ie){o.style.width="1px"}setTimeout(function(){o.style.width="";o.style.marginLeft=""},0);cssHelper.removeListener("cssMediaQueriesTested",arguments.callee)});m();c()}else{o.style.marginLeft=""}a()}}());try{document.execCommand("BackgroundImageCache",false,true)}catch(e){};
@@ -0,0 +1,24 @@
1
+ # Require any additional compass plugins here.
2
+
3
+ # Set this to the root of your project when deployed:
4
+ http_path = "/"
5
+ css_dir = "stylesheets"
6
+ sass_dir = "sass"
7
+ images_dir = "images"
8
+ javascripts_dir = "javascripts"
9
+
10
+ # You can select your preferred output style here (can be overridden via the command line):
11
+ # output_style = :expanded or :nested or :compact or :compressed
12
+
13
+ # To enable relative paths to assets via compass helper functions. Uncomment:
14
+ # relative_assets = true
15
+
16
+ # To disable debugging comments that display the original location of your selectors. Uncomment:
17
+ # line_comments = false
18
+
19
+
20
+ # If you prefer the indented syntax, you might want to regenerate this
21
+ # project again passing --syntax sass, or you can uncomment this:
22
+ # preferred_syntax = :sass
23
+ # and then run:
24
+ # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
@@ -0,0 +1,81 @@
1
+ @mixin sprite-background($name) {
2
+ background-image: sprite-url($sprites);
3
+ background-position: sprite-position($sprites, $name);
4
+ background-repeat: no-repeat;
5
+ display: block;
6
+ height: image-height(sprite-file($sprites, $name));
7
+ text-indent: -9999em;
8
+ width: image-width(sprite-file($sprites, $name));
9
+ }
10
+
11
+ @mixin retina-sprite-background($name) {
12
+ background-image: sprite-url($retina_sprites);
13
+ background-position: sprite-position($retina_sprites, $name);
14
+ background-repeat: no-repeat;
15
+ background-size: image-width(sprite-path($retina_sprites)) / 2;
16
+ display: block;
17
+ height: image-height(sprite-file($retina_sprites, $name)) / 2;
18
+ text-indent: -9999em;
19
+ width: image-width(sprite-file($retina_sprites, $name)) / 2;
20
+ }
21
+
22
+ @mixin transition($transitions...) {
23
+ -webkit-transition: $transitions;
24
+ -moz-transition: $transitions;
25
+ -o-transition: $transitions;
26
+ transition: $transitions;
27
+ }
28
+
29
+ @mixin box-shadow($shadows...) {
30
+ -webkit-box-shadow: $shadows;
31
+ -moz-box-shadow: $shadows;
32
+ -o-box-shadow: $shadows;
33
+ box-shadow: $shadows;
34
+ }
35
+
36
+ @mixin opacity ($opacity) {
37
+ opacity: $opacity;
38
+ -moz-opacity: $opacity;
39
+ filter:alpha(opacity=($opacity * 100));
40
+ }
41
+
42
+ @mixin css-triangle($direction: "down", $size: 20px, $color: #000) {
43
+ width: 0;
44
+ height: 0;
45
+ border-left: $size solid #{setTriangleColor($direction, "left", $color)};
46
+ border-right: $size solid #{setTriangleColor($direction, "right", $color)};
47
+ border-bottom: $size solid #{setTriangleColor($direction, "bottom", $color)};
48
+ border-top: $size solid #{setTriangleColor($direction, "top", $color)};
49
+ }
50
+
51
+ @function setTriangleColor($direction, $side, $color) {
52
+ @if $direction == "left" and $side == "right"
53
+ or $direction == "right" and $side == "left"
54
+ or $direction == "down" and $side == "top"
55
+ or $direction == "up" and $side == "bottom" {
56
+ @return $color
57
+ } @else {
58
+ @return "transparent";
59
+ }
60
+ }
61
+
62
+ @mixin font-face($family, $style, $weight, $filename) {
63
+ @font-face {
64
+ font-family: $family;
65
+ font-style: $style;
66
+ font-weight: $weight;
67
+ src: url('../../font/' + $filename + '.eot');
68
+ src: url('../../font/' + $filename + '.eot?#iefix') format('embedded-opentype'),
69
+ url('../../font/' + $filename + '.woff') format('woff'),
70
+ url('../../font/' + $filename + '.ttf') format('truetype'),
71
+ url('../../font/' + $filename + '.svg#' + $family +'') format('svg');
72
+ }
73
+ }
74
+
75
+ @mixin user-select($value) {
76
+ -webkit-user-select: $value;
77
+ -moz-user-select: $value;
78
+ -ms-user-select: $value;
79
+ -o-user-select: $value;
80
+ user-select: $value;
81
+ }