jabe 0.5.9 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. data/{LICENSE.txt → MIT-LICENSE} +1 -1
  2. data/README.textile +46 -31
  3. data/Rakefile +30 -47
  4. data/app/assets/images/jabe/delete.png +0 -0
  5. data/{public/images → app/assets/images/jabe}/delete_page.png +0 -0
  6. data/{public/images → app/assets/images/jabe}/full_page.png +0 -0
  7. data/{public/images → app/assets/images/jabe}/gravatar.gif +0 -0
  8. data/{public/javascripts → app/assets/javascripts/jabe}/application.js +15 -0
  9. data/{public/javascripts → app/assets/javascripts/jabe}/libs/dd_belatedpng.js +0 -0
  10. data/{public/javascripts → app/assets/javascripts/jabe}/libs/modernizr-1.6.min.js +0 -0
  11. data/{public/javascripts → app/assets/javascripts/jabe}/plugins.js +0 -0
  12. data/app/assets/stylesheets/jabe/application.css +3 -0
  13. data/app/{stylesheets → assets/stylesheets/jabe}/boilerplate.scss +0 -0
  14. data/app/{stylesheets → assets/stylesheets/jabe}/jabe.scss +47 -8
  15. data/app/controllers/jabe/admin/base_controller.rb +7 -0
  16. data/app/controllers/jabe/admin/entries_controller.rb +49 -0
  17. data/app/controllers/jabe/admin/settings_controller.rb +13 -0
  18. data/app/controllers/jabe/application_controller.rb +5 -0
  19. data/app/controllers/jabe/comments_controller.rb +34 -0
  20. data/app/controllers/jabe/entries_controller.rb +30 -0
  21. data/app/controllers/jabe/feed_controller.rb +8 -0
  22. data/app/controllers/jabe/sessions_controller.rb +4 -0
  23. data/app/helpers/jabe/application_helper.rb +25 -0
  24. data/app/mailers/jabe/comment_mailer.rb +12 -0
  25. data/app/models/jabe/admin.rb +11 -0
  26. data/app/models/jabe/comment.rb +35 -0
  27. data/app/models/jabe/entry.rb +22 -0
  28. data/app/models/jabe/settings.rb +14 -0
  29. data/app/views/{admin → jabe/admin}/entries/_form.html.haml +1 -1
  30. data/app/views/{admin → jabe/admin}/entries/edit.html.haml +0 -0
  31. data/app/views/{admin → jabe/admin}/entries/index.html.haml +9 -7
  32. data/app/views/{admin → jabe/admin}/entries/new.html.haml +0 -0
  33. data/app/views/{admin → jabe/admin}/settings/edit.html.haml +2 -1
  34. data/app/views/jabe/comment_mailer/notification.html.erb +19 -0
  35. data/app/views/jabe/confirmations/new.html.erb +15 -0
  36. data/app/views/{entries → jabe/entries}/index.html.haml +4 -3
  37. data/app/views/jabe/entries/show.html.haml +49 -0
  38. data/app/views/{feed → jabe/feed}/index.xml.builder +3 -3
  39. data/app/views/jabe/mailer/confirmation_instructions.html.erb +5 -0
  40. data/app/views/jabe/mailer/reset_password_instructions.html.erb +8 -0
  41. data/app/views/jabe/mailer/unlock_instructions.html.erb +7 -0
  42. data/app/views/jabe/passwords/edit.html.erb +19 -0
  43. data/app/views/jabe/passwords/new.html.erb +15 -0
  44. data/app/views/jabe/registrations/edit.html.erb +22 -0
  45. data/app/views/jabe/registrations/new.html.erb +17 -0
  46. data/app/views/jabe/sessions/new.html.erb +15 -0
  47. data/app/views/jabe/shared/_links.erb +25 -0
  48. data/app/views/jabe/unlocks/new.html.erb +15 -0
  49. data/app/views/layouts/jabe/_flashes.html.haml +3 -0
  50. data/app/views/layouts/{_footer.html.haml → jabe/_footer.html.haml} +0 -0
  51. data/app/views/layouts/jabe/_header.html.haml +4 -0
  52. data/app/views/layouts/jabe/_sidebar.html.haml +21 -0
  53. data/app/views/layouts/jabe/application.html.haml +63 -0
  54. data/{test/dummy/vendor/plugins/acts_as_textiled/init.rb → config/initializers/acts_as_textiled.rb} +2 -1
  55. data/config/initializers/devise.rb +3 -0
  56. data/config/initializers/settings.rb +5 -5
  57. data/config/initializers/simple_form.rb +93 -0
  58. data/config/initializers/time_formats.rb +1 -2
  59. data/config/locales/simple_form.en.yml +24 -0
  60. data/config/routes.rb +10 -5
  61. data/{test/dummy/db/migrate/20101229224027_create_settings.rb → db/migrate/20101230010434_create_settings.rb} +7 -2
  62. data/{lib/generators/jabe/templates/migrations/devise_create_admins.rb → db/migrate/20101230010436_devise_create_admins.rb} +6 -6
  63. data/{test/dummy/db/migrate/20101229224030_create_entries.rb → db/migrate/20101230010437_create_entries.rb} +2 -2
  64. data/{test/dummy/db/migrate/20101229224031_create_comments.rb → db/migrate/20101230010438_create_comments.rb} +3 -4
  65. data/{test/dummy/vendor/plugins/acts_as_textiled/lib/acts_as_textiled.rb → lib/acts_as_textiled/base.rb} +0 -0
  66. data/lib/jabe.rb +7 -15
  67. data/lib/jabe/engine.rb +5 -0
  68. data/lib/jabe/version.rb +3 -0
  69. data/lib/tasks/jabe_tasks.rake +4 -0
  70. metadata +187 -601
  71. data/Gemfile +0 -35
  72. data/Gemfile.lock +0 -214
  73. data/VERSION +0 -1
  74. data/app/controllers/admin/base_controller.rb +0 -3
  75. data/app/controllers/admin/entries_controller.rb +0 -42
  76. data/app/controllers/admin/settings_controller.rb +0 -11
  77. data/app/controllers/comments_controller.rb +0 -25
  78. data/app/controllers/entries_controller.rb +0 -26
  79. data/app/controllers/feed_controller.rb +0 -8
  80. data/app/helpers/jabe_helper.rb +0 -13
  81. data/app/models/admin.rb +0 -9
  82. data/app/models/comment.rb +0 -22
  83. data/app/models/entry.rb +0 -17
  84. data/app/models/settings.rb +0 -7
  85. data/app/stylesheets/_will_paginate.scss +0 -102
  86. data/app/stylesheets/handheld.scss +0 -7
  87. data/app/views/entries/_comment_form.html.haml +0 -3
  88. data/app/views/entries/show.html.haml +0 -38
  89. data/app/views/layouts/_header.html.haml +0 -4
  90. data/app/views/layouts/_sidebar.html.haml +0 -21
  91. data/app/views/layouts/application.html.haml +0 -59
  92. data/config/initializers/sass.rb +0 -5
  93. data/lib/generators/jabe/migrations/migrations_generator.rb +0 -38
  94. data/lib/generators/jabe/stylesheets/stylesheets_generator.rb +0 -9
  95. data/lib/generators/jabe/templates/migrations/add_new_settings.rb +0 -17
  96. data/lib/generators/jabe/templates/migrations/create_comments.rb +0 -20
  97. data/lib/generators/jabe/templates/migrations/create_entries.rb +0 -16
  98. data/lib/generators/jabe/templates/migrations/create_settings.rb +0 -21
  99. data/lib/generators/jabe/templates/migrations/create_slugs.rb +0 -18
  100. data/public/.htaccess +0 -220
  101. data/public/apple-touch-icon.png +0 -0
  102. data/public/blackbird/blackbird.css +0 -80
  103. data/public/blackbird/blackbird.js +0 -365
  104. data/public/blackbird/blackbird.png +0 -0
  105. data/public/crossdomain.xml +0 -25
  106. data/public/javascripts/jquery-ui.js +0 -11511
  107. data/public/javascripts/jquery-ui.min.js +0 -404
  108. data/public/javascripts/jquery.js +0 -7179
  109. data/public/javascripts/jquery.min.js +0 -167
  110. data/public/javascripts/libs/profiling/charts.swf +0 -0
  111. data/public/javascripts/libs/profiling/config.js +0 -59
  112. data/public/javascripts/libs/profiling/yahoo-profiling.css +0 -7
  113. data/public/javascripts/libs/profiling/yahoo-profiling.min.js +0 -39
  114. data/public/javascripts/rails.js +0 -154
  115. data/public/nginx.conf +0 -108
  116. data/public/robots.txt +0 -5
  117. data/test/dummy/app/controllers/application_controller.rb +0 -3
  118. data/test/dummy/app/helpers/application_helper.rb +0 -2
  119. data/test/dummy/config/application.rb +0 -52
  120. data/test/dummy/config/boot.rb +0 -10
  121. data/test/dummy/config/environment.rb +0 -5
  122. data/test/dummy/config/environments/development.rb +0 -26
  123. data/test/dummy/config/environments/production.rb +0 -49
  124. data/test/dummy/config/environments/test.rb +0 -35
  125. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  126. data/test/dummy/config/initializers/devise.rb +0 -142
  127. data/test/dummy/config/initializers/inflections.rb +0 -10
  128. data/test/dummy/config/initializers/mime_types.rb +0 -5
  129. data/test/dummy/config/initializers/secret_token.rb +0 -7
  130. data/test/dummy/config/initializers/session_store.rb +0 -8
  131. data/test/dummy/config/routes.rb +0 -58
  132. data/test/dummy/db/migrate/20101229224028_create_slugs.rb +0 -18
  133. data/test/dummy/db/migrate/20101229224029_devise_create_admins.rb +0 -26
  134. data/test/dummy/db/migrate/20110104004400_add_new_settings.rb +0 -17
  135. data/test/dummy/db/schema.rb +0 -110
  136. data/test/dummy/features/step_definitions/admin_steps.rb +0 -14
  137. data/test/dummy/features/step_definitions/email_steps.rb +0 -194
  138. data/test/dummy/features/step_definitions/entry_steps.rb +0 -54
  139. data/test/dummy/features/step_definitions/support_steps.rb +0 -3
  140. data/test/dummy/features/step_definitions/web_steps.rb +0 -219
  141. data/test/dummy/features/support/blueprints.rb +0 -37
  142. data/test/dummy/features/support/env.rb +0 -59
  143. data/test/dummy/features/support/paths.rb +0 -39
  144. data/test/dummy/spec/spec_helper.rb +0 -0
  145. data/test/dummy/spec/support/blueprints.rb +0 -9
  146. data/test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/author.rb +0 -4
  147. data/test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/story.rb +0 -4
  148. data/test/dummy/vendor/plugins/acts_as_textiled/test/helper.rb +0 -87
  149. data/test/dummy/vendor/plugins/acts_as_textiled/test/textiled_test.rb +0 -145
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Michael Moen
1
+ Copyright 2012 YOURNAME
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.textile CHANGED
@@ -2,51 +2,66 @@ h1. Just Another Blog Engine
2
2
 
