From 32bc0bb0e3adb0a3ce025724b51b7d413a554e27 Mon Sep 17 00:00:00 2001 From: Patrick Davey Date: Thu, 17 Oct 2013 08:55:13 +1300 Subject: Restricting tags to live posts --- app/helpers/refinery/blog/controller_helper.rb | 2 +- .../refinery/blog/controller_helper_spec.rb | 25 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 spec/helpers/refinery/blog/controller_helper_spec.rb diff --git a/app/helpers/refinery/blog/controller_helper.rb b/app/helpers/refinery/blog/controller_helper.rb index 87d5447..edbf934 100644 --- a/app/helpers/refinery/blog/controller_helper.rb +++ b/app/helpers/refinery/blog/controller_helper.rb @@ -19,7 +19,7 @@ module Refinery end def find_tags - @tags = Refinery::Blog::Post.tag_counts_on(:tags) + @tags = Refinery::Blog::Post.live.tag_counts_on(:tags) end def find_all_blog_categories @categories = Refinery::Blog::Category.translated diff --git a/spec/helpers/refinery/blog/controller_helper_spec.rb b/spec/helpers/refinery/blog/controller_helper_spec.rb new file mode 100644 index 0000000..89eeaad --- /dev/null +++ b/spec/helpers/refinery/blog/controller_helper_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' +module Refinery + module Blog + describe ControllerHelper do + describe "#find_tags" do + let(:tags) { helper.find_tags } + + context "with draft posts" do + let!(:blog_post) { FactoryGirl.create(:blog_post, :draft => true) } + it "does not return tags" do + tags.should be_empty + end + end + + context "with live posts" do + let!(:blog_post) { FactoryGirl.create(:blog_post) } + + it "does not return tags" do + tags.should_not be_empty + end + end + end + end + end +end -- cgit v1.2.3 From 1ef84a1d5b55304f1a6e365c944ecc1d222ab8e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ug=CC=A7is=20Ozols?= Date: Thu, 17 Oct 2013 08:32:11 +0300 Subject: Don't set tag_list on the post factory - it's not a required attribute. --- spec/factories/blog_posts.rb | 1 - spec/models/refinery/blog/post_spec.rb | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/factories/blog_posts.rb b/spec/factories/blog_posts.rb index ff4cf16..51c6b8a 100644 --- a/spec/factories/blog_posts.rb +++ b/spec/factories/blog_posts.rb @@ -3,7 +3,6 @@ FactoryGirl.define do sequence(:title) { |n| "Top #{n} Shopping Centers in Chicago" } body "These are the top ten shopping centers in Chicago. You're going to read a long blog post about them. Come to peace with it." draft false - tag_list "chicago, shopping, fun times" published_at Time.now author { FactoryGirl.create(:refinery_user) } diff --git a/spec/models/refinery/blog/post_spec.rb b/spec/models/refinery/blog/post_spec.rb index cec6a2f..bc9de6e 100644 --- a/spec/models/refinery/blog/post_spec.rb +++ b/spec/models/refinery/blog/post_spec.rb @@ -42,8 +42,10 @@ module Refinery it "acts as taggable" do post.should respond_to(:tag_list) - #the factory has default tags, including 'chicago' - post.tag_list.should include("chicago") + post.tag_list = "refinery, cms" + post.save! + + post.tag_list.should include("refinery") end end -- cgit v1.2.3 From c6f4616844fd2861c95fce383bdaefa1fbc5cf62 Mon Sep 17 00:00:00 2001 From: Patrick Davey Date: Fri, 18 Oct 2013 14:18:41 +1300 Subject: Explicitly setting tag list in tests --- spec/helpers/refinery/blog/controller_helper_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/helpers/refinery/blog/controller_helper_spec.rb b/spec/helpers/refinery/blog/controller_helper_spec.rb index 89eeaad..727e8b4 100644 --- a/spec/helpers/refinery/blog/controller_helper_spec.rb +++ b/spec/helpers/refinery/blog/controller_helper_spec.rb @@ -6,14 +6,14 @@ module Refinery let(:tags) { helper.find_tags } context "with draft posts" do - let!(:blog_post) { FactoryGirl.create(:blog_post, :draft => true) } + let!(:blog_post) { FactoryGirl.create(:blog_post, :draft => true, :tag_list => "first, second" ) } it "does not return tags" do tags.should be_empty end end context "with live posts" do - let!(:blog_post) { FactoryGirl.create(:blog_post) } + let!(:blog_post) { FactoryGirl.create(:blog_post, :tag_list => "first, second" ) } it "does not return tags" do tags.should_not be_empty -- cgit v1.2.3 From 77f65da471906e1b2a8ec06720c47cf54baffd6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ug=CC=A7is=20Ozols?= Date: Fri, 18 Oct 2013 07:58:59 +0300 Subject: Use expect syntax. --- spec/helpers/refinery/blog/controller_helper_spec.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/helpers/refinery/blog/controller_helper_spec.rb b/spec/helpers/refinery/blog/controller_helper_spec.rb index 727e8b4..732f2bd 100644 --- a/spec/helpers/refinery/blog/controller_helper_spec.rb +++ b/spec/helpers/refinery/blog/controller_helper_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper' + module Refinery module Blog describe ControllerHelper do @@ -7,16 +8,17 @@ module Refinery context "with draft posts" do let!(:blog_post) { FactoryGirl.create(:blog_post, :draft => true, :tag_list => "first, second" ) } + it "does not return tags" do - tags.should be_empty + expect(tags).to be_empty end end context "with live posts" do let!(:blog_post) { FactoryGirl.create(:blog_post, :tag_list => "first, second" ) } - it "does not return tags" do - tags.should_not be_empty + it "does return tags" do + expect(tags).to_not be_empty end end end -- cgit v1.2.3 From b25114c79eeffa4709bc477f9a90dc8f9f5c2939 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Tue, 22 Oct 2013 19:24:23 +1300 Subject: Clarify license, authors, version requirement. --- readme.md | 6 +++--- refinerycms-blog.gemspec | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 2bfc060..6102489 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ Simple blog engine for [Refinery CMS](http://refinerycms.com). It supports posts, categories and comments. -This version of `refinerycms-blog` supports Rails 3.2.x. To use Rails 2.3.x use the [refinerycms-blog "Rails 2.3.x stable branch"](http://github.com/resolve/refinerycms-blog/tree/rails2-stable). +This version of `refinerycms-blog` supports Rails 3.2.x. To use Rails 2.3.x use the [refinerycms-blog "Rails 2.3.x stable branch"](http://github.com/refinery/refinerycms-blog/tree/rails2-stable). Options: @@ -11,14 +11,14 @@ Options: ## Requirements -Refinery CMS version 2.0.1 or above. +Refinery CMS version 2.1.0 or above. ## Install Open up your ``Gemfile`` and add at the bottom this line: ```ruby -gem 'refinerycms-blog', '~> 2.0.0' +gem 'refinerycms-blog', '~> 2.1.0' ``` Now, run ``bundle install`` diff --git a/refinerycms-blog.gemspec b/refinerycms-blog.gemspec index 6ded22c..907bbcd 100644 --- a/refinerycms-blog.gemspec +++ b/refinerycms-blog.gemspec @@ -7,8 +7,9 @@ Gem::Specification.new do |s| s.summary = %q{Ruby on Rails blogging engine for Refinery CMS.} s.email = %q{info@refinerycms.com} s.homepage = %q{http://refinerycms.com/blog} - s.authors = ['Resolve Digital', 'Neoteric Design'] + s.authors = ['Philip Arndt', 'Uģis Ozols', 'Joe Sak'] s.require_paths = %w(lib) + s.license = %q{MIT} s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- spec/*`.split("\n") -- cgit v1.2.3 From 3d4397fc835a113ddbe5853e9003998f873260be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20FRERE?= Date: Thu, 24 Oct 2013 12:39:36 +0200 Subject: Fixes small french locale typo --- config/locales/fr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 82025f2..b5b1c23 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -8,7 +8,7 @@ fr: categories: category: edit: Modifier cette catégorie - delete: Supprimer cett catégorie + delete: Supprimer cette catégorie index: no_items_yet: 'Il n''y a aucune catégorie pour le moment. Cliquez sur "%{create}" pour ajouter votre première catégorie.' comments: -- cgit v1.2.3 From 2a65ecd3f70188a1e3ab39b5ddc63f0156eb6549 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 24 Nov 2013 17:13:46 +0100 Subject: Update norwegian (nb) locale. --- config/locales/nb.yml | 168 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 154 insertions(+), 14 deletions(-) diff --git a/config/locales/nb.yml b/config/locales/nb.yml index e9c3f48..aa619a7 100644 --- a/config/locales/nb.yml +++ b/config/locales/nb.yml @@ -2,28 +2,168 @@ nb: refinery: plugins: refinerycms_blog: - title: Blog + title: Blogg blog: admin: + categories: + category: + edit: Redigér kategori + delete: Slett denne kategorien permanent + index: + no_items_yet: 'Ingen kategorier definert. Klikk "%{create}" for å legge til din første kategori.' + comments: + approved: 'Kommentaren fra "%{author}" har blitt godkjent.' + comment: + view_live_html: 'Forhåndsvis denne kommentaren.
(åpner i et nytt vindu)' + read: Les denne kommentaren + reject: Avvis denne kommentaren + approve: Godkjenn denne kommentaren + rejected: 'Kommentaren fra "%{author}" har blitt avvist.' + index: + no_items_yet: 'Det finnes ingen %{type} kommentarer.' + show: + comment: Kommentar + blog_post: Blogginnlegg + from: Av + date: Publisert + message: Kommentar + details: Detaljer + age: Alder + actions: Aktiviteter + back: Tilbake til alle kommentarer + reject: Avvis denne kommentaren + approve: Godkjenn denne kommentaren posts: form: - seo_override_title: Nettleser tittel - seo_override_title_help: Skriv inn en tittel på 5-10 ord som oppsummerer innholdet på siden. - meta_description_title: Meta beskrivelse - meta_description_help: Skriv en kort beskrivelse på to eller tre setninger som forteller hva denne siden inneholder. + toggle_advanced_options: Klikk for tilgang til instillinger for metainformasjon og menyoppføring + published_at: Publiseringsdato + custom_url: Tilpasset URL + custom_url_help: Opprett URL for dette innlegget fra oppgitt tekst i stedet for fra innleggets tittel. + source_url: Kilde-Url + source_url_help: Lagrer en URL til kilden for innholdet i dette innlegget. + source_url_title: Tittel for kilde-Url + source_url_title_help: Tittel til kilden for innholdet i innlegget. + author: Forfatter + author_help: Oppgi brukeren som vil stå som forfatter av dette innlegget. + copy_body: Kopiér hovetdekst til ledetekst. + copy_body_help: Kopierer hovedteksten i innlegget til ledeteksten. La ledetekst forbli tom for å la Refinery automatisk generere den for deg. index: - no_items_yet: 'Det er ingen Blog Posts enda. Klikk på "Lag en ny Blog Posts" for å legge til din første blog posts.' + no_items_yet: 'Det finnes ingen blogginnlegg enda. Klikk på "Nytt blogginnlegg" for å legge til ditt første innlegg.' + uncategorized: + no_items_yet: 'Det finnes ingen ukategoriserte innlegg.' post: - view_live: 'Vis hvordan denne blog post ser ut offentlig
(åpner i et nytt vindu)' - edit: Rediger denne blog post - delete: Fjern denne blog post permanent + view_live: 'Forhåndsvis dette innlegget
(åpner i et nytt vindu)' + edit: Rediger dette innlegget + delete: Fjern dette innlegget permanent + draft: Kladd + settings: + notification_recipients: + value: Send beskjed om nye kommentarer til + explanation: 'Hver gang noen kommenterer på et innlegg, sender Refinery ut en epost for å fortelle om det.' + hint: 'Refinery gir deg beskjed via epost hver gang noen legger igjen en kommentar.' + example: "Skriv inn epostadressen(e) slik: ola@jobb.no, andrea@kontor.no" + updated: 'Mottagere av beskjed om kommentarer er satt til "%{recipients}"' submenu: + categories: + title: Kategorier + manage: Administrér + new: Opprett ny kategori comments: - new: ny + title: Kommentarer + title_with_count: 'Kommentarer (%{new_count} nye)' + new: Nye + unmoderated: Nye + approved: Godkjente + rejected: Avviste posts: - new: Lag en ny post + title: Blogginnlegg + manage: Administrér blogginnlegg + new: Nytt blogginnlegg + uncategorized: Ukategoriserte innlegg settings: + title: Innstillinger + moderation: Moderering update_notified: Oppdater hvem som blir informert - blog_posts: - show: - other: Andre Blog Posts + comments: Kommentarer + teasers: Ledetekst + comment_mailer: + notification: + greeting: Hei + you_recieved_new_comment: Du mottok nettopp en ny kommentar på din webside. + comment_starts: --- start kommentar --- + comment_ends: --- slutt kommentar --- + from: Fra + email: Epost + message: Melding + approve: Godkjenn + or: " eller " + reject: avvis + this_comment: " denne kommentaren." + closing_line: Vennlig hilsen + ps: 'P.S. Alle kommentarene lagres under "Blogg"-seksjonen i Refinery. Du finner dem under "Kommentarer" skulle du ønske å se dem igjen senere.' + shared: + categories: + title: Kategorier + rss_feed: + title: RSS-strøm + subscribe: Abonnér + posts: + other: Siste innlegg + created_at: 'Publisert %{when}' + read_more: Les mer + comments: + singular: kommentar + none: ingen kommentarer + archives: Arkiv + tags: + title: "Merkelapper" + categories: + show: + no_posts: Det er ingen innlegg i denne kategorien ennå. + posts: + post: + filled_in: Arkivert under + comment: kommentar + comments: + by: 'Postet av %{who}' + time_ago: '%{time} siden' + thank_you: 'Takk for din kommentar.' + thank_you_moderated: 'Takk for din kommentar. Meldingen din har blitt lagt i moderatorkøen og vil behandles så snart vi har tid.' + index: + no_blog_articles_yet: Ingen blogginnlegg har blitt postet enda. Følg med! + show: + blog_home: Blogg + comments: + title: Kommentarer + add: Legg igjen en kommentar + other: Siste blogginnlegg + filled_in: Arkivert under + tagged: Merket + submit: Send kommentar + name: Navn + email: Epost + message: Melding + by: av + source: Kilde + tagged: + no_blog_articles_yet: Ingen blogginnlegg har blitt postet enda. Følg med! + posts_tagged: Innlegg merket + archive: + blog_archive_for: 'Arkiv for %{date}' + no_blog_articles_posted: 'Det er ikke postet noen blogginnlegg for %{date}. Følg med.' + activerecord: + models: + refinery/blog/category: Kategori + refinery/blog/comment: Kommentar + refinery/blog/post: Blogginnlegg + attributes: + refinery/blog/category: + title: Tittel + refinery/blog/comment: + name: Navn + email: Epost + message: Melding + refinery/blog/post: + title: Tittel + body: Hovedtekst + teaser: Ledetekst -- cgit v1.2.3 From f622e6208c167398ca1a0a84bead79283965eeb0 Mon Sep 17 00:00:00 2001 From: Ken Ip Date: Sat, 7 Dec 2013 22:41:22 -0500 Subject: Apply core globalize fix 2450. Fixes #361. --- app/models/refinery/blog/post.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb index f0278f4..cf0a526 100644 --- a/app/models/refinery/blog/post.rb +++ b/app/models/refinery/blog/post.rb @@ -47,7 +47,10 @@ module Refinery seo_fields = ::SeoMeta.attributes.keys.map{|a| [a, :"#{a}="]}.flatten delegate(*(seo_fields << {:to => :translation})) - before_save { |m| m.translation.save } + before_save do |m| + m.translation.globalized_model = self + m.translation.save if m.translation.new_record? + end self.per_page = Refinery::Blog.posts_per_page -- cgit v1.2.3 From d891009d8b26cbccfc7fcdec645e1e2382c641bc Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Mon, 9 Dec 2013 03:45:38 +1300 Subject: Remove todo.md [ci skip] --- todo.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 todo.md diff --git a/todo.md b/todo.md deleted file mode 100644 index f32af48..0000000 --- a/todo.md +++ /dev/null @@ -1,5 +0,0 @@ -## Why not, let's get this list going, eh? - -* Replace comments with disqus? -* Facebook/twitter login for comments? -* What else? Add your ideas... \ No newline at end of file -- cgit v1.2.3