Compare commits

...
Sign in to create a new pull request.

309 commits

Author SHA1 Message Date
Jeena Paradies
d34735e1de added swedish translation 2012-06-14 15:45:40 +02:00
Uģis Ozols
91114fd837 Refinery::I18n won't be optional in 2.1.x. 2012-06-06 12:01:30 +03:00
Uģis Ozols
81dd47e649 Merge pull request #243 from ryandeussing/master
Hide 'read more' link when it is not needed
2012-06-06 01:59:29 -07:00
Ryan Deussing
30ea168afd Don't show 'read more' link in situations where the full post is already displayed because there is no teaser. 2012-06-05 00:48:54 -03:00
Philip Arndt
976b607ff5 Merge pull request #238 from GeekOnCoffee/fix_count
Adding Finder Method to utilize count
2012-05-19 20:03:36 -07:00
Andrew Hooker
4e8e714099 Removing redundant live method 2012-05-19 21:45:34 -05:00
Philip Arndt
0bb265521c Merge pull request #237 from GeekOnCoffee/eliminate_ternary
Eliminate Ternary
2012-05-19 19:37:59 -07:00
Andrew Hooker
67a177fbb1 Adding Finder Method to utilize count 2012-05-19 21:07:58 -05:00
Rob Yurkowski
f4b647cc93 Merge pull request #236 from GeekOnCoffee/refactor_post_by_archive
Rename ::by_archive to ::to_month for clarity's sake.
2012-05-19 19:06:50 -07:00
Andrew Hooker
c72d5d65f6 Eliminate Ternary 2012-05-19 21:03:36 -05:00
Andrew Hooker
ccf9c0e5c0 Adding Deprecation Version 2012-05-19 20:52:59 -05:00
Andrew Hooker
92d5455d94 Using Standard Refinery Deprecation Method 2012-05-19 20:46:03 -05:00
Andrew Hooker
86fa2d2f5d Renaming Method to better describe use, Including Deprecation Warning on Old Method 2012-05-19 20:00:16 -05:00
Uģis Ozols
6fa5bbdf33 Use 'refinery_login_with :refinery_user' instead of deprecated 'login_refinery_user' in request specs. 2012-05-15 08:22:56 +03:00
Uģis Ozols
538e6653f0 Bump master to 2.1.0.dev. 2012-05-15 08:22:20 +03:00
Philip Arndt
5577b8e701 Do we really need a model called comment_mailer? 2012-05-15 08:03:51 +03:00
Uģis Ozols
1cd514b3c9 Test using rbx-19mode on Travis. 2012-05-05 17:54:54 +03:00
Uģis Ozols
65f84593fa Set published_time as Time.utc to avoid hackery needed later to compare dates. 2012-05-05 17:52:28 +03:00
Uģis Ozols
ab1fa7ec32 Fix millisecond comparison issue in post spec. 2012-04-26 11:44:04 +03:00
Uģis Ozols
d1bfab99ce Changes on Travis:
* Remove Ruby 1.9.2 testing
  * Allow Rubinius to fail
2012-04-26 10:51:50 +03:00
Uģis Ozols
69b9699fca Adjust times for spec to avoid running into DST issues. 2012-04-26 10:50:42 +03:00
Uģis Ozols
7e1b4831f1 Remove testing dependencies. 2012-04-26 10:48:55 +03:00
Philip Arndt
8f6007c2ba Merge pull request #228 from GeekOnCoffee/patch-1
Adding More information to README
2012-04-22 18:29:04 -07:00
Andrew Hooker
976fafb9df Adding More information to README 2012-04-22 20:27:46 -05:00
Uģis Ozols
18065463e6 Notification recipients should be specified using :to instead of :recipients. Fixes #226. 2012-04-19 17:42:03 +03:00
Philip Arndt
8b8ce1f21b Merge pull request #225 from mattsgarrison/master
Fix for Categories and Rails 3.2 Mass Assignment whitelist requirements.
2012-04-18 14:18:39 -07:00
Matt Garrison
dbeed9bb77 Adding attr_accessible for Rails 3.2 mass assignment fixes. 2012-04-18 10:40:04 -05:00
Philip Arndt
70f7be1652 Merge pull request #221 from wakeless/fix-page-caching
Fix page caching on index when pages param is present.
2012-04-10 20:21:06 -07:00
Michael Gall
9a150112ae Fix page caching on index when pages param is present.
fixes #145
2012-04-11 13:13:58 +10:00
Uģis Ozols
981fc6ef68 In #prev and #next specs advance time by days instead of minutes. 2012-04-10 23:28:43 +03:00
Uģis Ozols
d36af516ea Use shorter syntax for render :partial => ... 2012-04-10 23:09:04 +03:00
Uģis Ozols
14cd410324 Fix deprecation warnings. 2012-04-10 23:02:41 +03:00
Uģis Ozols
3627b8f865 Merge pull request #219 from corydeppen/patch-2
Fix reference to ShareThis key.
2012-04-10 12:40:28 -07:00
Cory Deppen
cc6800d17e Fix reference to ShareThis key. 2012-04-10 16:02:54 -03:00
Philip Arndt
3a1c30fa5d We require 2.0.1 at least 2012-04-08 23:56:28 +12:00
Philip Arndt
8584cc942b Merge pull request #215 from resolve/bump_seo_meta_dep
Bump seo_meta for compitiblity with refinerycms 2-0-stable.
2012-04-01 17:52:03 -07:00
Pete Higgins
7f4ac3b6d4 Bump seo_meta for compitiblity with refinerycms 2-0-stable. 2012-04-01 17:45:53 -07:00
Philip Arndt
72375e0a00 Merge pull request #214 from resolve/fix_mass_assignment_error
Fix MassAssignmentSecurity::Error in integration test.
2012-04-01 16:26:46 -07:00
Pete Higgins
6df59131f1 Fix MassAssignmentSecurity::Error in integration test. 2012-04-01 16:23:15 -07:00
Joe Sak
2a00257420 Merge pull request #211 from nicinabox/master
Add draft label
2012-03-26 14:46:49 -07:00
Philip Arndt
cb88d9508e Merge pull request #212 from corydeppen/patch-1
Fixed drop_table for Category.
2012-03-24 12:52:31 -07:00
Cory Deppen
dd3002f8bb Fixed drop_table for Category. 2012-03-24 15:22:58 -03:00
Nic Haynes
0c78cd138d Fix draft translation 2012-03-22 08:41:38 -05:00
Nic Haynes
435763f307 Show published date if not drafted 2012-03-21 00:23:58 -05:00
Nic Haynes
f8e38d516a Fix markup for draft input 2012-03-21 00:23:42 -05:00
Nic Haynes
31bdd586f2 Move draft checkbox for better usability 2012-03-20 19:43:30 -05:00
Nic Haynes
96448fc374 Add draft label to admin index 2012-03-20 19:43:18 -05:00
Philip Arndt
3049816aa9 Don't cache when logged in or there's a flash message. Moved canonical to protected methods. 2012-03-20 15:16:58 +13:00
Uģis Ozols
460351e81f Add rake db:seed to install steps. 2012-03-09 17:07:24 +02:00
Philip Arndt
fccc86e63c Updated to support Refinery CMS 2.0.1 and Rails 3.2.2 2012-03-06 13:17:41 +13:00
Philip Arndt
1a3e0d057c Rephrase slightly 2012-03-03 11:35:34 +13:00
Uģis Ozols
0ea3690741 Test. 2012-03-01 22:22:56 +02:00
Uģis Ozols
52b1fce8aa Don't need testing task if we require refinery-settings. 2012-03-01 14:00:09 +02:00
Uģis Ozols
c6f36117a7 There's already dev, test group in Gemfile so use that. 2012-03-01 08:43:34 +02:00
Philip Arndt
6958ab82df Require seo_meta proper 2012-03-01 17:50:57 +13:00
Philip Arndt
215ea87e45 require refinerycms-settings 2012-03-01 13:48:13 +13:00
Philip Arndt
2e79e4f7a9 No more git sources in the Gemfile. 2012-03-01 13:45:06 +13:00
Philip Arndt
9bcf2b3dda This took code presentation to a new level. 2012-02-29 23:47:15 +13:00
Philip Arndt
70d8f46c12 Don't like having a dialogue for this 2012-02-29 21:26:33 +13:00
Philip Arndt
8edc3ab3dd y u need two lines 2012-02-29 21:23:10 +13:00
Uģis Ozols
4e7847dcbe RefineryCMS -> Refinery CMS. 2012-02-27 22:34:41 +02:00
Philip Arndt
594dd8ca96 Now supporting FriendlyId 4 2012-02-27 17:08:37 +13:00
Uģis Ozols
837ddfe42b There is no bin folder. 2012-02-24 20:49:54 +02:00
Uģis Ozols
44ec487542 Use refinery:testing:setup_extension rake task to copy Refinery::Setting migration file. 2012-02-24 06:39:13 +02:00
Uģis Ozols
bd2bcc0f2a Add Refinery::Setting dependency. 2012-02-23 21:48:37 +02:00
Philip Arndt
98f8d3f515 Merge pull request #203 from substantial/cleanup_models
Cleanup model code
2012-02-23 00:54:43 -08:00
Pete Higgins
d353cd556c Don't need to specify class names here. 2012-02-23 00:29:46 -08:00
Pete Higgins
5eaad8997f Cleanup next and previous stuff. 2012-02-23 00:20:37 -08:00
Pete Higgins
2537923034 Remove functionality provided by rails. 2012-02-23 00:09:09 -08:00
Pete Higgins
c9ff548329 DRY some Refinery::Blog::Post methods. 2012-02-23 00:02:15 -08:00
Pete Higgins
5ea1b7399b Change a .map to a .pluck. 2012-02-22 23:50:05 -08:00
Philip Arndt
f82d2c96e4 Merge pull request #195 from substantial/refactor_archive_widget
Refactor archive widget
2012-02-22 23:43:01 -08:00
Philip Arndt
aa729edc84 Merge pull request #202 from substantial/fix_seeds
Remove position setting from blog seed.
2012-02-22 23:38:07 -08:00
Pete Higgins
c37461cc43 Refinery::Page no longer has a position column. 2012-02-22 23:32:59 -08:00
Philip Arndt
5440fad815 Merge pull request #200 from dmoose/rails-3-1-recent-popular
Rails 3 1 recent popular
2012-02-22 20:11:14 -08:00
Jeff Shumate
602759af1b cleanup 2012-02-22 21:00:45 -07:00
Jeff Shumate
4f0b5f8223 add popularity counter to blog posts as well as accessor for recent posts 2012-02-22 20:37:08 -07:00
Philip Arndt
39fc086982 Merge pull request #199 from markstuart/rails-3-1
Fix error message: "translation missing: en.admin.blog.settings.notification_recipients.updated"
2012-02-22 18:47:06 -08:00
Mark Stuart
29809838f4 Correct translations scope 2012-02-23 15:43:07 +13:00
Uģis Ozols
45cad84f49 Generate blog initializer when running rails g refinery:blog. Closes #196. 2012-02-16 08:12:53 +02:00
Pete Higgins
2bcb7c8551 Fix spec name. 2012-02-12 23:54:07 -08:00
Uģis Ozols
e05fedb9b7 Merge pull request #194 from substantial/redirect_follower_log
Redirect follower log
2012-02-10 01:20:15 -08:00
Pete Higgins
dee1a9d539 Avoid creating some database records. 2012-02-10 01:07:15 -08:00
Pete Higgins
f140ed284f Refactor .by_archive and .by_year. 2012-02-10 01:07:04 -08:00
Pete Higgins
94ae01ce6f These aren't scopes anymore. :trollface: 2012-02-10 01:06:53 -08:00
Pete Higgins
922bc8b98f 'subject.class' -> described_class. 2012-02-10 01:06:41 -08:00
Pete Higgins
aaf26e22d2 Refactor all_previous into published_dates_older_than. 2012-02-10 01:06:05 -08:00
Pete Higgins
80187eac7d Refactor blog archive widget. 2012-02-10 01:05:51 -08:00
Pete Higgins
2275cde2ac Stop logging to stdout. 2012-02-05 23:54:41 -08:00
Uģis Ozols
1af631b501 Refinery::Crud already sets title_attribute and redirect_to_url with the same values. 2012-02-04 22:01:00 +02:00
Uģis Ozols
34fd7b7b89 Move some of the Refinery::Setting's over to Refinery::Blog. 2012-02-04 21:22:51 +02:00
Uģis Ozols
6cfebfae84 Remove rcov.opts. 2012-02-04 20:51:32 +02:00
Philip Arndt
6d06af3400 Converted scopes to class methods. 2012-02-03 11:34:49 +13:00
Uģis Ozols
5691a96a9d No need to specify Devise.stretches in spec_helper because it gets set in devise initializer. 2012-02-02 17:36:41 +02:00
Uģis Ozols
ba9091cd14 Make sure there is seeds.rb file before trying to append to it. 2012-02-02 15:49:07 +02:00
Uģis Ozols
5c3de1175f Don't need to set initializer order anymore. 2012-02-02 15:48:30 +02:00
Uģis Ozols
e1d6605d23 .find(:all) -> .all 2012-02-02 12:55:50 +02:00
Philip Arndt
e63bf074af Does it matter that these are out of order on different rubies? cc @joemsak 2012-02-02 23:16:28 +13:00
Philip Arndt
0df8829a59 Fix routing. 2012-02-02 10:53:57 +13:00
Philip Arndt
1244370bc5 Ignore .rbx 2012-02-02 10:53:53 +13:00
Philip Arndt
c9e5edcf6d Don't need to test on both 1.8.7 and ree and given the choice I'm going with 1.8.7
[ci skip]
2012-02-01 21:11:25 +13:00
Philip Arndt
82a929d60a Don't need to CI sqlite3.
[ci skip]
2012-02-01 21:05:51 +13:00
Philip Arndt
a85aaf6aaa Add jruby compatible DB gems. 2012-02-01 20:53:29 +13:00
Philip Arndt
bd7daa09ae Not postgres but postgresql. 2012-02-01 19:37:43 +13:00
Philip Arndt
76998c2885 I accidentally this twice. 2012-02-01 18:07:27 +13:00
Philip Arndt
33bfa4dd23 Added support for new code in Refinery CMS since resolve/refinerycms#1234 2012-02-01 16:34:06 +13:00
Philip Arndt
30ebf2d338 We don't need to read all about the dummy app or test on rbx-2.0 2012-01-31 18:16:31 +13:00
Philip Arndt
adcf66751c Merge pull request #189 from markstuart/rails-3-1
Fixes for notification settings access in refinery admin area
2012-01-29 20:51:38 -08:00
Mark Stuart
e46f0549c6 New 'main_app.' format. 2012-01-30 17:42:26 +13:00
Mark Stuart
2a672af348 New 'main_app.' format 2012-01-30 17:41:11 +13:00
Mark Stuart
f9d51ed549 Correct path for form tag. Updated cancel_url to new format. 2012-01-30 17:38:48 +13:00
Philip Arndt
44a059a475 Fix for deprecation in Rails 3.2 2012-01-30 11:48:24 +13:00
Philip Arndt
f8cd5804ad Merge pull request #187 from substantial/rails-3-2-compat
Rails 3 2 compat
2012-01-28 20:03:11 -08:00
Philip Arndt
d8bdcb482c Merge pull request #186 from dmoose/add-src-url-3-1
Add src url 3 1
2012-01-28 20:02:13 -08:00
Pete Higgins
c89b4dfc1f attr_accessible :author for Post model. 2012-01-26 16:58:04 -08:00
Pete Higgins
6b1fcc8ea1 Loosen version requirements in Gemfile. 2012-01-26 16:56:22 -08:00
Jeff Shumate
e274bb1757 add source url for post 2012-01-25 22:27:46 -07:00
Philip Arndt
d1ad82d42e Merge pull request #184 from dmoose/fix-issue-175
Fix issue 175
2012-01-25 21:04:17 -08:00
Jeff Shumate
f62ad53f8f really fix issue 175 path error in _nav 2012-01-25 22:00:56 -07:00
Philip Arndt
79a7551e73 Merge pull request #183 from dmoose/fix-issue-175
Fix issue 175
2012-01-25 20:53:10 -08:00
Jeff Shumate
be73028ee8 fix issue 175 2012-01-25 21:45:21 -07:00
Philip Arndt
5eab0be340 Merge pull request #182 from substantial/fix_category_creation
Fix category creation which fixes #179
2012-01-24 20:38:05 -08:00
Pete Higgins
492fd663ca Fix route helper in categories view. 2012-01-24 20:12:45 -08:00
Philip Arndt
ea2f177b0d Merge pull request #181 from enmasse-entertainment/fix_comment_posting
Fix comment posting
2012-01-24 14:45:13 -08:00
Pete Higgins
3abf537eaa Fix comment posting. 2012-01-24 14:42:54 -08:00
Uģis Ozols
ad0b7f6ac8 Don't need to set table_name_prefix because it gets set by isolate_namespace. 2012-01-20 15:34:59 +02:00
Uģis Ozols
083fd20ee5 Don't need to set engine_name because it gets set by isolate_namespace. 2012-01-20 15:27:00 +02:00
Philip Arndt
3dbbbbfdda Merge pull request #174 from tsemana/fixes-posts-helper-namespacing
Fixes posts helper namespacing
2012-01-19 13:02:11 -08:00
Tony Semana
4eb17bb58d Fixed to show the word 'blog' only once in route 2012-01-17 15:17:43 -05:00
Tony Semana
f77592bc05 Fixes posts_helper to use updated refinery namespacing 2012-01-17 12:51:38 -05:00
Philip Arndt
b1e4fd0094 Fixed namespacing for Refinery conventions. 2012-01-17 16:56:24 +13:00
Philip Arndt
b3a25c1b68 Restructured part of the project to Refinery::Blog::Admin not Refinery::Admin::Blog 2012-01-17 16:56:23 +13:00
Philip Arndt
2a2fcca649 Isolate this engine to Refinery::Blog (which, according to my interpretation of the docs, is how it should be) and remove url hack now that resolve/refinerycms#1193 has been fixed. 2012-01-10 17:19:28 +13:00
Philip Arndt
889127a58c ruby highlighting added 2012-01-10 16:30:36 +13:00
Philip Arndt
d642260538 Merge pull request #172 from substantial/fix_for_activity_fix
Fix for activity fix
2012-01-08 16:50:50 -08:00
Pete Higgins
becdbfaa9b Fix typo in activity route. 2012-01-08 16:30:41 -08:00
Philip Arndt
bbc6e90939 Merge pull request #170 from substantial/make_db_seed_idempotent
Make db seed idempotent
2012-01-08 14:29:07 -08:00
Pete Higgins
63b0bec5ff Make DB seed idempotent. 2012-01-08 13:52:44 -08:00
Pete Higgins
e3e5bcffc3 Linux needs a js runtime. 2012-01-08 13:51:51 -08:00
Uģis Ozols
7dd6cb5e60 Merge pull request #169 from substantial/fix_dashboard_activity
Fix dashboard activity
2012-01-06 13:31:07 -08:00
Pete Higgins
edfa8b81e7 Fix activity route generation. Workaround for resolve/refinerycms#1193. 2012-01-06 11:36:27 -08:00
Pete Higgins
4a8a46ccc7 The newest factory_girl apparently doesn't like how this worked. 2012-01-06 11:33:13 -08:00
Uģis Ozols
d6e9af98ef Currently there isn't any template so we don't need this code. 2012-01-03 20:58:25 +02:00
Uģis Ozols
0eb88e2d95 Merge pull request #165 from enmasse-entertainment/rails-3-1
use new syntax for config accessors
2012-01-02 20:23:16 -08:00
Shaun
d108f9c5df use new syntax for config accessors 2012-01-02 15:39:38 -08:00
Uģis Ozols
5e650f6800 No need to use awesome_nested_set edge version anymore. 2012-01-02 15:08:02 +02:00
Uģis Ozols
c84d887187 refinerycms-core requires Rails so don't check if defined?(Rails). 2012-01-02 14:26:49 +02:00
Uģis Ozols
223a719300 Use Refinery::Core.config to get site name. 2012-01-02 14:26:05 +02:00
Uģis Ozols
fd0521bb99 Fix deprecation warning. Closes #164. 2012-01-02 13:52:44 +02:00
Uģis Ozols
26243ddade Don't require rails explicitly because refinerycms-core will do it for us. 2011-12-22 12:10:42 +02:00
Uģis Ozols
567bdd6334 Return correct root path. 2011-12-22 11:36:48 +02:00
Philip Arndt
547c8bcff2 Refinery::Page.default_parts is now Refinery::Pages.config.default_parts 2011-12-17 17:57:26 +13:00
Philip Arndt
de5c02994c Use Refinery::Page APIs (content_for) properly. 2011-12-17 17:43:09 +13:00
Philip Arndt
9a8d38ad78 Merge pull request #159 from substantial/fix_tab_highlighting_again
Fix tab highlighting
2011-12-15 17:31:44 -08:00
Pete Higgins
8cc819aeed Fix tab highlighting in admin interface. 2011-12-15 17:27:18 -08:00
Philip Arndt
7c63d8188e Merge pull request #156 from substantial/fix_spec_setup
Fix spec setup
2011-12-14 18:21:23 -08:00
Philip Arndt
cc316ceb5b Merge pull request #157 from substantial/add_author_attribution
Add author attribution
2011-12-14 15:47:22 -08:00
Pete Higgins
04b49b2371 Allow configurable author for blog posts. 2011-12-14 15:24:20 -08:00
Pete Higgins
3bef84c3f8 Fix spec setup. 2011-12-14 11:51:46 -08:00
Jamie Winsor
3a7a9198a4 Merge branch 'fix-seeds' into rails-3-1 2011-11-14 13:03:55 -08:00
Jamie Winsor
c0cecdaad9 Remove accidentally generated content from end of seed file 2011-11-14 13:03:12 -08:00
Jamie Winsor
9255e1a71e Merge pull request #151 from enmasse-entertainment/page-title-seo-improvements
Page title seo improvements
2011-11-11 12:11:15 -08:00
Shaun
d90c831cca ensure page titles on date-based and tag-based archive views are unique 2011-11-11 12:09:05 -08:00
Shaun
1d5dfb1fdd remove redundancy in page title 2011-11-11 12:08:42 -08:00
Jamie Winsor
92e8230194 gemspec is not regenerated manually anymore 2011-11-11 11:46:06 -08:00
Philip Arndt
f9f56c6f1c Merge branch 'master' into rails-3-1
Conflicts:
	app/controllers/admin/blog/posts_controller.rb
	app/controllers/blog/posts_controller.rb
