Compare commits

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

23 commits

Author SHA1 Message Date
Philip Arndt
4a3c61f046 I think telling the user to lock to a x.x.0 is sufficient 2011-12-08 10:05:35 -08:00
Joe Sak
2bff0b207f Bump to 1.8.0, update README and Changelog with warnings about changes 2011-12-08 12:02:17 -06:00
Joe Sak
5efcadcc80 Merge pull request #154 from neotericdesign/refactor-post
Refactor post
2011-12-08 09:54:09 -08:00
Nic Haynes
5c78c38e98 Move Draft checkbox under title for better usability 2011-12-08 11:36:28 -06:00
Nic Haynes
57619d6993 Fix archive partial 2011-12-08 11:35:57 -06:00
Nic Haynes
9840c56b40 Add draft UI label in index 2011-12-08 11:01:08 -06:00
Nic Haynes
7d8588dfd2 Refactor archive helper
Now returns a list in an li instead of full markup
2011-12-08 10:48:11 -06:00
Nic Haynes
f3d32c1ac5 Rename posts partial to related posts 2011-12-08 10:47:55 -06:00
Philip Arndt
8ca270774f Revert "Add development_dependency "rake" for travis-ci"
This reverts commit 92ed22cce2.
2011-12-05 13:52:53 -08:00
Philip Arndt
2ed293f74a Only rails-3-1 for testing pls travis. 2011-12-05 13:51:52 -08:00
Joe Sak
5ab4ef464b Add travis yml for 1.9.2 ruby 2011-12-05 15:20:30 -06:00
Joe Sak
92ed22cce2 Add development_dependency "rake" for travis-ci 2011-12-05 14:57:06 -06:00
Joe Sak
22f398c724 Update changelog.md 2011-12-05 14:19:06 -06:00
Philip Arndt
b1d05554d6 Regenerated gemspec for 1.7.0 2011-12-05 12:15:27 -08:00
Philip Arndt
8b4be5638b Ensure we ignore future files in this branch. 2011-11-15 11:34:07 +13:00
Joe Sak
d9387e32c3 Version bump: 1.7.0 2011-11-14 16:28:38 -06:00
Joe Sak
81bf46cd7a Changelog update 2011-11-11 15:14:35 -06:00
Joe Sak
62c525e424 Merge pull request #152 from jgrevich/master
live scope in blog_archive_list helper method
2011-11-11 13:13:21 -08:00
Joe Sak
eb160aa354 1.6.3 bump 2011-11-11 14:20:59 -06:00
Joe Sak
d5fadb4523 Updated the changelog with 1.6.3 details + full list links between all releases 2011-11-11 14:19:00 -06:00
Justin Grevich
c761572593 use live scope in blog_archive_list helper method to prevent counting of draft posts 2011-11-11 11:07:32 -08:00
Joe Sak
329d54bdf0 Merge pull request #149 from alexmarles/master
Rails 3 application should not be called "blog"
2011-11-10 08:15:39 -08:00
Àlex
49404806ab Added Rails 3 name app requirement 2011-11-10 16:34:51 +01:00
17 changed files with 102 additions and 59 deletions

4
.gitignore vendored
View file

@ -42,3 +42,7 @@ nbproject
# Capybara Bug # Capybara Bug
capybara-*html capybara-*html
# Future stuff
Gemfile.lock
spec/dummy

5
.travis.yml Normal file
View file

@ -0,0 +1,5 @@
rvm:
- 1.9.2
branches:
only:
- rails-3-1

View file

@ -1,10 +1,8 @@
module BlogPostsHelper module BlogPostsHelper
def blog_archive_list def blog_archive_list
posts = BlogPost.select('published_at').all_previous posts = BlogPost.live.select('published_at').all_previous
return nil if posts.blank? return nil if posts.blank?
html = '<section id="blog_archive_list"><h2>' html = ''
html << t('archives', :scope => 'blog.shared')
html << '</h2><nav><ul>'
links = [] links = []
super_old_links = [] super_old_links = []
@ -20,7 +18,7 @@ module BlogPostsHelper
links.each do |l| links.each do |l|
year = l.split('/')[1] year = l.split('/')[1]
month = l.split('/')[0] month = l.split('/')[0]
count = BlogPost.by_archive(Time.parse(l)).size count = BlogPost.live.by_archive(Time.parse(l)).size
text = t("date.month_names")[month.to_i] + " #{year} (#{count})" text = t("date.month_names")[month.to_i] + " #{year} (#{count})"
html << "<li>" html << "<li>"
html << link_to(text, archive_blog_posts_path(:year => year, :month => month)) html << link_to(text, archive_blog_posts_path(:year => year, :month => month))
@ -28,13 +26,12 @@ module BlogPostsHelper
end end
super_old_links.each do |l| super_old_links.each do |l|
year = l.split('/')[1] year = l.split('/')[1]
count = BlogPost.by_year(Time.parse(l)).size count = BlogPost.live.by_year(Time.parse(l)).size
text = "#{year} (#{count})" text = "#{year} (#{count})"
html << "<li>" html << "<li>"
html << link_to(text, archive_blog_posts_path(:year => year)) html << link_to(text, archive_blog_posts_path(:year => year))
html << "</li>" html << "</li>"
end end
html << '</ul></nav></section>'
html.html_safe html.html_safe
end end

