From 82c73cd62c3fc616cb44660d9ac6b4dfbe53ddb9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?=
Date: Mon, 27 Feb 2012 11:45:23 +0100
Subject: [PATCH 01/35] Removing theme catalogue and mentions of Typogarden.
Theme catalogue now returns a 404 and is not maintained anymore.
We've lost typogarden.org (I actually forgot to renew it) and most themes were not supported anymore.
We'll need to find a way to display themes, maybe using themes.typosphere.org with a statically cached blog, I need to think about this first.
---
README.textile | 1 -
app/controllers/admin/themes_controller.rb | 46 --------------------
app/views/admin/dashboard/_overview.html.erb | 1 -
app/views/admin/themes/catalogue.html.erb | 26 -----------
app/views/admin/themes/index.html.erb | 5 ---
app/views/layouts/administration.html.erb | 1 -
6 files changed, 80 deletions(-)
delete mode 100644 app/views/admin/themes/catalogue.html.erb
diff --git a/README.textile b/README.textile
index 59a32ffd85..927796de7b 100644
--- a/README.textile
+++ b/README.textile
@@ -8,7 +8,6 @@ The current version is Typo 6.0.9 for Ruby on Rails 3.0.10
h2. Enhance your Typo blog
-* "Themes Catalogue":http://typogarden.org/
* "Sidebar Plugins":https://github.com/fdv/typo/wiki/Sidebar-plugins
* "In page Plugins":https://github.com/fdv/typo/wiki/In-Page-Plugins
diff --git a/app/controllers/admin/themes_controller.rb b/app/controllers/admin/themes_controller.rb
index 9541a3324c..9fe926e6be 100644
--- a/app/controllers/admin/themes_controller.rb
+++ b/app/controllers/admin/themes_controller.rb
@@ -27,55 +27,9 @@ def switchto
redirect_to :action => 'index'
end
- def catalogue
- # Data get by this URI is a JSON formatted
- # The return is a list. All element represent a item
- # Each item is a hash with this key :
- # * uid
- # * download_uri
- # * name
- # * author
- # * description
- # * tags
- # * screenshot_uri
- url = "http://www.dev411.com/typo/themes_2-1.txt"
- open(url) do |http|
- @themes = parse_catalogue_by_json(http.read)
- end
- rescue => e
- logger.info(e.message)
- nil
-
- @themes = []
- @error = true
- end
-
protected
def zap_theme_caches
FileUtils.rm_rf(%w{stylesheets javascript images}.collect{|v| page_cache_directory + "/#{v}/theme"})
end
-
- private
-
- class ThemeItem < Struct.new(:image, :name, :url, :author, :description)
- def to_s; name; end
- end
-
- def parse_catalogue_by_json(body)
- items_json = JSON.parse(body)
- items = []
- items_json.each do |elem|
- next unless elem['download_uri'] # No display theme without download URI
- item = ThemeItem.new
- item.image = elem['screenshot_uri']
- item.url = elem['download_uri']
- item.name = elem['name']
- item.author = elem['author']
- item.description = elem['description']
- items << item
- end
- items
- items.sort_by { |item| item.name }
- end
end
diff --git a/app/views/admin/dashboard/_overview.html.erb b/app/views/admin/dashboard/_overview.html.erb
index c5d70470fe..78c10ac7d1 100644
--- a/app/views/admin/dashboard/_overview.html.erb
+++ b/app/views/admin/dashboard/_overview.html.erb
@@ -13,7 +13,6 @@
<%= _("If you need help, %s. You can also browse our %s or %s to customize your Typo blog.",
link_to(_('read our documentation'), 'http://typosphere.org'),
- link_to(_('theme catalogue'), 'http://typogarden.org'),
link_to(_('download some plugins'), 'http://plugins.typosphere.org')) %>
- <% if i == 2 %>
- <% i = 0 %>
-
- <% else %>
- <% i+=1 %>
- <% end %>
-
-<% end %>
-
diff --git a/app/views/admin/themes/index.html.erb b/app/views/admin/themes/index.html.erb
index 20bdb67b7f..a2474316ba 100644
--- a/app/views/admin/themes/index.html.erb
+++ b/app/views/admin/themes/index.html.erb
@@ -31,8 +31,3 @@
<% i = (i == 0) ? 1 : 0%>
<% j += 1 %>
<% end %>
-
-
-
<%= _("Get more themes")%>
-
<%= _("You can download third party themes from officially supported %s ", link_to(_("Typogarden"), 'http://typogarden.org'))%> <%= _("To install a theme you just need to upload the theme folder into your themes directory. Once a theme is uploaded, you should see it on this page.") %>
- <%= _("If you need help, %s. You can also browse our %s or %s to customize your Typo blog.",
+ <%= _("If you need help, %s. You can also %s to customize your Typo blog.",
link_to(_('read our documentation'), 'http://typosphere.org'),
link_to(_('download some plugins'), 'http://plugins.typosphere.org')) %>
From 9f5180e903db4a9923e13241597a0d6f171d702f Mon Sep 17 00:00:00 2001
From: Maarten Mulders
Date: Thu, 1 Mar 2012 20:25:18 +0100
Subject: [PATCH 04/35] Translations and one grammar correction
---
lang/nl_NL.rb | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/lang/nl_NL.rb b/lang/nl_NL.rb
index 0e7e8826fe..494d44beea 100644
--- a/lang/nl_NL.rb
+++ b/lang/nl_NL.rb
@@ -437,7 +437,7 @@
l.store "Write", "Schrijf"
# app/views/admin/sidebar/_publish.html.erb
- l.store "Changes published", ""
+ l.store "Changes published", "Wijzigingen gepubliceerd"
# app/views/admin/sidebar/_target.html.erb
l.store "Drag some plugins here to fill your sidebar", ""
@@ -445,18 +445,18 @@
# app/views/admin/sidebar/index.html.erb
l.store "Drag and drop to change the sidebar items displayed on this blog. To remove items from the sidebar just click remove Changes are saved immediately, but not activated until you click the 'Publish' button", ""
l.store "Available Items", ""
- l.store "You have no plugins installed", ""
+ l.store "You have no plugins installed", "Je hebt geen plugins geïinstalleerd"
l.store "Active Sidebar items", ""
- l.store "Get more plugins", ""
+ l.store "Get more plugins", "Haal meer thema's op"
l.store "Sidebar", ""
- l.store "Publish changes", ""
+ l.store "Publish changes", "Publiceer wijzigingen"
# app/views/admin/tags/_form.html.erb
l.store "Display name", "Schermnaam"
# app/views/admin/tags/destroy.html.erb
- l.store "Are you sure you want to delete the tag", ""
- l.store "Delete this tag", ""
+ l.store "Are you sure you want to delete the tag", "Weet je zeker dat je deze tag wilt verwijderen?"
+ l.store "Delete this tag", "Verwijder deze tag"
# app/views/admin/tags/edit.html.erb
l.store "Editing ", ""
@@ -464,25 +464,25 @@
# app/views/admin/tags/index.html.erb
l.store "Display Name", ""
- l.store "Manage tags", ""
+ l.store "Manage tags", "Beheer tags"
# app/views/admin/themes/catalogue.html.erb
- l.store "Sorry the theme catalogue is not available", ""
- l.store "Theme catalogue", ""
+ l.store "Sorry the theme catalogue is not available", "Sorry, de thema catalogus is niet beschikbaar"
+ l.store "Theme catalogue", "Thema catalogus"
# app/views/admin/themes/editor.html.erb
- l.store "Theme editor", ""
+ l.store "Theme editor", "Thema editor"
# app/views/admin/themes/index.html.erb
- l.store "Active theme", ""
- l.store "Get more themes", ""
- l.store "You can download third party themes from officially supported %s ", ""
- l.store "Typogarden", ""
- l.store "To install a theme you just need to upload the theme folder into your themes directory. Once a theme is uploaded, you should see it on this page.", ""
- l.store "Choose a theme", ""
+ l.store "Active theme", "Actieve thema's"
+ l.store "Get more themes", "Haal meer thema's op"
+ l.store "You can download third party themes from officially supported %s ", "Je kunt thema's van derden downloaden van officieel ondersteunde %s "
+ l.store "Typogarden", "Typogarden"
+ l.store "To install a theme you just need to upload the theme folder into your themes directory. Once a theme is uploaded, you should see it on this page.", "Om een thema te installeren moet je het uploaden in de themes map. Zodra het is geupload zou je het op deze pagina moeten zien."
+ l.store "Choose a theme", "Kies een thema"
# app/views/admin/users/_form.html.erb
- l.store "Account settings", ""
+ l.store "Account settings", "Account instellingen"
l.store "Password confirmation", "Bevestig wachtwoord"
l.store "Profile", "Profiel"
l.store "User's status", "Status van de gebruiker"
@@ -536,7 +536,7 @@
# app/views/articles/_comment.html.erb
l.store "said", "zei"
- l.store "This comment has been flagged for moderator approval. It won't appear on this blog until the author approves it", "Dit commentaar is gemarkeerd voor goedkeuring. Het zal niet getoond worden totdat de auteur het goedkeurd."
+ l.store "This comment has been flagged for moderator approval. It won't appear on this blog until the author approves it", "Dit commentaar is gemarkeerd voor goedkeuring. Het zal niet getoond worden totdat de auteur het goedkeurt."
# app/views/articles/_comment_box.html.erb
l.store "Your name", "Jouw naam"
From 3f9753c63aa9b6228f9af28a48b7fec66140bd9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?=
Date: Thu, 1 Mar 2012 12:24:11 +0100
Subject: [PATCH 05/35] Make sure that migration 103 does not destroy tag
association.
---
...y_update_existing_articles_with_nil_or_empty_post_type.rb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/db/migrate/103_really_update_existing_articles_with_nil_or_empty_post_type.rb b/db/migrate/103_really_update_existing_articles_with_nil_or_empty_post_type.rb
index 398c70c833..db98a91168 100644
--- a/db/migrate/103_really_update_existing_articles_with_nil_or_empty_post_type.rb
+++ b/db/migrate/103_really_update_existing_articles_with_nil_or_empty_post_type.rb
@@ -10,6 +10,11 @@ def self.up
if art.post_type.nil? or art.post_type.empty?
say "Fixing '#{art.title}'", 1
art.post_type = "read"
+
+ # this doesn't really belong here but since this migration
+ # would otherwise reset tags, it's better than nothing.
+ art.keywords = art.tags.collect(&:name).join(" ")
+
art.save!
end
end
From 5ae108a4b3077a24e956daf818655d10b4e49b72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?=
Date: Sun, 4 Mar 2012 09:31:54 +0100
Subject: [PATCH 06/35] Fixes issue 55: ActionView::Template::Error (settings
was supposed to be a Hash, but was a String)
Thank you to Georges Arnould for finding out and fixing.
---
app/models/article.rb | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/app/models/article.rb b/app/models/article.rb
index 8daa9b52ab..a933ba5d87 100644
--- a/app/models/article.rb
+++ b/app/models/article.rb
@@ -48,7 +48,7 @@ def spam
before_create :set_defaults, :create_guid
after_create :add_notifications
- before_save :set_published_at
+ before_save :set_published_at, :ensure_settings_type
after_save :post_trigger
after_save :keywords_to_tags
@@ -424,6 +424,13 @@ def set_published_at
end
end
+ def ensure_settings_type
+ if settings.is_a?(String)
+ # Any dump access forcing de-serialization
+ password.blank?
+ end
+ end
+
def set_defaults
if self.attributes.include?("permalink") and
(self.permalink.blank? or
From 63843aa9b75b7677aebfc125e1ad44873ede3356 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?=
Date: Sun, 4 Mar 2012 09:50:52 +0100
Subject: [PATCH 07/35] Fixes specs for tags autocomplete
---
spec/controllers/admin/content_controller_spec.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/spec/controllers/admin/content_controller_spec.rb b/spec/controllers/admin/content_controller_spec.rb
index 198428c8b3..88824b19d2 100644
--- a/spec/controllers/admin/content_controller_spec.rb
+++ b/spec/controllers/admin/content_controller_spec.rb
@@ -591,19 +591,19 @@ def base_article(options={})
it 'should return foo for keywords fo' do
get :auto_complete_for_article_keywords, :article => {:keywords => 'fo'}
response.should be_success
- response.body.should == '
foo
'
+ response.body.should == '
foo
'
end
it 'should return nothing for hello' do
get :auto_complete_for_article_keywords, :article => {:keywords => 'hello'}
response.should be_success
- response.body.should == '
'
+ response.body.should == '
'
end
it 'should return bar and bazz for ba keyword' do
get :auto_complete_for_article_keywords, :article => {:keywords => 'ba'}
response.should be_success
- response.body.should == '
bar
bazz
'
+ response.body.should == '
bar
bazz
'
end
end
From 93f4196ff29f45a65a7571906f51077a22580376 Mon Sep 17 00:00:00 2001
From: Maarten Mulders
Date: Sun, 4 Mar 2012 11:11:08 +0100
Subject: [PATCH 08/35] Some more Dutch translations
---
lang/nl_NL.rb | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/lang/nl_NL.rb b/lang/nl_NL.rb
index 83fe4044d5..6726689813 100644
--- a/lang/nl_NL.rb
+++ b/lang/nl_NL.rb
@@ -360,10 +360,10 @@
l.store "Typo can notify you when new articles or comments are posted", "Typo can je notificeren wanneer nieuwe artikelen of commentaren gepost worden"
l.store "Source Email", "Bron e-mail"
l.store "Email address used by Typo to send notifications", "E-mail adres dat Typo gebruikt om notificaties te versturen"
- l.store "Enabling spam protection will make typo compare the IP address of posters as well as the contents of their posts against local and remote blacklists. Good defense against spam bots", ""
+ l.store "Enabling spam protection will make typo compare the IP address of posters as well as the contents of their posts against local and remote blacklists. Good defense against spam bots", "Het aanzetten van spambescherming zorgt dat typo het IP-adres en de inhoud van reacties vergelijkt met lokale en centrale zwarte lijsten. Een goede bescherming tegen spam robots"
l.store "Enable spam protection", "Gebruik spam-bescherming"
l.store "Akismet Key", "Akismet sleutel"
- l.store "Typo can (optionally) use the %s spam-filtering service. You need to register with Akismet and receive an API key before you can use their service. If you have an Akismet key, enter it here", ""
+ l.store "Typo can (optionally) use the %s spam-filtering service. You need to register with Akismet and receive an API key before you can use their service. If you have an Akismet key, enter it here", "Typo kan (optioneel) de %s spam-filter dienst gebruiken. Je moet een registratie bij Akismet hebben en een API sleutel voordat je deze dienst kunt gebruiken. Als je een Akismet sleutel hebt, vul die dan hier in"
l.store "Disable trackbacks site-wide", "Gebruik nergens trackbacks"
l.store "This setting allows you to disable trackbacks for every article in your blog. It won't remove existing trackbacks, but it will prevent any further attempt to add a trackback anywhere on your blog.", "Deze instelling zorgt er voor dat bij geen enkel artikel in je blog trackbacks gebruikt kunnen worden. Het zal bestaande trackbacks niet verwijderen, maar het zal voorkomen dat nieuwe trackbacks worden toegevoegd."
l.store "Disable comments after", "Sta commentaren niet toe na"
@@ -401,14 +401,14 @@
l.store "Meta keywords", "Meta-kewords"
l.store "Use RSS description", "Gebruik RSS beschrijving"
l.store "Index categories", ""
- l.store "Unchecking this box will add noindex, follow meta tags in every category page, removing them from search engines and preventing duplicate content issues", ""
+ l.store "Unchecking this box will add noindex, follow meta tags in every category page, removing them from search engines and preventing duplicate content issues", "Het uitzetten van dit vinkje zal de meta-tags noindex, follow toevoegen aan elke categorie pagina, zodat die niet door zoekmachines geïndexeerd wordt; dit voorkomt dubbele hits"
l.store "Index tags", ""
- l.store "Unchecking this box will add noindex, follow meta tags in every tags page, removing them from search engines and preventing duplicate content issues", ""
+ l.store "Unchecking this box will add noindex, follow meta tags in every tags page, removing them from search engines and preventing duplicate content issues", "Het uitzetten van dit vinkje zal de meta-tags noindex, follow toevoegen aan elke tag pagina, zodat die niet door zoekmachines geïndexeerd wordt; dit voorkomt dubbele hits"
l.store "Robots.txt", "Robots.txt"
l.store "You robots.txt file is not writeable. Typo won't be able to write it", "Je robots.txt bestand is niet schrijfbaar. Typo kan het niet wijzigen"
l.store "Search Engine Optimization", "Zoekmachine optimalisatie"
- l.store "This will display", ""
- l.store "at the bottom of each of your post in the RSS feed", ""
+ l.store "This will display", "Dit zorgt er voor dat "
+ l.store "at the bottom of each of your post in the RSS feed", " onderaan elke post in je RSS-feed verschijnt"
# app/views/admin/settings/update_database.html.erb
l.store "Information", "Informatie"
@@ -424,8 +424,8 @@
l.store "no", "nee"
# app/views/admin/settings/write.html.erb
- l.store "Send trackbacks", ""
- l.store "When publishing articles, Typo can send trackbacks to websites that you link to. This should be disabled for private blogs as it will leak non-public information to sites that you're discussing. For public blogs, there's no real point in disabling this.", ""
+ l.store "Send trackbacks", "Verstuur trackbacks"
+ l.store "When publishing articles, Typo can send trackbacks to websites that you link to. This should be disabled for private blogs as it will leak non-public information to sites that you're discussing. For public blogs, there's no real point in disabling this.", "Wanneer je een artikel publiceert kan Typo een trackback sturen naar de sites waaraan je linkt. Dit zou voor privé-blogs uit moeten staan, omdat het niet-publieke informatie 'lekt' naar sites die je bediscussieert. Voor publieke blogs is er geen goede reden om het uit te zetten."
l.store "URLs to ping automatically", ""
l.store "Latitude, Longitude", ""
l.store "your lattitude and longitude", ""
@@ -436,15 +436,15 @@
l.store "Changes published", "Wijzigingen gepubliceerd"
# app/views/admin/sidebar/_target.html.erb
- l.store "Drag some plugins here to fill your sidebar", ""
+ l.store "Drag some plugins here to fill your sidebar", "Sleep wat plugins naar hier om de zijbalk te vullen"
# app/views/admin/sidebar/index.html.erb
- l.store "Drag and drop to change the sidebar items displayed on this blog. To remove items from the sidebar just click remove Changes are saved immediately, but not activated until you click the 'Publish' button", ""
- l.store "Available Items", ""
+ l.store "Drag and drop to change the sidebar items displayed on this blog. To remove items from the sidebar just click remove Changes are saved immediately, but not activated until you click the 'Publish' button", "Sleep dingen heen en weer om de zijbalk van dit blog aan te passen. Om dingen te verwijderen klik je op verwijderen Wijzigen worden automatisch opgeslagen, maar niet geactiveerd totdat je de 'Publiceer' knop klikt"
+ l.store "Available Items", "Beschikbare dingen"
l.store "You have no plugins installed", "Je hebt geen plugins geïinstalleerd"
- l.store "Active Sidebar items", ""
+ l.store "Active Sidebar items", "Actieve zijbalk dingen"
l.store "Get more plugins", "Haal meer thema's op"
- l.store "Sidebar", ""
+ l.store "Sidebar", "Zijbalk"
l.store "Publish changes", "Publiceer wijzigingen"
# app/views/admin/tags/_form.html.erb
@@ -455,8 +455,8 @@
l.store "Delete this tag", "Verwijder deze tag"
# app/views/admin/tags/edit.html.erb
- l.store "Editing ", ""
- l.store "Back to tags list", ""
+ l.store "Editing ", "Wijzigen"
+ l.store "Back to tags list", "Terug naar de lijst van tags"
# app/views/admin/tags/index.html.erb
l.store "Display Name", ""
@@ -581,12 +581,12 @@
# app/views/layouts/administration.html.erb
l.store "%s »", ""
- l.store "is proudly powered by", ""
+ l.store "is proudly powered by", "wordt trots aangedreven door"
l.store "Dashboard", "Dashboard"
# app/views/setup/index.html.erb
l.store "Welcome", "Welkom"
- l.store "Welcome to your %s blog setup. Just fill in your blog title and your email, and Typo will take care of everything else", ""
+ l.store "Welcome to your %s blog setup. Just fill in your blog title and your email, and Typo will take care of everything else", "Welkom bij je %s blog setup. Vul een titel voor je blog in, en een e-mailadres, en Typo zorgt voor de rest"
# app/views/shared/_confirm.html.erb
l.store "Congratulation!", "Gefeliciteerd!"
From 4c59f992238bfb7df820dda12da4d7a000ee69ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?=
Date: Mon, 5 Mar 2012 16:00:57 +0100
Subject: [PATCH 09/35] Moves permalink sanitization to String with a new
to_permalink method.
Refactores existing code to remove duplicate code entries and not needed mthods when building the permalink from the model.
---
app/controllers/admin/content_controller.rb | 2 +-
app/controllers/admin/pages_controller.rb | 3 ---
app/models/article.rb | 7 +-----
app/models/page.rb | 13 ++++++-----
app/models/post_type.rb | 3 +--
app/models/sanitizable.rb | 22 -------------------
lib/transforms.rb | 19 ++++++++++++++++
.../admin/pages_controller_spec.rb | 5 +----
spec/lib/transforms_spec.rb | 6 +++++
spec/models/article_spec.rb | 10 ++++-----
spec/models/page_spec.rb | 2 +-
spec/models/sanitizable_spec.rb | 16 --------------
12 files changed, 42 insertions(+), 66 deletions(-)
delete mode 100644 app/models/sanitizable.rb
delete mode 100644 spec/models/sanitizable_spec.rb
diff --git a/app/controllers/admin/content_controller.rb b/app/controllers/admin/content_controller.rb
index 28e20d53a7..eac0916a36 100644
--- a/app/controllers/admin/content_controller.rb
+++ b/app/controllers/admin/content_controller.rb
@@ -169,7 +169,7 @@ def new_or_edit
if @article.draft
@article.state = "draft"
else
- @article.permalink = @article.stripped_title if @article.permalink.nil? or @article.permalink.empty?
+ @article.permalink = @article.title.to_permalink if @article.permalink.nil? or @article.permalink.empty?
end
if @article.save
diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb
index 2345398058..a65e3cb6d9 100644
--- a/app/controllers/admin/pages_controller.rb
+++ b/app/controllers/admin/pages_controller.rb
@@ -17,9 +17,6 @@ def new
@page.text_filter ||= current_user.text_filter
@images = Resource.where("mime LIKE '%image%'").order('created_at DESC').page(1).per(10)
if request.post?
- if @page.name.blank?
- @page.name = @page.sanitized_title
- end
@page.published_at = Time.now
if @page.save
set_shortened_url if @page.published
diff --git a/app/models/article.rb b/app/models/article.rb
index a933ba5d87..8b84d94145 100644
--- a/app/models/article.rb
+++ b/app/models/article.rb
@@ -5,7 +5,6 @@
class Article < Content
include TypoGuid
include ConfigManager
- include Sanitizable
serialize :settings, Hash
@@ -119,10 +118,6 @@ def search_with_pagination(search_hash, paginate_hash)
end
- def stripped_title
- remove_accents(title).gsub(/<[^>]*>/, '').to_url
- end
-
def year_url
published_at.year.to_s
end
@@ -437,7 +432,7 @@ def set_defaults
self.permalink.to_s =~ /article-draft/ or
self.state == "draft"
)
- self.permalink = self.stripped_title
+ self.permalink = self.title.to_permalink
end
if blog && self.allow_comments.nil?
self.allow_comments = blog.default_allow_comments
diff --git a/app/models/page.rb b/app/models/page.rb
index 09eaf7da3e..f098374cb2 100644
--- a/app/models/page.rb
+++ b/app/models/page.rb
@@ -1,14 +1,19 @@
class Page < Content
belongs_to :user
- validates_presence_of :name, :title, :body
+ validates_presence_of :title, :body
validates_uniqueness_of :name
include ConfigManager
- include Sanitizable
serialize :settings, Hash
setting :password, :string, ''
+ before_save :set_permalink
+
+ def set_permalink
+ self.name = self.title.to_permalink if self.name.blank?
+ end
+
def initialize(*args)
super
# Yes, this is weird - PDC
@@ -47,8 +52,4 @@ def permalink_url(anchor=nil, only_path=false)
def self.find_by_published_at
super(:created_at)
end
-
- def sanitized_title
- remove_accents(self.title).gsub(/<[^>]*>/, '').to_url
- end
end
diff --git a/app/models/post_type.rb b/app/models/post_type.rb
index ea1968031d..0361edc77a 100644
--- a/app/models/post_type.rb
+++ b/app/models/post_type.rb
@@ -1,6 +1,5 @@
# coding: utf-8
class PostType < ActiveRecord::Base
- include Sanitizable
validates_uniqueness_of :name
validates_presence_of :name
validate :name_is_not_read
@@ -11,7 +10,7 @@ def name_is_not_read
end
def sanitize_title
- self.permalink = remove_accents(self.name).gsub(/<[^>]*>/, '').to_url
+ self.permalink = self.name.to_permalink
end
end
diff --git a/app/models/sanitizable.rb b/app/models/sanitizable.rb
deleted file mode 100644
index cebd34840f..0000000000
--- a/app/models/sanitizable.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# coding: utf-8
-# not sure about best place to put this class...
-
-module Sanitizable
-
- Accents = { ['á','à','â','ä','ã','Ã','Ä','Â','À'] => 'a',
- ['é','è','ê','ë','Ë','É','È','Ê'] => 'e',
- ['í','ì','î','ï','I','Î','Ì'] => 'i',
- ['ó','ò','ô','ö','õ','Õ','Ö','Ô','Ò'] => 'o',
- ['œ'] => 'oe',
- ['ß'] => 'ss',
- ['ú','ù','û','ü','U','Û','Ù'] => 'u',
- ['ç','Ç'] => 'c'
- }
-
- def remove_accents string
- Accents.keys.each do |key|
- string = string.tr(key.join, Accents[key])
- end
- string
- end
-end
diff --git a/lib/transforms.rb b/lib/transforms.rb
index 84f62419c8..4eea392633 100644
--- a/lib/transforms.rb
+++ b/lib/transforms.rb
@@ -1,5 +1,24 @@
# coding: utf-8
class String
+ Accents = { ['á','à','â','ä','ã','Ã','Ä','Â','À'] => 'a',
+ ['é','è','ê','ë','Ë','É','È','Ê'] => 'e',
+ ['í','ì','î','ï','I','Î','Ì'] => 'i',
+ ['ó','ò','ô','ö','õ','Õ','Ö','Ô','Ò'] => 'o',
+ ['œ'] => 'oe',
+ ['ß'] => 'ss',
+ ['ú','ù','û','ü','U','Û','Ù'] => 'u',
+ ['ç','Ç'] => 'c'
+ }
+
+ def to_permalink
+ string = self
+ Accents.keys.each do |key|
+ string = string.tr(key.join, Accents[key])
+ end
+ string = string.tr("'", "-")
+ string.gsub(/<[^>]*>/, '').to_url
+ end
+
# Returns a-string-with-dashes when passed 'a string with dashes'.
# All special chars are stripped in the process
def to_url
diff --git a/spec/controllers/admin/pages_controller_spec.rb b/spec/controllers/admin/pages_controller_spec.rb
index 6d46216155..e852adfe52 100644
--- a/spec/controllers/admin/pages_controller_spec.rb
+++ b/spec/controllers/admin/pages_controller_spec.rb
@@ -110,7 +110,7 @@ def base_page(options={})
#TODO but this kind of action must move to model !
it "should use sanitize title to set page name" do
page = Factory.build(:page, :name => '')
- page.should_receive(:sanitized_title).and_return('title-with-accents-eea')
+ page.name.should == page.title.to_permalink
Page.should_receive(:new).and_return(page)
post :new, :page => {:title => 'title with accents éèà'}
end
@@ -147,7 +147,4 @@ def base_page(options={})
response.should render_template('_visual_editor')
end
end
-
-
-
end
diff --git a/spec/lib/transforms_spec.rb b/spec/lib/transforms_spec.rb
index 01de94bd47..f3978076bd 100644
--- a/spec/lib/transforms_spec.rb
+++ b/spec/lib/transforms_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
require 'spec_helper'
describe String do
@@ -17,6 +18,11 @@
"%excerpt%".to_title(item, settings, params)
end
+
+ it 'should build a nice permalink from an accentuated string' do
+ "L'été s'ra chaud, l'été s'ra chaud".to_permalink.should == "l-ete-s-ra-chaud-l-ete-s-ra-chaud"
+ end
+
end
end
diff --git a/spec/models/article_spec.rb b/spec/models/article_spec.rb
index bf0d127ae9..e5e23141a5 100644
--- a/spec/models/article_spec.rb
+++ b/spec/models/article_spec.rb
@@ -117,19 +117,19 @@ def assert_results_are(*expected)
describe "#stripped_title" do
it "works for simple cases" do
- assert_equal "article-1", Article.new(:title => 'Article 1!').stripped_title
- assert_equal "article-2", Article.new(:title => 'Article 2!').stripped_title
- assert_equal "article-3", Article.new(:title => 'Article 3!').stripped_title
+ assert_equal "article-1", Article.new(:title => 'Article 1!').title.to_permalink
+ assert_equal "article-2", Article.new(:title => 'Article 2!').title.to_permalink
+ assert_equal "article-3", Article.new(:title => 'Article 3!').title.to_permalink
end
it "strips html" do
a = Article.new(:title => "This is a test")
- assert_equal 'this-is-a-test', a.stripped_title
+ assert_equal 'this-is-a-test', a.title.to_permalink
end
it "does not escape multibyte characters" do
a = Article.new(:title => "ルビー")
- a.stripped_title.should == "ルビー"
+ a.title.to_permalink.should == "ルビー"
end
it "is called upon saving the article" do
diff --git a/spec/models/page_spec.rb b/spec/models/page_spec.rb
index dd4e67cc83..96f3984a84 100644
--- a/spec/models/page_spec.rb
+++ b/spec/models/page_spec.rb
@@ -27,7 +27,7 @@
it "should give a sanitized title" do
page = Factory.build(:page, :title => 'title with accents éèà')
- page.sanitized_title.should == 'title-with-accents-eea'
+ page.title.to_permalink.should == 'title-with-accents-eea'
end
end
diff --git a/spec/models/sanitizable_spec.rb b/spec/models/sanitizable_spec.rb
deleted file mode 100644
index 08665b2022..0000000000
--- a/spec/models/sanitizable_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# coding: utf-8
-require 'spec_helper'
-
-describe Sanitizable, " an object with this module" do
-
- it "should respond to #remove_accents" do
- Object.new.extend(Sanitizable).should respond_to("remove_accents")
- end
-
- it 'should have a sanitized name attribute' do
- object = Object.new
- object.extend(Sanitizable)
- object.remove_accents('Un joli nom accentué').should == 'un joli nom accentue'
- end
-end
-
From 7db1582a2e1802fc8d264cfaf074d80a00aed2ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?=
Date: Mon, 5 Mar 2012 16:03:26 +0100
Subject: [PATCH 10/35] Force categories to use to_permalink
---
app/models/category.rb | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/app/models/category.rb b/app/models/category.rb
index 40f3470d74..94707aafa8 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -50,10 +50,6 @@ def self.reorder_alpha
reorder send(:with_exclusive_scope){find(:all, :order => 'UPPER(name)').collect { |c| c.id }}
end
- def stripped_name
- self.name.to_url
- end
-
def published_articles
articles.already_published
end
@@ -82,7 +78,7 @@ def to_param
before_save :set_defaults
def set_defaults
- self.permalink ||= self.stripped_name
+ self.permalink ||= self.name.to_permalink
end
validates_presence_of :name
From aae592454fbc95e129aa3ca88eb3f3eb0b48a3ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?=
Date: Mon, 5 Mar 2012 19:36:37 +0100
Subject: [PATCH 11/35] Fixing specs for pages. Moving permalink related specs
to model which is where they should be
---
.../admin/pages_controller_spec.rb | 8 -------
spec/models/page_spec.rb | 21 ++++++++++---------
2 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/spec/controllers/admin/pages_controller_spec.rb b/spec/controllers/admin/pages_controller_spec.rb
index e852adfe52..83c132a5f8 100644
--- a/spec/controllers/admin/pages_controller_spec.rb
+++ b/spec/controllers/admin/pages_controller_spec.rb
@@ -107,14 +107,6 @@ def base_page(options={})
:published => true }.merge(options)
end
- #TODO but this kind of action must move to model !
- it "should use sanitize title to set page name" do
- page = Factory.build(:page, :name => '')
- page.name.should == page.title.to_permalink
- Page.should_receive(:new).and_return(page)
- post :new, :page => {:title => 'title with accents éèà'}
- end
-
it 'should create a published page with a redirect' do
post(:new, 'page' => base_page)
assigns(:page).redirects.count.should == 1
diff --git a/spec/models/page_spec.rb b/spec/models/page_spec.rb
index 96f3984a84..7674750ff8 100644
--- a/spec/models/page_spec.rb
+++ b/spec/models/page_spec.rb
@@ -43,7 +43,7 @@ def only(*keys)
describe 'Given no pages' do
def valid_attributes
- { :name => 'name', :title => 'title', :body => 'body'}
+ { :title => 'title', :body => 'body'}
end
before(:each) do
@@ -55,19 +55,11 @@ def valid_attributes
@page.should_not be_valid
end
- it 'A page is valid with name, title and body' do
+ it 'A page is valid with a title and body' do
@page.attributes = valid_attributes
@page.should be_valid
end
- it 'A page is invalid without a name' do
- @page.attributes = valid_attributes.except(:name)
- @page.should_not be_valid
- @page.errors[:name].should == ["can't be blank"]
- @page.name = 'somename'
- @page.should be_valid
- end
-
it 'A page is invalid without a title' do
@page.attributes = valid_attributes.except(:title)
@page.should_not be_valid
@@ -83,6 +75,15 @@ def valid_attributes
@page.body = 'somebody'
@page.should be_valid
end
+
+ it "should use sanitize title to set page name" do
+ @page.attributes = valid_attributes.except(:title)
+ @page.title = 'title with accents éèà'
+ @page.should be_valid
+ @page.save
+ @page.name.should == "title-with-accents-eea"
+ end
+
end
describe 'Given a valid page' do
From cd2e895be9f312c8830dc33620176c59e15d4795 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?=
Date: Mon, 5 Mar 2012 19:37:22 +0100
Subject: [PATCH 12/35] Moves the permalink generation to model
---
app/controllers/admin/content_controller.rb | 6 +-----
app/models/article.rb | 9 +++++++--
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/app/controllers/admin/content_controller.rb b/app/controllers/admin/content_controller.rb
index eac0916a36..6c20ffefae 100644
--- a/app/controllers/admin/content_controller.rb
+++ b/app/controllers/admin/content_controller.rb
@@ -166,11 +166,7 @@ def new_or_edit
set_article_author
save_attachments
- if @article.draft
- @article.state = "draft"
- else
- @article.permalink = @article.title.to_permalink if @article.permalink.nil? or @article.permalink.empty?
- end
+ @article.state = "draft" if @article.draft
if @article.save
destroy_the_draft unless @article.draft
diff --git a/app/models/article.rb b/app/models/article.rb
index 8b84d94145..608dbf8660 100644
--- a/app/models/article.rb
+++ b/app/models/article.rb
@@ -47,7 +47,7 @@ def spam
before_create :set_defaults, :create_guid
after_create :add_notifications
- before_save :set_published_at, :ensure_settings_type
+ before_save :set_published_at, :ensure_settings_type, :set_permalink
after_save :post_trigger
after_save :keywords_to_tags
@@ -72,6 +72,11 @@ def initialize(*args)
end
end
+ def set_permalink
+ return if self.state == 'draft'
+ self.permalink = self.title.to_permalink if self.permalink.nil? or self.permalink.empty?
+ end
+
def has_child?
Article.exists?({:parent_id => self.id})
end
@@ -432,7 +437,7 @@ def set_defaults
self.permalink.to_s =~ /article-draft/ or
self.state == "draft"
)
- self.permalink = self.title.to_permalink
+ set_permalink
end
if blog && self.allow_comments.nil?
self.allow_comments = blog.default_allow_comments
From 564c0a6740851ec221b9eec669f6c8a08464d01b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?=
Date: Mon, 5 Mar 2012 19:53:08 +0100
Subject: [PATCH 13/35] Adds permalink field to category creation
---
app/models/category.rb | 6 +++---
app/views/admin/categories/new.html.erb | 7 +++++++
spec/models/category_spec.rb | 13 +++++++++++++
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/app/models/category.rb b/app/models/category.rb
index 94707aafa8..4e1108a4cd 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -75,10 +75,10 @@ def to_param
protected
- before_save :set_defaults
+ before_save :set_permalink
- def set_defaults
- self.permalink ||= self.name.to_permalink
+ def set_permalink
+ self.permalink = self.name.to_permalink if self.permalink.nil? or self.permalink.empty?
end
validates_presence_of :name
diff --git a/app/views/admin/categories/new.html.erb b/app/views/admin/categories/new.html.erb
index 110f11573a..57bce5cb1a 100644
--- a/app/views/admin/categories/new.html.erb
+++ b/app/views/admin/categories/new.html.erb
@@ -15,6 +15,13 @@
<%= text_field :category, :keywords, :class => 'large' %>
+
+
+
+ <%= text_field :category, :permalink, :class => 'large' %>
+ <%= _("Your category slug. Leave empty if you don't know what to put here") %>
+
+
diff --git a/spec/models/category_spec.rb b/spec/models/category_spec.rb
index 5f0515f58d..8c247fcc99 100644
--- a/spec/models/category_spec.rb
+++ b/spec/models/category_spec.rb
@@ -23,6 +23,19 @@
c.articles.size.should == 2
c.published_articles.size.should == 1
end
+
+ it "empty permalink should be converted" do
+ Factory(:blog)
+ c = Category.create(:name => "test 1")
+ c.permalink.should == "test-1"
+ end
+
+ it "category with permalink should not have permalink generated" do
+ Factory(:blog)
+ c = Category.create(:name => "Test 2", :permalink => "yeah-nice-one")
+ c.permalink.should == "yeah-nice-one"
+ end
+
end
describe Category do
From 5d2c6dcbe5b14cf52c37b6b6176e0932b737f355 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?=
Date: Tue, 6 Mar 2012 21:55:07 +0100
Subject: [PATCH 14/35] Fixes permalink not being correctly updated when
updating a permalink. closes #62
The old behavior was rather buggy as it created a new redirect everytime an article or page permalink was updated. This shortened URL was never displayed because we only called the first redirect instead of the last one.
This commit:
* Fixes existing old shortened URL showing when multiple shorten URLS exist
* Fixes this behavior by updating the existing shortened URL when a published article or page permalink is updated
* Moves the shortened URL creation from controller to model
* Removes duplicate code between admin/content_controller and admin/page_controller
* Adds specs as this part was never tested before
* Tells a story about a young farm boy, a princess called Buttercup (silly name if you want my opinion), true love and high adventure, pirates, princess, giants, miracles, fencing, and rodents of unusual size.
---
app/controllers/admin/content_controller.rb | 16 +-----------
app/controllers/admin/pages_controller.rb | 15 -----------
app/models/article.rb | 4 +--
app/models/content.rb | 20 ++++++++++++++-
app/models/page.rb | 1 +
spec/models/article_spec.rb | 26 +++++++++++++++++++
spec/models/page_spec.rb | 28 +++++++++++++++++++++
7 files changed, 77 insertions(+), 33 deletions(-)
diff --git a/app/controllers/admin/content_controller.rb b/app/controllers/admin/content_controller.rb
index 6c20ffefae..6ef4ebf969 100644
--- a/app/controllers/admin/content_controller.rb
+++ b/app/controllers/admin/content_controller.rb
@@ -92,7 +92,7 @@ def autosave
@article.text_filter = current_user.text_filter if current_user.simple_editor?
get_fresh_or_existing_draft_for_article
-
+
@article.attributes = params[:article]
@article.published = false
set_article_author
@@ -171,7 +171,6 @@ def new_or_edit
if @article.save
destroy_the_draft unless @article.draft
set_article_categories
- set_shortened_url if @article.published
set_the_flash
redirect_to :action => 'index'
return
@@ -229,19 +228,6 @@ def set_article_categories
end
end
- def set_shortened_url
- # In a very short time, I'd like to have permalink modification generate a 301 redirect as well to
- # So I set this up the big way now
-
- return unless Redirect.find_by_to_path(@article.permalink_url).nil?
-
- red = Redirect.new
- red.from_path = red.shorten
- red.to_path = @article.permalink_url
- red.save
- @article.redirects << red
- end
-
def def_build_body
if @article.body =~ //
body = @article.body.split('')
diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb
index a65e3cb6d9..8c95c8b68b 100644
--- a/app/controllers/admin/pages_controller.rb
+++ b/app/controllers/admin/pages_controller.rb
@@ -19,7 +19,6 @@ def new
if request.post?
@page.published_at = Time.now
if @page.save
- set_shortened_url if @page.published
flash[:notice] = _('Page was successfully created.')
redirect_to :action => 'index'
end
@@ -32,7 +31,6 @@ def edit
@page = Page.find(params[:id])
@page.attributes = params[:page]
if request.post? and @page.save
- set_shortened_url if @page.published
flash[:notice] = _('Page was successfully updated.')
redirect_to :action => 'index'
end
@@ -46,19 +44,6 @@ def destroy
redirect_to :action => 'index'
end
- def set_shortened_url
- # In a very short time, I'd like to have permalink modification generate a 301 redirect as well to
- # So I set this up the big way now
-
- return unless Redirect.find_by_to_path(@page.permalink_url).nil?
-
- red = Redirect.new
- red.from_path = red.shorten
- red.to_path = @page.permalink_url
- red.save
- @page.redirects << red
- end
-
# TODO Duplicate with Admin::ContentController
def insert_editor
editor = 'visual'
diff --git a/app/models/article.rb b/app/models/article.rb
index 608dbf8660..c80469b734 100644
--- a/app/models/article.rb
+++ b/app/models/article.rb
@@ -48,8 +48,7 @@ def spam
before_create :set_defaults, :create_guid
after_create :add_notifications
before_save :set_published_at, :ensure_settings_type, :set_permalink
- after_save :post_trigger
- after_save :keywords_to_tags
+ after_save :post_trigger, :keywords_to_tags, :shorten_url
scope :category, lambda {|category_id| {:conditions => ['categorizations.category_id = ?', category_id], :include => 'categorizations'}}
scope :drafts, lambda { { :conditions => { :state => 'draft' }, :order => 'created_at DESC' } }
@@ -285,6 +284,7 @@ def self.get_or_build_article id = nil
art.allow_comments = art.blog.default_allow_comments
art.allow_pings = art.blog.default_allow_pings
art.text_filter = art.blog.text_filter
+ art.old_permalink = art.permalink_url unless art.permalink.nil? or art.permalink.empty?
art.published = true
end
end
diff --git a/app/models/content.rb b/app/models/content.rb
index 8aa5484f8d..1d6e646a46 100644
--- a/app/models/content.rb
+++ b/app/models/content.rb
@@ -69,6 +69,24 @@ def invalidates_cache?(on_destruction = false)
(changed? && published?) || just_changed_published_status?
end
end
+
+ def shorten_url
+ return unless self.published
+
+ r = Redirect.new
+ r.from_path = r.shorten
+ r.to_path = self.permalink_url
+
+ # This because updating self.redirects.first raises ActiveRecord::ReadOnlyRecord
+ unless (red = self.redirects.first).nil?
+ return if red.to_path == self.permalink_url
+ r.from_path = red.from_path
+ red.destroy
+ self.redirects.clear # not sure we need this one
+ end
+
+ self.redirects << r
+ end
class << self
def content_fields *attribs
@@ -262,7 +280,7 @@ def normalized_permalink_url
def short_url
# Double check because of crappy data in my own old database
return unless self.published and self.redirects.count > 0
- blog.url_for(redirects.first.from_path, :only_path => false)
+ blog.url_for(redirects.last.from_path, :only_path => false)
end
end
diff --git a/app/models/page.rb b/app/models/page.rb
index f098374cb2..6b0de0f892 100644
--- a/app/models/page.rb
+++ b/app/models/page.rb
@@ -9,6 +9,7 @@ class Page < Content
setting :password, :string, ''
before_save :set_permalink
+ after_save :shorten_url
def set_permalink
self.name = self.title.to_permalink if self.name.blank?
diff --git a/spec/models/article_spec.rb b/spec/models/article_spec.rb
index e5e23141a5..8211a54828 100644
--- a/spec/models/article_spec.rb
+++ b/spec/models/article_spec.rb
@@ -184,6 +184,32 @@ def assert_results_are(*expected)
### XXX: Should we have a test here?
it "test_send_multiple_pings" do
end
+
+ describe "Testing redirects" do
+ it "a new published article gets a redirect" do
+ a = Article.create(:title => "Some title", :body => "some text", :published => true)
+ a.redirects.first.should_not be_nil
+ a.redirects.first.to_path.should == a.permalink_url
+ end
+
+ it "a new unpublished article should not get a redirect" do
+ a = Article.create(:title => "Some title", :body => "some text", :published => false)
+ a.redirects.first.should be_nil
+ end
+
+ it "Changin a published article permalink url should only change the to redirection" do
+ a = Article.create(:title => "Some title", :body => "some text", :published => true)
+ a.redirects.first.should_not be_nil
+ a.redirects.first.to_path.should == a.permalink_url
+ r = a.redirects.first.from_path
+
+ a.permalink = "some-new-permalink"
+ a.save
+ a.redirects.first.should_not be_nil
+ a.redirects.first.to_path.should == a.permalink_url
+ a.redirects.first.from_path.should == r
+ end
+ end
describe "with tags" do
it "recieves tags from the keywords property" do
diff --git a/spec/models/page_spec.rb b/spec/models/page_spec.rb
index 7674750ff8..50775f994b 100644
--- a/spec/models/page_spec.rb
+++ b/spec/models/page_spec.rb
@@ -9,6 +9,34 @@
end
end
+describe "Testing redirects" do
+ it "a new published page gets a redirect" do
+ a = Page.create(:title => "Some title", :body => "some text", :published => true)
+ a.should be_valid
+ a.redirects.first.should_not be_nil
+ a.redirects.first.to_path.should == a.permalink_url
+ end
+
+ it "a new unpublished page should not get a redirect" do
+ a = Page.create(:title => "Another title", :body => "some text", :published => false)
+ a.redirects.first.should be_nil
+ end
+
+ it "Changin a published article permalink url should only change the to redirection" do
+ a = Page.create(:title => "Third title", :body => "some text", :published => true)
+ a.should be_valid
+ a.redirects.first.should_not be_nil
+ a.redirects.first.to_path.should == a.permalink_url
+ r = a.redirects.first.from_path
+
+ a.name = "some-new-permalink"
+ a.save
+ a.redirects.first.should_not be_nil
+ a.redirects.first.to_path.should == a.permalink_url
+ a.redirects.first.from_path.should == r
+ end
+end
+
describe 'Given the fixture :first_page' do
before(:each) do
Factory(:blog)
From 75c407378096bfc211d33349145f2a08562738ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?=
Date: Tue, 6 Mar 2012 22:01:56 +0100
Subject: [PATCH 15/35] Fixes the comment management bulk operations. Closes
#46
---
app/views/admin/feedback/_button.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/admin/feedback/_button.html.erb b/app/views/admin/feedback/_button.html.erb
index 46dadc94f5..62b3ccdc79 100644
--- a/app/views/admin/feedback/_button.html.erb
+++ b/app/views/admin/feedback/_button.html.erb
@@ -3,7 +3,7 @@
<%= hidden_field_tag "confirmed", params[:confirmed] %>
<%= hidden_field_tag "published", params[:published] %>