2011-11-10 09:23:02 +13:00
Uģis Ozols
81475ff380 Merge pull request #147 from greendog/rails-3-1
Generator for installing migrations
2011-11-09 10:32:00 -08:00
greendog
f5d94d60b8 added install migratons generator 2011-11-09 22:01:53 +04:00
Philip Arndt
36c005ecd1 Refactored everything (models, helpers) into proper namespace of Refinery::Blog. Requires refinery commit 25162b585b9c4023d39fd1a9796140bfa4ecb909 2011-11-09 22:19:07 +13:00
Uģis Ozols
d18364d359 Use root menthod to set engine factory path. 2011-11-06 21:28:25 +02:00
Uģis Ozols
9936281bb8 Regenerate gemspec. Closes #146. 2011-11-06 07:26:48 +02:00
Uģis Ozols
a85b7ffab0 Specify correct path to factories. 2011-11-04 15:54:12 +02:00
Jamie Winsor
151629f044 Update travis.yml to use dummy app for testing 2011-10-28 13:20:11 -07:00
Jamie Winsor
c2a0ef9f41 Merge branch 'use-generated-dummy-for-testing' into rails-3-1 2011-10-28 13:17:48 -07:00
Jamie Winsor
fd7ce5e692 Update readme on how to test 2011-10-28 13:07:27 -07:00
Jamie Winsor
b1baeba3d2 seo meta table migration removed
We should not generate the seo meta table here - it is handled by refinerycms if the user wants it
2011-10-28 13:05:32 -07:00
Jamie Winsor
be06f1658d Add rspec rake tasks 2011-10-28 13:05:22 -07:00
Jamie Winsor
3165574730 Move blog tab accessor and class array to blog file from tab file 2011-10-28 12:15:07 -07:00
Jamie Winsor
4577f788e5 No need to explicitly call load_factories for Refinery::Testing 2011-10-28 12:13:16 -07:00
Jamie Winsor
e01e9ff9b7 Tabs are autoloaded, don't need to explicitly require 2011-10-27 19:37:38 -07:00
Jamie Winsor
14daff297b Refactor require layout to match other engines 2011-10-27 19:36:54 -07:00
Jamie Winsor
2b73c292c8 Seed data should not be loaded mid migration
Column information is not totally generated and seed will be done at end of migration run
2011-10-27 18:38:48 -07:00
Jamie Winsor
5a958007c5 Update blog generator to use Rails 3.1 base
Seeds will now follow Rails 3.1 conventions
2011-10-27 18:12:32 -07:00
Jamie Winsor
8cd4a282d8 This is the blog engine... not hte resources engine.. 2011-10-27 15:29:02 -07:00
Jamie Winsor
0de4fd9582 Add ENGINE_ROOT constant to Rakefile for refinerycms-testing tasks 2011-10-26 13:50:26 -07:00
Jamie Winsor
4ddc2b3754 Add spec/dummy to git ignore file 2011-10-26 13:29:41 -07:00
Jamie Winsor
5dd11ffc61 Remove Refinery::Application route draw call, it no longer exists 2011-10-26 13:29:01 -07:00
Jamie Winsor
993b4a8b1b Update engine definition
Isolate engine to Refinery
add engine name
Add initializer to register engine with Refinery
Rename plugin init initializer to be more descriptive
Update plugin initializer to conform to latest master of RefineryCMS
2011-10-26 13:28:54 -07:00
Jamie Winsor
db93751fd6 Modify Rakefile to load engine tasks and testing railtie tasks 2011-10-26 13:12:26 -07:00
Jamie Winsor
1b3195bf30 Remove dummy application for testing 2011-10-26 13:11:54 -07:00
Jamie Winsor
4ab9eccdee Add rbenv files to gitignore 2011-10-26 13:07:00 -07:00
Jamie Winsor
64d83c5ce4 Regenerate gemspec 2011-10-11 18:21:49 -07:00
Philip Arndt
eb487f0e4e Merge pull request #144 from resolve/expose-factories
Load refinerycms factories properly
2011-10-10 19:42:38 -07:00
Jamie Winsor
754cddb141 Load refinerycms factories properly
Expose blog factories to other gems
2011-10-10 19:39:51 -07:00
Uģis Ozols
85419ce88e Merge pull request #143 from Kagetsuki/rails-3-1
Rails 3 1 jp to ja correction
2011-10-10 10:46:55 -07:00
影月 零
19ee4b8f69 jp to ja correction 2011-10-11 02:43:58 +09:00
Jamie Winsor
5e91670a80 Fix draft preview of blog posts 2011-09-21 00:56:54 -07:00
Jamie Winsor
df0664b142 Update gemspec
[ci skip]
2011-09-19 19:11:40 -07:00
Philip Arndt
8a69c623bb Merge pull request #139 from resolve/abstract-filters-into-controller-helper
Abstract filters into controller helper
2011-09-19 19:06:25 -07:00
Jamie Winsor
1b51e2343d setting indentation to 'rails way' for protected and private classes 2011-09-19 18:58:31 -07:00
Jamie Winsor
362088d027 Fix indent on protected methods 2011-09-19 18:50:38 -07:00
Jamie Winsor
be7d341532 Namespace BlogController into Blog::BaseController 2011-09-19 18:48:29 -07:00
Jamie Winsor
de4cc6b9ef Namespace BlogControllerHelper to Blog::ControllerHelper 2011-09-19 18:43:09 -07:00
Jamie Winsor
c40eb83af3 remove duplicate BlogControllerHelper include 2011-09-19 18:35:58 -07:00
Jamie Winsor
d37ef11f63 Abstract filter methods into controller helpers
This will enable users to include the controller helper into their
own controllers to perform common functions - such as finding a blog
post or listing all blog posts.
2011-09-19 15:35:47 -07:00
Jamie Winsor
7fe5fe5de6 Merge pull request #136 from enmasse-entertainment/remove-unnecessary-js-includes
Remove jquery include - now handled by asset pipeline
2011-09-16 18:25:44 -07:00
Jamie Winsor
66b445ad5c Remove jquery include - now handled by asset pipeline 2011-09-16 18:24:34 -07:00
Jamie Winsor
76be452faf Merge pull request #135 from enmasse-entertainment/fix-devise-user
Change current_user to current_refinery_user
2011-09-14 16:28:42 -07:00
Jamie Winsor
65cb81b4c0 Change current_user to current_refinery_user
Fixes for 8294a86c13
2011-09-14 16:25:50 -07:00
Philip Arndt
cc3be37a41 Merge pull request #131 from wakeless/rails-3-1
Fix for ::Refinery::AdminController
2011-09-05 01:37:17 -07:00
Michael Gall
6be013e0c0 Second commit for ::Refinery::AdminController 2011-09-05 15:54:57 +10:00
Philip Arndt
d8f36a4196 Merge pull request #128 from enmasse-entertainment/rails-3-1
Revert sweeper's expiration parameter to strings for now
2011-09-04 15:56:27 -07:00
Jamie Winsor
88556fe709 Revert sweeper's expiration parameter to strings for now 2011-09-04 15:54:51 -07:00
Philip Arndt
f584651b58 Merge pull request #127 from enmasse-entertainment/more-comment-fixes
More comment fixes
2011-09-04 15:28:07 -07:00
Jamie Winsor
b9c44d851e use let instead of let! when we can lazily load these fixtures 2011-09-04 15:10:00 -07:00
Jamie Winsor
4d4ae4e682 accidentally had refinerycms pointing to my local filesystem... 2011-09-04 14:57:38 -07:00
Jamie Winsor
e35e3994d5 convert expire_page parameters in blog sweeper from strings to url helpers 2011-09-04 14:48:35 -07:00
Jamie Winsor
ba38b63370 remove useless comment 2011-09-04 14:47:24 -07:00
Jamie Winsor
3431b15ef3 fix localization string for submit button on comment 2011-09-04 14:46:45 -07:00
Jamie Winsor
ec6ed3f951 accidentally had left perform_caching set to true 2011-09-04 14:40:12 -07:00
Jamie Winsor
7903bdfed2 refactor factories and add #show tests for posts controller
Do not want to cache classes, but do want to reload models after factory girl:

http://groups.google.com/group/factory_girl/browse_thread/thread/daa24556d90c31fc
http://stackoverflow.com/questions/5145165/associationtypemismatch-and-factorygirl

rails_autolink was removed from Rails 3.1 and abstracted to an external gem
fix display author name and post time on comment show
fix namespace for thanking and moderated flash notices
2011-09-04 14:35:03 -07:00
Philip Arndt
40be4f71ee Merge pull request #126 from enmasse-entertainment/fix-comments
Fix comments
2011-09-03 22:09:51 -07:00
Jamie Winsor
6212e60f9e index action of blog post controller now caches and sweeps on changes
fix various views which were broken and untested with rails-3-1 upgrade
add request spec tests for admin blog comments
Factory is now FactoryGirl
Fix multiple issues around listing unmoderated comments
use cleaner definitions to set per_page willpaginate attribute on models
update all paginate calls to use new arel representation
reorganize filter sections to be located at top of controller
modify uncategorized class method to activerecord scope and perform a left outer join instead of iterate through an array to find uncategorized posts
move request specs into their proper places
update guardfile to ensure that request specs get run when their respective controllers are modified
Fix show action for AdminBlogComments and added test
Fix redirection link after approving or rejecting a comment
2011-09-03 21:55:30 -07:00
Philip Arndt
80ca7c1bf9 Config is deprecated, using RbConfig instread. 2011-09-03 16:40:25 +12:00
Philip Arndt
4439f6afda Using edge awesome_nested_set until 2.0.2 gem is released to fix deprecation warnings. 2011-09-03 11:44:35 +12:00
Philip Arndt
0497261f39 Converted Factory to FactoryGirl to fix deprecation warnings. 2011-09-03 11:44:21 +12:00
Philip Arndt
67cc6b4512 Merge pull request #125 from enmasse-entertainment/green-tests
Green tests
2011-09-02 16:05:50 -07:00
Jamie Winsor
2053a022a2 remove accidental inclusion of future feature 2011-09-02 14:21:19 -07:00
Jamie Winsor
fc68f22858 update and import refinerycms migrations and seeds
update Guardfile, spec_helper, and support files to match those generated by refinerycms-testing
2011-09-02 13:35:25 -07:00
Philip Arndt
1779274971 Added sqlite3, pg, mysql2 to the Gemfile and added Jamie to the notifications list for TRavis. 2011-09-02 13:06:38 +12:00
Philip Arndt
05bc8bc962 Merge pull request #124 from enmasse-entertainment/travis-ci
Travis ci
2011-09-01 17:40:22 -07:00
Jamie Winsor
34e5da1347 Disable libnotifications for travis 2011-09-01 16:18:07 -07:00
Uģis Ozols
5e5c6a78af Merge pull request #122 from enmasse-entertainment/revise-gemfile
Revise gemfile for Rails 3.1
2011-08-31 12:02:36 -07:00
Jamie Winsor
2bd8df5d4f Devise edge no longer required for Rails 3-1 branch 2011-08-31 11:59:46 -07:00
Philip Arndt
372235b963 Merge pull request #121 from wakeless/attr_accessible
Attr accessible
2011-08-30 19:22:26 -07:00
Michael Gall
0791d3a2e5 Add attr_accessible to blog posts to interact better with page_images 2011-08-31 12:16:40 +10:00
Philip Arndt
2f695519da Merge pull request #120 from enmasse-entertainment/revise-gemfile
Revise gemfile to support latest master branch of refinerycms
2011-08-29 18:17:11 -07:00
Jamie Winsor
9df6580d9c gemspec revision to support latest master branch of refinerycms 2011-08-29 15:09:53 -07:00
Uģis Ozols
36affef45e will_paginate is back. 2011-08-25 13:57:59 +03:00
Philip Arndt
6b73469c1a Merge pull request #117 from enmasse-entertainment/rails-3-1-rc6-support
Rails 3 1 rc6 support
2011-08-18 15:03:23 -07:00
Jamie Winsor
d0681c273c Update gemspec to require newest version of seo_meta 2011-08-18 14:51:51 -07:00
Philip Arndt
d8f82439eb Merge pull request #116 from enmasse-entertainment/use-fuubar-formatting
Use fuubar formatting
2011-08-15 00:50:56 -07:00
Philip Arndt
5e6f9bc270 Merge pull request #115 from enmasse-entertainment/fix-testing-not-loaded
Fix testing not loaded
2011-08-15 00:49:37 -07:00
Jamie Winsor
9363e8d8c5 Update Gemfile to what would be generated by Refinerycms 2011-08-15 00:37:43 -07:00
Jamie Winsor
8434790df7 Use fuubar formatting for rspec 2011-08-15 00:15:36 -07:00
Jamie Winsor
028489bf15 This will fix the build when runing rspec spec/. If you do not specify refinerycms-testing in the development group of the Gemfile it will not be properly loaded. 2011-08-15 00:13:54 -07:00
Philip Arndt
eaaa351f3a Merge pull request #113 from enmasse-entertainment/ruby-187-support
Ruby 187 support
2011-08-14 23:31:15 -07:00
Jamie Winsor
aed0b8f173 Move gemspec method to top of file
http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
2011-08-14 23:14:46 -07:00
Jamie Winsor
13cafc0947 Syntax fixes for Ruby 1.8.7 2011-08-14 19:32:25 -07:00
Philip Arndt
87bc12a1e4 HI 2 U TRAVIS; This is how to run specs in this engine 2011-08-15 13:07:26 +12:00
Philip Arndt
9b74f31a2a Merge remote-tracking branch 'enmasse-entertainment/fix-gemspec-filelist' into rails-3-1 2011-08-15 13:00:13 +12:00
Jamie Winsor
cb2bcf387c remove empty directory from gemspec file list 2011-08-14 17:40:50 -07:00
Uģis Ozols
e70193ca11 Update readme. 2011-08-14 00:51:41 +03:00
Uģis Ozols
dbb02d953f Move factories under spec dir so that they get picked up by spec_helper. 2011-08-13 21:57:43 +03:00
Jamie Winsor
fbcf2bd34a Ignore .lock files in Gemspec 2011-08-12 12:44:39 -07:00
Uģis Ozols
d0d5d9eb7d There's no test directory. 2011-08-12 08:59:15 +03:00
Uģis Ozols
7ae6e146b2 Use arel 2.1.4 for now because 2.1.5 got yanked. 2011-08-12 08:55:00 +03:00
Philip Arndt
83d407c8bb Need to use edge everything, excluding spec/dummy from the gemspec. 2011-08-12 11:26:37 +12:00
Jamie Winsor
eca7a1a591 Remove spork as a development dependency
Add spork to development & test group in Gemfile
Fix ControllerMacros and RequestMacros namespace in refinery support file
2011-08-11 03:08:12 -07:00
Jamie Winsor
45d8663de5 Dummy app is no longer a submodule, now part of the projected - generated by testing generator
Remove remaining traces of cucumber
2011-08-10 17:03:37 -07:00
Jamie Winsor
cfba1b86d1 Add Rails3.1 assets gemfile entry into Gemfile (required to start Rails dummy app)
Bump dummy app head
2011-08-06 04:45:27 -07:00
Jamie Winsor
ad784342dd test database will be initialized before rake rspec is run 2011-08-04 17:49:18 -07:00
Jamie Winsor
87f478e664 Update testing setup task to reflect new namespace 2011-08-04 17:38:39 -07:00
Jamie Winsor
0516a2cc00 Update gemspec 2011-08-04 15:54:53 -07:00
Jamie Winsor
82ca14af89 Update Rakefile to include rspec task 2011-08-04 15:53:53 -07:00
Jamie Winsor
ee215655cb Replace cucumber tag features with rspec request tests
Remove cucumber support from project
2011-08-04 15:39:04 -07:00
Jamie Winsor
8bd056e3e8 Replace category.features with capybara rspec requests
Update FactoryGirl factory definition syntax
2011-08-04 15:11:05 -07:00
Jamie Winsor
84a2fcdf08 Replace authors.feature with capybara rspec tests 2011-08-04 13:59:29 -07:00
Jamie Winsor
c3b7d0b1d2 Add request and controller authentication macros to rspec config
refactor request specs to take advantage of authentication macros
2011-08-04 03:21:21 -07:00
Jamie Winsor
a23689a6aa Remove shared functionality that now exists in refinerycms-testing engine 2011-08-04 03:12:38 -07:00
Jamie Winsor
1c186d26d0 Remove (commented out) duplicate refinerycms-testing gem requirement 2011-08-03 22:33:04 -07:00
Jamie Winsor
c481c78afa Require refinerycms-testing framework
Location of testing tasks changed
2011-08-03 22:25:41 -07:00
Jamie Winsor
e85535da5f Refactor testing tasks out of this project and into refinerycms project 2011-08-03 20:56:12 -07:00
Jamie Winsor
d3eff64d19 Add rake tasks to initialize the testing environment
Update README to reflect new functionality
2011-08-03 20:38:41 -07:00
Jamie Winsor
274ba14ea2 refactor dummy application into git submodule 2011-08-03 19:18:19 -07:00
Jamie Winsor
13c35c2620 rename default database for mysql and postgres example databases 2011-08-03 19:02:27 -07:00
Jamie Winsor
00d71519a9 Rid this project of autotest 2011-08-03 19:02:16 -07:00
Jamie Winsor
5e24eeb3d2 Update README with additional development instructions 2011-08-03 18:27:20 -07:00
Jamie Winsor
21b19db5a3 refactor engine testing scenario
Engine is now tested standalone by leveraging a dummy rails app
Enable Guard for speedy testing
Move factories to the more standard location `spec/factories/*`
Update README with a Testing section
Rename migrations to contain datetimestamps for their version to fix migration order issues when migrating the dummy application
2011-08-03 18:01:32 -07:00
Uģis Ozols
3454a9c300 I18n scope fix. 2011-08-03 16:59:31 +03:00
Uģis Ozols
fddcebd878 Make those specs green again. 2011-08-03 13:54:07 +03:00
Uģis Ozols
476ad3f158 WIP - use asset pipeline. 2011-08-03 13:17:16 +03:00
Uģis Ozols
806aef1858 Fix some I18n translations. 2011-08-03 13:09:02 +03:00
Philip Arndt
a86b7698a1 Merge pull request #108 from ricaurte/rails-3-1
Update to Pull Request
2011-07-30 13:39:04 -07:00
Justin Ricaurte
999f9e7c0e Made it so that comments and the body_content_right have been further refactored out, so that they can be easily overridden. body_content_right can also now have things prepended and appended to it. 2011-07-30 13:11:22 -07:00
Justin Ricaurte
bd3591c6d1 Made it so that comments and the body_content_right have been further refactored out, so that they can be easily overridden. body_content_right can also now have things prepended and appended to it. 2011-07-30 13:11:12 -07:00
Philip Arndt
302c1ea05a Merge pull request #107 from enmasse-entertainment/fix-i18n-nested-deprecation
Fix i18n nested deprecation
2011-07-30 02:06:24 -07:00
Jamie Winsor
b70ed6de02 Fix [DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attributes.refinery" is no longer supported
Fix [DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.models.refinery" is no longer supported
2011-07-30 01:58:48 -07:00
Philip Arndt
28492b69e0 Merge pull request #106 from enmasse-entertainment/refactor-archive-list-to-widget
Refactor archive list to widget
2011-07-29 23:20:22 -07:00
Jamie Winsor
dbedb27c04 Refactor blog_archive_list helper function into blog_archive_widget function (with alias for compatability)
Fix archive view for rails-3-1 support
2011-07-29 15:15:06 -07:00
Uģis Ozols
0f3be1a0b4 DB isn't cleared from previous test data. For now clear it ourselves but as feature todo - fix it. 2011-07-29 14:17:30 +03:00
Uģis Ozols
6e2046f4b9 Need a user first because otherwise it will redirect to first user creation form. 2011-07-29 07:55:13 +03:00
Uģis Ozols
0cf860f577 Manage blog posts request specs are now green. 2011-07-29 06:05:40 +03:00
Philip Arndt
f0c2eb9867 Merge pull request #105 from enmasse-entertainment/rails31-compatability-fixes
Rails31 compatability fixes
2011-07-28 17:49:47 -07:00
Jamie Winsor
a70ea17038 Update translation scopes
Update url helpers in public views
Various uninitialized constant fixes for public views & controllers
Add some request specs to test what was fixed in this commit
2011-07-28 17:29:34 -07:00
Uģis Ozols
17f08ab5cb Update translation scopes and routes. 2011-07-28 13:39:05 +03:00
Uģis Ozols
3475603f72 More request specs and updates to code to make specs pass. 2011-07-28 12:05:43 +03:00
Uģis Ozols
106571cded Start to add request specs. 2011-07-28 11:29:32 +03:00
Uģis Ozols
9d23338de2 Array is paginated differently. 2011-07-28 10:37:36 +03:00
Uģis Ozols
e0714c2ed0 Update some translation scopes. 2011-07-28 06:33:12 +03:00
Uģis Ozols
80048a6a31 Properly namespace translations. 2011-07-27 23:17:43 +03:00
Uģis Ozols
bba9d632d6 will_paginate -> paginate. 2011-07-27 22:53:46 +03:00
Uģis Ozols
d3da59e3f2 Remove per_page pagination code from controllers. 2011-07-27 22:50:02 +03:00
Uģis Ozols
109184377f Move per_page pagination stuff into model to dry up posts controller. 2011-07-27 22:41:42 +03:00
Uģis Ozols
164dc27a42 Cucumber tag steps now pass. 2011-07-27 22:32:26 +03:00
Uģis Ozols
ded42bc691 Cucumber category steps now pass. 2011-07-27 21:25:56 +03:00
Uģis Ozols
b5646a35c9 Cucumber author steps now pass. 2011-07-27 21:22:19 +03:00
Uģis Ozols
06071e5580 Wip. 2011-07-27 17:28:09 +03:00
Uģis Ozols
3fa8937b95 Rails 3.1 - wip. 2011-07-27 13:46:24 +03:00
218 changed files with 4953 additions and 4048 deletions

10
.gitignore vendored
View file

@ -14,6 +14,7 @@ doc/*
*.autobackupbyrefinery.*
/refinerycms-blog*.gem
.autotest
spec/dummy
# Mac
.DS_Store
@ -42,3 +43,12 @@ nbproject
# Capybara Bug
capybara-*html
# rvm
.rvmrc
#rbenv
.rbenv-version
Gemfile.lock
.rbx

1
.rspec Normal file
View file

@ -0,0 +1 @@
--colour

20
.travis.yml Normal file
View file

@ -0,0 +1,20 @@
before_script:
- "bundle exec rake refinery:testing:dummy_app > /dev/null"
script: "bundle exec rake spec"
notifications:
email:
- parndt@gmail.com
- ugis.ozolss@gmail.com
- joe@joesak.com
- jamie@enmasse.com
env:
- DB=postgresql
- DB=mysql
matrix:
allow_failures:
- rvm: rbx-19mode
rvm:
- 1.8.7
- 1.9.3
- rbx-19mode
- jruby

73
Gemfile
View file

@ -1,7 +1,70 @@
source 'http://rubygems.org'
source "http://rubygems.org"
gemspec
gem 'refinerycms', :git => 'git://github.com/resolve/refinerycms.git'
gem 'refinerycms-i18n', :git => 'git://github.com/parndt/refinerycms-i18n.git'
gem 'refinerycms-settings', :git => 'git://github.com/parndt/refinerycms-settings.git'
group :development, :test do
gem 'sqlite3'
gem 'mysql2'
gem 'pg'
end
require 'rbconfig'
gem 'refinerycms-testing', :git => 'git://github.com/resolve/refinerycms.git'
platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter'
gem 'activerecord-jdbcmysql-adapter'
gem 'activerecord-jdbcpostgresql-adapter'
gem 'jruby-openssl'
end
unless defined?(JRUBY_VERSION)
gem 'sqlite3'
gem 'mysql2'
gem 'pg'
end
platforms :mswin, :mingw do
gem 'win32console'
gem 'rb-fchange', '~> 0.0.5'
gem 'rb-notifu', '~> 0.0.4'
end
platforms :ruby do
gem 'spork', '0.9.0.rc9'
gem 'guard-spork'
unless ENV['TRAVIS']
if RbConfig::CONFIG['target_os'] =~ /darwin/i
gem 'rb-fsevent', '>= 0.3.9'
gem 'growl', '~> 1.0.3'
end
if RbConfig::CONFIG['target_os'] =~ /linux/i
gem 'rb-inotify', '>= 0.5.1'
gem 'libnotify', '~> 0.1.3'
gem 'therubyracer', '~> 0.9.9'
end
end
end
platforms :jruby do
unless ENV['TRAVIS']
if RbConfig::CONFIG['target_os'] =~ /darwin/i
gem 'growl', '~> 1.0.3'
end
if RbConfig::CONFIG['target_os'] =~ /linux/i
gem 'rb-inotify', '>= 0.5.1'
gem 'libnotify', '~> 0.1.3'
end
end
end
end
# Refinery/rails should pull in the proper versions of these
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
end
gem 'jquery-rails'

20
Guardfile Normal file
View file

@ -0,0 +1,20 @@
guard 'rspec', :version => 2, :cli => "--format Fuubar --color --drb" do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/controllers/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('spec/spec_helper.rb') { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^config/environments/.+\.rb$})
watch(%r{^config/initializers/.+\.rb$})
watch('spec/spec_helper.rb')
end

19
Rakefile Normal file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env rake
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
ENGINE_PATH = File.dirname(__FILE__)
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
if File.exists?(APP_RAKEFILE)
load 'rails/tasks/engine.rake'
end
require "refinerycms-testing"
Refinery::Testing::Railtie.load_tasks
Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)
load File.expand_path('../tasks/rspec.rake', __FILE__)

View file

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 512 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 413 B

After

Width:  |  Height:  |  Size: 413 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 557 B

After

Width:  |  Height:  |  Size: 557 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 110 B

After

Width:  |  Height:  |  Size: 110 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 537 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 668 B

After

Width:  |  Height:  |  Size: 668 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 733 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 635 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 739 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 663 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 111 B

After

Width:  |  Height:  |  Size: 111 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 689 B

After

Width:  |  Height:  |  Size: 689 B

Before After
Before After

View file

@ -47,4 +47,69 @@ $(document).ready(function(){
}, $(this)));
e.preventDefault();
});
});
$(function() {
$('#page-tabs').tabs();
$('#copy_body_link').click(function(event) {
// Find the WYMEditor that maps to the custom_teaser field
var teaserTextArea = $('#blog_post_custom_teaser')[0];
var teaserEditor = null;
$.each(WYMeditor.INSTANCES, function(index, editor) {
if (editor._element[0] == teaserTextArea) {
teaserEditor = editor;
}
});
if (teaserEditor) {
teaserEditor.html($('#blog_post_body').attr('value'));
}
event.preventDefault();
});
});
function split( val ) {
return val.split( /,\s*/ );
}
function extractLast( term ) {
return split( term ).pop();
}
page_options.init(false, '', '')
$('<%= dom_id %>').bind( "keydown", function( event ) {
if ( event.keyCode === $.ui.keyCode.TAB && $( this ).data( "autocomplete" ).menu.active ) {
event.preventDefault()
}
}).autocomplete({
source: function( request, response ) {
$.getJSON( "<%= url %>", {
term: extractLast( request.term )
}, response );
},
search: function() {
// custom minLength
var term = extractLast( this.value );
if ( term.length < 2 ) {
return false;
}
},
focus: function() {
// prevent value inserted on focus
return false;
},
select: function( event, ui ) {
var terms = split( this.value );
// remove the current input
terms.pop();
// add the selected item
terms.push( ui.item.value );
// add placeholder to get the comma-and-space at the end
terms.push( "" );
this.value = terms.join( ", " );
return false;
}
})
});