3
3
  h3. What is this?
4
4
 
5
- Jabe is a bare bones blogging engine that is installed as a gem. It will grow as its needs do.
5
+ JABE is a bare bones blogging engine that is installed as a gem. It will grow as its needs do.
6
6
 
7
- h2. Basic TODOs
8
-
9
- * Comment notifications
7
+ This version is for Rails 3.1+
10
8
 
11
9
  h2. Installing
12
10
 
13
11
  Edit your Gemfile and add the required gems
14
12
 
15
- <pre><code>gem 'devise'
16
- gem 'friendly_id', '3.1.8'
17
- gem 'formtastic', '>= 1.2.3.beta'
18
- gem 'gravtastic'
19
- gem 'haml', '>= 3.0.23'
20
- gem 'haml-rails'
21
- gem 'jabe'
22
- gem 'jquery-rails'
23
- gem 'RedCloth'
24
- gem 'sass', '>= 3.1.0.alpha.206'
25
- gem 'will_paginate', '>= 3.0.pre2'
13
+ <pre><code>gem 'devise', '>= 2.0.0'
14
+ gem 'friendly_id', '>= 4.0.0'
15
+ gem 'haml-rails', '>= 0.3.4'
16
+ gem 'kaminari', '>= 0.13.0'
17
+ gem 'simple_form', '>= 1.5.2'
26
18
  </code></pre>
