Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into multiple-authors

Conflicts:
	README.textile
	app/controllers/admin/sessions_controller.rb
	app/helpers/application_helper.rb
	app/views/layouts/application.html.erb
	config/enki.yml
	config/initializers/exception_notifier.rb
	db/schema.rb
	features/step_definitions/factories.rb
  • Loading branch information...
commit 7ac26f1d47094d98ff485f8750e5540ae5fd7f34 2 parents 4cff3b9 + 4d88cdd
@xaviershay authored
Showing with 2,015 additions and 16,381 deletions.
  1. +7 −0 .gitignore
  2. +0 −1  vendor/cucumber-0.1.13/spec/spec.opts → .rspec
  3. +41 −0 Gemfile
  4. +134 −0 Gemfile.lock
  5. +13 −2 README.textile
  6. +2 −7 Rakefile
  7. +5 −5 app/controllers/admin/comments_controller.rb
  8. +1 −1  app/controllers/admin/dashboard_controller.rb
  9. +8 −2 app/controllers/admin/health_controller.rb
  10. +4 −4 app/controllers/admin/pages_controller.rb
  11. +5 −5 app/controllers/admin/posts_controller.rb
  12. +14 −10 app/controllers/admin/sessions_controller.rb
  13. +18 −12 app/controllers/admin/tags_controller.rb
  14. +0 −25 app/controllers/application.rb
  15. +15 −0 app/controllers/application_controller.rb
  16. +18 −26 app/controllers/comments_controller.rb
  17. +1 −1  app/helpers/admin/navigation_helper.rb
  18. +4 −5 app/helpers/application_helper.rb
  19. +1 −1  app/helpers/date_helper.rb
  20. +4 −4 app/helpers/navigation_helper.rb
  21. +1 −1  app/helpers/page_title_helper.rb
  22. +1 −1  app/helpers/tag_helper.rb
  23. +4 −36 app/helpers/url_helper.rb
  24. +5 −6 app/models/comment.rb
  25. +3 −2 app/models/comment_activity.rb
  26. +6 −4 app/models/post.rb
  27. +7 −7 app/models/tag.rb
  28. +2 −2 app/models/tagging.rb
  29. +3 −3 app/views/admin/comments/_comment.html.erb
  30. +6 −6 app/views/admin/comments/index.html.erb
  31. +5 −5 app/views/admin/comments/show.html.erb
  32. +14 −14 app/views/admin/dashboard/show.html.erb
  33. +1 −1  app/views/admin/health/index.html.erb
  34. +2 −2 app/views/admin/pages/_form.html.erb
  35. +5 −5 app/views/admin/pages/_page.html.erb
  36. +5 −5 app/views/admin/pages/index.html.erb
  37. +4 −4 app/views/admin/pages/new.html.erb
  38. +5 −5 app/views/admin/pages/show.html.erb
  39. +5 −5 app/views/admin/posts/_form.html.erb
  40. +4 −4 app/views/admin/posts/_post.html.erb
  41. +4 −4 app/views/admin/posts/index.html.erb
  42. +3 −3 app/views/admin/posts/new.html.erb
  43. +5 −5 app/views/admin/posts/show.html.erb
  44. +2 −2 app/views/admin/sessions/new.html.erb
  45. +7 −7 app/views/admin/tags/edit.html.erb
  46. +7 −7 app/views/admin/tags/index.html.erb
  47. +11 −9 app/views/admin/undo_items/index.html.erb
  48. +2 −2 app/views/archives/index.html.erb
  49. +2 −2 app/views/comments/_comment.html.erb
  50. +11 −15 app/views/layouts/admin.html.erb
  51. +13 −17 app/views/layouts/application.html.erb
  52. +5 −9 app/views/layouts/login.html.erb
  53. +1 −1  app/views/pages/_page.html.erb
  54. +1 −1  app/views/pages/show.html.erb
  55. +2 −2 app/views/posts/_post.html.erb
  56. +1 −1  app/views/posts/index.atom.builder
  57. +2 −2 app/views/posts/index.html.erb
  58. +8 −8 app/views/posts/show.html.erb
  59. +2 −0  autotest/discover.rb
  60. +4 −0 config.ru
  61. +42 −0 config/application.rb
  62. +13 −109 config/boot.rb
  63. +8 −0 config/cucumber.yml
  64. +5 −2 config/database.example.yml
  65. +4 −75 config/environment.rb
  66. +22 −13 config/environments/development.rb
  67. +44 −13 config/environments/production.rb
  68. +30 −17 config/environments/test.rb
  69. +7 −0 config/initializers/backtrace_silencers.rb
  70. +3 −0  config/initializers/enki_ext.rb
  71. +4 −1 config/initializers/exception_notifier.rb
  72. +2 −2 config/initializers/inflections.rb
  73. +2 −0  {vendor/rails/railties/configs → config}/initializers/new_rails_defaults.rb
  74. +7 −0 config/initializers/secret_token.rb
  75. +8 −0 config/initializers/session_store.rb
  76. +1 −1  {vendor/rails/railties/configs → config}/locales/en.yml
  77. +25 −23 config/routes.rb
  78. +14 −13 db/schema.rb
  79. +7 −0 db/seeds.rb
  80. +17 −0 features/admin_tags.feature
  81. +2 −0  features/admin_undo.feature
  82. 0  features/{steps → step_definitions}/admin.rb
  83. 0  features/{steps → step_definitions}/browsing.rb
  84. +5 −3 features/{steps → step_definitions}/factories.rb
  85. 0  features/{steps → step_definitions}/posts.rb
  86. +281 −0 features/step_definitions/web_steps.rb
  87. +0 −36 features/steps/common_webrat.rb
  88. +0 −14 features/steps/env.rb
  89. +57 −0 features/support/env.rb
  90. +35 −0 features/support/paths.rb
  91. +4 −4 lib/core_extensions/string.rb
  92. +3 −1 lib/enki/config.rb
  93. +8 −0 lib/enki/html5_tags.rb
  94. +1 −1  lib/enki_formatter.rb
  95. +51 −5 lib/tasks/cucumber.rake
  96. +4 −4 lib/tasks/enki.rake
  97. +0 −132 lib/tasks/rspec.rake
  98. +3 −3 public/.htaccess
  99. +16 −19 public/404.html
  100. +16 −19 public/422.html
  101. +16 −19 public/500.html
  102. BIN  public/images/rails.png
  103. +9 −9 public/javascripts/admin/common.js
  104. +2 −2 public/javascripts/admin/dashboard.js
  105. +5 −8 public/javascripts/admin/edit-preview.js
  106. +23 −23 public/javascripts/admin/shortcut.js
  107. +0 −2  public/javascripts/application.js
  108. +7 −7 public/javascripts/common.js
  109. +33 −33 public/javascripts/jquery.easing.1.3.js
  110. +23 −23 public/javascripts/jquery.jfeed.js
  111. +74 −74 public/javascripts/jquery.js
  112. +40 −40 public/javascripts/jquery.livequery.js
  113. +7 −3 public/javascripts/live-comment-preview.js
  114. +6 −4 public/stylesheets/admin.css
  115. +25 −25 public/stylesheets/application.css
  116. +2 −2 public/stylesheets/formtastic.css
  117. +0 −3  script/about
  118. +0 −3  script/autospec
  119. +0 −3  script/console
  120. +10 −0 script/cucumber
  121. +0 −3  script/dbconsole
  122. +0 −3  script/destroy
  123. +0 −3  script/generate
  124. +0 −3  script/performance/benchmarker
  125. +0 −3  script/performance/profiler
  126. +0 −3  script/performance/request
  127. +0 −3  script/plugin
  128. +0 −3  script/process/inspector
  129. +0 −3  script/process/reaper
  130. +0 −3  script/process/spawner
  131. +6 −0 script/rails
  132. +0 −3  script/runner
  133. +0 −3  script/server
  134. +0 −4 script/spec
  135. +0 −116 script/spec_server
  136. +4 −4 spec/controllers/admin/comments_controller_spec.rb
  137. +7 −7 spec/controllers/admin/health_controller_spec.rb
  138. +2 −3 spec/controllers/admin/pages_controller_spec.rb
  139. +4 −5 spec/controllers/admin/posts_controller_spec.rb
  140. +5 −9 spec/controllers/admin/sessions_controller_spec.rb
  141. +4 −14 spec/controllers/admin/sessions_routing_spec.rb
  142. +1 −1  spec/controllers/admin/tags_controller_spec.rb
  143. +7 −7 spec/controllers/admin/undo_items_controller_spec.rb
  144. +2 −8 spec/controllers/archives_routing_spec.rb
  145. +11 −29 spec/controllers/comments_controller_spec.rb
  146. +1 −1  spec/controllers/pages_controller_spec.rb
  147. +4 −3 spec/controllers/pages_routing_spec.rb
  148. +14 −8 spec/controllers/posts_controller_spec.rb
  149. +8 −20 spec/controllers/posts_routing_spec.rb
  150. +1 −1  spec/helpers/page_title_helper_spec.rb
  151. +31 −0 spec/lib/slugorize_spec.rb
  152. +45 −1 spec/models/comment_activity_spec.rb
  153. +36 −19 spec/models/comment_spec.rb
  154. +1 −1  spec/models/delete_comment_undo_spec.rb
  155. +9 −5 spec/models/page_spec.rb
  156. +18 −8 spec/models/post_spec.rb
  157. +17 −45 spec/spec_helper.rb
  158. +151 −0 spec/support/be_valid_html5.rb
  159. +29 −35 spec/{ → support}/be_valid_xhtml.rb
  160. +3 −3 spec/views/admin/comments/index.html.erb_spec.rb
  161. +4 −3 spec/views/admin/comments/show.html.erb_spec.rb
  162. +10 −6 spec/views/admin/dashboard/show.html.erb_spec.rb
  163. +3 −3 spec/views/admin/pages/index.html.erb_spec.rb
  164. +3 −3 spec/views/admin/pages/new.html.erb_spec.rb
  165. +3 −3 spec/views/admin/pages/show.html.erb_spec.rb
  166. +3 −3 spec/views/admin/posts/index.html.erb_spec.rb
  167. +3 −3 spec/views/admin/posts/new.html.erb_spec.rb
  168. +3 −3 spec/views/admin/posts/show.html.erb_spec.rb
  169. +4 −3 spec/views/admin/sessions/new.html.erb_spec.rb
  170. +3 −3 spec/views/admin/undo_items/index.html.erb_spec.rb
  171. +5 −3 spec/views/archives/index.html.erb_spec.rb
  172. +2 −1  spec/views/layouts/admin.html.erb_spec.rb
  173. +6 −4 spec/views/layouts/application.html.erb_spec.rb
  174. +2 −1  spec/views/layouts/login.html.erb_spec.rb
  175. +5 −3 spec/views/pages/show.html.erb_spec.rb
  176. +5 −3 spec/views/posts/index.atom.builder_spec.rb
  177. +10 −8 spec/views/posts/index.html.erb_spec.rb
  178. +11 −9 spec/views/posts/show.html.erb_spec.rb
  179. +0 −3  vendor/RedCloth-3.0.4/bin/redcloth
  180. +0 −160 vendor/RedCloth-3.0.4/doc/CHANGELOG
  181. +0 −25 vendor/RedCloth-3.0.4/doc/COPYING
  182. +0 −106 vendor/RedCloth-3.0.4/doc/README
  183. +0 −216 vendor/RedCloth-3.0.4/doc/REFERENCE
  184. +0 −359 vendor/RedCloth-3.0.4/doc/make.rb
  185. +0 −1,130 vendor/RedCloth-3.0.4/lib/redcloth.rb
  186. +0 −28 vendor/RedCloth-3.0.4/run-tests.rb
  187. +0 −1,376 vendor/RedCloth-3.0.4/setup.rb
  188. +0 −105 vendor/RedCloth-3.0.4/tests/code.yml
  189. +0 −26 vendor/RedCloth-3.0.4/tests/hard_breaks.yml
  190. +0 −171 vendor/RedCloth-3.0.4/tests/images.yml
  191. +0 −39 vendor/RedCloth-3.0.4/tests/instiki.yml
  192. +0 −155 vendor/RedCloth-3.0.4/tests/links.yml
  193. +0 −77 vendor/RedCloth-3.0.4/tests/lists.yml
  194. +0 −218 vendor/RedCloth-3.0.4/tests/markdown.yml
  195. +0 −64 vendor/RedCloth-3.0.4/tests/poignant.yml
  196. +0 −198 vendor/RedCloth-3.0.4/tests/table.yml
  197. +0 −406 vendor/RedCloth-3.0.4/tests/textism.yml
  198. +0 −53 vendor/chronic-0.2.3/History.txt
  199. +0 −47 vendor/chronic-0.2.3/Manifest.txt
  200. +0 −149 vendor/chronic-0.2.3/README.txt
  201. +0 −19 vendor/chronic-0.2.3/Rakefile
  202. +0 −125 vendor/chronic-0.2.3/lib/chronic.rb
  203. +0 −239 vendor/chronic-0.2.3/lib/chronic/chronic.rb
  204. +0 −26 vendor/chronic-0.2.3/lib/chronic/grabber.rb
  205. +0 −469 vendor/chronic-0.2.3/lib/chronic/handlers.rb
  206. +0 −40 vendor/chronic-0.2.3/lib/chronic/ordinal.rb
  207. +0 −27 vendor/chronic-0.2.3/lib/chronic/pointer.rb
  208. +0 −115 vendor/chronic-0.2.3/lib/chronic/repeater.rb
  209. +0 −47 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_day.rb
  210. +0 −46 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_day_name.rb
  211. +0 −93 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_day_portion.rb
  212. +0 −65 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_fortnight.rb
  213. +0 −52 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_hour.rb
  214. +0 −52 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_minute.rb
  215. +0 −61 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_month.rb
  216. +0 −93 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_month_name.rb
  217. +0 −23 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_season.rb
  218. +0 −24 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_season_name.rb
  219. +0 −36 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_second.rb
  220. +0 −117 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_time.rb
  221. +0 −68 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_week.rb
  222. +0 −60 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_weekend.rb
  223. +0 −58 vendor/chronic-0.2.3/lib/chronic/repeaters/repeater_year.rb
  224. +0 −74 vendor/chronic-0.2.3/lib/chronic/scalar.rb
  225. +0 −76 vendor/chronic-0.2.3/lib/chronic/separator.rb
  226. +0 −22 vendor/chronic-0.2.3/lib/chronic/time_zone.rb
  227. +0 −103 vendor/chronic-0.2.3/lib/numerizer/numerizer.rb
  228. +0 −9 vendor/chronic-0.2.3/test/suite.rb
  229. +0 −50 vendor/chronic-0.2.3/test/test_Chronic.rb
  230. +0 −110 vendor/chronic-0.2.3/test/test_Handler.rb
  231. +0 −48 vendor/chronic-0.2.3/test/test_Numerizer.rb
  232. +0 −52 vendor/chronic-0.2.3/test/test_RepeaterDayName.rb
  233. +0 −63 vendor/chronic-0.2.3/test/test_RepeaterFortnight.rb
  234. +0 −65 vendor/chronic-0.2.3/test/test_RepeaterHour.rb
  235. +0 −47 vendor/chronic-0.2.3/test/test_RepeaterMonth.rb
  236. +0 −57 vendor/chronic-0.2.3/test/test_RepeaterMonthName.rb
  237. +0 −72 vendor/chronic-0.2.3/test/test_RepeaterTime.rb
  238. +0 −63 vendor/chronic-0.2.3/test/test_RepeaterWeek.rb
  239. +0 −75 vendor/chronic-0.2.3/test/test_RepeaterWeekend.rb
  240. +0 −63 vendor/chronic-0.2.3/test/test_RepeaterYear.rb
  241. +0 −24 vendor/chronic-0.2.3/test/test_Span.rb
  242. +0 −50 vendor/chronic-0.2.3/test/test_Time.rb
  243. +0 −26 vendor/chronic-0.2.3/test/test_Token.rb
  244. +0 −614 vendor/chronic-0.2.3/test/test_parsing.rb
  245. +0 −53 vendor/coderay-0.7.4.215/FOLDERS
  246. +0 −340 vendor/coderay-0.7.4.215/LICENSE
  247. +0 −117 vendor/coderay-0.7.4.215/README
  248. +0 −77 vendor/coderay-0.7.4.215/bin/coderay
  249. +0 −4 vendor/coderay-0.7.4.215/bin/coderay_stylesheet
  250. +0 −319 vendor/coderay-0.7.4.215/lib/coderay.rb
  251. +0 −29 vendor/coderay-0.7.4.215/lib/coderay/duo.rb
  252. +0 −173 vendor/coderay-0.7.4.215/lib/coderay/encoder.rb
  253. +0 −8 vendor/coderay-0.7.4.215/lib/coderay/encoders/_map.rb
  254. +0 −21 vendor/coderay-0.7.4.215/lib/coderay/encoders/count.rb
  255. +0 −46 vendor/coderay-0.7.4.215/lib/coderay/encoders/debug.rb
  256. +0 −20 vendor/coderay-0.7.4.215/lib/coderay/encoders/div.rb
  257. +0 −260 vendor/coderay-0.7.4.215/lib/coderay/encoders/html.rb
  258. +0 −77 vendor/coderay-0.7.4.215/lib/coderay/encoders/html/classes.rb
  259. +0 −65 vendor/coderay-0.7.4.215/lib/coderay/encoders/html/css.rb
  260. +0 −122 vendor/coderay-0.7.4.215/lib/coderay/encoders/html/numerization.rb
  261. +0 −195 vendor/coderay-0.7.4.215/lib/coderay/encoders/html/output.rb
  262. +0 −26 vendor/coderay-0.7.4.215/lib/coderay/encoders/null.rb
  263. +0 −21 vendor/coderay-0.7.4.215/lib/coderay/encoders/page.rb
  264. +0 −20 vendor/coderay-0.7.4.215/lib/coderay/encoders/span.rb
  265. +0 −81 vendor/coderay-0.7.4.215/lib/coderay/encoders/statistic.rb
  266. +0 −33 vendor/coderay-0.7.4.215/lib/coderay/encoders/text.rb
  267. +0 −44 vendor/coderay-0.7.4.215/lib/coderay/encoders/tokens.rb
  268. +0 −71 vendor/coderay-0.7.4.215/lib/coderay/encoders/xml.rb
  269. +0 −22 vendor/coderay-0.7.4.215/lib/coderay/encoders/yaml.rb
  270. +0 −182 vendor/coderay-0.7.4.215/lib/coderay/helpers/file_type.rb
  271. +0 −122 vendor/coderay-0.7.4.215/lib/coderay/helpers/gzip_simple.rb
  272. +0 −326 vendor/coderay-0.7.4.215/lib/coderay/helpers/plugin.rb
  273. +0 −119 vendor/coderay-0.7.4.215/lib/coderay/helpers/word_list.rb
  274. +0 −238 vendor/coderay-0.7.4.215/lib/coderay/scanner.rb
  275. +0 −15 vendor/coderay-0.7.4.215/lib/coderay/scanners/_map.rb
  276. +0 −163 vendor/coderay-0.7.4.215/lib/coderay/scanners/c.rb
  277. +0 −60 vendor/coderay-0.7.4.215/lib/coderay/scanners/debug.rb
  278. +0 −149 vendor/coderay-0.7.4.215/lib/coderay/scanners/delphi.rb
  279. +0 −177 vendor/coderay-0.7.4.215/lib/coderay/scanners/html.rb
  280. +0 −133 vendor/coderay-0.7.4.215/lib/coderay/scanners/nitro_xhtml.rb
  281. +0 −16 vendor/coderay-0.7.4.215/lib/coderay/scanners/plaintext.rb
  282. +0 −73 vendor/coderay-0.7.4.215/lib/coderay/scanners/rhtml.rb
  283. +0 −367 vendor/coderay-0.7.4.215/lib/coderay/scanners/ruby.rb
  284. +0 −230 vendor/coderay-0.7.4.215/lib/coderay/scanners/ruby/patterns.rb
  285. +0 −18 vendor/coderay-0.7.4.215/lib/coderay/scanners/xml.rb
  286. +0 −20 vendor/coderay-0.7.4.215/lib/coderay/style.rb
  287. +0 −7 vendor/coderay-0.7.4.215/lib/coderay/styles/_map.rb
  288. +0 −125 vendor/coderay-0.7.4.215/lib/coderay/styles/cycnus.rb
  289. +0 −119 vendor/coderay-0.7.4.215/lib/coderay/styles/murphy.rb
  290. +0 −368 vendor/coderay-0.7.4.215/lib/coderay/tokens.rb
  291. +0 −318 vendor/cucumber-0.1.13/History.txt
  292. +0 −20 vendor/cucumber-0.1.13/License.txt
  293. +0 −257 vendor/cucumber-0.1.13/Manifest.txt
  294. +0 −4 vendor/cucumber-0.1.13/README.txt
  295. +0 −8 vendor/cucumber-0.1.13/Rakefile
  296. +0 −6 vendor/cucumber-0.1.13/bin/cucumber
  297. +0 −69 vendor/cucumber-0.1.13/config/hoe.rb
  298. +0 −15 vendor/cucumber-0.1.13/config/requirements.rb
  299. +0 −1  vendor/cucumber-0.1.13/cucumber.yml
  300. +0 −6 vendor/cucumber-0.1.13/examples/calculator_ruby_features/Rakefile