View file

@ -0,0 +1,73 @@
.comments_icon {
background-image: image_url('refinery/blog/icons/comments.png');
}
.comment_icon {
background-image: image_url('refinery/blog/icons/comment.png');
}
.comment_cross_icon {
background-image: image_url('refinery/blog/icons/comment_cross.png');
}
.comment_tick_icon {
background-image: image_url('refinery/blog/icons/comment_tick.png');
}
.folder_icon {
background-image: image_url('refinery/blog/icons/folder.png');
}
.folder_add_icon {
background-image: image_url('refinery/blog/icons/folder_add.png');
}
.folder_edit_icon {
background-image: image_url('refinery/blog/icons/folder_edit.png');
}
.settings_icon {
background-image: image_url('refinery/blog/icons/cog.png');
}
.page_icon {
background-image: image_url('refinery/blog/icons/page.png');
}
.page_copy_icon {
background-image: image_url('refinery/blog/icons/page_copy.png');
}
.page_add_icon {
background-image: image_url('refinery/blog/icons/page_add.png');
}
ul.collapsible_menu li {
position: relative;
}
ul.collapsible_menu li span.arrow {
background-repeat: no-repeat;
position: absolute;
right: 10px;
top: 13px;
width: 11px;
height: 7px;
cursor: pointer;
}
ul.collapsible_menu li span.arrow {
background-image: image_url('refinery/blog/icons/up.gif');
}
ul.collapsible_menu li.closed span.arrow {
background-image: image_url('refinery/blog/icons/down.gif');
}
ul.collapsible_menu > div {
width: 93%;
margin: 0px auto;
}
ul.blog_categories{
height:200px;
overflow:auto;
border:1px solid #ccc;
padding:5px;
}
ul.blog_categories, ul.blog_categories li {
list-style: none;
margin:5px 0;
}
a#copy_body_link {
background: image_url('refinery/blog/icons/add.png') no-repeat scroll 0 6px transparent;
border-bottom: 0 none;
display: inline;
line-height: 29px;
margin-top: 0;
padding-left: 20px;
}

View file