27
19
 
28
20
  From your rails root
29
21
 
30
22
  <pre><code>bundle install
31
- rails plugin install http://github.com/defunkt/acts_as_textiled.git
32
23
  rails g devise:install
33
- rails g jabe:migrations
24
+ </code></pre>
25
+
26
+ Follow Devise install directions.
27
+
28
+ Edit your Gemfile and add JABE
29
+
30
+ <pre><code>gem 'jabe'
31
+ </code></pre>
32
+
33
+ JABE is now mountable, so you can put it wherever you want. Edit routes.rb
34
+
35
+ <pre><code>mount Jabe::Engine => "/jabe"
36
+ </code></pre>
37
+
38
+ From your rails root
39
+
40
+ <pre><code>rake jabe:install:migrations
34
41
  rake db:migrate
35
- rm app/views/layouts/*
36
- rm public/index.html
37
- rails c
38
- >> Admin.create!(:email => 'you@example.com', :password => 'password', :password_confirmation => 'password')
39
- rails s
40
- login
41
- edit settings
42
+
43
+ rails runner "Jabe::Admin.create!(
44
+ :email => 'you@example.com',
45
+ :password => 'password',
46
+ :password_confirmation => 'password'
47
+ )"
42
48
  </code></pre>
43
49
 
44
- h2. Deploying on Heroku
50
+ h2. Upgrading from 0.5.*
51
+
52
+ Create a new migration to handle the database changes.
53
+
54
+ <pre><code>
55
+ def change
56
+ rename_table :settings, :jabe_settings
57
+ rename_table :admins, :jabe_admins
58
+ rename_table :entries, :jabe_entries
59
+ rename_table :comments, :jabe_comments
60
+ rename_column :jabe_entries, :cached_slug, :slug
61
+ end
62
+ </code></pre>
45
63
 
46
- There are a couple changes you need to make to deploy on Heroku.
64
+ h2. TODO
47
65
 
48
- * In produciton.rb set <code>config.serve_static_assets = true</code>
49
- * Add an initializer for Sass config/initializers/zz-sass.rb
50
- <code>Sass::Plugin.options[:never_update] = true</code>
51
- * Generate the stylesheets
52
- <code>rails g jabe:stylesheets</code>
66
+ * Migrate generators
67
+ * Switch from boilerplate to Twitter Bootstrap?
data/Rakefile CHANGED
@@ -1,57 +1,40 @@
1
- require 'rubygems'
2
- require 'bundler'
1
+ #!/usr/bin/env rake
3
2
  begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
9
6
  end
10
- require 'rake'
11
-
12
- require 'jeweler'
13
- Jeweler::Tasks.new do |gem|
14
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
- gem.name = "jabe"
16
- gem.homepage = "http://github.com/pixels-and-bits/jabe"
17
- gem.license = "MIT"
18
- gem.summary = "Just Another Blog Engine"
19
- gem.description = "Blog engine for Rails 3+"
20
- gem.email = "michael@pixels-and-bits.com"
21
- gem.authors = ['Michael Moen a.k.a. UnderpantsGnome', 'Neil Heinrich']
22
- gem.files.exclude 'test/dummy'
23
- gem.files.exclude 'spec'
24
- gem.files.exclude 'features'
25
- gem.test_files += Dir.glob('features/**/*')
26
- # Include your dependencies below. Runtime dependencies are required when using your gem,
27
- # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
28
- # gem.add_runtime_dependency 'jabber4r', '> 0.1'
29
- # gem.add_development_dependency 'rspec', '> 1.2.3'
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
30
13
  end
