Compare commits

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

36 commits

Author SHA1 Message Date
Philip Arndt
0d9394dacd Regenerate the gemspec 2012-01-19 11:39:04 +13:00
Joe Sak
2d4e9085eb Merge pull request #176 from philtr/master
Fix pop culture reference
2012-01-18 08:57:29 -08:00
Phillip Ridlen
0f4d976f34 Fix pop culture reference.
The red pill is the adventurous one.
2012-01-18 09:58:39 -06:00
Uģis Ozols
dda07a7fab Revert "fix seeds to use correct config"
This reverts commit a0ec115272.
2012-01-04 08:32:50 +02:00
Uģis Ozols
e26d53bee4 Merge pull request #163 from dmoose/master
update db seeds
2011-12-28 22:45:57 -08:00
Jeff Shumate
a0ec115272 fix seeds to use correct config 2011-12-28 23:10:14 -07:00
Philip Arndt
31bb972db9 Regenerated gemspec, removed lock file from gemspec. 2011-12-22 14:03:37 +13:00
Uģis Ozols
09d919d1b7 Merge pull request #161 from 1ukash/master
Some localization strings for russian locale
2011-12-21 10:42:27 -08:00
Alexey A. Lukashin
6884642093 Added missed localization strings 2011-12-21 19:09:32 +01:00
Philip Arndt
58b87c9e1a Merge pull request #160 from halan/master
Some  pt-BR i18n (my language.. :p )
2011-12-16 15:49:12 -08:00
Halan Pinheiro
01a10f5266 Added some pt-BR i18n on post form 2011-12-16 20:40:01 -03:00
Uģis Ozols
7ad876b8a5 Merge pull request #155 from pcantrell/master
Fixed avatar_url
2011-12-11 23:40:43 -08:00
Paul Cantrell
d3a914261a Changed back to 1.8 hash syntax. 2011-12-11 21:19:29 -06:00
pcantrell
6a5afeaa19 Fixed avatar_url so it (1) uses the correct Gravatar URL syntax, (2) actually respects the :size option, and (3) supports a custom default image. 2011-12-09 20:36:51 -06: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
21 changed files with 135 additions and 65 deletions

4
.gitignore vendored
View file

@ -42,3 +42,7 @@ nbproject
# Capybara Bug
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
def blog_archive_list
posts = BlogPost.select('published_at').all_previous
posts = BlogPost.live.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>'
html = ''
links = []
super_old_links = []
@ -20,7 +18,7 @@ module BlogPostsHelper
links.each do |l|
year = l.split('/')[1]
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})"
html << "<li>"
html << link_to(text, archive_blog_posts_path(:year => year, :month => month))
@ -28,13 +26,12 @@ module BlogPostsHelper
end
super_old_links.each do |l|
year = l.split('/')[1]
count = BlogPost.by_year(Time.parse(l)).size
count = BlogPost.live.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

View file

@ -20,10 +20,16 @@ class BlogComment < ActiveRecord::Base
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"
params = {
:s => options[:size] || 60,
:d => options[:default_image]
}
query_string = params.map do |k,v|
[k,v].map { |s| CGI::escape(s.to_s) }.join('=')
end.join('&')
email_md5 = Digest::MD5.hexdigest(self.email.to_s.strip.downcase)
"http://gravatar.com/avatar/#{email_md5}?#{query_string}"
end
def approve!

View file

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

View file

@ -6,6 +6,9 @@
<%= " by #{post.author.username}" if post.author.present? %>
</span>
</span>
<% if post.draft? %>
<span class="label notice">Draft</span>
<% end %>
<span class='actions'>
<%= link_to refinery_icon_tag("application_go.png"), blog_post_url(post),
: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/tags" %>
<%= render :partial => "/blog/shared/rss_feed" %>
<%= blog_archive_list %>
<%= render :partial => "/blog/shared/archive_list" %>
<% end %>
<%= render :partial => "/shared/content_page" %>

View file

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

View file