@ -22,7 +22,7 @@
#rss_feed_subscribe {
display: block;
padding-left: 25px;
background: url('/images/refinerycms-blog/rss-feed.png') no-repeat;
background: image_url('refinery/blog/rss-feed.png') no-repeat;
}
#next_prev_article{
overflow:hidden;
@ -58,7 +58,7 @@
.flash_notice, .flash_message {
border: 1px solid #00A017;
color: #00A017;
background: 7px 7px no-repeat url('/images/refinery/icons/accept.png') #E0F5E0;
background: 7px 7px no-repeat image_url('refinery/blog/icons/accept.png') #E0F5E0;
}
.flash_notice, .flash_notice * {
color: #00A017;
@ -66,7 +66,7 @@
.flash_error {
border: 1px solid #A00027;
color: #A00027;
background: 7px 7px no-repeat url('/images/refinery/icons/cancel.png') #FFB1B1;
background: 7px 7px no-repeat image_url('refinery/blog/icons/cancel.png') #FFB1B1;
}
.flash.flash_notice #flash_close, .flash.flash_error #flash_close {
text-transform: lowercase;

0
app/controllers/.gitkeep Normal file
View file

View file

@ -1,11 +0,0 @@
module Admin
module Blog
class CategoriesController < Admin::BaseController
crudify :blog_category,
:title_attribute => :title,
:order => 'title ASC'
end
end
end

View file

@ -1,40 +0,0 @@
module Admin
module Blog
class CommentsController < Admin::BaseController
crudify :blog_comment,
:title_attribute => :name,
:order => 'published_at DESC'
def index
@blog_comments = BlogComment.unmoderated
render :action => 'index'
end
def approved
unless params[:id].present?
@blog_comments = BlogComment.approved
render :action => 'index'
else
@blog_comment = BlogComment.find(params[:id])
@blog_comment.approve!
flash[:notice] = t('approved', :scope => 'admin.blog.comments', :author => @blog_comment.name)
redirect_to :action => params[:return_to] || 'index'
end
end
def rejected
unless params[:id].present?
@blog_comments = BlogComment.rejected
render :action => 'index'
else
@blog_comment = BlogComment.find(params[:id])
@blog_comment.reject!
flash[:notice] = t('rejected', :scope => 'admin.blog.comments', :author => @blog_comment.name)
redirect_to :action => params[:return_to] || 'index'
end
end
end
end
end

View file

@ -1,97 +0,0 @@
module Admin
module Blog
class PostsController < Admin::BaseController
require 'will_paginate/array'
crudify :blog_post,
:title_attribute => :title,
:order => 'published_at DESC'
def uncategorized
@blog_posts = BlogPost.uncategorized.paginate({
:page => params[:page],
:per_page => BlogPost.per_page
})
end
def tags
op = case ActiveRecord::Base.connection.adapter_name.downcase
when 'postgresql'
'~*'
else
'LIKE'
end
wildcard = case ActiveRecord::Base.connection.adapter_name.downcase
when 'postgresql'
'.*'
else
'%'
end
@tags = BlogPost.tag_counts_on(:tags).where(
["tags.name #{op} ?", "#{wildcard}#{params[:term].to_s.downcase}#{wildcard}"]
).map { |tag| {:id => tag.id, :value => tag.name}}
render :json => @tags.flatten
end
def create
# if the position field exists, set this object as last object, given the conditions of this class.
if BlogPost.column_names.include?("position")
params[:blog_post].merge!({
:position => ((BlogPost.maximum(:position, :conditions => "")||-1) + 1)
})
end
if BlogPost.column_names.include?("user_id")
params[:blog_post].merge!({
:user_id => current_user.id
})
end
if (@blog_post = BlogPost.create(params[:blog_post])).valid?
(request.xhr? ? flash.now : flash).notice = t(
'refinery.crudify.created',
:what => "'#{@blog_post.title}'"
)
unless from_dialog?
unless params[:continue_editing] =~ /true|on|1/
redirect_back_or_default(admin_blog_posts_url)
else
unless request.xhr?
redirect_to :back
else
render :partial => "/shared/message"
end
end
else
render :text => "<script>parent.window.location = '#{admin_blog_posts_url}';</script>"
end
else
unless request.xhr?
render :action => 'new'
else
render :partial => "/shared/admin/error_messages",
:locals => {
:object => @blog_post,
:include_object_name => true
}
end
end
end
before_filter :find_all_categories,
:only => [:new, :edit, :create, :update]
before_filter :check_category_ids, :only => :update
protected
def find_all_categories
@blog_categories = BlogCategory.find(:all)
end
def check_category_ids
params[:blog_post][:category_ids] ||= []
end
end
end
end

View file

@ -1,53 +0,0 @@
module Admin
module Blog
class SettingsController < Admin::BaseController
def notification_recipients
@recipients = BlogComment::Notification.recipients
if request.post?
BlogComment::Notification.recipients = params[:recipients]
flash[:notice] = t('updated', :scope => 'admin.blog.settings.notification_recipients',
:recipients => BlogComment::Notification.recipients)
unless request.xhr? or from_dialog?
redirect_back_or_default(admin_blog_posts_path)
else
render :text => "<script type='text/javascript'>parent.window.location = '#{admin_blog_posts_path}';</script>",
:layout => false
end
end
end
def moderation
enabled = BlogComment::Moderation.toggle!
unless request.xhr?
redirect_back_or_default(admin_blog_posts_path)
else
render :json => {:enabled => enabled},
:layout => false
end
end
def comments
enabled = BlogComment.toggle!
unless request.xhr?
redirect_back_or_default(admin_blog_posts_path)
else
render :json => {:enabled => enabled},
:layout => false
end
end
def teasers
enabled = BlogPost.teaser_enabled_toggle!
unless request.xhr?
redirect_back_or_default(admin_blog_posts_path)
else
render :json => {:enabled => enabled},
:layout => false
end
end
end
end
end

View file

@ -1,13 +0,0 @@
module Blog
class CategoriesController < BlogController
def show
@category = BlogCategory.find(params[:id])
@blog_posts = @category.posts.live.includes(:comments, :categories).paginate({
:page => params[:page],
:per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10)
})
end
end
end

View file

@ -1,109 +0,0 @@
module Blog
class PostsController < BlogController
before_filter :find_all_blog_posts, :except => [:archive]
before_filter :find_blog_post, :only => [:show, :comment, :update_nav]
before_filter :find_tags
respond_to :html, :js, :rss
def index
# Rss feeders are greedy. Let's give them every blog post instead of paginating.
(@blog_posts = BlogPost.live.includes(:comments, :categories).all) if request.format.rss?
respond_with (@blog_posts) do |format|
format.html
format.rss
end
end
def show
@blog_comment = BlogComment.new
@canonical = url_for(:locale => ::Refinery::I18n.default_frontend_locale) if canonical?
respond_with (@blog_post) do |format|
format.html { present(@blog_post) }
format.js { render :partial => 'post', :layout => false }
end
end
def comment
if (@blog_comment = @blog_post.comments.create(params[:blog_comment])).valid?
if BlogComment::Moderation.enabled? or @blog_comment.ham?
begin
Blog::CommentMailer.notification(@blog_comment, request).deliver
rescue
logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n"
end
end
if BlogComment::Moderation.enabled?
flash[:notice] = t('thank_you_moderated', :scope => 'blog.posts.comments')
redirect_to blog_post_url(params[:id])
else
flash[:notice] = t('thank_you', :scope => 'blog.posts.comments')
redirect_to blog_post_url(params[:id],
:anchor => "comment-#{@blog_comment.to_param}")
end
else
render :action => 'show'
end
end
def archive
if params[:month].present?
date = "#{params[:month]}/#{params[:year]}"
@archive_date = Time.parse(date)
@date_title = @archive_date.strftime('%B %Y')
@blog_posts = BlogPost.live.by_archive(@archive_date).paginate({
:page => params[:page],
:per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10)
})
else
date = "01/#{params[:year]}"
@archive_date = Time.parse(date)
@date_title = @archive_date.strftime('%Y')
@blog_posts = BlogPost.live.by_year(@archive_date).paginate({
:page => params[:page],
:per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10)
})
end
respond_with (@blog_posts)
end
def tagged
@tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
@tag_name = @tag.name
@blog_posts = BlogPost.tagged_with(@tag_name).paginate({
:page => params[:page],
:per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10)
})
end
protected
def find_blog_post
unless (@blog_post = BlogPost.find(params[:id])).try(:live?)
if refinery_user? and current_user.authorized_plugins.include?("refinerycms_blog")
@blog_post = BlogPost.find(params[:id])
else
error_404
end
end
end
def find_all_blog_posts
@blog_posts = BlogPost.live.includes(:comments, :categories).paginate({
:page => params[:page],
:per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10)
})
end
def find_tags
@tags = BlogPost.tag_counts_on(:tags)
end
def canonical?
::Refinery.i18n_enabled? && ::Refinery::I18n.default_frontend_locale != ::Refinery::I18n.current_frontend_locale
end
end
end

View file

@ -1,16 +0,0 @@
class BlogController < ApplicationController
helper :blog_posts
before_filter :find_page, :find_all_blog_categories
protected
def find_page
@page = Page.find_by_link_url("/blog")
end
def find_all_blog_categories
@blog_categories = BlogCategory.all
end
end

View file

@ -0,0 +1,12 @@
module Refinery
module Blog
module Admin
class CategoriesController < ::Refinery::AdminController
crudify :'refinery/blog/category',
:order => 'title ASC'
end
end
end
end

View file

@ -0,0 +1,49 @@
module Refinery
module Blog
module Admin
class CommentsController < ::Refinery::AdminController
cache_sweeper Refinery::BlogSweeper
crudify :'refinery/blog/comment',
:title_attribute => :name,
:order => 'published_at DESC'
def index
@comments = Refinery::Blog::Comment.unmoderated.page(params[:page])
render :action => 'index'
end
def approved
unless params[:id].present?
@comments = Refinery::Blog::Comment.approved.page(params[:page])
render :action => 'index'
else
@comment = Refinery::Blog::Comment.find(params[:id])
@comment.approve!
flash[:notice] = t('approved', :scope => 'refinery.blog.admin.comments', :author => @comment.name)
redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil)
end
end
def rejected
unless params[:id].present?
@comments = Refinery::Blog::Comment.rejected.page(params[:page])
render :action => 'index'
else
@comment = Refinery::Blog::Comment.find(params[:id])
@comment.reject!
flash[:notice] = t('rejected', :scope => 'refinery.blog.admin.comments', :author => @comment.name)
redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil)
end
end
end
end
end
end

View file

@ -0,0 +1,90 @@
module Refinery
module Blog
module Admin
class PostsController < ::Refinery::AdminController
cache_sweeper Refinery::BlogSweeper
crudify :'refinery/blog/post',
:order => 'published_at DESC'
before_filter :find_all_categories,
:only => [:new, :edit, :create, :update]
before_filter :check_category_ids, :only => :update
def uncategorized
@posts = Refinery::Blog::Post.uncategorized.page(params[:page])
end
def tags
if ActiveRecord::Base.connection.adapter_name.downcase == 'postgresql'
op = '~*'
wildcard = '.*'
else
op = 'LIKE'
wildcard = '%'
end
@tags = Refinery::Blog::Post.tag_counts_on(:tags).where(
["tags.name #{op} ?", "#{wildcard}#{params[:term].to_s.downcase}#{wildcard}"]
).map { |tag| {:id => tag.id, :value => tag.name}}
render :json => @tags.flatten
end
def new
@post = ::Refinery::Blog::Post.new(:author => current_refinery_user)
end
def create
# if the position field exists, set this object as last object, given the conditions of this class.
if Refinery::Blog::Post.column_names.include?("position")
params[:post].merge!({
:position => ((Refinery::Blog::Post.maximum(:position, :conditions => "")||-1) + 1)
})
end
if (@post = Refinery::Blog::Post.create(params[:post])).valid?
(request.xhr? ? flash.now : flash).notice = t(
'refinery.crudify.created',
:what => "'#{@post.title}'"
)
unless from_dialog?
unless params[:continue_editing] =~ /true|on|1/
redirect_back_or_default(refinery.blog_admin_posts_path)
else
unless request.xhr?
redirect_to :back
else
render "/shared/message"
end
end
else
render :text => "<script>parent.window.location = '#{refinery.blog_admin_posts_url}';</script>"
end
else
unless request.xhr?
render :action => 'new'
else
render :partial => "/refinery/admin/error_messages",
:locals => {
:object => @post,
:include_object_name => true
}
end
end
end
protected
def find_all_categories
@categories = Refinery::Blog::Category.find(:all)
end
def check_category_ids
params[:post][:category_ids] ||= []
end
end
end
end
end

View file

@ -0,0 +1,55 @@
module Refinery
module Blog
module Admin
class SettingsController < ::Refinery::AdminController
def notification_recipients
@recipients = Refinery::Blog::Comment::Notification.recipients
if request.post?
Refinery::Blog::Comment::Notification.recipients = params[:recipients]
flash[:notice] = t('updated', :scope => 'refinery.blog.admin.settings.notification_recipients',
:recipients => Refinery::Blog::Comment::Notification.recipients)
unless request.xhr? or from_dialog?
redirect_back_or_default(refinery.blog_admin_posts_path)
else
render :text => "<script type='text/javascript'>parent.window.location = '#{refinery.blog_admin_posts_path}';</script>",
:layout => false
end
end
end
def moderation
enabled = Refinery::Blog::Comment::Moderation.toggle!
unless request.xhr?
redirect_back_or_default(refinery.blog_admin_posts_path)
else
render :json => {:enabled => enabled},
:layout => false
end
end
def comments
enabled = Refinery::Blog::Comment.toggle!
unless request.xhr?
redirect_back_or_default(refinery.blog_admin_posts_path)
else
render :json => {:enabled => enabled},
:layout => false
end
end
def teasers
enabled = Refinery::Blog::Post.teaser_enabled_toggle!
unless request.xhr?
redirect_back_or_default(refinery.blog_admin_posts_path)
else
render :json => {:enabled => enabled},
:layout => false
end
end
end
end
end
end

View file

@ -0,0 +1,17 @@
module Refinery
module Blog
class BlogController < ::ApplicationController
include ControllerHelper
helper :'refinery/blog/posts'
before_filter :find_page, :find_all_blog_categories
protected
def find_page
@page = Refinery::Page.find_by_link_url("/blog")
end
end
end
end

View file

@ -0,0 +1,12 @@
module Refinery
module Blog
class CategoriesController < BlogController
def show
@category = Refinery::Blog::Category.find(params[:id])
@posts = @category.posts.live.includes(:comments, :categories).page(params[:page])
end
end
end
end

View file

@ -0,0 +1,85 @@
module Refinery
module Blog
class PostsController < BlogController
caches_page :index, :unless => proc {|c| c.refinery_user_signed_in? || c.flash.any? || params[:page].present? }
before_filter :find_all_blog_posts, :except => [:archive]
before_filter :find_blog_post, :only => [:show, :comment, :update_nav]
before_filter :find_tags
respond_to :html, :js, :rss
def index
# Rss feeders are greedy. Let's give them every blog post instead of paginating.
(@posts = Post.live.includes(:comments, :categories).all) if request.format.rss?
respond_with (@posts) do |format|
format.html
format.rss
end
end
def show
@comment = Comment.new
@canonical = url_for(:locale => ::Refinery::I18n.default_frontend_locale) if canonical?
@post.increment!(:access_count, 1)
respond_with (@post) do |format|
format.html { present(@post) }
format.js { render :partial => 'post', :layout => false }
end
end
def comment
if (@comment = @post.comments.create(params[:comment])).valid?
if Comment::Moderation.enabled? or @comment.ham?
begin
CommentMailer.notification(@comment, request).deliver
rescue
logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n"
end
end
if Comment::Moderation.enabled?
flash[:notice] = t('thank_you_moderated', :scope => 'refinery.blog.posts.comments')
redirect_to refinery.blog_post_url(params[:id])
else
flash[:notice] = t('thank_you', :scope => 'refinery.blog.posts.comments')
redirect_to refinery.blog_post_url(params[:id],
:anchor => "comment-#{@comment.to_param}")
end
else
render :action => 'show'
end
end
def archive
if params[:month].present?
date = "#{params[:month]}/#{params[:year]}"
@archive_date = Time.parse(date)
@date_title = @archive_date.strftime('%B %Y')
@posts = Post.live.by_month(@archive_date).page(params[:page])
else
date = "01/#{params[:year]}"
@archive_date = Time.parse(date)
@date_title = @archive_date.strftime('%Y')
@posts = Post.live.by_year(@archive_date).page(params[:page])
end
respond_with (@posts)
end
def tagged
@tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
@tag_name = @tag.name
@posts = Post.tagged_with(@tag_name).page(params[:page])
end
protected
def canonical?
::Refinery.i18n_enabled? && ::Refinery::I18n.default_frontend_locale != ::Refinery::I18n.current_frontend_locale
end
end
end
end