31
- Jeweler::RubygemsDotOrgTasks.new
32
14
 
33
- require 'rake/testtask'
34
- Rake::TestTask.new(:test) do |test|
35
- test.libs << 'lib' << 'test'
36
- test.pattern = 'test/**/test_*.rb'
37
- test.verbose = true
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'Jabe'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
38
21
  end
39
22
 
40
- require 'rcov/rcovtask'
41
- Rcov::RcovTask.new do |test|
42
- test.libs << 'test'
43
- test.pattern = 'test/**/test_*.rb'
44
- test.verbose = true
45
- end
23
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
46
25
 
47
- task :default => :test
48
26
 
49
- require 'rake/rdoctask'
50
- Rake::RDocTask.new do |rdoc|
51
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
52
27
 
53
- rdoc.rdoc_dir = 'rdoc'
54
- rdoc.title = "jabe #{version}"
55
- rdoc.rdoc_files.include('README*')
56
- rdoc.rdoc_files.include('lib/**/*.rb')
28
+ Bundler::GemHelper.install_tasks
29
+
30
+ require 'rake/testtask'
31
+
32
+ Rake::TestTask.new(:test) do |t|
33
+ t.libs << 'lib'
34
+ t.libs << 'test'
35
+ t.pattern = 'test/**/*_test.rb'
36
+ t.verbose = false
57
37
  end