@ -1,6 +1,37 @@
<% content_for :body_content_left do %>
<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>
<% if BlogPost.comments_allowed? %>
@ -50,9 +81,9 @@
<% 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/related_posts" %>
<%= render :partial => "/blog/shared/rss_feed" %>
<%= blog_archive_list %>
<%= render :partial => "/blog/shared/archive_list" %>
<% end %>
<%= 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/tags" %>
<%= render :partial => "/blog/shared/rss_feed" %>
<%= blog_archive_list %>
<%= render :partial => "/blog/shared/archive_list" %>
<% end %>
<%= 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)
* 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]
* 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 bug fixed [ruprict](https://github.com/ruprict)
* 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]
* 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)
* [See full list](https://github.com/resolve/refinerycms-blog/compare/1.6...1.6.1)
## 1.6 [20 June 2011]
* Category bug fixes and cleanup [wikyd](https://github.com/wikyd)
@ -20,11 +33,14 @@
* More testing [wakeless](https://github.com/wakeless)
* Tag list autocomplete baked in [joemsak](https://github.com/joemsak)
* 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]
* Added Gravatar support. [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]
@ -66,4 +82,4 @@
* Rails 3 Support
* Archives
* Categories
* [See full list](https://github.com/resolve/refinerycms-blog/compare/1.0...1.1)
* [See full list](https://github.com/resolve/refinerycms-blog/compare/1.0...1.1)

View file

@ -46,6 +46,10 @@ pt-BR:
toggle_advanced_options: Clique aqui para acessar as configurações de meta tag e menu
save_as_draft: Salvar como rascunho
published_at: Data de publicação
custom_url: Url customizada
custom_url_help: Gere a url para o post do blog a partir dessa ao invés de utilizar o título
copy_body: Copiar o Corpo do post para o Teaser
copy_body_helper: Copiar o corpo do post para o teaser. Deixe o teaser em branco para deixar o Refinery fazer o teaser automaticamente.
index:
no_items_yet: 'Ainda não há Posts no Blog. Clique em "%{create}" para adicionar o primeiro post.'
uncategorized:
@ -83,6 +87,7 @@ pt-BR:
moderation: Moderação
update_notified: Quem receberá a notificação?
comments: Comentários
teasers: Teasers
blog:
comment_mailer:
notification:

View file

@ -101,6 +101,8 @@ ru:
singular: комментарий
none: нет комментариев
archives: Архивы
tags:
title: "Теги"
categories:
show:
no_posts: Записей пока нет.
@ -122,7 +124,12 @@ ru:
add: Написать комментарий
other: Другие записи
filed_in: Категория
tagged: Теги
submit: Отправить комментарий
name: Имя
email: Email
message: Сообщение
by: Автор
archive:
blog_archive_for: 'Архив %{date}'
no_blog_articles_posted: 'Ни одной записи за %{date} не опубликовано. Следите за новостями.'

View file

@ -30,7 +30,7 @@ class CreateBlogStructure < ActiveRecord::Migration
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_post_id
end

View file

@ -2,7 +2,7 @@
require File.expand_path('../refinery/blog/version', __FILE__)
version = ::Refinery::Blog::Version.to_s
raise "Could not get version so gemspec can not be built" if version.nil?
files = Dir.glob("**/*").flatten.reject{|f| f =~ %r{.gem$}}
files = Dir.glob("**/*").flatten.reject{|f| f =~ %r{.(gem|lock)$}}
gemspec = <<EOF
Gem::Specification.new do |s|

View file

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

View file

@ -12,12 +12,23 @@ Options:
## Requirements
Refinery CMS version 1.0.0 or above.
Your Rails 3 application should not be called "blog"
## Install
Open up your ``Gemfile`` and add at the bottom this line:
gem 'refinerycms-blog', '~> 1.6.1'
# You now have two options:
## Take the blue pill and stay on 1.7.x
gem 'refinerycms-blog', '~> 1.7.0'
## Take the red pill and head up to 1.8.x
## Where the previous shared/_post.html.erb partial was moved directly into show.html.erb
## *MEANING:* If you depend on that partial, you'll have to check the changes and merge your customizations back in!
gem 'refinerycms-blog', '~> 1.8.0'
Now, run ``bundle install``
@ -27,4 +38,4 @@ Next, to install the blog plugin run:
Finally migrate your database and you're done.
rake db:migrate
rake db:migrate

View file

@ -1,8 +1,8 @@
Gem::Specification.new do |s|
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.date = %q{2011-06-29}
s.date = %q{2012-01-19}
s.summary = %q{Ruby on Rails blogging engine for RefineryCMS.}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com/blog}
@ -81,16 +81,16 @@ Gem::Specification.new do |s|
app/views/blog/posts
app/views/blog/posts/_comment.html.erb
app/views/blog/posts/_nav.html.erb
app/views/blog/posts/_post.html.erb
app/views/blog/posts/archive.html.erb
app/views/blog/posts/index.html.erb
app/views/blog/posts/index.rss.builder
app/views/blog/posts/show.html.erb
app/views/blog/posts/tagged.html.erb
app/views/blog/shared
app/views/blog/shared/_archive_list.html.erb
app/views/blog/shared/_categories.html.erb
app/views/blog/shared/_post.html.erb
app/views/blog/shared/_posts.html.erb
app/views/blog/shared/_related_posts.html.erb
app/views/blog/shared/_rss_feed.html.erb
app/views/blog/shared/_tags.html.erb
app/views/shared
@ -99,12 +99,14 @@ Gem::Specification.new do |s|
changelog.md
config
config/locales
config/locales/bg.yml
config/locales/cs.yml
config/locales/de.yml
config/locales/en.yml
config/locales/es.yml
config/locales/fr.yml
config/locales/it.yml
config/locales/ja.yml
config/locales/nb.yml
config/locales/nl.yml
config/locales/pl.yml
@ -122,6 +124,7 @@ Gem::Specification.new do |s|
db/migrate/5_add_cached_slugs.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/8_add_primary_key_to_categorizations.rb
db/seeds
db/seeds/refinerycms_blog.rb
features
@ -138,6 +141,7 @@ Gem::Specification.new do |s|
features/support/step_definitions/category_steps.rb
features/support/step_definitions/tags_steps.rb
features/tags.feature
Gemfile
lib
lib/gemspec.rb
lib/generators
@ -197,6 +201,7 @@ Gem::Specification.new do |s|
spec/models/blog_category_spec.rb
spec/models/blog_comment_spec.rb
spec/models/blog_post_spec.rb
todo.md
)
end