0
app/helpers/.gitkeep Normal file
View file

View file

@ -1,59 +0,0 @@
module BlogPostsHelper
def blog_archive_list
posts = BlogPost.select('published_at').all_previous
return nil if posts.blank?
html = '<section id="blog_archive_list"><h2>'
html << t('archives', :scope => 'blog.shared')
html << '</h2><nav><ul>'
links = []
super_old_links = []
posts.each do |e|
if e.published_at >= Time.now.end_of_year.advance(:years => -3)
links << e.published_at.strftime('%m/%Y')
else
super_old_links << e.published_at.strftime('01/%Y')
end
end
links.uniq!
super_old_links.uniq!
links.each do |l|
year = l.split('/')[1]
month = l.split('/')[0]
count = BlogPost.by_archive(Time.parse(l)).size
text = t("date.month_names")[month.to_i] + " #{year} (#{count})"
html << "<li>"
html << link_to(text, archive_blog_posts_path(:year => year, :month => month))
html << "</li>"
end
super_old_links.each do |l|
year = l.split('/')[1]
count = BlogPost.by_year(Time.parse(l)).size
text = "#{year} (#{count})"
html << "<li>"
html << link_to(text, archive_blog_posts_path(:year => year))
html << "</li>"
end
html << '</ul></nav></section>'
html.html_safe
end
def next_or_previous?(post)
post.next.present? or post.prev.present?
end
def blog_post_teaser_enabled?
BlogPost.teasers_enabled?
end
def blog_post_teaser(post)
if post.respond_to?(:custom_teaser) && post.custom_teaser.present?
post.custom_teaser.html_safe
else
truncate(post.body, {
:length => RefinerySetting.find_or_set(:blog_post_teaser_length, 250),
:preserve_html_tags => true
}).html_safe
end
end
end

View file

@ -0,0 +1,29 @@
module Refinery
module Blog
module ControllerHelper
protected
def find_blog_post
unless (@post = Refinery::Blog::Post.find(params[:id])).try(:live?)
if refinery_user? and current_refinery_user.authorized_plugins.include?("refinerycms_blog")
@post = Refinery::Blog::Post.find(params[:id])
else
error_404
end
end
end
def find_all_blog_posts
@posts = Refinery::Blog::Post.live.includes(:comments, :categories).page(params[:page])
end
def find_tags
@tags = Refinery::Blog::Post.tag_counts_on(:tags)
end
def find_all_blog_categories
@categories = Refinery::Blog::Category.all
end
end
end
end

View file

@ -0,0 +1,72 @@
module Refinery
module Blog
module PostsHelper
def next_or_previous?(post)
post.next.present? or post.prev.present?
end
def blog_post_teaser_enabled?
Refinery::Blog::Post.teasers_enabled?
end
def blog_post_teaser(post)
if post.respond_to?(:custom_teaser) && post.custom_teaser.present?
post.custom_teaser.html_safe
else
truncate(post.body, {
:length => Refinery::Blog.post_teaser_length,
:preserve_html_tags => true
}).html_safe
end
end
def blog_archive_widget(dates=blog_archive_dates)
ArchiveWidget.new(dates, self).display
end
def blog_archive_dates(cutoff=Time.now.beginning_of_month)
Refinery::Blog::Post.published_dates_older_than(cutoff)
end
class ArchiveWidget
delegate :t, :link_to, :refinery, :render, :to => :view_context
attr_reader :view_context
def initialize(dates, view_context, cutoff=3.years.ago.end_of_year)
@recent_dates, @old_dates = dates.sort_by {|date| -date.to_i }.
partition {|date| date > cutoff }
@view_context = view_context
end
def recent_links
@recent_dates.group_by {|date| [date.year, date.month] }.
map {|(year, month), dates| recent_link(year, month, dates.count) }
end
def recent_link(year, month, count)
link_to "#{t("date.month_names")[month]} #{year} (#{count})",
refinery.blog_archive_posts_path(:year => year, :month => month)
end
def old_links
@old_dates.group_by {|date| date.year }.
map {|year, dates| old_link(year, dates.size) }
end
def old_link(year, count)
link_to "#{year} (#{count})", refinery.blog_archive_posts_path(:year => year)
end
def links
recent_links + old_links
end
def display
return "" if links.empty?
render "refinery/blog/widgets/blog_archive", :links => links
end
end
end
end
end

View file

@ -1,13 +0,0 @@
module Blog
class CommentMailer < ActionMailer::Base
def notification(comment, request)
subject BlogComment::Notification.subject
recipients BlogComment::Notification.recipients
from "\"#{RefinerySetting[:site_name]}\" <no-reply@#{request.domain(RefinerySetting.find_or_set(:tld_length, 1))}>"
sent_on Time.now
@comment = comment
end
end
end

View file

@ -0,0 +1,14 @@
module Refinery
module Blog
class CommentMailer < ActionMailer::Base
def notification(comment, request)
@comment = comment
mail :subject => Blog::Comment::Notification.subject,
:to => Blog::Comment::Notification.recipients,
:from => "\"#{Refinery::Core.site_name}\" <no-reply@#{request.domain}>"
end
end
end
end

0
app/models/.gitkeep Normal file
View file

View file

@ -1 +0,0 @@
require File.expand_path('../../../mailers/blog/comment_mailer', __FILE__)

View file

@ -1,19 +0,0 @@
class BlogCategory < ActiveRecord::Base
has_many :categorizations, :dependent => :destroy
has_many :posts, :through => :categorizations, :source => :blog_post
acts_as_indexed :fields => [:title]
validates :title, :presence => true, :uniqueness => true
has_friendly_id :title, :use_slug => true,
:default_locale => (::Refinery::I18n.default_frontend_locale rescue :en),
:approximate_ascii => RefinerySetting.find_or_set(:approximate_ascii, false, :scoping => 'blog'),
:strip_non_ascii => RefinerySetting.find_or_set(:strip_non_ascii, false, :scoping => 'blog')
def post_count
posts.select(&:live?).count
end
end

View file

@ -1,131 +0,0 @@
class BlogComment < ActiveRecord::Base
attr_accessible :name, :email, :message
filters_spam :author_field => :name,
:email_field => :email,
:message_field => :body
belongs_to :post, :class_name => 'BlogPost', :foreign_key => 'blog_post_id'
acts_as_indexed :fields => [:name, :email, :message]
alias_attribute :message, :body
validates :name, :message, :presence => true
validates :email, :format => { :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i }
scope :unmoderated, :conditions => {:state => nil}
scope :approved, :conditions => {:state => 'approved'}
scope :rejected, :conditions => {:state => 'rejected'}
def avatar_url(options = {})
options = {:size => 60}
require 'digest/md5'
size = ("?s=#{options[:size]}" if options[:size])
"http://gravatar.com/avatar/#{Digest::MD5.hexdigest(self.email.to_s.strip.downcase)}#{size}.jpg"
end
def approve!
self.update_attribute(:state, 'approved')
end
def reject!
self.update_attribute(:state, 'rejected')
end
def rejected?
self.state == 'rejected'
end
def approved?
self.state == 'approved'
end
def unmoderated?
self.state.nil?
end
def self.toggle!
currently = RefinerySetting.find_or_set(:comments_allowed, true, {
:scoping => 'blog'
})
RefinerySetting.set(:comments_allowed, {:value => !currently, :scoping => 'blog'})
end
before_create do |comment|
unless BlogComment::Moderation.enabled?
comment.state = comment.ham? ? 'approved' : 'rejected'
end
end
module Moderation
class << self
def enabled?
RefinerySetting.find_or_set(:comment_moderation, true, {
:scoping => 'blog',
:restricted => false
})
end
def toggle!
new_value = {
:value => !BlogComment::Moderation.enabled?,
:scoping => 'blog',
:restricted => false
}
if RefinerySetting.respond_to?(:set)
RefinerySetting.set(:comment_moderation, new_value)
else
RefinerySetting[:comment_moderation] = new_value
end
end
end
end
module Notification
class << self
def recipients
RefinerySetting.find_or_set(:comment_notification_recipients, (Role[:refinery].users.first.email rescue ''),
{
:scoping => 'blog',
:restricted => false
})
end
def recipients=(emails)
new_value = {
:value => emails,
:scoping => 'blog',
:restricted => false
}
if RefinerySetting.respond_to?(:set)
RefinerySetting.set(:comment_notification_recipients, new_value)
else
RefinerySetting[:comment_notification_recipients] = new_value
end
end
def subject
RefinerySetting.find_or_set(:comment_notification_subject, "New inquiry from your website", {
:scoping => 'blog',
:restricted => false
})
end
def subject=(subject_line)
new_value = {
:value => subject_line,
:scoping => 'blog',
:restricted => false
}
if RefinerySetting.respond_to?(:set)
RefinerySetting.set(:comment_notification_subject, new_value)
else
RefinerySetting[:comment_notification_subject] = new_value
end
end
end
end
end

View file

@ -1,114 +0,0 @@
require 'acts-as-taggable-on'
require 'seo_meta'
class BlogPost < ActiveRecord::Base
is_seo_meta if self.table_exists?
default_scope :order => 'published_at DESC'
#.first & .last will be reversed -- consider a with_exclusive_scope on these?
belongs_to :author, :class_name => 'User', :foreign_key => :user_id, :readonly => true
has_many :comments, :class_name => 'BlogComment', :dependent => :destroy
acts_as_taggable
has_many :categorizations, :dependent => :destroy
has_many :categories, :through => :categorizations, :source => :blog_category
acts_as_indexed :fields => [:title, :body]
validates :title, :presence => true, :uniqueness => true
validates :body, :presence => true
has_friendly_id :friendly_id_source, :use_slug => true,
:default_locale => (::Refinery::I18n.default_frontend_locale rescue :en),
:approximate_ascii => RefinerySetting.find_or_set(:approximate_ascii, false, :scoping => 'blog'),
:strip_non_ascii => RefinerySetting.find_or_set(:strip_non_ascii, false, :scoping => 'blog')
scope :by_archive, lambda { |archive_date|
where(['published_at between ? and ?', archive_date.beginning_of_month, archive_date.end_of_month])
}
scope :by_year, lambda { |archive_year|
where(['published_at between ? and ?', archive_year.beginning_of_year, archive_year.end_of_year])
}
scope :all_previous, lambda { where(['published_at <= ?', Time.now.beginning_of_month]) }
scope :live, lambda { where( "published_at <= ? and draft = ?", Time.now, false) }
scope :previous, lambda { |i| where(["published_at < ? and draft = ?", i.published_at, false]).limit(1) }
# next is now in << self
def next
BlogPost.next(self).first
end
def prev
BlogPost.previous(self).first
end
def live?
!draft and published_at <= Time.now
end
def category_ids=(ids)
self.categories = ids.reject{|id| id.blank?}.collect {|c_id|
BlogCategory.find(c_id.to_i) rescue nil
}.compact
end
def friendly_id_source
custom_url.present? ? custom_url : title
end
class << self
def next current_record
self.send(:with_exclusive_scope) do
where(["published_at > ? and draft = ?", current_record.published_at, false]).order("published_at ASC")
end
end
def comments_allowed?
RefinerySetting.find_or_set(:comments_allowed, true, {
:scoping => 'blog'
})
end
def teasers_enabled?
RefinerySetting.find_or_set(:teasers_enabled, true, {
:scoping => 'blog'
})
end
def teaser_enabled_toggle!
currently = RefinerySetting.find_or_set(:teasers_enabled, true, {
:scoping => 'blog'
})
RefinerySetting.set(:teasers_enabled, {:value => !currently, :scoping => 'blog'})
end
def uncategorized
BlogPost.live.reject { |p| p.categories.any? }
end
end
module ShareThis
DEFAULT_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
class << self
def key
RefinerySetting.find_or_set(:share_this_key, BlogPost::ShareThis::DEFAULT_KEY, {
:scoping => 'blog'
})
end
def enabled?
key = BlogPost::ShareThis.key
key.present? and key != BlogPost::ShareThis::DEFAULT_KEY
end
end
end
end

View file

@ -1,7 +0,0 @@
class Categorization < ActiveRecord::Base
set_table_name 'blog_categories_blog_posts'
belongs_to :blog_post
belongs_to :blog_category
end

View file

@ -0,0 +1,25 @@
module Refinery
module Blog
class Category < ActiveRecord::Base
extend FriendlyId
friendly_id :title, :use => [:slugged]
has_many :categorizations, :dependent => :destroy, :foreign_key => :blog_category_id
has_many :posts, :through => :categorizations, :source => :blog_post
acts_as_indexed :fields => [:title]
validates :title, :presence => true, :uniqueness => true
attr_accessible :title
def post_count
posts.live.count
end
# how many items to show per page
self.per_page = Refinery::Blog.posts_per_page
end
end
end

View file

