enki-engine 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. data/.gitignore +13 -0
  2. data/.rspec +1 -0
  3. data/.travis.yml +3 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE +284 -0
  6. data/README.textile +112 -0
  7. data/Rakefile +13 -0
  8. data/TODO.textile +8 -0
  9. data/app/assets/images/admin/flash_bg.gif +0 -0
  10. data/app/assets/images/admin/future_bg.png +0 -0
  11. data/app/assets/images/admin/gray_bg.gif +0 -0
  12. data/app/assets/images/admin/new_button.png +0 -0
  13. data/app/assets/images/admin/silver_bg.gif +0 -0
  14. data/app/assets/images/admin/submit_bg.gif +0 -0
  15. data/app/assets/images/admin/subnav_bg.gif +0 -0
  16. data/app/assets/images/openid_icon.png +0 -0
  17. data/app/assets/images/rails.png +0 -0
  18. data/app/assets/images/silk/arrow_undo.png +0 -0
  19. data/app/assets/images/silk/delete.png +0 -0
  20. data/app/assets/images/silk/pencil.png +0 -0
  21. data/app/assets/javascripts/admin/actions.js +18 -0
  22. data/app/assets/javascripts/admin/comments.js +3 -0
  23. data/app/assets/javascripts/admin/common.js +109 -0
  24. data/app/assets/javascripts/admin/dashboard.js +33 -0
  25. data/app/assets/javascripts/admin/edit-preview.js +40 -0
  26. data/app/assets/javascripts/admin/pages.js +1 -0
  27. data/app/assets/javascripts/admin/posts.js +1 -0
  28. data/app/assets/javascripts/admin/shortcut.js +223 -0
  29. data/app/assets/javascripts/admin.js +17 -0
  30. data/app/assets/javascripts/application.js +15 -0
  31. data/app/assets/javascripts/common.js +22 -0
  32. data/app/assets/javascripts/enki.js +13 -0
  33. data/app/assets/javascripts/live-comment-preview.js +36 -0
  34. data/app/assets/stylesheets/admin.css +304 -0
  35. data/app/assets/stylesheets/application.css.scss +486 -0
  36. data/app/assets/stylesheets/humanmsg.css +112 -0
  37. data/app/assets/stylesheets/login.css +65 -0
  38. data/app/controllers/enki/admin/base_controller.rb +15 -0
  39. data/app/controllers/enki/admin/comments_controller.rb +52 -0
  40. data/app/controllers/enki/admin/dashboard_controller.rb +12 -0
  41. data/app/controllers/enki/admin/health_controller.rb +20 -0
  42. data/app/controllers/enki/admin/pages_controller.rb +97 -0
  43. data/app/controllers/enki/admin/posts_controller.rb +104 -0
  44. data/app/controllers/enki/admin/undo_items_controller.rb +43 -0
  45. data/app/controllers/enki/application_controller.rb +21 -0
  46. data/app/controllers/enki/archives_controller.rb +7 -0
  47. data/app/controllers/enki/base_controller.rb +5 -0
  48. data/app/controllers/enki/comments_controller.rb +43 -0
  49. data/app/controllers/enki/pages_controller.rb +7 -0
  50. data/app/controllers/enki/posts_controller.rb +27 -0
  51. data/app/helpers/enki/admin/navigation_helper.rb +10 -0
  52. data/app/helpers/enki/application_helper.rb +35 -0
  53. data/app/helpers/enki/date_helper.rb +15 -0
  54. data/app/helpers/enki/form_helper.rb +7 -0
  55. data/app/helpers/enki/host_helper.rb +19 -0
  56. data/app/helpers/enki/navigation_helper.rb +23 -0
  57. data/app/helpers/enki/page_title_helper.rb +33 -0
  58. data/app/helpers/enki/posts_helper.rb +9 -0
  59. data/app/helpers/enki/tag_helper.rb +7 -0
  60. data/app/helpers/enki/url_helper.rb +25 -0
  61. data/app/models/enki/base/post.rb +153 -0
  62. data/app/models/enki/comment.rb +75 -0
  63. data/app/models/enki/comment_activity.rb +33 -0
  64. data/app/models/enki/delete_comment_undo.rb +33 -0
  65. data/app/models/enki/delete_page_undo.rb +32 -0
  66. data/app/models/enki/delete_post_undo.rb +36 -0
  67. data/app/models/enki/page.rb +42 -0
  68. data/app/models/enki/post.rb +4 -0
  69. data/app/models/enki/stats.rb +19 -0
  70. data/app/models/enki/tag.rb +19 -0
  71. data/app/models/enki/tagging.rb +7 -0
  72. data/app/models/enki/undo_item.rb +10 -0
  73. data/app/views/enki/admin/comments/_comment.html.erb +12 -0
  74. data/app/views/enki/admin/comments/index.html.erb +30 -0
  75. data/app/views/enki/admin/comments/show.html.erb +9 -0
  76. data/app/views/enki/admin/dashboard/show.html.erb +61 -0
  77. data/app/views/enki/admin/health/index.html.erb +3 -0
  78. data/app/views/enki/admin/pages/_form.html.erb +3 -0
  79. data/app/views/enki/admin/pages/_page.html.erb +12 -0
  80. data/app/views/enki/admin/pages/index.html.erb +25 -0
  81. data/app/views/enki/admin/pages/new.html.erb +8 -0
  82. data/app/views/enki/admin/pages/show.html.erb +8 -0
  83. data/app/views/enki/admin/posts/_form.html.erb +11 -0
  84. data/app/views/enki/admin/posts/_post.html.erb +12 -0
  85. data/app/views/enki/admin/posts/_taggings_form.html.erb +4 -0
  86. data/app/views/enki/admin/posts/_upload_form.html.erb +0 -0
  87. data/app/views/enki/admin/posts/index.html.erb +25 -0
  88. data/app/views/enki/admin/posts/new.html.erb +8 -0
  89. data/app/views/enki/admin/posts/show.html.erb +8 -0
  90. data/app/views/enki/admin/undo_items/index.html.erb +24 -0
  91. data/app/views/enki/archives/index.html.erb +17 -0
  92. data/app/views/enki/comments/_comment.html.erb +4 -0
  93. data/app/views/enki/pages/_page.html.erb +3 -0
  94. data/app/views/enki/pages/show.html.erb +5 -0
  95. data/app/views/enki/posts/_post.html.erb +13 -0
  96. data/app/views/enki/posts/index.atom.builder +27 -0
  97. data/app/views/enki/posts/index.html.erb +15 -0
  98. data/app/views/enki/posts/show.html.erb +37 -0
  99. data/autotest/discover.rb +2 -0
  100. data/config/cucumber.yml +8 -0
  101. data/config/enki.yml.sample +16 -0
  102. data/config/initializers/enki_ext.rb +3 -0
  103. data/config/initializers/set_chronic_timezone.rb +1 -0
  104. data/config/initializers/verification.rb +135 -0
  105. data/config/routes.rb +34 -0
  106. data/db/migrate/20110709024316_initialize_db.rb +97 -0
  107. data/db/seeds.rb +8 -0
  108. data/enki-engine.gemspec +47 -0
  109. data/features/admin_dashboard.feature +10 -0
  110. data/features/admin_health.feature +10 -0
  111. data/features/admin_undo.feature +20 -0
  112. data/features/browsing.feature +16 -0
  113. data/features/step_definitions/admin.rb +27 -0
  114. data/features/step_definitions/browsing.rb +3 -0
  115. data/features/step_definitions/posts.rb +11 -0
  116. data/features/step_definitions/web_steps.rb +1 -0
  117. data/features/support/env.rb +59 -0
  118. data/features/support/paths.rb +35 -0
  119. data/features/support/selectors.rb +39 -0
  120. data/lib/core_extensions/object.rb +9 -0
  121. data/lib/core_extensions/string.rb +22 -0
  122. data/lib/enki/config.rb +44 -0
  123. data/lib/enki/engine.rb +19 -0
  124. data/lib/enki/html5_tags.rb +8 -0
  125. data/lib/enki/pagination_shim.rb +25 -0
  126. data/lib/enki/version.rb +3 -0
  127. data/lib/enki.rb +14 -0
  128. data/lib/enki_formatter.rb +11 -0
  129. data/lib/tag_list.rb +2 -0
  130. data/lib/tags_helper.rb +13 -0
  131. data/lib/tasks/cucumber.rake +65 -0
  132. data/lib/tasks/enki.rake +29 -0
  133. data/lib/undo_failed.rb +2 -0
  134. data/script/cucumber +10 -0
  135. data/spec/controllers/admin/comments_controller_spec.rb +140 -0
  136. data/spec/controllers/admin/dashboard_controller_spec.rb +47 -0
  137. data/spec/controllers/admin/health_controller_spec.rb +49 -0
  138. data/spec/controllers/admin/pages_controller_spec.rb +136 -0
  139. data/spec/controllers/admin/posts_controller_spec.rb +183 -0
  140. data/spec/controllers/admin/undo_items_controller_spec.rb +93 -0
  141. data/spec/controllers/archives_controller_spec.rb +37 -0
  142. data/spec/controllers/comments_controller_spec.rb +126 -0
  143. data/spec/controllers/pages_controller_spec.rb +46 -0
  144. data/spec/controllers/posts_controller_spec.rb +168 -0
  145. data/spec/dummy/Gemfile +5 -0
  146. data/spec/dummy/Rakefile +7 -0
  147. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  148. data/spec/dummy/config/application.rb +34 -0
  149. data/spec/dummy/config/boot.rb +10 -0
  150. data/spec/dummy/config/database.yml +6 -0
  151. data/spec/dummy/config/enki.yml +20 -0
  152. data/spec/dummy/config/environment.rb +5 -0
  153. data/spec/dummy/config/environments/development.rb +34 -0
  154. data/spec/dummy/config/environments/test.rb +32 -0
  155. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  156. data/spec/dummy/config/initializers/session_store.rb +8 -0
  157. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  158. data/spec/dummy/config/locales/en.yml +5 -0
  159. data/spec/dummy/config/routes.rb +14 -0
  160. data/spec/dummy/config.ru +6 -0
  161. data/spec/dummy/script/rails +6 -0
  162. data/spec/factories/factories.rb +36 -0
  163. data/spec/helpers/page_title_helper_spec.rb +54 -0
  164. data/spec/helpers/url_helper_spec.rb +23 -0
  165. data/spec/lib/slugorize_spec.rb +44 -0
  166. data/spec/models/comment_activity_spec.rb +60 -0
  167. data/spec/models/comment_spec.rb +125 -0
  168. data/spec/models/delete_comment_undo_spec.rb +52 -0
  169. data/spec/models/delete_post_undo_spec.rb +18 -0
  170. data/spec/models/page_spec.rb +75 -0
  171. data/spec/models/post_spec.rb +257 -0
  172. data/spec/models/stats_spec.rb +28 -0
  173. data/spec/models/tag_spec.rb +13 -0
  174. data/spec/models/tagging_spec.rb +30 -0
  175. data/spec/rcov.opts +2 -0
  176. data/spec/routing/admin/pages_routing_spec.rb +29 -0
  177. data/spec/routing/archives_routing_spec.rb +9 -0
  178. data/spec/routing/comments_routing_spec.rb +17 -0
  179. data/spec/routing/pages_routing_spec.rb +9 -0
  180. data/spec/routing/posts_routing_spec.rb +26 -0
  181. data/spec/spec.opts +4 -0
  182. data/spec/spec_helper.rb +60 -0
  183. data/spec/support/be_valid_html5.rb +150 -0
  184. data/spec/support/be_valid_xhtml.rb +148 -0
  185. data/spec/support/routes_override_helper.rb +12 -0
  186. data/spec/views/admin/comments/index.html_spec.rb +26 -0
  187. data/spec/views/admin/comments/show.html_spec.rb +28 -0
  188. data/spec/views/admin/dashboard/show.html_spec.rb +37 -0
  189. data/spec/views/admin/pages/index.html_spec.rb +23 -0
  190. data/spec/views/admin/pages/new.html_spec.rb +16 -0
  191. data/spec/views/admin/pages/show.html_spec.rb +16 -0
  192. data/spec/views/admin/posts/index.html_spec.rb +24 -0
  193. data/spec/views/admin/posts/new.html_spec.rb +16 -0
  194. data/spec/views/admin/posts/show.html_spec.rb +16 -0
  195. data/spec/views/admin/undo_items/index.html_spec.rb +19 -0
  196. data/spec/views/archives/index.html_spec.rb +34 -0
  197. data/spec/views/pages/show.html_spec.rb +23 -0
  198. data/spec/views/posts/index.atom.builder_spec.rb +36 -0
  199. data/spec/views/posts/index.html_spec.rb +39 -0
  200. data/spec/views/posts/show.html_spec.rb +49 -0
  201. data/vendor/assets/javascripts/humanmsg.js +86 -0
  202. data/vendor/assets/javascripts/jquery.easing.1.3.js +205 -0
  203. data/vendor/assets/javascripts/jquery.form.js +869 -0
  204. data/vendor/assets/javascripts/jquery.jfeed.js +143 -0
  205. data/vendor/assets/javascripts/jquery.livequery.js +250 -0
  206. metadata +464 -0