Sorry, we could not display the entire diff because too many files (3,261) changed.
View
7 .gitignore
@@ -1 +1,8 @@
+log/**/*
+log
+tmp/**/*
tmp
+config/database.yml
+db/schema.rb
+.bundle
+*.log
View
1  vendor/cucumber-0.1.13/spec/spec.opts → .rspec
@@ -1,2 +1 @@
--colour
---diff
View
41 Gemfile
@@ -0,0 +1,41 @@
+source 'http://rubygems.org'
+
+gem 'rails', '3.0.1'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3-ruby', :require => 'sqlite3'
+
+# Use unicorn as the web server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug'
+
+# Bundle the extra gems:
+gem 'RedCloth', :require => 'redcloth'
+gem 'ruby-openid', :require => 'openid'
+gem 'rack-openid', :require => 'rack/openid'
+gem 'aaronh-chronic', :require => 'chronic' # Fixes for 1.9.2
+gem 'coderay'
+gem 'lesstile'
+gem 'formtastic'
+gem 'will_paginate', '~> 3.0.pre3'
+
+gem 'highline' # For rake setup
+
+# Bundle gems for the local environment. Make sure to
+# put test-only gems in this group so their generators
+# and rake tasks are available in development mode:
+group :development, :test do
+ gem 'cucumber-rails'
+ gem 'webrat'
+ gem 'factory_girl'
+ gem 'rspec'
+ gem 'rspec-rails'
+ gem 'hpricot'
+end
View
134 Gemfile.lock
@@ -0,0 +1,134 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ RedCloth (4.2.3)
+ aaronh-chronic (0.3.9)
+ abstract (1.0.0)
+ actionmailer (3.0.1)
+ actionpack (= 3.0.1)
+ mail (~> 2.2.5)
+ actionpack (3.0.1)
+ activemodel (= 3.0.1)
+ activesupport (= 3.0.1)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.4.1)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.12)
+ rack-test (~> 0.5.4)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.1)
+ activesupport (= 3.0.1)
+ builder (~> 2.1.2)
+ i18n (~> 0.4.1)
+ activerecord (3.0.1)
+ activemodel (= 3.0.1)
+ activesupport (= 3.0.1)
+ arel (~> 1.0.0)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.1)
+ activemodel (= 3.0.1)
+ activesupport (= 3.0.1)
+ activesupport (3.0.1)
+ arel (1.0.1)
+ activesupport (~> 3.0.0)
+ builder (2.1.2)
+ coderay (0.9.5)
+ cucumber (0.9.4)
+ builder (~> 2.1.2)
+ diff-lcs (~> 1.1.2)
+ gherkin (~> 2.2.9)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ cucumber-rails (0.3.2)
+ cucumber (>= 0.8.0)
+ diff-lcs (1.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ factory_girl (1.3.2)
+ formtastic (1.1.0)
+ actionpack (>= 2.3.0)
+ activesupport (>= 2.3.0)
+ i18n (>= 0.4.0)
+ gherkin (2.2.9)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ highline (1.6.1)
+ hpricot (0.8.3)
+ i18n (0.4.2)
+ json (1.4.6)
+ lesstile (1.0.0)
+ mail (2.2.9)
+ activesupport (>= 2.3.6)
+ i18n (~> 0.4.1)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ nokogiri (1.4.3.1)
+ polyglot (0.3.1)
+ rack (1.2.1)
+ rack-mount (0.6.13)
+ rack (>= 1.0.0)
+ rack-openid (1.2.0)
+ rack (>= 1.1.0)
+ ruby-openid (>= 2.1.8)
+ rack-test (0.5.6)
+ rack (>= 1.0)
+ rails (3.0.1)
+ actionmailer (= 3.0.1)
+ actionpack (= 3.0.1)
+ activerecord (= 3.0.1)
+ activeresource (= 3.0.1)
+ activesupport (= 3.0.1)
+ bundler (~> 1.0.0)
+ railties (= 3.0.1)
+ railties (3.0.1)
+ actionpack (= 3.0.1)
+ activesupport (= 3.0.1)
+ rake (>= 0.8.4)
+ thor (~> 0.14.0)
+ rake (0.8.7)
+ rspec (2.1.0)
+ rspec-core (~> 2.1.0)
+ rspec-expectations (~> 2.1.0)
+ rspec-mocks (~> 2.1.0)
+ rspec-core (2.1.0)
+ rspec-expectations (2.1.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.1.0)
+ rspec-rails (2.1.0)
+ rspec (~> 2.1.0)
+ ruby-openid (2.1.8)
+ sqlite3-ruby (1.3.2)
+ term-ansicolor (1.0.5)
+ thor (0.14.4)
+ treetop (1.4.8)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.23)
+ webrat (0.7.2)
+ nokogiri (>= 1.2.0)
+ rack (>= 1.0)
+ rack-test (>= 0.5.3)
+ will_paginate (3.0.pre2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ RedCloth
+ aaronh-chronic
+ coderay
+ cucumber-rails
+ factory_girl
+ formtastic
+ highline
+ hpricot
+ lesstile
+ rack-openid
+ rails (= 3.0.1)
+ rspec
+ rspec-rails
+ ruby-openid
+ sqlite3-ruby
+ webrat
+ will_paginate (~> 3.0.pre3)
View
15 README.textile
@@ -11,11 +11,18 @@ h2. Quick Start
<pre><code> git clone git://github.com/xaviershay/enki.git enki
cd enki
git checkout -b myblog # Create a new work branch
+ bundle install # Install all the required gems
+
cp config/database.example.yml config/database.yml
# Edit config/enki.yml and config/database.yml to taste
+
+ # Next step needs libxml2 and libxslt1 and their headers
+ # On Debian-based systems: apt-get install libxml2-dev libxslt1-dev
+ # On Mac OS X: no action required
+
rake setup
- rake spec
- ./script/server
+ rake # Run tests
+ rails server # Start the server
# Load http://localhost:3000/admin in your browser</code></pre>
Or for bonus points, fork "enki at github":http://github.com/xaviershay/enki/tree/master and clone that instead.
@@ -42,6 +49,10 @@ h2. How it differs from SimpleLog
Enki embodies much of the philosophy of SimpleLog, but does so in a style that is much more consistent with Rails best practices, making it easier to understand and hack the code.
+h2. Compatibility
+
+Uses rails 3. Runs on MySQL or Postgres. Works on heroku.
+
h2. Contributors, these guys rock
<pre><code>git log | grep Author | sort | uniq</code></pre>
View
9 Rakefile
@@ -1,12 +1,7 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
+require File.expand_path('../config/application', __FILE__)
require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-require 'tasks/rails'
-task :default => [:spec, :features]
+Enki::Application.load_tasks
View
10 app/controllers/admin/comments_controller.rb
@@ -4,11 +4,11 @@ class Admin::CommentsController < Admin::BaseController
def index
@comments = Comment.paginate(
:include => "post",
- :order => "comments.created_at DESC",
- :page => params[:page]
+ :order => "comments.created_at DESC",
+ :page => params[:page]
)
end
-
+
def show
respond_to do |format|
format.html {
@@ -32,9 +32,9 @@ def destroy
respond_to do |format|
format.html do
flash[:notice] = "Deleted comment by #{@comment.author}"
- redirect_to :action => 'index'
+ redirect_to :action => 'index'
end
- format.json {
+ format.json {
render :json => {
:undo_path => undo_admin_undo_item_path(undo_item),
:undo_message => undo_item.description,
View
2  app/controllers/admin/dashboard_controller.rb
@@ -2,6 +2,6 @@ class Admin::DashboardController < Admin::BaseController
def show
@posts = Post.find_recent(:limit => 8)
@comment_activity = CommentActivity.find_recent
- @stats = Stats.new
+ @stats = Stats.new
end
end
View
10 app/controllers/admin/health_controller.rb
@@ -1,11 +1,17 @@
class Admin::HealthController < Admin::BaseController
before_filter :require_login
- verify :method => 'post', :only => 'exception', :render => {:text => 'Method not allowed', :status => 405}, :add_headers => {"Allow" => "POST"}
+ verify :method => 'post',
+ :only => 'generate_exception',
+ :add_headers => {
+ "Allow" => "POST"},
+ :render => {
+ :text => 'Method not allowed',
+ :status => 405}
def index
end
- def exception
+ def generate_exception
raise RuntimeError
end
end
View
8 app/controllers/admin/pages_controller.rb
@@ -27,7 +27,7 @@ def create
end
end
end
-
+
def update
if @page.update_attributes(params[:page])
respond_to do |format|
@@ -60,7 +60,7 @@ def preview
respond_to do |format|
format.js {
- render :partial => 'pages/page.html.erb'
+ render :partial => 'pages/page.html.erb', :locals => {:page => @page}
}
end
end
@@ -71,9 +71,9 @@ def destroy
respond_to do |format|
format.html do
flash[:notice] = "Deleted page '#{@page.title}'"
- redirect_to :action => 'index'
+ redirect_to :action => 'index'
end
- format.json {
+ format.json {
render :json => {
:undo_path => undo_admin_undo_item_path(undo_item),
:undo_message => undo_item.description,
View
10 app/controllers/admin/posts_controller.rb
@@ -27,7 +27,7 @@ def create
end
end
end
-
+
def update
if @post.update_attributes(params[:post])
respond_to do |format|
@@ -54,13 +54,13 @@ def show
def new
@post = Post.new
end
-
+
def preview
@post = Post.build_for_preview(params[:post])
respond_to do |format|
format.js {
- render :partial => 'posts/post.html.erb'
+ render :partial => 'posts/post.html.erb', :locals => {:post => @post}
}
end
end
@@ -71,9 +71,9 @@ def destroy
respond_to do |format|
format.html do
flash[:notice] = "Deleted post '#{@post.title}'"
- redirect_to :action => 'index'
+ redirect_to :action => 'index'
end
- format.json {
+ format.json {
render :json => {
:undo_path => undo_admin_undo_item_path(undo_item),
:undo_message => undo_item.description,
View
24 app/controllers/admin/sessions_controller.rb
@@ -14,18 +14,22 @@ def new
def create
return successful_login(Author.find(:first)) if allow_login_bypass? && params[:bypass_login]
- authenticate_with_open_id(params[:openid_url]) do |result, identity_url|
- if result.successful?
- if author = Author.with_open_id(identity_url)
- return successful_login(author)
+ if params[:openid_url].present?
+ authenticate_with_open_id(params[:openid_url]) do |result, identity_url|
+ if result.successful?
+ if author = Author.with_open_id(identity_url)
+ return successful_login(author)
+ else
+ flash.now[:error] = result.message
+ end
else
- flash.now[:error] = "You are not authorized"
+ flash.now[:error] = "Sorry, the OpenID server couldn't be found"
end
- else
- flash.now[:error] = result.message
end
- render :action => 'new'
+ else
+ flash.now[:error] = "You must supply a URL"
end
+ render :action => 'new'
end
def destroy
@@ -38,11 +42,11 @@ def destroy
def successful_login(author)
session[:logged_in] = true
session[:author_id] = author.id
- redirect_to(admin_dashboard_path)
+ redirect_to(admin_root_path)
end
def allow_login_bypass?
- ["development", "test"].include?(RAILS_ENV)
+ %w(development test).include?(Rails.env)
end
helper_method :allow_login_bypass?
end
View
30 app/controllers/admin/tags_controller.rb
@@ -1,22 +1,28 @@
class Admin::TagsController < Admin::BaseController
- make_resourceful do
- actions :all
+ before_filter :find_tag, :except => 'index'
- after(:update) do
- flash[:notice] = "Tag updated"
- end
+ def index
+ @tags = Tag.paginate(:order => 'name', :page => params[:page])
+ end
+
+ def show
+ end
+
+ def edit
+ end
- response_for(:update) do
- redirect_to(:action => 'index')
+ def update
+ if @tag.update_attributes(params[:tag])
+ flash[:notice] = "Tag updated"
+ redirect_to :action => 'index'
+ else
+ render :action => 'edit'
end
end
protected
- def current_objects
- @current_object ||= current_model.paginate(
- :order => "name",
- :page => params[:page]
- )
+ def find_tag
+ @tag = Tag.find(params[:id])
end
end
View
25 app/controllers/application.rb
@@ -1,25 +0,0 @@
-# Filters added to this controller apply to all controllers in the application.
-# Likewise, all the methods added will be available for all controllers.
-
-class ApplicationController < ActionController::Base
- include ExceptionNotifiable
-
- helper :all # include all helpers, all the time
-
- after_filter :set_content_type
-
- # See ActionController::RequestForgeryProtection for details
- # Uncomment the :secret if you're not using the cookie session store
-# protect_from_forgery :secret => 'a6a9e417376364b61645d469f04ac8cf'
-
- protected
-
- def set_content_type
- headers['Content-Type'] ||= 'application/xhtml+xml; charset=utf-8'
- end
-
- def config
- @@config = Enki::Config.default
- end
- helper_method :config
-end
View
15 app/controllers/application_controller.rb
@@ -0,0 +1,15 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+ after_filter :set_content_type
+
+ protected
+
+ def set_content_type
+ headers['Content-Type'] ||= 'text/html; charset=utf-8'
+ end
+
+ def enki_config
+ @@enki_config = Enki::Config.default
+ end
+ helper_method :enki_config
+end
View
44 app/controllers/comments_controller.rb
@@ -1,5 +1,9 @@
class CommentsController < ApplicationController
include UrlHelper
+ OPEN_ID_ERRORS = {
+ :missing => "Sorry, the OpenID server couldn't be found",
+ :canceled => "OpenID verification was canceled",
+ :failed => "Sorry, the OpenID verification failed" }
before_filter :find_post, :except => [:new]
@@ -7,10 +11,7 @@ def index
if request.post? || using_open_id?
create
else
- respond_to do |format|
- format.html { redirect_to(post_path(@post)) }
- format.atom { @comments = @post.approved_comments }
- end
+ redirect_to(post_path(@post))
end
end
@@ -19,7 +20,7 @@ def new
respond_to do |format|
format.js do
- render :partial => 'comment.html.erb'
+ render :partial => 'comment.html.erb', :locals => {:comment => @comment}
end
end
end
@@ -30,36 +31,27 @@ def create
session[:pending_comment] = nil
- if @comment.requires_openid_authentication?
+ unless @comment.requires_openid_authentication?
+ @comment.blank_openid_fields
+ else
session[:pending_comment] = params[:comment]
- return if authenticate_with_open_id(@comment.author,
- :optional => [:nickname, :fullname, :email]
- ) do |result, identity_url, registration|
-
- case result.status
- when :missing
- @comment.openid_error = "Sorry, the OpenID server couldn't be found"
- when :canceled
- @comment.openid_error = "OpenID verification was canceled"
- when :failed
- @comment.openid_error = "Sorry, the OpenID verification failed"
- when :successful
+ return if authenticate_with_open_id(@comment.author, :optional => [:nickname, :fullname, :email]) do |result, identity_url, registration|
+ if result.status == :successful
@comment.post = @post
- @comment.author_url = @comment.author
- @comment.author = (registration["fullname"] || registration["nickname"] || @comment.author_url).to_s
- @comment.author_email = registration["email"].to_s
+ @comment.author_url = @comment.author
+ @comment.author = (registration["fullname"] || registration["nickname"] || @comment.author_url).to_s
+ @comment.author_email = (registration["email"] || @comment.author_url).to_s
@comment.openid_error = ""
+ session[:pending_comment] = nil
+ else
+ @comment.openid_error = OPEN_ID_ERRORS[ result.status ]
end
-
- session[:pending_comment] = nil
end
- else
- @comment.blank_openid_fields
end
- if @comment.save
+ if session[:pending_comment].nil? && @comment.save
redirect_to post_path(@post)
else
render :template => 'posts/show'
View
2  app/helpers/admin/navigation_helper.rb
@@ -1,6 +1,6 @@
module Admin::NavigationHelper
def nav_link_to(text, url, options)
- options.merge!(:class => 'current') if url == request.request_uri
+ options.merge!(:class => 'current') if url == request.fullpath
link_to(text, url, options)
end
end
View
9 app/helpers/application_helper.rb
@@ -1,16 +1,15 @@
-# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def author
Author.find(:first)
end
def open_id_delegation_link_tags(server, delegate)
- links = <<-EOS
- <link rel="openid.server" href="#{server}" />
- <link rel="openid.delegate" href="#{delegate}" />
+ raw links = <<-EOS
+ <link rel="openid.server" href="#{server}">
+ <link rel="openid.delegate" href="#{delegate}">
EOS
end
-
+
def format_comment_error(error)
{
'body' => 'Please comment',
View
2  app/helpers/date_helper.rb
@@ -2,7 +2,7 @@ module DateHelper
def format_month(date)
date.strftime("%B %Y")
end
-
+
def format_post_date(date)
date.strftime("%B %d, %Y")
end
View
8 app/helpers/navigation_helper.rb
@@ -1,15 +1,15 @@
module NavigationHelper
def page_links_for_navigation
link = Struct.new(:name, :url)
- [link.new("Home", posts_path),
- link.new("Archives", archives_path)] +
- Page.find(:all, :order => 'title').collect {|page| link.new(page.title, page_path(page))}
+ [link.new("Home", root_path),
+ link.new("Archives", archives_path)] +
+ Page.find(:all, :order => 'title').collect {|page| link.new(page.title, page_path(page.slug))}
end
def category_links_for_navigation
link = Struct.new(:name, :url)
@popular_tags ||= Tag.find(:all).reject {|tag| tag.taggings.empty? }.sort_by {|tag| tag.taggings.size }.reverse
- @popular_tags.collect {|tag| link.new(tag.name, posts_path(:tag => tag)) }
+ @popular_tags.collect {|tag| link.new(tag.name, posts_path(:tag => tag.name)) }
end
def class_for_tab(tab_name, index)
View
2  app/helpers/page_title_helper.rb
@@ -18,6 +18,6 @@ def page_title(page)
private
def compose_title(*parts)
- (parts << config[:title]).reject(&:blank?).join(" - ")
+ (parts << enki_config[:title]).reject(&:blank?).join(" - ")
end
end
View
2  app/helpers/tag_helper.rb
@@ -1,5 +1,5 @@
module TagHelper
def linked_tag_list(tags)
- tags.collect {|tag| link_to(h(tag.name), posts_path(:tag => tag))}.join(", ")
+ raw tags.collect {|tag| link_to(tag.name, posts_path(:tag => tag.name))}.join(", ")
end
end
View
40 app/helpers/url_helper.rb
@@ -1,52 +1,20 @@
module UrlHelper
- def posts_path(options = {})
- if options[:tag]
- options[:tag] = options[:tag].name if options[:tag].respond_to?(:name)
- options[:tag] = options[:tag].downcase
- posts_with_tag_path(options)
- else
- super
- end
- end
-
- def formatted_posts_path(options = {})
- if options[:tag]
- options[:tag] = options[:tag].name if options[:tag].respond_to?(:name)
- options[:tag] = options[:tag].downcase
- formatted_posts_with_tag_path(options)
- else
- super
- end
- end
-
def post_path(post, options = {})
suffix = options[:anchor] ? "##{options[:anchor]}" : ""
path = post.published_at.strftime("/%Y/%m/%d/") + post.slug + suffix
- path = URI.join(config[:url], path) if options[:only_path] == false
- path.untaint
+ path = URI.join(enki_config[:url], path) if options[:only_path] == false
+ path
end
def post_comments_path(post)
post_path(post) + "/comments"
end
- def page_path(page)
- "/pages/#{page.slug}"
- end
-
def author_link(comment)
if comment.author_url.blank?
- h(comment.author)
- else
- link_to(h(comment.author), h(comment.author_url), :class => 'openid')
- end
- end
-
- def posts_atom_path(tag)
- if tag.blank?
- formatted_posts_path(:format => 'atom')
+ comment.author
else
- formatted_posts_with_tag_path(:tag => tag, :format => 'atom')
+ link_to(comment.author, comment.author_url, :class => 'openid')
end
end
end
View
11 app/models/comment.rb
@@ -11,17 +11,16 @@ class Comment < ActiveRecord::Base
after_destroy :denormalize
validates_presence_of :author, :body, :post
+ validate :open_id_error_should_be_blank
- # validate :open_id_thing
- def validate
- super
+ def open_id_error_should_be_blank
errors.add(:base, openid_error) unless openid_error.blank?
end
def apply_filter
self.body_html = Lesstile.format_as_xhtml(self.body, :code_formatter => Lesstile::CodeRayFormatter)
end
-
+
def blank_openid_fields
self.author_url = ""
self.author_email = ""
@@ -42,7 +41,7 @@ def user_logged_in?
def approved?
true
end
-
+
def denormalize
self.post.denormalize_comments_count!
end
@@ -65,7 +64,7 @@ class << self
def protected_attribute?(attribute)
[:author, :body].include?(attribute.to_sym)
end
-
+
def new_with_filter(params)
comment = Comment.new(params)
comment.created_at = Time.now
View
5 app/models/comment_activity.rb
@@ -16,9 +16,10 @@ def most_recent_comment
class << self
def find_recent
Post.find(:all,
- :select => 'distinct posts.*',
+ :group => "comments.post_id, posts." + Post.column_names.join(", posts."),
+ :select => 'posts.*, max(comments.created_at), comments.post_id',
:joins => 'INNER JOIN comments ON comments.post_id = posts.id',
- :order => 'comments.created_at DESC',
+ :order => 'max(comments.created_at) desc',
:limit => 5
).collect {|post|
CommentActivity.new(post)
View
10 app/models/post.rb
@@ -28,7 +28,7 @@ def minor_edit
def minor_edit?
self.minor_edit == "1"
end
-
+
def published?
published_at?
end
@@ -54,7 +54,7 @@ def find_recent(options = {})
tag = options.delete(:tag)
options = {
:order => 'posts.published_at DESC',
- :conditions => ['published_at < ?', Time.now],
+ :conditions => ['published_at < ?', Time.zone.now],
:limit => DEFAULT_LIMIT
}.merge(options)
if tag
@@ -68,8 +68,10 @@ def find_by_permalink(year, month, day, slug, options = {})
begin
day = Time.parse([year, month, day].collect(&:to_i).join("-")).midnight
post = find_all_by_slug(slug, options).detect do |post|
- post.published_at.midnight == day
- end
+ [:year, :month, :day].all? {|time|
+ post.published_at.send(time) == day.send(time)
+ }
+ end
rescue ArgumentError # Invalid time
post = nil
end
View
14 app/models/tag.rb
@@ -1,9 +1,9 @@
class Tag < ActiveRecord::Base
has_many :taggings, :dependent => :destroy
-
+
validates_presence_of :name
validates_uniqueness_of :name
-
+
# TODO: Contribute this back to acts_as_taggable_on_steroids plugin
# Update taggables' cached_tag_list
after_destroy do |tag|
@@ -15,23 +15,23 @@ class Tag < ActiveRecord::Base
end
end
end
-
+
cattr_accessor :destroy_unused
self.destroy_unused = false
-
+
# LIKE is used for cross-database case-insensitivity
def self.find_or_create_with_like_by_name(name)
find(:first, :conditions => ["name LIKE ?", name]) || create(:name => name)
end
-
+
def ==(object)
super || (object.is_a?(Tag) && name == object.name)
end
-
+
def to_s
name
end
-
+
def count
read_attribute(:count).to_i
end
View
4 app/models/tagging.rb
@@ -1,8 +1,8 @@
class Tagging < ActiveRecord::Base #:nodoc:
belongs_to :tag, :counter_cache => true
belongs_to :taggable, :class_name => 'Post', :foreign_key => 'taggable_id' #:polymorphic => true
-
- def after_destroy
+
+ def self.after_destroy
if Tag.destroy_unused and tag.taggings.count.zero?
tag.destroy
end
View
6 app/views/admin/comments/_comment.html.erb
@@ -1,11 +1,11 @@
<tr id="comment-<%= comment.id %>" class="<%= cycle('', 'alt') %>">
<td class='created_at'><%= comment.created_at.strftime('%d %b, %Y') %></td>
- <td class='author'><%= link_to(h(comment.author), admin_comment_path(comment)) %></td>
- <td><%=h truncate(comment.body, :length => 40) %></td>
+ <td class='author'><%= link_to(comment.author, admin_comment_path(comment)) %></td>
+ <td><%= truncate(comment.body, :length => 40) %></td>
<td><%= link_to(comment.post_title, admin_post_path(comment.post))%></td>
<td>
<%= link_to(image_tag('silk/pencil.png', :alt => 'edit'), admin_comment_path(comment)) %>
- <% form_for(:comment, comment, :url => admin_comment_path(comment), :html => {:class => 'delete-item', :method => :delete}) do |form| -%>
+ <%= form_for(comment, :as => :comment, :url => admin_comment_path(comment), :html => {:class => 'delete-item', :method => :delete}) do |form| -%>
<%= image_submit_tag("silk/delete.png", :alt => "Delete Comment") %>
<% end -%>
</td>
View
12 app/views/admin/comments/index.html.erb
@@ -4,7 +4,7 @@
<% end -%>
<h1>Comments</h1>
-<table cellspacing="0" cellpadding="0">
+<table>
<thead>
<tr>
<th>Created At</th>
@@ -14,8 +14,8 @@
<th>Actions</th>
</tr>
</thead>
-
- <tbody>
+
+ <tbody>
<% if @comments.empty? -%>
<tr><td colspan="5">There are no comments at this time.</td></tr>
<% else -%>
@@ -28,8 +28,8 @@
<tr class="pagination">
<td colspan='5'>
<%= will_paginate(@comments, :previous_label => '« Newer', :next_label => 'Older »') %>
- </td>
- </tr>
- <% end -%>
+ </td>
+ </tr>
+ <% end -%>
</tfoot>
</table>
View
10 app/views/admin/comments/show.html.erb
@@ -1,13 +1,13 @@
-<h1>Editing comment by <%=h @comment.author %></h1>
+<h1>Editing comment by <%= @comment.author %></h1>
-<% semantic_form_for([:admin, @comment]) do |form| -%>
- <% form.input_field_set do -%>
+<%= semantic_form_for([:admin, @comment]) do |form| -%>
+ <%= form.input_field_set do -%>
<%= form.input :author %>
<%= form.input :author_url, :required => false %>
<%= form.input :author_email, :required => false %>
- <%= form.input :body, :hint => "<a href='http://lesstile.rubyforge.org'>Lesstile enabled</a>." %>
+ <%= form.input :body, :hint => "<a href='http://lesstile.rubyforge.org'>Lesstile enabled</a>.".html_safe %>
<% end %>
- <% form.button_field_set do -%>
+ <%= form.button_field_set do -%>
<%= form.commit_button("Save") %>
<% end -%>
<% end -%>
View
28 app/views/admin/dashboard/show.html.erb
@@ -5,7 +5,7 @@
<% end -%>
<div id="summary">
-<h1><%= link_to(h(config[:title]), '/') %></h1>
+<h1><%= link_to(enki_config[:title], '/') %></h1>
<p class="stats"><%= pluralize(@stats.post_count, 'post') %>, <%= pluralize(@stats.comment_count, 'comment') %>, <%= pluralize(@stats.tag_count, 'tag') %></p>
</div>
@@ -14,12 +14,12 @@
<ul>
<% @posts.each_with_index do |post, i| -%>
<li class="<%= i == 0 ? 'first ' : '' %>item">
- <%= link_to("<h3>%s</h3>" % [h(truncate(post.title, :length => 50))], admin_post_path(post)) %>
- <span class='date'><%=h post.published_at.strftime("%b %e") %></span>
- <span class='count'><%= link_to(h(post.approved_comments.size), post_path(post)) %></span>
- </li>
+ <h3><%= link_to(truncate(post.title, :length => 50), admin_post_path(post)) %></h3>
+ <span class='date'><%= post.published_at.strftime("%b %e") %></span>
+ <span class='count'><%= link_to(post.approved_comments.size, post_path(post)) %></span>
+ </li>
<% end -%>
-</ul>
+</ul>
</div>
<div id="recent-comments" class="panel">
@@ -27,13 +27,13 @@
<ul>
<% @comment_activity.each_with_index do |activity, i| -%>
<li class="<%= i == 0 ? 'first ' : '' %>item">
- <%= link_to("<h3>%s</h3>" % [h(truncate(activity.post.title, :length => 50))], post_path(activity.post)) %>
- <span class='date'><%=h activity.most_recent_comment.created_at.strftime("%b %e") %></span>
- <span class='count'><%=h activity.post.approved_comments.size %></span>
+ <h3><%= link_to(truncate(activity.post.title, :length => 50), post_path(activity.post)) %></h3>
+ <span class='date'><%= activity.most_recent_comment.created_at.strftime("%b %e") %></span>
+ <span class='count'><%= activity.post.approved_comments.size %></span>
<ul>
<% activity.comments.each_with_index do |comment, index| -%>
- <% content_tag :li, :class => activity.comments.size == index + 1 ? 'last' : nil do -%>
- <%= link_to(h(comment.author), admin_comment_path(comment), {:id => "comment-link-#{comment.id}", :class => 'comment-link'}) -%>
+ <%= content_tag :li, :class => activity.comments.size == index + 1 ? 'last' : nil do -%>
+ <%= link_to(comment.author, admin_comment_path(comment), {:id => "comment-link-#{comment.id}", :class => 'comment-link'}) -%>
<% end -%>
<% end -%>
</ul>
@@ -41,8 +41,8 @@
<div class='comment-body' id='comment-body-<%= comment.id %>'>
<div class='comment-actions'>
<%= link_to(image_tag('silk/pencil.png', :alt => 'edit'), admin_comment_path(comment)) %>
- <% form_for(:comment, comment, :url => admin_comment_path(comment), :html => {:class => 'delete-item', :id => "delete-comment-#{comment.id}", :method => :delete}) do |form| -%>
- <%= image_submit_tag("silk/delete.png") %>
+ <%= form_for(comment, :as => :comment, :url => admin_comment_path(comment), :html => {:class => 'delete-item', :id => "delete-comment-#{comment.id}", :method => :delete}) do |form| -%>
+ <%= image_submit_tag("silk/delete.png", :alt => 'Delete Comment') %>
<% end -%>
</div>
<%= comment.body_html %>
@@ -50,6 +50,6 @@
<% end -%>
</li>
<% end -%>
-</ul>
+</ul>
</div>
View
2  app/views/admin/health/index.html.erb
@@ -1,3 +1,3 @@
<h1>Health</h1>
-<p><%= button_to("Throw exception", admin_health_path(:action => 'exception')) %></p>
+<%= button_to("Throw exception", admin_health_path(:action => 'generate_exception')) %>
View
4 app/views/admin/pages/_form.html.erb
@@ -2,8 +2,8 @@
<%= javascript_include_tag 'admin/edit-preview' %>
<% end -%>
-<% form.input_field_set do -%>
+<%= form.input_field_set do -%>
<%= form.input :title %>
<%= form.input :slug, :hint => "Leave blank for an auto-generated slug based on the title." %>
- <%= form.input :body, :hint => "<a href='http://hobix.com/textile/quick.html'>Textile enabled</a>. Use Ctrl+E to switch between preview and edit mode." %>
+ <%= form.input :body, :hint => "<a href='http://hobix.com/textile/quick.html'>Textile enabled</a>. Use Ctrl+E to switch between preview and edit mode.".html_safe %>
<% end -%>
View
10 app/views/admin/pages/_page.html.erb
@@ -1,12 +1,12 @@
<tr class="<%= cycle('', 'alt') %>">
<td><%= page.created_at.strftime('%d %b, %Y') %></td>
- <td><%= link_to(h(page.title), admin_page_path(page)) %></td>
- <td><%=h truncate(page.body, :length => 50) %></td>
+ <td><%= link_to(page.title, admin_page_path(page)) %></td>
+ <td><%= truncate(page.body, :length => 50) %></td>
<td><%= page.slug %></td>
- <td>
+ <td>
<%= link_to(image_tag('silk/pencil.png', :alt => 'edit'), admin_page_path(page)) %>
- <% form_for(:page, page, :url => admin_page_path(page), :html => {:class => 'delete-item', :method => :delete}) do |form| -%>
- <%= image_submit_tag("silk/delete.png") %>
+ <%= form_for(page, :as => :page, :url => admin_page_path(page), :html => {:class => 'delete-item', :method => :delete}) do |form| -%>
+ <%= image_submit_tag("silk/delete.png", :alt => 'Delete Comment') %>
<% end -%>
</td>
</tr>
View
10 app/views/admin/pages/index.html.erb
@@ -4,7 +4,7 @@
<h1>Your pages</h1>
-<table cellspacing="0" cellpadding="0">
+<table>
<thead>
<tr>
<th>Created At</th>
@@ -14,7 +14,7 @@
<th>Actions</th>
</tr>
</thead>
-
+
<tbody>
<% if @pages.empty? -%>
<tr><td colspan="5">There are no pages at this time.</td></tr>
@@ -28,8 +28,8 @@
<tr class="pagination">
<td colspan='5'>
<%= will_paginate(@pages, :previous_label => '« Newer', :next_label => 'Older »') %>
- </td>
- </tr>
- <% end -%>
+ </td>
+ </tr>
+ <% end -%>
</tfoot>
</table>
View
8 app/views/admin/pages/new.html.erb
@@ -1,8 +1,8 @@
<h1>New page</h1>
-<% semantic_form_for([:admin, @page]) do |form| -%>
+<%= semantic_form_for([:admin, @page]) do |form| -%>
<%= render :partial => 'form', :locals => {:form => form} %>
- <% form.button_field_set do -%>
- <%= form.commit_button("Save") -%>
- <% end -%>
+ <%= form.button_field_set do -%>
+ <%= form.commit_button("Save") -%>
+ <% end -%>
<% end -%>
View
10 app/views/admin/pages/show.html.erb
@@ -1,8 +1,8 @@
-<h1>Editing page - <%= link_to(h(@page.title), page_path(@page)) %></h1>
+<h1>Editing page - <%= link_to(@page.title, page_path(@page.slug)) %></h1>
-<% semantic_form_for([:admin, @page]) do |form| -%>
+<%= semantic_form_for([:admin, @page]) do |form| -%>
<%= render :partial => 'form', :locals => {:form => form} %>
- <% form.button_field_set do -%>
- <%= form.commit_button("Save") -%>
- <% end -%>
+ <%= form.button_field_set do -%>
+ <%= form.commit_button("Save") -%>
+ <% end -%>
<% end -%>
View
10 app/views/admin/posts/_form.html.erb
@@ -2,13 +2,13 @@
<%= javascript_include_tag 'admin/edit-preview' %>
<% end -%>
-<% form.input_field_set do -%>
+<%= form.input_field_set do -%>
<%= form.input :title -%>
- <%= form.input :body, :hint => "<a href='http://hobix.com/textile/quick.html'>Textile enabled</a>. Use Ctrl+E to switch between preview and edit mode." -%>
- <%= form.input :tag_list, :as => 'string', :required => false, :hint => 'Comma separated: ruby, rails&hellip;' -%>
+ <%= form.input :body, :hint => "<a href='http://hobix.com/textile/quick.html'>Textile enabled</a>. Use Ctrl+E to switch between preview and edit mode.".html_safe -%>
+ <%= form.input :tag_list, :as => 'string', :required => false, :hint => 'Comma separated: ruby, rails&hellip;'.html_safe -%>
<% end -%>
-<% form.input_field_set do -%>
- <%= form.input :published_at_natural, :label => 'Published at', :as => 'string', :hint => 'Example: now, yesterday, 1 hour from now, ' + link_to("more&hellip;", "http://chronic.rubyforge.org/") -%>
+<%= form.input_field_set do -%>
+ <%= form.input :published_at_natural, :label => 'Published at', :as => 'string', :hint => 'Example: now, yesterday, 1 hour from now, '.html_safe + link_to("more&hellip;".html_safe, "http://chronic.rubyforge.org/") -%>
<%= form.input :slug, :hint => "Leave blank for an auto-generated slug based on the title." -%>
<%= form.input :minor_edit, :as => 'boolean', :hint => 'Minor edits will not show up as refreshed in feed readers. Use this to fix spelling mistakes and the like.' unless @post.new_record? -%>
<% end -%>
View
8 app/views/admin/posts/_post.html.erb
@@ -1,12 +1,12 @@
<tr class="<%= cycle('', 'alt') %>">
<td><%= post.published_at.strftime('%d %b, %Y') %></td>
- <td><%= link_to (post.title == '' ? '[Untitled]' : h(truncate(post.title, :length => 30))), admin_post_path(post) %></td>
- <td><% tmpc = h(truncate(post.body, :length => 55)) %><%= (tmpc != '' ? tmpc : '&nbsp;') %></td>
+ <td><%= link_to (post.title == '' ? '[Untitled]' : truncate(post.title, :length => 30)), admin_post_path(post) %></td>
+ <td><% tmpc = truncate(post.body, :length => 55) %><%= (tmpc != '' ? tmpc : '&nbsp;') %></td>
<td><%= post.approved_comments.size %></td>
<td>
<%= link_to(image_tag('silk/pencil.png', :alt => 'edit'), admin_post_path(post)) %>
- <% form_for(:post, post, :url => admin_post_path(post), :html => {:class => 'delete-item', :method => :delete}) do |form| -%>
- <%= image_submit_tag("silk/delete.png") %>
+ <%= form_for(post, :as => :post, :url => admin_post_path(post), :html => {:class => 'delete-item', :method => :delete}) do |form| -%>
+ <%= image_submit_tag("silk/delete.png", :alt => 'Delete Comment') %>
<% end -%>
</td>
</tr>
View
8 app/views/admin/posts/index.html.erb
@@ -3,7 +3,7 @@
<% end -%>
<h1>Your posts</h1>
-<table cellspacing="0" cellpadding="0">
+<table>
<thead>
<tr>
<th>Published At</th>
@@ -20,15 +20,15 @@
<% else -%>
<%= render :partial => 'post', :collection => @posts %>
<% end -%>
- </tbody>
+ </tbody>
<tfoot>
<% if @posts.total_pages > 1 -%>
<tr class="pagination">
<td colspan="5">
<%= will_paginate(@posts, :previous_label => '« Newer', :next_label => 'Older »') %>
- </td>
+ </td>
</tr>
<% end -%>
- </tfoot>
+ </tfoot>
</table>
View
6 app/views/admin/posts/new.html.erb
@@ -1,8 +1,8 @@
<h1>New post</h1>
-<% semantic_form_for([:admin, @post]) do |form| -%>
+<%= semantic_form_for([:admin, @post]) do |form| -%>
<%= render :partial => 'form', :locals => {:form => form} -%>
- <% form.button_field_set do -%>
- <%= form.commit_button("Save") -%>
+ <%= form.button_field_set do -%>
+ <%= form.commit_button("Save") -%>
<% end -%>
<% end -%>
View
10 app/views/admin/posts/show.html.erb
@@ -1,8 +1,8 @@
-<h1>Editing post - <%= link_to(h(@post.title), post_path(@post)) %></h1>
+<h1>Editing post - <%= link_to(@post.title, post_path(@post)) %></h1>
-<% semantic_form_for([:admin, @post]) do |form| -%>
+<%= semantic_form_for([:admin, @post]) do |form| -%>
<%= render :partial => 'form', :locals => {:form => form} %>
- <% form.button_field_set do -%>
- <%= form.commit_button("Save") -%>
- <% end -%>
+ <%= form.button_field_set do -%>
+ <%= form.commit_button("Save") -%>
+ <% end -%>
<% end -%>
View
4 app/views/admin/sessions/new.html.erb
@@ -1,6 +1,6 @@
-<h1><%= link_to(h(config[:title]), '/') %></h1>
+<h1><%= link_to(enki_config[:title], '/') %></h1>
<% if flash[:error] %><p><%= flash[:error] %></p><% end %>
-<% form_tag(admin_session_path) do -%>
+<%= form_tag(admin_session_path) do -%>
<h2>Stop! Who are you?</h2>
<p><%= text_field_tag 'openid_url' %></p>
<% if allow_login_bypass? -%>
View
14 app/views/admin/tags/edit.html.erb
@@ -1,10 +1,10 @@
-<h1>Editing tag - <%= link_to(h(@tag.name), posts_path(:tag => @tag)) %></h1>
+<h1>Editing tag - <%= link_to(@tag.name, posts_path(:tag => @tag)) %></h1>
-<% semantic_form_for([:admin, @tag]) do |form| -%>
- <% form.input_field_set do -%>
+<%= semantic_form_for([:admin, @tag]) do |form| -%>
+ <%= form.input_field_set do -%>
<%= form.input :name %>
- <% end -%>
- <% form.button_field_set do -%>
- <%= form.commit_button("save") -%>
- <% end -%>
+ <% end -%>
+ <%= form.button_field_set do -%>
+ <%= form.commit_button("save") -%>
+ <% end -%>
<% end -%>
View
14 app/views/admin/tags/index.html.erb
@@ -1,18 +1,18 @@
<h1>Your tags</h1>
-<table cellspacing="0" cellpadding="0">
- <thead>
+<table>
+ <thead>
<tr>
<th>Name</th>
<th>Posts Tagged</th>
<th>Actions</th>
</tr>
</thead>
-
+
<tbody>
<% if @tags.empty? -%>
<tr><td colspan="3">There are no tags at this time.</td></tr>
- <% else -%>
+ <% else -%>
<% @tags.each do |tag| -%>
<tr class="<%= cycle('', 'alt') %>">
<td><%= link_to(tag.name, edit_admin_tag_path(tag)) %></td>
@@ -31,8 +31,8 @@
<tr class="pagination">
<td colspan='3'>
<%= will_paginate(@tags, :previous_label => '« newer', :next_label => 'older »') %>
- </td>
- </tr>
- <% end -%>
+ </td>
+ </tr>
+ <% end -%>
</tfoot>
</table>
View
20 app/views/admin/undo_items/index.html.erb
@@ -3,24 +3,26 @@
<% end -%>
<h1>Recent actions</h1>
-<table cellspacing="0" cellpadding="0">
+<table>
<thead>
- <th>Date</th>
- <th>Action</th>
- <th></th>
+ <tr>
+ <th>Date</th>
+ <th>Description</th>
+ <th>Action</th>
+ </tr>
</thead>
<tbody>
<% @undo_items.each do |undo_item| -%>
<tr class="<%= cycle('', 'alt') %>">
- <td><%=h undo_item.created_at.strftime('%d %b, %Y') %></td>
- <td><%=h undo_item.description %></td>
+ <td><%= undo_item.created_at.strftime('%d %b, %Y') %></td>
+ <td><%= undo_item.description %></td>
<td>
- <% form_for(:undo_item, undo_item, :url => undo_admin_undo_item_path(undo_item), :html => {:class => 'undo-item', :method => :post}) do |form| -%>
+ <%= form_for(undo_item, :as => :undo_item, :url => undo_admin_undo_item_path(undo_item), :html => {:class => 'undo-item', :method => :post}) do |form| -%>
<%= image_submit_tag("silk/arrow_undo.png", :alt => 'Undo') %>
<% end -%>
</td>
- </tr>
+ </tr>
<% end -%>
</tbody>
-</table>
+</table>
View
4 app/views/archives/index.html.erb
@@ -1,4 +1,4 @@
-<% content_for(:page_title) do %><%=h archives_title %><% end -%>
+<% content_for(:page_title) do %><%= archives_title %><% end -%>
<h2>Archives</h2>
<% if @months.empty? -%>
@@ -11,7 +11,7 @@
<% month.posts.each do |post| -%>
<li><%= link_to(post.title, post_path(post)) %><% unless post.tags.empty? %> <span class='tags'>(<%= linked_tag_list(post.tags) %>)</span><% end -%></li>
<% end -%>
- </ul>
+ </ul>
<% end -%>
<% end -%>
View
4 app/views/comments/_comment.html.erb
@@ -1,4 +1,4 @@
<cite><%= author_link(comment) %></cite> says:
- <br />
+ <br>
<small class="commentmetadata"><a href="#comment-<%= comment.id %>" title=""><%= format_comment_date(comment.created_at) %></a></small>
- <p><%= comment.body_html.untaint %></p>
+ <p><%=raw comment.body_html %></p>
View
26 app/views/layouts/admin.html.erb
@@ -1,13 +1,9 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC
- "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
- "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<!DOCTYPE html>
+<html dir="ltr" lang="en-US">
<head>
- <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
-
- <title><%=h config[:title] %> - Admin</title>
+ <meta charset="utf-8">
+
+ <title><%= enki_config[:title] %> - Admin</title>
<%= javascript_include_tag 'jquery.js' %>
<%= javascript_include_tag 'jquery.livequery.js' %>
@@ -25,8 +21,8 @@
<% if flash[:notice] -%>
<script>
jQuery(document).ready(function() {
- humanMsg.displayMsg('<%= escape_javascript(h(flash[:notice])) %>');
- })
+ humanMsg.displayMsg('<%= escape_javascript(flash[:notice]) %>');
+ })
</script>
<% end -%>
@@ -38,9 +34,9 @@
</div>
<div id="nav">
<ul>
- <li><%= nav_link_to("Dashboard", admin_dashboard_path, :accesskey => '1') %></li>
- <li><%= nav_link_to("Posts", admin_posts_path, :accesskey => '2') %> <%= nav_link_to("(+)", new_admin_post_path, :access_key => 'n') %></li>
- <li><%= nav_link_to("Pages", admin_pages_path, :accesskey => '3') %> <%= nav_link_to("(+)", new_admin_page_path, :access_key => 'p') %></li>
+ <li><%= nav_link_to("Dashboard", admin_root_path, :accesskey => '1') %></li>
+ <li><%= nav_link_to("Posts", admin_posts_path, :accesskey => '2') %> <%= nav_link_to("(+)", new_admin_post_path, :accesskey => 'n') %></li>
+ <li><%= nav_link_to("Pages", admin_pages_path, :accesskey => '3') %> <%= nav_link_to("(+)", new_admin_page_path, :accesskey => 'p') %></li>
<li><%= nav_link_to("Comments", admin_comments_path, :accesskey => '4') %></li>
<li><%= nav_link_to("Tags", admin_tags_path, :accesskey => '5') %></li>
<li><%= nav_link_to("Actions", admin_undo_items_path, :accesskey => '6') %></li>
@@ -50,6 +46,6 @@
<li><%= link_to("View Site", '/', :accesskey => 'v', :title => 'View Site') %></li>
</ul>
</div>
- </div>
+ </div>
</body>
</html>
View
30 app/views/layouts/application.html.erb
@@ -1,20 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC
- "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
- "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<!DOCTYPE html>
+<html dir="ltr" lang="en-US">
<head>
- <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
- <title><%= yield(:page_title) || h(config[:title]) %></title>
+ <meta charset="utf-8">
+ <title><%= yield(:page_title) || enki_config[:title] %></title>
<%= stylesheet_link_tag 'application' %>
<%= javascript_include_tag 'jquery' %>
- <%= open_id_delegation_link_tags(h(config[:open_id_delegation, :server]), h(config[:open_id_delegation, :delegate])) if config[:open_id_delegation] %>
+ <%= open_id_delegation_link_tags(enki_config[:open_id_delegation, :server], enki_config[:open_id_delegation, :delegate]) if enki_config[:open_id_delegation] %>
<%= yield(:head) %>
</head>
<body>
<div id="page_container">
- <h1 id="page_heading"><a href="<%=h config[:url] %>"><%=h config[:title] %></a></h1>
+ <h1 id="page_heading"><a href="<%= root_url %>"><%= enki_config[:title] %></a></h1>
<div id="main">
<%= yield %>
@@ -24,14 +20,14 @@
<h2>Pages</h2>
<ul>
<% page_links_for_navigation.each do |link| -%>
- <li><%= link_to(h(link.name), link.url) %></li>
+ <li><%= link_to(link.name, link.url) %></li>
<% end -%>
</ul>
<% unless category_links_for_navigation.empty? -%>
<h2>Categories</h2>
<ul>
<% category_links_for_navigation.each do |link| -%>
- <li><%= link_to(h(link.name), link.url) %></li>
+ <li><%= link_to(link.name, link.url) %></li>
<% end -%>
</ul>
<% end -%>