@ -0,0 +1,135 @@
module Refinery
module Blog
class Comment < ActiveRecord::Base
attr_accessible :name, :email, :message
filters_spam :author_field => :name,
:email_field => :email,
:message_field => :body
belongs_to :post, :foreign_key => 'blog_post_id'
acts_as_indexed :fields => [:name, :email, :message]
alias_attribute :message, :body
validates :name, :message, :presence => true
validates :email, :format => { :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i }
class << self
def unmoderated
where(:state => nil)
end
def approved
where(:state => 'approved')
end
def rejected
where(:state => 'rejected')
end
end
self.per_page = Refinery::Blog.comments_per_page
def avatar_url(options = {})
options = {:size => 60}
require 'digest/md5'
size = ("?s=#{options[:size]}" if options[:size])
"http://gravatar.com/avatar/#{Digest::MD5.hexdigest(self.email.to_s.strip.downcase)}#{size}.jpg"
end
def approve!
self.update_attribute(:state, 'approved')
end
def reject!
self.update_attribute(:state, 'rejected')
end
def rejected?
self.state == 'rejected'
end
def approved?
self.state == 'approved'
end
def unmoderated?
self.state.nil?
end
def self.toggle!
currently = Refinery::Setting.find_or_set(:comments_allowed, true, {
:scoping => 'blog'
})
Refinery::Setting.set(:comments_allowed, {:value => !currently, :scoping => 'blog'})
end
before_create do |comment|
unless Moderation.enabled?
comment.state = comment.ham? ? 'approved' : 'rejected'
end
end
module Moderation
class << self
def enabled?
Refinery::Setting.find_or_set(:comment_moderation, true, {
:scoping => 'blog',
:restricted => false
})
end
def toggle!
new_value = {
:value => !Blog::Comment::Moderation.enabled?,
:scoping => 'blog',
:restricted => false
}
Refinery::Setting.set(:comment_moderation, new_value)
end
end
end
module Notification
class << self
def recipients
Refinery::Setting.find_or_set(:comment_notification_recipients, (Refinery::Role[:refinery].users.first.email rescue ''),
{
:scoping => 'blog',
:restricted => false
})
end
def recipients=(emails)
new_value = {
:value => emails,
:scoping => 'blog',
:restricted => false
}
Refinery::Setting.set(:comment_notification_recipients, new_value)
end
def subject
Refinery::Setting.find_or_set(:comment_notification_subject, "New inquiry from your website", {
:scoping => 'blog',
:restricted => false
})
end
def subject=(subject_line)
new_value = {
:value => subject_line,
:scoping => 'blog',
:restricted => false
}
Refinery::Setting.set(:comment_notification_subject, new_value)
end
end
end
end
end
end

View file

@ -0,0 +1,120 @@
require 'acts-as-taggable-on'
require 'seo_meta'
module Refinery
module Blog
class Post < ActiveRecord::Base
extend FriendlyId
friendly_id :friendly_id_source, :use => [:slugged]
is_seo_meta if self.table_exists?
default_scope :order => 'published_at DESC'
belongs_to :author, :class_name => 'Refinery::User', :foreign_key => :user_id, :readonly => true
has_many :comments, :dependent => :destroy, :foreign_key => :blog_post_id
acts_as_taggable
has_many :categorizations, :dependent => :destroy, :foreign_key => :blog_post_id
has_many :categories, :through => :categorizations, :source => :blog_category
acts_as_indexed :fields => [:title, :body]
validates :title, :presence => true, :uniqueness => true
validates :body, :presence => true
validates :source_url, :url => { :if => 'Refinery::Blog.validate_source_url',
:update => true,
:allow_nil => true,
:allow_blank => true,
:verify => [:resolve_redirects]}
attr_accessible :title, :body, :custom_teaser, :tag_list, :draft, :published_at, :custom_url, :author
attr_accessible :browser_title, :meta_keywords, :meta_description, :user_id, :category_ids
attr_accessible :source_url, :source_url_title
self.per_page = Refinery::Blog.posts_per_page
def next
self.class.next(self)
end
def prev
self.class.previous(self)
end
def live?
!draft and published_at <= Time.now
end
def friendly_id_source
custom_url.presence || title
end
class << self
def by_month(date)
where(:published_at => date.beginning_of_month..date.end_of_month)
end
def by_archive(date)
Refinery.deprecate("Refinery::Blog::Post.by_archive(date)", {:replacement => "Refinery::Blog::Post.by_month(date)", :when => 2.2 })
by_month(date)
end
def by_year(date)
where(:published_at => date.beginning_of_year..date.end_of_year)
end
def published_dates_older_than(date)
published_before(date).pluck(:published_at)
end
def recent(count)
live.limit(count)
end
def popular(count)
unscoped.order("access_count DESC").limit(count)
end
def previous(item)
published_before(item.published_at).first
end
def uncategorized
live.includes(:categories).where(:categories => { Refinery::Categorization.table_name => { :blog_category_id => nil } })
end
def next(current_record)
where(["published_at > ? and draft = ?", current_record.published_at, false]).first
end
def published_before(date=Time.now)
where("published_at < ? and draft = ?", date, false)
end
alias_method :live, :published_before
def comments_allowed?
Refinery::Setting.find_or_set(:comments_allowed, true, :scoping => 'blog')
end
def teasers_enabled?
Refinery::Setting.find_or_set(:teasers_enabled, true, :scoping => 'blog')
end
def teaser_enabled_toggle!
currently = Refinery::Setting.find_or_set(:teasers_enabled, true, :scoping => 'blog')
Refinery::Setting.set(:teasers_enabled, :value => !currently, :scoping => 'blog')
end
end
module ShareThis
def self.enabled?
Refinery::Blog.share_this_key != "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
end
end
end
end
end

View file

@ -0,0 +1,10 @@
module Refinery
class Categorization < ActiveRecord::Base
self.table_name = 'refinery_blog_categories_blog_posts'
belongs_to :blog_post, :class_name => 'Refinery::Blog::Post', :foreign_key => :blog_post_id
belongs_to :blog_category, :class_name => 'Refinery::Blog::Category', :foreign_key => :blog_category_id
attr_accessible :blog_category_id, :blog_post_id
end
end

View file

@ -0,0 +1,26 @@
module Refinery
class BlogSweeper < ActionController::Caching::Sweeper
observe Blog::Post, Blog::Comment
def after_create(record)
expire_cache_for(record)
end
def after_update(record)
expire_cache_for(record)
end
def after_destroy(record)
expire_cache_for(record)
end
private
def expire_cache_for(record)
# TODO: Convert these to url helpers
expire_page '/blog'
expire_page '/blog/feed.rss'
end
end
end

0
app/views/.gitkeep Normal file
View file

View file

@ -1 +0,0 @@
<%= render :partial => "form" %>

View file

@ -1,26 +0,0 @@
<%= render :partial => '/admin/blog/submenu' %>
<div id='records'>
<% if searching? %>
<h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
<% if @blog_categories.any? %>
<%= render :partial => "blog_categories",
:collection => @blog_categories %>
<% else %>
<p><%= t('search_no_results', :scope => 'admin') %></p>
<% end %>
<% else %>
<% if @blog_categories.any? %>
<%= will_paginate @blog_categories %>
<%= render :partial => "sortable_list" %>
<%= will_paginate @blog_categories %>
<% else %>
<p>
<strong>
<%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.categories')) %>
</strong>
</p>
<% end %>
<% end %>
</div>

View file

@ -1 +0,0 @@
<%= render :partial => "form" %>

View file

@ -1,35 +0,0 @@
<%= render :partial => '/admin/blog/submenu' %>
<div id='records'>
<% if searching? %>
<h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
<% if @blog_comments.any? %>
<%=# will_paginate @blog_comments
%>
<ul>
<%= render :partial => "blog_comments",
:collection => @blog_comments %>
</ul>
<%=# will_paginate @blog_comments
%>
<% else %>
<p><%= t('search_no_results', :scope => 'admin') %></p>
<% end %>
<% else %>
<% if @blog_comments.any? %>
<%=# will_paginate @blog_comments
%>
<%= render :partial => "sortable_list" %>
<%=# will_paginate @blog_comments
%>
<% else %>
<h3>
<%= t('.no_items_yet',
:type => t(action_name.gsub('index', 'new'), :scope => 'admin.blog.submenu.comments').downcase) %>
</h3>
<% end %>
<% end %>
</div>

View file

@ -1,63 +0,0 @@
<div id='actions'>
<h2><%= t('.details')%></h2>
<p>
<strong><%= t('.age') %>:</strong> <%= time_ago_in_words(@blog_comment.created_at) %>
</p>
<h2><%= t('.actions') %></h2>
<ul>
<li>
<%= link_to t('.back'), {:action => 'index'}, :class => "back_icon" %>
</li>
<li>
<%= link_to t('.reject'), rejected_admin_blog_comment_path(@blog_comment, :return_to => 'rejected'),
:class => 'comment_cross_icon' unless @blog_comment.rejected? %>
</li>
<li>
<%= link_to t('.approve'), approved_admin_blog_comment_path(@blog_comment, :return_to => 'approved'),
:class => 'comment_tick_icon' unless @blog_comment.approved? %>
</li>
</ul>
</div>
<div id='records'>
<h2><%= t('.comment') %></h2>
<table id='inquiry'>
<tr>
<td>
<strong><%= t('.blog_post') %></strong>
</td>
<td>
<%= link_to @blog_comment.post.title,
blog_post_url(@blog_comment.post, :anchor => "comment-#{@blog_comment.to_param}"),
:target => '_blank' %>
</td>
</tr>
<tr>
<td>
<strong><%= t('.from') %></strong>
</td>
<td>
<%= @blog_comment.name %> [<%= mail_to @blog_comment.email, @blog_comment.email, {:title => t('.click_to_email')} %>]
</td>
</tr>
<tr>
<td>
<strong><%= t('.date') %></strong>
</td>
<td>
<%= l(Date.parse(@blog_comment.created_at.to_s), :format => :long) %>
</td>
</tr>
<tr>
<td valign='top'>
<strong><%= t('.message') %></strong>
</td>
<td>
<p style='margin-top: 0px'>
<%= @blog_comment.message.gsub("\r\n\r\n", "\r\n").gsub("\r\n", "</p><p>") %>
</p>
</td>
</tr>
</table>
</div>
<% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog') %>

View file

@ -1,20 +0,0 @@
<style type='text/css'>
ul.blog_categories{
height:200px;
overflow:auto;
border:1px solid #ccc;
padding:5px;
}
ul.blog_categories, ul.blog_categories li {
list-style: none;
margin:5px 0;
}
a#copy_body_link {
background: url("/images/refinery/icons/add.png") no-repeat scroll 0 6px transparent;
border-bottom: 0 none;
display: inline;
line-height: 29px;
margin-top: 0;
padding-left: 20px;
}
</style>

View file

@ -1,23 +0,0 @@
<script>
(function($) {
$(function() {
$('#page-tabs').tabs();
$('#copy_body_link').click(function(event) {
// Find the WYMEditor that maps to the custom_teaser field
var teaserTextArea = $('#blog_post_custom_teaser')[0];
var teaserEditor = null;
$.each(WYMeditor.INSTANCES, function(index, editor) {
if (editor._element[0] == teaserTextArea) {
teaserEditor = editor;
}
});
if (teaserEditor) {
teaserEditor.html($('#blog_post_body').attr('value'));
}
event.preventDefault();
});
});
})(jQuery);
</script>

View file

@ -1,21 +0,0 @@
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(post) -%>">
<span class='title'>
<%= post.title %>
<span class="preview">
<%= post.published_at.try(:strftime, '%b %d, %Y') || 'draft' %>
<%= " by #{post.author.username}" if post.author.present? %>
</span>
</span>
<span class='actions'>
<%= link_to refinery_icon_tag("application_go.png"), blog_post_url(post),
:title => t('.view_live_html'),
:target => "_blank" %>
<%= link_to refinery_icon_tag("application_edit.png"), edit_admin_blog_post_path(post),
:title => t('.edit') %>
<%= link_to refinery_icon_tag("delete.png"), admin_blog_post_path(post),
:class => "cancel confirm-delete",
:title => t('.delete'),
:method => :delete,
:confirm => t('message', :scope => 'shared.admin.delete', :title => post.title) %>
</span>
</li>

View file

@ -1 +0,0 @@
<%= render :partial => "form" %>

View file

@ -1,28 +0,0 @@
<%= render :partial => '/admin/blog/submenu' %>
<div id='records'>
<% if searching? %>
<h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
<% if @blog_posts.any? %>
<ul>
<%= render :partial => "post",
:collection => @blog_posts %>
</ul>
<% else %>
<p><%= t('no_results', :scope => 'shared.admin.search') %></p>
<% end %>
<% else %>
<% if @blog_posts.any? %>
<%= will_paginate @blog_posts %>
<%= render :partial => "sortable_list" %>
<%= will_paginate @blog_posts %>
<% else %>
<p>
<strong>
<%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.posts')) %>
</strong>
</p>
<% end %>
<% end %>
</div>

View file

@ -1 +0,0 @@
<%= render :partial => "form" %>

View file

@ -1,26 +0,0 @@
<%= render :partial => '/admin/blog/submenu' %>
<div id='records'>
<% if searching? %>
<h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
<% if @blog_posts.any? %>
<%= render :partial => "blog_posts",
:collection => @blog_posts %>
<% else %>
<p><%= t('search_no_results', :scope => 'admin') %></p>
<% end %>
<% else %>
<% if @blog_posts.any? %>
<%= will_paginate @blog_posts %>
<%= render :partial => "sortable_list" %>
<%= will_paginate @blog_posts %>
<% else %>
<p>
<strong>
<%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.posts')) %>
</strong>
</p>
<% end %>
<% end %>
</div>

View file

@ -1,21 +0,0 @@
<% content_for :body_content_title, @category.title %>
<% content_for :body_content_left do %>
<% if @blog_posts.any? %>
<section id="blog_posts">
<%= render :partial => "/blog/shared/post", :collection => @blog_posts %>
<%= will_paginate @blog_posts %>
</section>
<% else %>
<p>
<%= t('.no_posts') %>
</p>
<% end %>
<% end %>
<% content_for :body_content_right do %>
<%= render :partial => "/blog/shared/categories" %>
<% end %>
<%= render :partial => "/shared/content_page" %>
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>

View file

@ -1,11 +0,0 @@
<nav id="next_prev_article">
<% if @blog_post.next.present? -%>
<%= link_to (truncate(@blog_post.next.title) + " &#187;").html_safe, @blog_post.next, :class => 'next' %>
<% end -%>
<%= link_to t('blog_home', :scope => 'blog.posts.show'), blog_root_path, :class => 'home' %>
<% if @blog_post.prev.present? -%>
<%= link_to ("&#171; " + truncate(@blog_post.prev.title)).html_safe, @blog_post.prev, :class => 'prev' %>
<% end -%>
</nav><!-- /next_prev_article -->

View file