View file

@ -9,7 +9,12 @@
<%= f.label :title -%> <%= f.label :title -%>
<%= f.text_field :title, :class => 'larger widest' -%> <%= f.text_field :title, :class => 'larger widest' -%>
</div> </div>
<div class="field">
<p>
<%= f.check_box :draft %>
<%= f.label :draft, t('.save_as_draft'), :class => "stripped" %>
</p>
</div>
<div class='field'> <div class='field'>
<div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'> <div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'>
<ul id='page_parts'> <ul id='page_parts'>
@ -59,10 +64,7 @@
:id => 'toggle_advanced_options', :id => 'toggle_advanced_options',
:title => t('.toggle_advanced_options') %> :title => t('.toggle_advanced_options') %>
</p> </p>
<span id='draft_field'>
<%= f.check_box :draft %>
<%= f.label :draft, t('.save_as_draft'), :class => "stripped" %>
</span>
</div> </div>
<div id='more_options' style="display:none;"> <div id='more_options' style="display:none;">
<div class="hemisquare"> <div class="hemisquare">

View file

@ -6,6 +6,9 @@
<%= " by #{post.author.username}" if post.author.present? %> <%= " by #{post.author.username}" if post.author.present? %>
</span> </span>
</span> </span>
<% if post.draft? %>
<span class="label notice">Draft</span>
<% end %>
<span class='actions'> <span class='actions'>
<%= link_to refinery_icon_tag("application_go.png"), blog_post_url(post), <%= link_to refinery_icon_tag("application_go.png"), blog_post_url(post),
:title => t('.view_live_html'), :title => t('.view_live_html'),

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

@ -13,7 +13,7 @@
<%= render :partial => "/blog/shared/categories" %> <%= render :partial => "/blog/shared/categories" %>
<%= render :partial => "/blog/shared/tags" %> <%= render :partial => "/blog/shared/tags" %>
<%= render :partial => "/blog/shared/rss_feed" %> <%= render :partial => "/blog/shared/rss_feed" %>
<%= blog_archive_list %> <%= render :partial => "/blog/shared/archive_list" %>
<% end %> <% end %>
<%= render :partial => "/shared/content_page" %> <%= render :partial => "/shared/content_page" %>

View file

@ -17,7 +17,7 @@
<%= render :partial => "/blog/shared/categories" %> <%= render :partial => "/blog/shared/categories" %>
<%= render :partial => "/blog/shared/tags" %> <%= render :partial => "/blog/shared/tags" %>
<%= render :partial => "/blog/shared/rss_feed" %> <%= render :partial => "/blog/shared/rss_feed" %>
<%= blog_archive_list %> <%= render :partial => "/blog/shared/archive_list" %>
<% end %> <% end %>
<%= render :partial => "/shared/content_page" %> <%= render :partial => "/shared/content_page" %>

View file

@ -1,6 +1,37 @@
<% content_for :body_content_left do %> <% content_for :body_content_left do %>
<div id="show_blog_post"> <div id="show_blog_post">
<%= render 'post' %> <% 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) %>
</div> </div>
<% if BlogPost.comments_allowed? %> <% if BlogPost.comments_allowed? %>
@ -50,9 +81,9 @@
<% content_for :body_content_right do %> <% content_for :body_content_right do %>
<%= render :partial => "/blog/shared/categories" %> <%= render :partial => "/blog/shared/categories" %>
<%= render :partial => "/blog/shared/tags" %> <%= render :partial => "/blog/shared/tags" %>
<%= render :partial => "/blog/shared/posts" %> <%= render :partial => "/blog/shared/related_posts" %>
<%= render :partial => "/blog/shared/rss_feed" %> <%= render :partial => "/blog/shared/rss_feed" %>
<%= blog_archive_list %> <%= render :partial => "/blog/shared/archive_list" %>
<% end %> <% end %>
<%= render :partial => "/shared/content_page", :locals => { :remove_automatic_sections => true } %> <%= render :partial => "/shared/content_page", :locals => { :remove_automatic_sections => true } %>