@@ -0,0 +1,486 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ */
13
+
14
+ /* High level containers */
15
+ body
16
+ {
17
+ color: black;
18
+
19
+ font: normal 12px verdana, arial, helvetica, sans-serif;
20
+ line-height: 1.5;
21
+ padding: 0px;
22
+ margin: 0px;
23
+ }
24
+
25
+ #page_container
26
+ {
27
+ position: absolute;
28
+ min-height: 400px;
29
+
30
+ color: black;
31
+ width: 100%;
32
+ }
33
+
34
+ #content {
35
+ width: 900px;
36
+ margin: 5px auto;
37
+ position: relative;
38
+ padding-right: 55px;
39
+ /* display: inline;*/
40
+ }
41
+
42
+ #footer
43
+ {
44
+ position: relative;
45
+ font-size: 8pt;
46
+ /* padding-top: 5px;*/
47
+ padding-right: 15px;
48
+ padding-bottom: 5px;
49
+ padding-left: 5px;
50
+ color: gray;
51
+ /* border-bottom: solid 1px #aaaaaa;*/
52
+ }
53
+
54
+ /* Headings */
55
+ h1#page_heading
56
+ {
57
+ font-size: 24pt;
58
+ color: #000 !important;
59
+ }
60
+
61
+ h2
62
+ {
63
+ font-size: 1.4em;
64
+ color: #333333;
65
+ }
66
+
67
+ h2 a, h3, h4, h5
68
+ {
69
+ color: #333333;
70
+ }
71
+
72
+ /* Text */
73
+ p
74
+ {
75
+ padding: 0px;
76
+ margin-top: 0.5em;
77
+ margin-bottom: 1em;
78
+ margin-left: 0px;
79
+ margin-right: 0px;
80
+ }
81
+
82
+ strong
83
+ {
84
+ color: #333333;
85
+ }
86
+ /* Links */
87
+ .openid
88
+ {
89
+ background-image: image-url("openid_icon.png");
90
+ padding-left: 15px;
91
+ background-repeat: no-repeat;
92
+ background-position: 0px 2px;
93
+ }
94
+
95
+ a
96
+ {
97
+ color: #000051;
98
+
99
+ text-decoration: none;
100
+ }
101
+
102
+ small a, label a
103
+ {
104
+ text-decoration: underline;
105
+ }
106
+
107
+ a:hover
108
+ {
109
+ text-decoration: underline;
110
+ }
111
+
112
+ #footer a
113
+ {
114
+ color: gray;
115
+ text-decoration: underline;
116
+ }
117
+
118
+ img
119
+ {
120
+ border: solid 1px black;
121
+ }
122
+
123
+ /* Two columns */
124
+ #navigation
125
+ {
126
+ position: absolute;
127
+ width: 15em;
128
+ top: -1px;
129
+ right: -1px;
130
+
131
+ border: none;
132
+ padding: 5px;
133
+ }
134
+
135
+ #navigation h2
136
+ {
137
+ display: inline;
138
+ }
139
+
140
+
141
+ #navigation label
142
+ {
143
+ margin-left: 0;
144
+ font-style: normal;
145
+ }
146
+
147
+ #navigation ul
148
+ {
149
+ padding-left: 10px;
150
+
151
+ margin-left: 0px;
152
+ margin-top: 0px;
153
+ list-style: none;
154
+ }
155
+
156
+ #navigation ul li
157
+ {
158
+ padding-left: 0px;
159
+ margin-left: 0px;
160
+ }
161
+
162
+ #navigation h3
163
+ {
164
+ font-size: 1.2em;
165
+ font-weight: bold;
166
+ font-family: verdana,arial,helvetica,sans-serif;
167
+ }
168
+
169
+ #navigation input
170
+ {
171
+ border: solid 1px black;
172
+ width: 100%;
173
+ margin-left: 10px;
174
+ }
175
+
176
+ #navigation form
177
+ {
178
+ margin-bottom: 1em;
179
+ }
180
+
181
+ #main
182
+ {
183
+ padding-right: 150px;
184
+ padding-left: 0px;
185
+ padding-top: 0px;
186
+ padding-bottom: 40px;
187
+ }
188
+
189
+ div.meta
190
+ {
191
+ margin-top: 1em;
192
+ margin-bottom: 3em;
193
+ }
194
+ /* Formatting */
195
+
196
+ .meta ul
197
+ {
198
+ list-style: none;
199
+ margin: 0px;
200
+ padding-left: 0em;
201
+ padding-bottom: 0.5em;
202
+ display: inline;
203
+ color: #cccccc;
204
+ font-size: 9pt;
205
+ }
206
+ .archive-month .tags
207
+ {
208
+ color: #bbbbbb;
209
+ }
210
+
211
+ .meta a, .archive-month .tags a
212
+ {
213
+ color: #bbbbbb;
214
+ border-bottom: dotted 1px #bbbbbb;
215
+ }
216
+
217
+ .meta a:hover
218
+ {
219
+ text-decoration: none;
220
+ }
221
+
222
+ .meta ul li
223
+ {
224
+ display: inline;
225
+ }
226
+
227
+ .meta ul li:after
228
+ {
229
+ content: " | ";
230
+ }
231
+
232
+ .meta ul li:last-child:after
233
+ {
234
+ content: "";
235
+ }
236
+
237
+ h2
238
+ {
239
+ margin-bottom: 0px;
240
+ }
241
+
242
+ .separator
243
+ {
244
+ height: 1px;
245
+ margin-top:5px;
246
+ clear: both;
247
+ }
248
+
249
+ /* Forms */
250
+ label
251
+ {
252
+ margin-left: 1em;
253
+ }
254
+
255
+ textarea, select
256
+ {
257
+ font: normal 12px verdana, arial, helvetica, sans-serif;
258
+ }
259
+
260
+ textarea
261
+ {
262
+ width: 500px;
263
+ }
264
+
265
+ #project_summary
266
+ {
267
+ height: 150px;
268
+ }
269
+
270
+ #new_comment textarea, #edit_comment textarea
271
+ {
272
+ height: 150px;
273
+ }
274
+
275
+ .alt, .container_alt
276
+ {
277
+ background-color: #fafafa;
278
+ }
279
+
280
+ div.date
281
+ {
282
+ color: #999;
283
+ font-size: .8em;
284
+ }
285
+
286
+ div.comments div.body
287
+ {
288
+ padding: 5px;
289
+ }
290
+
291
+ div.comments div.meta
292
+ {
293
+ min-height: 0px;
294
+ padding: 0px;
295
+ }
296
+
297
+ div.comments div.separator
298
+ {
299
+ height: 10px;
300
+ }
301
+
302
+ div.errors
303
+ {
304
+ border: solid 1px red;
305
+ background-color: #ffcccc;
306
+ padding: 5px;
307
+ padding-left: 10px;
308
+ width: 485px;
309
+ }
310
+
311
+ div.errors h3
312
+ {
313
+ font-size: 1.0em;
314
+ }
315
+
316
+ .fieldWithErrors
317
+ {
318
+ display: inline;
319
+ }
320
+
321
+ span.error
322
+ {
323
+ font-weight: bold;
324
+ }
325
+
326
+ hr
327
+ {
328
+ border-top: dotted 1px black;
329
+ border-bottom: none;
330
+ height: 1px;
331
+ }
332
+
333
+ #preview
334
+ {
335
+ height: 200px;
336
+ overflow: auto;
337
+ }
338
+
339
+ .related {
340
+ background-color: #f8f8f8;
341
+ border: 1px solid silver;
342
+ padding: 10px;
343
+ }
344
+
345
+ /* Syntax */
346
+
347
+
348
+ /* TOC */
349
+ fieldset.toc
350
+ {
351
+ float: right;
352
+ border: dotted 1px black;
353
+ background-color: #fafafa;
354
+ padding: 10px;
355
+ margin-left: 5px;
356
+ }
357
+
358
+ .toc legend
359
+ {
360
+ font-weight: bold;
361
+ }
362
+
363
+ .toc ol
364
+ {
365
+ margin: 0px;
366
+ padding-left: 0px;
367
+ list-style-position: inside;
368
+ }
369
+
370
+ .toc ol ol
371
+ {
372
+ list-style-type: lower-alpha;
373
+ padding-left: 15px;
374
+ }
375
+
376
+ pre.ruby .keyword { color: #c41f1f; }
377
+ pre.ruby .constant { color: #961818; }
378
+ pre.ruby .comment { color: #f37e00; }
379
+ pre.ruby .string { color: #b77c0a; }
380
+
381
+ /* CODERAY */
382
+ .CodeRay {
383
+ background-color: #f8f8f8;
384
+ border: 1px solid silver;
385
+ font-family: 'Courier New', 'Terminal', monospace;
386
+ color: #100;
387
+ margin-bottom: 1em;
388
+ }
389
+ .CodeRay pre { margin: 0px; font-size: 12px }
390
+
391
+ div.CodeRay { }
392
+
393
+ span.CodeRay { white-space: pre; border: 0px; padding: 2px }
394
+
395
+ table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px }
396
+ table.CodeRay td { padding: 2px 4px; vertical-align: top }
397
+
398
+ .CodeRay .line_numbers, .CodeRay .no {
399
+ background-color: #eaeaea;
400
+ color: gray;
401
+ text-align: right;
402
+ }
403
+ .CodeRay .line_numbers tt { font-weight: bold }
404
+ .CodeRay .no { padding: 0px 4px }
405
+ .CodeRay .code { width: 100% }
406
+
407
+ ol.CodeRay { font-size: 10pt }
408
+ ol.CodeRay li { white-space: pre }
409
+
410
+ .CodeRay .code pre { overflow: auto }
411
+ .af { color:#00C }
412
+ .an { color:#007 }
413
+ .av { color:#700 }
414
+ .aw { color:#C00 }
415
+ .bi { color:#509; font-weight:bold }
416
+ .c { color:#888 }
417
+
418
+ .ch { color:#04D }
419
+ .ch .k { color:#04D }
420
+ .ch .dl { color:#039 }
421
+
422
+ .cl { color:#B06; font-weight:bold }
423
+ .co { color:#036; font-weight:bold }
424
+ .cr { color:#0A0 }
425
+ .cv { color:#369 }
426
+ .df { color:#099; font-weight:bold }
427
+ .di { color:#088; font-weight:bold }
428
+ .dl { color:black }
429
+ .do { color:#970 }
430
+ .ds { color:#D42; font-weight:bold }
431
+ .e { color:#666; font-weight:bold }
432
+ .en { color:#800; font-weight:bold }
433
+ .er { color:#F00; background-color:#FAA }
434
+ .ex { color:#F00; font-weight:bold }
435
+ .fl { color:#60E; font-weight:bold }
436
+ .fu { color:#06B; font-weight:bold }
437
+ .gv { color:#d70; font-weight:bold }
438
+ .hx { color:#058; font-weight:bold }
439
+ .i { color:#00D; font-weight:bold }
440
+ .ic { color:#B44; font-weight:bold }
441
+
442
+ .il { background: #eee }
443
+ .il .il { background: #ddd }
444
+ .il .il .il { background: #ccc }
445
+ .il .dl { font-weight: bold ! important; color: #888 ! important }
446
+
447
+ .in { color:#B2B; font-weight:bold }
448
+ .iv { color:#33B }
449
+ .la { color:#970; font-weight:bold }
450
+ .lv { color:#963 }
451
+ .oc { color:#40E; font-weight:bold }
452
+ .on { color:#000; font-weight:bold }
453
+ .op { }
454
+ .pc { color:#038; font-weight:bold }
455
+ .pd { color:#369; font-weight:bold }
456
+ .pp { color:#579 }
457
+ .pt { color:#339; font-weight:bold }
458
+ .r { color:#080; font-weight:bold }
459
+
460
+ .rx { background-color:#fff0ff }
461
+ .rx .k { color:#808 }
462
+ .rx .dl { color:#404 }
463
+ .rx .mod { color:#C2C }
464
+ .rx .fu { color:#404; font-weight: bold }
465
+
466
+ .s { background-color:#fff0f0 }
467
+ .s .s { background-color:#ffe0e0 }
468
+ .s .s .s { background-color:#ffd0d0 }
469
+ .s .k { color:#D20 }
470
+ .s .dl { color:#710 }
471
+
472
+ .sh { background-color:#f0fff0 }
473
+ .sh .k { color:#2B2 }
474
+ .sh .dl { color:#161 }
475
+
476
+ .sy { color:#A60 }
477
+ .sy .k { color:#A60 }
478
+ .sy .dl { color:#630 }
479
+
480
+ .ta { color:#070 }
481
+ .tf { color:#070; font-weight:bold }
482
+ .ts { color:#D70; font-weight:bold }
483
+ .ty { color:#339; font-weight:bold }
484
+ .v { color:#036 }
485
+ .xt { color:#444 }
486
+
@@ -0,0 +1,112 @@
1
+ /*
2
+ HUMANIZED MESSAGES 1.0
3
+ idea - http://www.humanized.com/weblog/2006/09/11/monolog_boxes_and_transparent_messages
4
+ home - http://humanmsg.googlecode.com
5
+ */
6
+
7
+ html, body {
8
+ height: 100%; /* Damn you IE! */
9
+ }
10
+
11
+ .humanMsg {
12
+ font: normal 20px/50px Helvetica, Arial, Sans-Serif;
13
+ letter-spacing: -1px;
14
+ position: fixed;
15
+ top: 40px;
16
+ left: 25%;
17
+ width: 50%;
18
+ color: white;
19
+ background-color: black;
20
+ text-align: center;
21
+ display: none;
22
+ opacity: 0;
23
+ z-index: 100000;
24
+ }
25
+
26
+ .humanMsg .round {
27
+ border-left: solid 2px white;
28
+ border-right: solid 2px white;
29
+ font-size: 1px; height: 2px;
30
+ }
31
+
32
+ .humanMsg p {
33
+ padding: .3em;
34
+ display: inline;
35
+ }
36
+
37
+ .humanMsg a {
38
+ display: none;
39
+ }
40
+
41
+ #humanMsgLog {
42
+ font: normal 10px Helvetica, Arial, Sans-Serif;
43
+ color: white;
44
+ position: fixed;
45
+ bottom: 0;
46
+ left: 0;
47
+ width: 100%;
48
+ max-height: 200px;
49
+ display: none;
50
+ z-index: 10000;
51
+ }
52
+
53
+ #humanMsgLog p {
54
+ position: relative;
55
+ left: 50%;
56
+ width: 200px;
57
+ margin: 0;
58
+ margin-left: -100px;
59
+ padding: 0 10px;
60
+ line-height: 20px;
61
+ background: #333;
62
+ text-align: center;
63
+ white-space: pre;
64
+ cursor: pointer;
65
+ }
66
+
67
+ #humanMsgLog p:hover {
68
+ background: #222;
69
+ }
70
+
71
+ #humanMsgLog ul {
72
+ background: #eee url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAARCAIAAACaSvE/AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAE1JREFUeNqEjVEKACAIQ516Ee//5wVNCjIjaB/iY5vC3YkoIgDkVDOjQ5pqLCI3r2bLFzNzyydvM4uKqfJPKN4vyl9LO/7o3/6PhwADAIWkFPjc5eRrAAAAAElFTkSuQmCC) repeat-x;
73
+ margin: 0;
74
+ padding: 0;
75
+ position: relative;
76
+ max-height: 180px;
77
+ overflow: auto;
78
+ display: none;
79
+ }
80
+
81
+ #humanMsgLog ul li {
82
+ color: #555;
83
+ font-size: 12px;
84
+ list-style-type: none;
85
+ border-bottom: 1px solid #ddd;
86
+ line-height: 40px;
87
+ display: none;
88
+ padding: 0 20px;
89
+ position: relative;
90
+ overflow: hidden;
91
+ white-space: pre;
92
+ }
93
+
94
+ #humanMsgLog ul li:hover {
95
+ background: #f2f2f2;
96
+ }
97
+
98
+ #humanMsgLog ul li:first-child {
99
+ margin-top: 1px;
100
+ }
101
+
102
+ #humanMsgLog ul li .error {
103
+ color: orangered;
104
+ }
105
+
106
+ #humanMsgLog ul li .indent {
107
+ position: absolute;
108
+ top: 0;
109
+ left: 100px;
110
+ margin-right: 200px;
111
+ height: inherit;
112
+ }
@@ -0,0 +1,65 @@
1
+ body {
2
+ padding-top: 30px;
3
+ background-color: #dddddd;
4
+ font-family: Helvetica, Sans-serif;
5
+ font-size: 10pt;
6
+ margin: 10px;
7
+ }
8
+
9
+ #nav {
10
+ position: absolute;
11
+ width: 100%;
12
+ top: 0px;
13
+ left: 0px;
14
+ background-color: #222222;
15
+ }
16
+
17
+ #nav ul {
18
+ list-style-type: none;
19
+ margin: 10px;
20
+ padding: 0;
21
+ }
22
+
23
+ #nav ul li {
24
+ display: inline;
25
+ margin-right: 10px;
26
+ }
27
+
28
+ #nav a {
29
+ color: #eeeeee;
30
+ text-decoration: none;
31
+ font-weight: bold;
32
+ }
33
+ #nav a.current {
34
+ border-bottom: solid 3px #eeeeee;
35
+ }
36
+
37
+ #content {
38
+ text-align: center;
39
+ color: #222222;
40
+ }
41
+
42
+ #content a {
43
+ color: #222222;
44
+ text-decoration: none;
45
+ }
46
+
47
+ #content form {
48
+ margin: 10px auto;
49
+ background-color: #ececec;
50
+ padding: 0.2em 1em;
51
+ width: 34em;
52
+ }
53
+
54
+ #content input[type="checkbox"] {
55
+ vertical-align: bottom;
56
+ }
57
+
58
+ #content input[type="text"] {
59
+ padding: 0.2em;
60
+ font-size: 1.3em;
61
+ font-family: "lucida grande", "lucida sans unicode", "lucida", sans-serif;
62
+ width: 24em;
63
+ color: #222222;
64
+ text-align: center;
65
+ }
@@ -0,0 +1,15 @@
1
+ module Enki
2
+ module Admin
3
+ class BaseController < Enki::ApplicationController
4
+
5
+ before_filter :require_login
6
+
7
+ protected
8
+
9
+ def set_content_type
10
+ headers['Content-Type'] ||= 'text/html; charset=utf-8'
11
+ end
12
+
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,52 @@
1
+ module Enki
2
+ module Admin
3
+ class CommentsController < BaseController
4
+ before_filter :find_comment, :only => [:show, :update, :destroy]
5
+
6
+ def index
7
+ @comments = Comment.order("comments.created_at DESC").includes(:post).paginated(params)
8
+ end
9
+
10
+ def show
11
+ respond_to do |format|
12
+ format.html {
13
+ render :partial => 'comment', :locals => {:comment => @comment} if request.xhr?
14
+ }
15
+ end
16
+ end
17
+
18
+ def update
19
+ if @comment.update_attributes(params[:comment])
20
+ flash[:notice] = "Updated comment by #{@comment.author}"
21
+ redirect_to [:admin, :comments]
22
+ else
23
+ render :action => 'show'
24
+ end
25
+ end
26
+
27
+ def destroy
28
+ undo_item = @comment.destroy_with_undo
29
+
30
+ respond_to do |format|
31
+ format.html do
32
+ flash[:notice] = "Deleted comment by #{@comment.author}"
33
+ redirect_to admin_comments_url
34
+ end
35
+ format.json {
36
+ render :json => {
37
+ :undo_path => undo_admin_undo_item_path(undo_item),
38
+ :undo_message => undo_item.description,
39
+ :comment => @comment.attributes
40
+ }.to_json
41
+ }
42
+ end
43
+ end
44
+
45
+ protected
46
+
47
+ def find_comment
48
+ @comment = Comment.find(params[:id])
49
+ end
50
+ end
51
+ end
52
+ end