@ -1,31 +0,0 @@
<% flash.each do |key, value| %>
<div id='flash' class="flash flash_<%= key %>">
<%= value %>
</div>
<% end %>
<article id="blog_post">
<header>
<h1><%= @blog_post.title %></h1>
<section class='details'>
<time datetime="<%=l @blog_post.published_at.to_date, :format => :default %>" class='posted_at'>
<%= t('created_at', :scope => 'blog.shared.posts', :when => l(@blog_post.published_at.to_date, :format => :short)) %>
</time>
<%= "#{t('by', :scope => 'blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>.
<% if (categories = @blog_post.categories).any? %>
<aside class='filed_in'>
<%= t('filed_in', :scope => 'blog.posts.show') %>
<% categories.each_with_index do |category, index| %>
<%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %>
<% end %>
</aside>
<% end %>
</section>
</header>
<%= @blog_post.body.html_safe %>
<% if BlogPost::ShareThis.enabled? %>
<span class="st_sharethis" displayText="ShareThis"></span>
<% end %>
</article>
<%= render :partial => '/shared/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%>
<%= render 'nav' if next_or_previous?(@blog_post) %>

View file

@ -1,20 +0,0 @@
<% content_for :body_content_left do %>
<h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1>
<% if @blog_posts.any? %>
<section id="blog_posts">
<%= render :partial => "/blog/shared/post", :collection => @blog_posts %>
</section>
<% else %>
<p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p>
<% end %>
<% end %>
<% content_for :body_content_right do %>
<%= render :partial => "/blog/shared/categories" %>
<%= render :partial => "/blog/shared/tags" %>
<%= render :partial => "/blog/shared/rss_feed" %>
<%= blog_archive_list %>
<% end %>
<%= render :partial => "/shared/content_page" %>
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>

View file

@ -1,24 +0,0 @@
<% content_for :body_content_left do %>
<%=raw @page[Page.default_parts.first.to_sym] if Page.default_parts.any? %>
<% if @blog_posts.any? %>
<section id="blog_posts">
<%= render :partial => "/blog/shared/post", :collection => @blog_posts %>
<%= will_paginate @blog_posts %>
</section>
<% else %>
<p><%= t('.no_blog_articles_yet') %></p>
<% end %>
<% end %>
<% content_for :body_content_right do %>
<%=raw @page[Page.default_parts.second.to_sym] if Page.default_parts.many? %>
<%= render :partial => "/blog/shared/categories" %>
<%= render :partial => "/blog/shared/tags" %>
<%= render :partial => "/blog/shared/rss_feed" %>
<%= blog_archive_list %>
<% end %>
<%= render :partial => "/shared/content_page" %>
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>

View file

@ -1,17 +0,0 @@
xml.instruct! :xml, :version => "1.0"
xml.rss :version => "2.0" do
xml.channel do
xml.title RefinerySetting.find_or_set(:site_name, "Company Name")
xml.description RefinerySetting.find_or_set(:site_name, "Company Name") + " Blog Posts"
xml.link blog_root_url
@blog_posts.each do |post|
xml.item do
xml.title post.title
xml.description post.body
xml.pubDate post.published_at.to_s(:rfc822)
xml.link blog_post_url(post)
end
end
end
end

View file

@ -1,67 +0,0 @@
<% content_for :body_content_left do %>
<div id="show_blog_post">
<%= render 'post' %>
</div>
<% if BlogPost.comments_allowed? %>
<aside id="comments">
<h2><%= t('.comments.title') %></h2>
<% if (comments = @blog_post.comments.approved).any? %>
<%= render :partial => "comment", :collection => comments %>
<% else %>
<p>
<%= t('none', :scope => 'blog.shared.comments') %>.
</p>
<% end %>
<% flash.each do |key, value| %>
<div id='flash' class="flash flash_<%= key %>">
<%= value %>
</div>
<% end %>
<h2><%= t('.comments.add') %></h2>
<%= form_for [:blog_post, @blog_comment] do |f| %>
<%= render :partial => "/shared/admin/error_messages",
:locals => {
:object => f.object,
:include_object_name => true
} %>
<div class='field'>
<%= f.label :name %>
<%= f.text_field :name %>
</div>
<div class='field'>
<%= f.label :email %>
<%= f.email_field :email %>
</div>
<div class='field message_field'>
<%= f.label :message %>
<%= f.text_area :message, :rows => 6 %>
</div>
<div class='field form-actions'>
<%= f.submit t('.submit') %>
</div>
<% end %>
</aside>
<% end %>
<% end %>
<% content_for :body_content_right do %>
<%= render :partial => "/blog/shared/categories" %>
<%= render :partial => "/blog/shared/tags" %>
<%= render :partial => "/blog/shared/posts" %>
<%= render :partial => "/blog/shared/rss_feed" %>
<%= blog_archive_list %>
<% end %>
<%= render :partial => "/shared/content_page", :locals => { :remove_automatic_sections => true } %>
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
<% content_for :before_javascript_libraries, jquery_include_tags(:jquery_ui => false) %>
<% content_for :javascripts do %>
<%# enable AJAX'd post nav at your own risk until html5 history API implemented. %>
<%#= javascript_include_tag('refinerycms-blog') %>
<script src="http://w.sharethis.com/button/buttons.js"></script>
<script>stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});</script>
<% end if BlogPost::ShareThis.enabled? %>

View file

@ -1,22 +0,0 @@
<% content_for :body_content_title, "#{t('.posts_tagged')} &#8220;#{@tag_name.titleize}&#8221;".html_safe -%>
<% content_for :body_content_left do %>
<% if @blog_posts.any? %>
<section id="blog_posts">
<%= render :partial => "/blog/shared/post", :collection => @blog_posts %>
<%= will_paginate @blog_posts %>
</section>
<% else %>
<p><%= t('.no_blog_articles_yet') %></p>
<% end %>
<% end %>
<% content_for :body_content_right do %>
<%= render :partial => "/blog/shared/categories" %>
<%= render :partial => "/blog/shared/tags" %>
<%= render :partial => "/blog/shared/rss_feed" %>
<%= blog_archive_list %>
<% end %>
<%= render :partial => "/shared/content_page" %>
<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>

View file

@ -1,46 +0,0 @@
<% if post.live? %>
<article class="blog_post" id="<%= dom_id(post) %>">
<header>
<h1><%= link_to post.title, blog_post_url(post) %></h1>
<section class='details'>
<time datetime="<%=l post.published_at.to_date, :format => :default %>" class='posted_at'>
<%= t('created_at', :scope => 'blog.shared.posts', :when => l(post.published_at.to_date, :format => :short)) %>
</time>
<%= "#{t('by', :scope => 'blog.posts.show')} #{post.author.username}" if post.author.present? %>.
<% if (categories = post.categories).any? %>
<aside class='filed_in'>
<%= t('filed_in', :scope => 'blog.posts.show') %>
<%=raw categories.collect { |category| link_to category.title, blog_category_url(category) }.to_sentence %>
</aside>
<% end %>
<% if (tags = post.tags).any? %>
<aside class='tagged'>
<%= t('tagged', :scope => 'blog.posts.show') %>
<%=raw tags.collect { |tag| link_to tag, tagged_posts_path(tag.id, tag.name.parameterize) }.to_sentence %>
</aside>
<% end %>
</section>
</header>
<section class='clearfix'>
<% if blog_post_teaser_enabled? %>
<%= blog_post_teaser(post) %>
<% else %>
<%= post.body.html_safe %>
<% end %>
</section>
<footer>
<p>
<%= link_to t('read_more', :scope => 'blog.shared.posts'), blog_post_url(post) if blog_post_teaser_enabled? %>
</p>
<aside class='comment_count'>
<% if BlogPost.comments_allowed? %>
<% if post.comments.any? %>
(<%= pluralize(post.comments.approved.count, t('singular', :scope => 'blog.shared.comments')) %>)
<% else %>
(<%= t('none', :scope => 'blog.shared.comments') %>)
<% end %>
<% end %>
</aside>
</footer>
</article>
<% end %>

View file

@ -1,10 +0,0 @@
<% if @blog_posts.many? %>
<h2><%= t('.other') %></h2>
<ul id="blog_posts">
<% @blog_posts.each do |blog_post| %>
<li class='clearfix'>
<%= link_to blog_post.title, blog_post_url(blog_post) %>
</li>
<% end %>
</ul>
<% end %>

View file

@ -1,2 +0,0 @@
<h2><%= t('.title') %></h2>
<%= link_to t('.subscribe'), blog_rss_feed_url, :id => "rss_feed_subscribe"%>

View file

@ -1,9 +1,9 @@
<nav id='actions' class='multilist'>
<ul class='search_list'>
<li class='not_a_link'>
<%= render :partial => "/shared/admin/search",
<%= render :partial => "/refinery/admin/search",
:locals => {
:url => admin_blog_posts_url
:url => refinery.blog_admin_posts_path
} %>
</li>
</ul>
@ -14,23 +14,23 @@
:class => 'page_copy_icon' %>
</li>
<li>
<%= link_to t('.posts.manage'), admin_blog_posts_path,
<%= link_to t('.posts.manage'), refinery.blog_admin_posts_path,
:class => 'page_icon' %>
</li>
<li>
<%= link_to t('.posts.uncategorized'), uncategorized_admin_blog_posts_url,
<%= link_to t('.posts.uncategorized'), refinery.uncategorized_blog_admin_posts_path,
:class => 'page_icon' %>
</li>
<li>
<%= link_to t('.posts.new'), new_admin_blog_post_url,
<%= link_to t('.posts.new'), refinery.new_blog_admin_post_path,
:class => 'page_add_icon' %>
</li>
</ul>
<% if BlogPost.comments_allowed? %>
<% if Refinery::Blog::Post.comments_allowed? %>
<ul class='collapsible_menu'>
<li class='not_a_link'>
<% if BlogComment.unmoderated.any? %>
<% title = t('.comments.title_with_count', :new_count => BlogComment.unmoderated.size) %>
<% if Refinery::Blog::Comment.unmoderated.any? %>
<% title = t('.comments.title_with_count', :new_count => Refinery::Blog::Comment.unmoderated.size) %>
<% else %>
<% title = t('.comments.title') %>
<% end %>
@ -38,15 +38,15 @@
:class => 'comments_icon' %>
</li>
<li>
<%= link_to t('.comments.new'), admin_blog_comments_path,
<%= link_to t('.comments.new'), refinery.blog_admin_comments_path,
:class => 'comment_icon' %>
</li>
<li>
<%= link_to t('.comments.approved'), approved_admin_blog_comments_path,
<%= link_to t('.comments.approved'), refinery.approved_blog_admin_comments_path,
:class => 'comment_tick_icon' %>
</li>
<li>
<%= link_to t('.comments.rejected'), rejected_admin_blog_comments_path,
<%= link_to t('.comments.rejected'), refinery.rejected_blog_admin_comments_path,
:class => 'comment_cross_icon' %>
</li>
</ul>
@ -58,39 +58,39 @@
:class => 'folder_icon' %>
</li>
<li>
<%= link_to t('.categories.manage'), admin_blog_categories_url,
<%= link_to t('.categories.manage'), refinery.blog_admin_categories_path,
:class => 'folder_edit_icon' %>
</li>
<li>
<%= link_to t('.categories.new'), new_admin_blog_category_url(:dialog => true, :height => 325),
<%= link_to t('.categories.new'), refinery.new_blog_admin_category_path,
:class => 'folder_add_icon' %>
</li>
</ul>
<ul class='collapsible_menu'>
<li class='not_a_link'>
<%= link_to t('.settings.title'), admin_blog_settings_path,
<%= link_to t('.settings.title'), refinery.blog_admin_settings_path,
:class => 'settings_icon' %>
</li>
<li>
<%= link_to t('.settings.comments'), comments_admin_blog_settings_url,
:class => "#{BlogPost.comments_allowed? ? 'success' : 'failure'}_icon" %>
<%= link_to t('.settings.comments'), refinery.comments_blog_admin_settings_path,
:class => "#{Refinery::Blog::Post.comments_allowed? ? 'success' : 'failure'}_icon" %>
</li>
<li>
<%= link_to t('.settings.moderation'), moderation_admin_blog_settings_url,
:class => "#{BlogComment::Moderation.enabled? ? 'success' : 'failure'}_icon" %>
<%= link_to t('.settings.moderation'), refinery.moderation_blog_admin_settings_path,
:class => "#{Refinery::Blog::Comment::Moderation.enabled? ? 'success' : 'failure'}_icon" %>
</li>
<li>
<%= link_to t('.settings.update_notified'),
notification_recipients_admin_blog_settings_url(:dialog => true, :height => 400),
refinery.notification_recipients_blog_admin_settings_path(:dialog => true, :height => 400),
:class => 'user_comment_icon' %>
</li>
<li>
<%= link_to t('.settings.teasers'),
teasers_admin_blog_settings_url, :class => "#{BlogPost.teasers_enabled? ? 'success' : 'failure'}_icon" %>
refinery.teasers_blog_admin_settings_path, :class => "#{Refinery::Blog::Post.teasers_enabled? ? 'success' : 'failure'}_icon" %>
</li>
</ul>
</nav>
<% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog')%>
<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/backend') %>

View file

@ -5,12 +5,12 @@
</span>
<span class='actions'>
<%= link_to refinery_icon_tag("application_edit.png"),
edit_admin_blog_category_path(category, :dialog => true, :height => 325),
refinery.edit_blog_admin_category_path(category, :dialog => true, :height => 325),
:title => t('.edit') %>
<%= link_to refinery_icon_tag("delete.png"), admin_blog_category_path(category),
<%= link_to refinery_icon_tag("delete.png"), refinery.blog_admin_category_path(category),
:class => "cancel confirm-delete",
:title => t('.delete'),
:method => :delete,
:confirm => t('message', :scope => 'shared.admin.delete', :title => category.title) %>
:confirm => t('message', :scope => 'refinery.admin.delete', :title => category.title) %>
</span>
</li>

Some files were not shown because too many files have changed in this diff Show more