View file

@ -15,7 +15,7 @@
<%= render :partial => "/blog/shared/categories" %> <%= render :partial => "/blog/shared/categories" %>
<%= render :partial => "/blog/shared/tags" %> <%= render :partial => "/blog/shared/tags" %>
<%= render :partial => "/blog/shared/rss_feed" %> <%= render :partial => "/blog/shared/rss_feed" %>
<%= blog_archive_list %> <%= render :partial => "/blog/shared/archive_list" %>
<% end %> <% end %>
<%= render :partial => "/shared/content_page" %> <%= render :partial => "/shared/content_page" %>

View file

@ -0,0 +1,9 @@
<%
archive_posts = blog_archive_list
%>
<% if archive_posts.present? %>
<h2><%= t('archives', :scope => 'blog.shared') %></h2>
<ul>
<%= archive_posts %>
</ul>
<% end %>

View file

@ -1,16 +1,29 @@
## 1.6.3 [UNRELEASED] ## 1.8.0 [UNRELEASED]
* extraneous shared/_post partial was moved directly into posts/show [nicinabox](https://github.com/nicinabox)
* blog archive list helper logic refactored (HTML exists in view template) [nicinabox](https://github.com/nicinabox)
* pretty "Draft" label added to admin list of blog posts [nicinabox](https://github.com/nicinabox)
* [See full list](https://github.com/resolve/refinerycms-blog/compare/1.7.0...1.8.0)
## 1.7.0 [05 December 2011]
* Bulgarian translations [mirosr](https://github.com/mirosr) * Bulgarian translations [mirosr](https://github.com/mirosr)
* posts/tagged... params[:tag_name] is optional [joemsak](https://github.com/joemsak) * posts/tagged... params[:tag_name] is optional [joemsak](https://github.com/joemsak)
* Bug Fix on Categorization relationship: destroying a post produced error because no primary key existed on join table [joemsak](https://github.com/joemsak)
* Bug fix on archive listing, don't include draft posts [jgrevich](https://github.com/jgrevich)
* [See full list](https://github.com/resolve/refinerycms-blog/compare/1.6.2...1.7.0)
## 1.6.2 [29 June 2011] ## 1.6.2 [29 June 2011]
* Custom teaser field to overwrite the automatic truncation of the body [wikyd](https://github.com/wikyd) * Custom teaser field to overwrite the automatic truncation of the body [wikyd](https://github.com/wikyd)
* Tagging URL strategy updated again [joemsak](https://github.com/joemsak) * Tagging URL strategy updated again [joemsak](https://github.com/joemsak)
* Tagging bug fixed [ruprict](https://github.com/ruprict) * Tagging bug fixed [ruprict](https://github.com/ruprict)
* Refactored specs [parndt](https://github.com/parndt) * Refactored specs [parndt](https://github.com/parndt)
* * [See full list](https://github.com/resolve/refinerycms-blog/compare/1.6.1...1.6.2)
## 1.6.1 [21 June 2011] ## 1.6.1 [21 June 2011]
* Tagging URL strategy updated for reliability /blog/posts/tagged/ID-name-parameterized [joemsak](https://github.com/joemsak) * Tagging URL strategy updated for reliability /blog/posts/tagged/ID-name-parameterized [joemsak](https://github.com/joemsak)
* Heroku/PostgreSQL support for autocomplete tags [joemsak](https://github.com/joemsak) * Heroku/PostgreSQL support for autocomplete tags [joemsak](https://github.com/joemsak)
* [See full list](https://github.com/resolve/refinerycms-blog/compare/1.6...1.6.1)
## 1.6 [20 June 2011] ## 1.6 [20 June 2011]
* Category bug fixes and cleanup [wikyd](https://github.com/wikyd) * Category bug fixes and cleanup [wikyd](https://github.com/wikyd)
@ -20,11 +33,14 @@
* More testing [wakeless](https://github.com/wakeless) * More testing [wakeless](https://github.com/wakeless)
* Tag list autocomplete baked in [joemsak](https://github.com/joemsak) * Tag list autocomplete baked in [joemsak](https://github.com/joemsak)
* Customize the URL of your blog post [wikyd](https://github.com/wikyd) * Customize the URL of your blog post [wikyd](https://github.com/wikyd)
* [See full list](https://github.com/resolve/refinerycms-blog/compare/1.5...1.6)
## 1.5 [28 May 2011] ## 1.5 [28 May 2011]
* Added Gravatar support. [parndt](https://github.com/parndt) * Added Gravatar support. [parndt](https://github.com/parndt)
* Added support for Refinery CMS 1.0.0 and above. [parndt](https://github.com/parndt) * Added support for Refinery CMS 1.0.0 and above. [parndt](https://github.com/parndt)
* [See full list](https://github.com/resolve/refinerycms-blog/compare/1.4...1.5)
## 1.4 [26 May 2011] ## 1.4 [26 May 2011]

View file

@ -30,7 +30,7 @@ class CreateBlogStructure < ActiveRecord::Migration
add_index :blog_categories, :id add_index :blog_categories, :id
create_table :blog_categories_blog_posts, :id => true do |t| create_table :blog_categories_blog_posts, :id => false do |t|
t.integer :blog_category_id t.integer :blog_category_id
t.integer :blog_post_id t.integer :blog_post_id
end end

View file

@ -2,8 +2,8 @@ module Refinery
module Blog module Blog
class Version class Version
@major = 1 @major = 1
@minor = 6 @minor = 8
@tiny = 2 @tiny = 0
class << self class << self
attr_reader :major, :minor, :tiny attr_reader :major, :minor, :tiny

View file

@ -12,12 +12,13 @@ Options:
## Requirements ## Requirements
Refinery CMS version 1.0.0 or above. Refinery CMS version 1.0.0 or above.
Your Rails 3 application should not be called "blog"
## Install ## Install
Open up your ``Gemfile`` and add at the bottom this line: Open up your ``Gemfile`` and add at the bottom this line:
gem 'refinerycms-blog', '~> 1.6.1' gem 'refinerycms-blog', '~> 1.8.0'
Now, run ``bundle install`` Now, run ``bundle install``

View file

@ -1,8 +1,8 @@
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = %q{refinerycms-blog} s.name = %q{refinerycms-blog}
s.version = %q{1.6.2} s.version = %q{1.8.0}
s.description = %q{A really straightforward open source Ruby on Rails blog engine designed for integration with RefineryCMS.} s.description = %q{A really straightforward open source Ruby on Rails blog engine designed for integration with RefineryCMS.}
s.date = %q{2011-06-29} s.date = %q{2011-12-08}
s.summary = %q{Ruby on Rails blogging engine for RefineryCMS.} s.summary = %q{Ruby on Rails blogging engine for RefineryCMS.}
s.email = %q{info@refinerycms.com} s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com/blog} s.homepage = %q{http://refinerycms.com/blog}
@ -99,12 +99,14 @@ Gem::Specification.new do |s|
changelog.md changelog.md
config config
config/locales config/locales
config/locales/bg.yml
config/locales/cs.yml config/locales/cs.yml
config/locales/de.yml config/locales/de.yml
config/locales/en.yml config/locales/en.yml
config/locales/es.yml config/locales/es.yml
config/locales/fr.yml config/locales/fr.yml
config/locales/it.yml config/locales/it.yml
config/locales/ja.yml
config/locales/nb.yml config/locales/nb.yml
config/locales/nl.yml config/locales/nl.yml
config/locales/pl.yml config/locales/pl.yml
@ -122,6 +124,7 @@ Gem::Specification.new do |s|
db/migrate/5_add_cached_slugs.rb db/migrate/5_add_cached_slugs.rb
db/migrate/6_add_custom_url_field_to_blog_posts.rb db/migrate/6_add_custom_url_field_to_blog_posts.rb
db/migrate/7_add_custom_teaser_field_to_blog_posts.rb db/migrate/7_add_custom_teaser_field_to_blog_posts.rb
db/migrate/8_add_primary_key_to_categorizations.rb
db/seeds db/seeds
db/seeds/refinerycms_blog.rb db/seeds/refinerycms_blog.rb
features features
@ -138,6 +141,8 @@ Gem::Specification.new do |s|
features/support/step_definitions/category_steps.rb features/support/step_definitions/category_steps.rb
features/support/step_definitions/tags_steps.rb features/support/step_definitions/tags_steps.rb
features/tags.feature features/tags.feature
Gemfile
Gemfile.lock
lib lib
lib/gemspec.rb lib/gemspec.rb
lib/generators lib/generators
@ -197,6 +202,7 @@ Gem::Specification.new do |s|
spec/models/blog_category_spec.rb spec/models/blog_category_spec.rb
spec/models/blog_comment_spec.rb spec/models/blog_comment_spec.rb
spec/models/blog_post_spec.rb spec/models/blog_post_spec.rb
todo.md
) )
end end