38
+
39
+
40
+ task :default => :test
Binary file
@@ -1,3 +1,18 @@
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
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require_tree .
14
+ //= require_tree ./libs
15
+
1
16
  $(function() {
2
17
  if($('#first-focus').length > 0) {
3
18
  $('#first-focus').focus();
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require_tree .
3
+ */
@@ -1,4 +1,3 @@
1
- @import "will_paginate";
2
1
 
3
2
  @mixin gradients {
4
3
  background-image: -webkit-gradient(
@@ -72,8 +71,8 @@ h1#site-tagline {
72
71
  }
73
72
  }
74
73
  }
75
-
76
74
  }
75
+
77
76
  .entry {
78
77
  margin: 0 0 30px 0;
79
78
  padding:0 0 30px 0;
@@ -101,6 +100,14 @@ h1#site-tagline {
101
100
  color:#eee;
102
101
  }
103
102
  }
103
+
104
+ .content {
105
+ p {
106
+ font-size:1.1em;
107
+ line-height:1.4em;
108
+ padding:.5em;
109
+ }
110
+ }
104
111
  }
105
112
 
106
113
  .last {
@@ -119,6 +126,11 @@ h1#site-tagline {
119
126
  .comment {
120
127
  clear:both;
121
128
 
129
+ .delete {
130
+ float:right;
131
+ padding-top:2px;
132
+ }
133
+
122
134
  .gravatar {
123
135
  margin:10px 10px 10px 0;
124
136
  float:left;
@@ -157,6 +169,15 @@ h1#site-tagline {
157
169
  }
158
170
  }
159
171
 
172
+ code {
173
+ background-color: #222222;
174
+ color: #EEEEEE;
175
+ padding:2px 5px;
176
+ -webkit-border-radius: 5px;
177
+ -moz-border-radius: 5px;
178
+ border-radius: 5px;
179
+ }
180
+
160
181
  pre {
161
182
  color:#eee;
162
183
  background-color:#222;
@@ -165,6 +186,10 @@ pre {
165
186
  border-top:solid #777 2px;
166
187
  border-bottom:solid #777 2px;
167
188
  overflow-x:auto;
189
+
190
+ code {
191
+ padding:0 !important;
192
+ }
168
193
  }
169
194
 
170
195
  label {
@@ -180,7 +205,7 @@ label {
180
205
  color:red;
181
206
  }
182
207
 
183
- #comment_nickname_input {
208
+ #comment_nickname, label[for=comment_nickname] {
184
209
  display:none;
185
210
  }
186
211
 
@@ -230,17 +255,18 @@ table.entries {
230
255
  font-size:1.1em;
231
256
  height:32px;
232
257
  line-height:32px;
233
- padding:0 10px;
258
+ padding:0 10px 10px 0;
259
+
260
+ .when {
261
+ font-size:.8em;
262
+ line-height:1em;
263
+ }
234
264
  }
235
265
 
236
266
  td.icons {
237
267
  width:64px;
238
268
  white-space:nowrap;
239
269
  }
240
-
241
- td.when {
242
- text-align:right;
243
- }
244
270
  }
245
271
 
246
272
  footer {
@@ -250,6 +276,19 @@ footer {
250
276
  clear:both;
251
277
  }
252
278
 
279
+ .flash-notice, .flash-error {
280
+ color:green;
281
+ font-size:1.2em;
282
+ border:solid 3px green;
283
+ padding:15px;
284
+ margin-bottom:10px;
285
+ }
286
+
287
+ .flash-error {
288
+ color:red;
289
+ border-color:red;
290
+ }
291
+
253
292
  form {
254
293
  label {
255
294
  padding-top:10px;
@@ -0,0 +1,7 @@
1
+ module Jabe
2
+ class Admin::BaseController < ApplicationController
3
+ layout 'jabe/application'
4
+ include PublicEntryUrl
5
+ before_filter :authenticate_admin!
6
+ end
7
+ end
@@ -0,0 +1,49 @@
1
+ module Jabe
2
+ class Admin::EntriesController < Admin::BaseController
3
+ helper_method :entry
4
+ before_filter :set_is_draft, :only => [:create, :update]
5
+
6
+ def index
7
+ @drafts = Entry.drafts
8
+ @published = Entry.published.page(params[:page])
9
+ end
10
+
11
+ def create
12
+ if entry.save
13
+ redirect_to(admin_entries_path, :notice => message)
14
+ else
15
+ render :new
16
+ end
17
+ end
18
+
19
+ def update
20
+ if entry.update_attributes(params[:entry])
21
+ redirect_to(admin_entries_path, :notice => message)
22
+ else
23
+ render :edit
24
+ end
25
+ end
26
+
27
+ def destroy
28
+ entry.destroy
29
+ redirect_to admin_entries_path
30
+ end
31
+
32
+ private
33
+
34
+ def entry
35
+ @entry ||= params[:id].blank? ?
36
+ Entry.new(params[:entry]) :
37
+ Entry.find(params[:id])
38
+ end
39
+
40
+ def set_is_draft
41
+ params[:entry][:draft] = (params[:commit] =~ /draft/i).present?
42
+ end
43
+
44
+ def message
45
+ entry.draft ? "Entry was saved as a draft." : "Entry was published."
46
+ end
47
+
48
+ end
49
+ end
@@ -0,0 +1,13 @@
1
+ module Jabe
2
+ class Admin::SettingsController < Admin::BaseController
3
+
4
+ def update
5
+ if Jabe::SETTINGS.update_attributes(params[:settings])
6
+ Jabe::SETTINGS.do_updates
7
+ redirect_to admin_root_path, :notice => 'Settings updated.'
8
+ else
9
+ render :edit
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ module Jabe
2
+ class ApplicationController < ActionController::Base
3
+ include PublicEntryUrl
4
+ end
5
+ end
@@ -0,0 +1,34 @@
1
+ module Jabe
2
+ class CommentsController < Admin::BaseController
3
+ layout 'application'
4
+ skip_before_filter :authenticate_admin!, :only => [ :create, :new ]
5
+ helper_method :entry, :comment
6
+
7
+ def create
8
+ if comment.save
9
+ comment.send_notification(request)
10
+ redirect_to entry_path(entry), :notice => 'Your comment was submitted.'
11
+ else
12
+ flash[:error] = 'Unable to submit your comment.'
13
+ render 'entries/show'
14
+ end
15
+ end
16
+
17
+ def destroy
18
+ comment.destroy
19
+ redirect_to entry_path(entry), :notice => 'Comment was deleted.'
20
+ end
21
+
22
+ private
23
+
24
+ def entry
25
+ @entry ||= Entry.find(params[:entry_id])
26
+ end
27
+
28
+ def comment
29
+ @comment ||= params[:id].blank? ?
30
+ entry.comments.new(params[:comment]) :
31
+ Comment.find(params[:id])
32
+ end
33
+ end
34
+ end