Permalink
Browse files

Merge branch 'master' into rails4

Conflicts:
	.travis.yml
	core/app/controllers/refinery/admin/core_controller.rb
	core/lib/refinery/crud.rb
	pages/app/models/refinery/page.rb
	pages/spec/models/refinery/page_spec.rb
  • Loading branch information...
2 parents 1183105 + 9310913 commit 4f48bb6ca27aacc8dd9ad8dd934374d6f89ed0d3 @parndt parndt committed Aug 8, 2012
View
@@ -18,9 +18,9 @@ env:
- DB=mysql
matrix:
allow_failures:
- - rvm: jruby-19mode
- rvm: rbx-19mode
+ - rvm: jruby-19mode
rvm:
- 1.9.3
+ - rbx-19mode
- jruby-19mode
- - rbx-19mode
View
@@ -2,7 +2,7 @@
* Refactored wysiwyg fields into a partial. [#1796](https://github.com/resolve/refinerycms/pull/1796). [Rob Yurkowski](https://github.com/robyurkowski)
* Shortened all authentication helpers. [#1719](https://github.com/resolve/refinerycms/pull/1719). [Ryan Bigg](https://github.com/radar)
-* Added canonical page id to body to allow CSS selectors to target specific pages instead of including special CSS files. [#1700](https://github.com/resolve/refinerycms/pull/1700) & [#1828](https://github.com/resolve/refinerycms/pull/1828). [Philip Arndy](https://github.com/parndt) & [Graham Wagener](https://github.com/gwagener/)
+* Added canonical page id to body to allow CSS selectors to target specific pages instead of including special CSS files. [#1700](https://github.com/resolve/refinerycms/pull/1700) & [#1828](https://github.com/resolve/refinerycms/pull/1828). [Philip Arndt](https://github.com/parndt) & [Graham Wagener](https://github.com/gwagener/)
* [See full list](https://github.com/resolve/refinerycms/compare/2-0-stable...master)
@@ -13,6 +13,7 @@
* Fixed page reorder issue on Ruby 1.8.x. [#1585](https://github.com/resolve/refinerycms/issues/1585). [Uģis Ozols](https://github.com/ugisozols) & [Philip Arndt](https://github.com/parndt).
* Allowed to override presenters using `rake refinery:override`. [#1790](https://github.com/resolve/refinerycms/pull/1790). [Kevin Bullock](https://github.com/krbullock).
* Fixed issue with saving settings in generated form extension by completely rewriting settings controller. [#1817](https://github.com/resolve/refinerycms/issues/1817). [Uģis Ozols](https://github.com/ugisozols)
+* Removed Refinery::Page#title_with_meta in favour of view helpers. [#1847](https://github.com/resolve/refinerycms/pull/1847). [Philip Arndt](https://github.com/parndt)
## 2.0.5 [11 June 2012]
* Now extension/form generators will add all attributes to attr_accessible. [#1613](https://github.com/resolve/refinerycms/pull/1613). [Uģis Ozols](https://github.com/ugisozols)
@@ -1,26 +1,42 @@
module ::Refinery
module Admin
class DialogsController < ::Refinery::AdminController
+ TYPES = %w[image link]
+
+ before_filter :find_dialog_type, :find_iframe_src, :only => [:show]
+
def index
redirect_to refinery.admin_root_path
end
def show
- @dialog_type = params[:id].downcase
+ render :layout => false
+ end
+
+ def from_dialog?
+ true
+ end
+
+ protected
+ def find_dialog_type
+ error_404 if TYPES.exclude? params[:id].downcase
- url_params = params.reject {|key, value| key =~ /(action)|(controller)/}
+ @dialog_type = params[:id].downcase
+ end
- @iframe_src = if @dialog_type == 'image'
- refinery.insert_admin_images_path(url_params.merge(:id => nil, :modal => true))
+ def find_iframe_src
+ if @dialog_type == 'image'
+ @iframe_src = refinery.insert_admin_images_path(
+ url_params.merge(:modal => true)
+ )
elsif @dialog_type == 'link'
- refinery.link_to_admin_pages_dialogs_path(url_params.merge(:id => nil))
+ @iframe_src = refinery.link_to_admin_pages_dialogs_path url_params
end
-
- render :layout => false
end
- def from_dialog?
- true
+ def url_params
+ params.reject {|key, value| /(action)|(controller)/ === key}.
+ merge :id => nil
end
end
@@ -0,0 +1,28 @@
+sk:
+ refinery:
+ plugins:
+ <%= plural_name %>:
+ title: <%= plural_name.titleize %>
+ <%= namespacing.underscore %>:
+ admin:
+ <%= plural_name %>:
+ actions:
+ create_new: Pridať <%= singular_name.titleize %>
+ reorder: Preusporiadať <%= singular_name.titleize.pluralize %>
+ reorder_done: Koniec radenia <%= singular_name.titleize.pluralize %>
+ records:
+ title: <%= plural_name.titleize %>
+ sorry_no_results: Ľutujeme, ale neboli nájdené žiadne výsledky.
+ no_items_yet: Nie sú vytvorené žiadne <%= singular_name.titleize.pluralize %>. Kliknite na "Pridať <%= singular_name.titleize %>" pre pridanie prvého <%= singular_name.titleize.downcase %>.
+ <%= singular_name %>:
+ view_live_html: Zobraziť náhľad <%= singular_name.titleize.downcase %><br/><em>(otvorí sa v novom okne)</em>
+ edit: Upraviť <%= singular_name.titleize.downcase %>
+ delete: Zmazať <%= singular_name.titleize.downcase %>
+ <%= plural_name %>:
+ show:
+ other: Daľšie <%= singular_name.titleize.pluralize %>
+ activerecord:
+ attributes:
+ 'refinery/<%= namespacing.underscore %>/<%= singular_name %>':<% attributes.each do |a| %>
+ <%= a.name %>: <%= a.name.titleize -%>
+<% end -%>
@@ -1,7 +1,7 @@
<li class='clearfix record <%%= cycle("on", "on-hover") %>'>
<span class='title'>
<%%= link_to <%= singular_name %>.name, refinery.<%= namespacing.underscore %>_admin_<%= singular_name %>_path(<%= singular_name %>) %> <%%= t('.said') %>
- <span class="preview"><%%= truncate(strip_tags(<%= singular_name %>.message), :length => 60) -%></span>
+ <span class="preview"><%%= truncate(strip_tags(sanitize(<%= singular_name %>.message)), :length => 60) -%></span>
</span>
<span class='actions'>
<%%= link_to refinery_icon_tag('delete.png'), refinery.<%= namespacing.underscore %>_admin_<%= singular_name %>_path(<%= singular_name %>),
@@ -0,0 +1,78 @@
+cs:
+ refinery:
+ plugins:
+ <%= plural_name %>:
+ title: <%= plural_name.titleize %>
+ description: Poskytuje kontaktní formulář a zaznamenáva <%= plural_name.humanize.downcase %>
+ <%= namespacing.underscore %>:
+ <%= plural_name %>:
+ new:
+ send: Odeslat zprávu
+ privacy_policy: Chráníme vaše soukromí
+ admin:
+ <%= plural_name %>:
+ delete: Trvale odstranit <%= singular_name.humanize.downcase %>
+ <%= singular_name %>:
+ read_<%= singular_name %>: Přečíst <%= singular_name.humanize.downcase %>
+ said: řekl
+ mark_as_spam: Označit jako spam
+ mark_as_ham: Označit jako přečtené
+ submenu:
+ inbox: Inbox
+ spam: Spam
+ update_notified: Upravit seznam notifikovaných
+ edit_confirmation_email: Upravit potvrzovací e-mail
+ index:
+ no_<%= plural_name %>: Zatím jste neobdrželi žádné <%= plural_name.humanize.downcase %>.
+ spam:
+ no_spam: Hurá! Nemáte žádný spam.
+ show:
+ details: Podrobnosti
+ age: Věk
+ actions: Akce
+ back_to_all_<%= plural_name %>: Zpět na všechny <%= plural_name.humanize.downcase %>
+ spam: Spam
+ spam_yes: 'ano'
+ <%= singular_name %>: <%= class_name.underscore.titleize %>
+ to: Komu
+ from: Od
+ click_to_email: Klikněte pro odeslání této adresy e-mailem
+ phone: Telefon
+ date: Datum
+ message: Zpráva
+ settings:
+ notification_recipients_form:
+ settings_value_name: Zaslat upozornění pro
+ explanation: Pokaždé, když Vás někdo kontaktuje přes vaše webové stránky, Refinery odešle e-mail s upozorněním na nový <%= singular_name.humanize.downcase %>.
+ hint: Když je odeslán nový <%= singular_name.humanize.downcase %>, Refinery pošle upozornení na Váš e-mail.
+ example: "Zadejte e-mailové adresy jako: jack@work.com, jill@office.com"
+ confirmation_email_form:
+ to: Komu
+ from: Od
+ subject: Předmet
+ click_to_edit_subject: Klikněte zde pro editaci předmetu
+ explanation: Když Vás někdo kontaktuje přes vaše webové stránky, Refinery odešle e-mail s potvrzením o přijetí odesílateli <%= singular_name.humanize.downcase %>.
+ below_edit_email_sent: Níže můžete upravit e-mail, který je odeslán.
+ the_customer_making_<%= singular_name %>: Klient delá <%= singular_name.humanize.downcase %>
+ message: Zpráva
+ note: "Poznámka: umístěte text %name%, pro určení pozice jména klienta v e-maile"
+ mailer:
+ notification:
+ greeting: Hi there
+ you_recieved_new_<%= singular_name %>: You just received a new <%= singular_name.humanize.downcase %> on your website.
+ <%= singular_name %>_starts: --- <%= singular_name.humanize.downcase %> starts ---
+ <%= singular_name %>_ends: --- <%= singular_name.humanize.downcase %> ends ---
+ from: Od
+ email: E-mail
+ phone: Telefon
+ message: Zpráva
+ closing_line: S pozdravem
+ ps_html: P.S. Všechny vaše <%= plural_name.humanize.downcase %> jsou uloženy pod záložkou "<%= plural_name.titleize %>" v Refinery, pokud by jste je chtěli zobrazit pozdeji.
+ activerecord:
+ models:
+ <%= singular_name %>: <%= class_name.underscore.titleize %>
+ attributes:
+ <%= singular_name %>:
+<% attributes.each do |a| -%>
+ <%= a.name %>: <%= a.name.humanize %>
+<% end -%>
@@ -0,0 +1,78 @@
+sk:
+ refinery:
+ plugins:
+ <%= plural_name %>:
+ title: <%= plural_name.titleize %>
+ description: Poskytuje kontaktný formulár a zaznamenáva <%= plural_name.humanize.downcase %>
+ <%= namespacing.underscore %>:
+ <%= plural_name %>:
+ new:
+ send: Odoslať správu
+ privacy_policy: Chránime vaše súkromie
+ admin:
+ <%= plural_name %>:
+ delete: Trvalo odstrániť <%= singular_name.humanize.downcase %>
+ <%= singular_name %>:
+ read_<%= singular_name %>: Prečítať <%= singular_name.humanize.downcase %>
+ said: povedal
+ mark_as_spam: Označiť ako spam
+ mark_as_ham: Označiť ako prečítané
+ submenu:
+ inbox: Inbox
+ spam: Spam
+ update_notified: Upraviť zoznam notifikovaných
+ edit_confirmation_email: Upraviť potvrdzovací e-mail
+ index:
+ no_<%= plural_name %>: Zatiaľ ste neobdržali žiadne <%= plural_name.humanize.downcase %>.
+ spam:
+ no_spam: Hurá! Nemáte žiaden spam.
+ show:
+ details: Podrobnosti
+ age: Vek
+ actions: Akcie
+ back_to_all_<%= plural_name %>: Späť na všetky <%= plural_name.humanize.downcase %>
+ spam: Spam
+ spam_yes: 'áno'
+ <%= singular_name %>: <%= class_name.underscore.titleize %>
+ to: Komu
+ from: Od
+ click_to_email: Kliknite pre odoslanie tejto adresy e-mailom
+ phone: Telefón
+ date: Dátum
+ message: Správa
+ settings:
+ notification_recipients_form:
+ settings_value_name: Poslať upozornenie pre
+ explanation: Zakaždým, keď Vás niekto kontaktuje cez vaše webové stránky, Refinery odošle e-mail s upozornením na nový <%= singular_name.humanize.downcase %>.
+ hint: Keď je odoslaný nový <%= singular_name.humanize.downcase %>, Refinery odošle upozornenie na Váš e-mail.
+ example: "Zadajte e-mailovú adresu(y) ako: jack@work.com, jill@office.com"
+ confirmation_email_form:
+ to: Komu
+ from: Od
+ subject: Predmet
+ click_to_edit_subject: Kliknite tu ak chcete upraviť predmet
+ explanation: Zakaždým, keď Vás niekto kontaktuje cez vaše webové stránky, Refinery odošle e-mail s potvrdením o prijatí odosielateľovi <%= singular_name.humanize.downcase %>.
+ below_edit_email_sent: Nižšie môžete upraviť e-mail, ktorý je odosielaný.
+ the_customer_making_<%= singular_name %>: Klient robiť <%= singular_name.humanize.downcase %>
+ message: Správa
+ note: "Poznámka: umiestniťe text %name%, pre určenie pozície mena klienta v e-maile"
+ mailer:
+ notification:
+ greeting: Ahoj
+ you_recieved_new_<%= singular_name %>: Práve ste obdržali nový <%= singular_name.humanize.downcase %> na vašej webové stránke.
+ <%= singular_name %>_starts: --- <%= singular_name.humanize.downcase %> začiatok ---
+ <%= singular_name %>_ends: --- <%= singular_name.humanize.downcase %> koniec ---
+ from: Od
+ email: E-mail
+ phone: Telefón
+ message: Správa
+ closing_line: S pozdravom
+ ps_html: P.S. Všetky vaše <%= plural_name.humanize.downcase %> sú uložené v "<%= plural_name.titleize %>" sekcii v Refinery, ak by ste ich chceli zobraziť neskôr.
+ activerecord:
+ models:
+ <%= singular_name %>: <%= class_name.underscore.titleize %>
+ attributes:
+ <%= singular_name %>:
+<% attributes.each do |a| -%>
+ <%= a.name %>: <%= a.name.humanize %>
+<% end -%>
@@ -217,7 +217,7 @@ def merge_locales!
# get the path to the existing file and perform a deep hash merge.
current_path = extension_path_for(path, extension_name, false)
new_contents = nil
- if %r{.yml$} === new_file_path.to_s
+ if File.exist?(new_file_path) && %r{.yml$} === new_file_path.to_s
# merge translation files together.
new_contents = YAML::load(new_file_path.read).deep_merge(
YAML::load(current_path.read)
@@ -19,9 +19,10 @@ module Refinery
end
context "a" do
- it "have empty iframe src" do
+ it "404s" do
+ Admin::DialogsController.any_instance.should_receive(:error_404).once
+
visit refinery.admin_dialog_path('a')
- page.should have_selector("iframe[src='']")
end
end
end
@@ -1,6 +1,8 @@
h2. Changing Page Parts
-Refinery sets up two default page parts +Body+ and +Side Body+. Sometimes this is not suitable for your project. This guide will show you how to:
+Refinery sets up two default page parts +Body+ and +Side Body+.
+Sometimes this is not suitable for your project.
+This guide will show you how to:
* Change the default page parts to be something else
* Add a new page part to a single page
@@ -9,18 +11,23 @@ endprologue.
h3. Changing default Page Parts
-By default, Refinery provides you with +Body+ and +Side Body+ page parts since most pages have a two column-style layout. If your layout has three content areas or one, you're going to want to update this setting to reflect that.
+By default, Refinery provides you with +Body+ and +Side Body+ page parts since
+most pages have a two column-style layout. If your layout has three content
+areas or one, you're going to want to update this setting to reflect that.
-Within @config/initializers/refinery/pages.rb@ you will see various default settings are commented out, including the following:
+Within @config/initializers/refinery/pages.rb@ you will see various default
+settings are commented out, including the following:
<ruby>
# Configure global page default parts
# config.default_parts = ["Body", "Side Body"]
</ruby>
-Edit this code to have the names of the default page parts you want, click +Save+ and you're done.
+Edit this code to have the names of the default page parts you want, click +Save+
+and you're done.
-Here's a sample of a site that would have three content areas on most of its pages.
+Here's a sample of a site that would have three content areas on most of its
+pages.
<ruby>
# Configure global page default parts
@@ -29,24 +36,39 @@ Here's a sample of a site that would have three content areas on most of its pag
h3. Changing Page Parts for a single page
-Often we find our home pages have three or more page parts but the rest of the site only needs two. In this situation you just want to have the default page parts set to Body and Side Body and your home page setup to have an extra one.
+Often we find our home pages have three or more page parts but the rest of the
+site only needs two. In this situation you just want to have the default page
+parts set to Body and Side Body and your home page setup to have an extra one.
-Refinery supports the ability for the user to add new Page Parts on the fly when editing a page.
+Refinery supports the ability for the user to add new Page Parts on the fly when
+editing a page.
-To add a new Page Part just to the home page, refer back to @config/initializers/refinery/pages.rb@. Inside, you should see the following:
+To add a new Page Part just to the home page, refer back to
+@config/initializers/refinery/pages.rb@. Inside, you should see the following:
<ruby>
# config.new_page_parts = false
</ruby>
Uncomment this and change the value to true, save, and restart your server.
-Now go to your "Pages" tab in Refinery and edit your home page. You'll notice a plus and minus button at the top right of the visual editor. Click on the plus icon and add a new page part titled "Middle Body" and click save. A new visual editor will appear in a tab called "Middle Body" ready to use just for this page. Inserting content there will show up on any page that uses the @content_page@ partial (by default, all of them).
+Now go to your "Pages" tab in Refinery and edit your home page. You'll notice a
+plus and minus button at the top right of the visual editor. Click on the plus
+icon and add a new page part titled "Middle Body" and click save. A new visual
+editor will appear in a tab called "Middle Body" ready to use just for this
+page. Inserting content there will show up on any page that uses the
+@content_page@ partial (by default, all of them).
-WARNING. If you've modified your @app/views/refinery/pages/home.html.erb@ file, you will not see your new page part until you set that page part to display in the view.
+WARNING. If you've modified your @app/views/refinery/pages/home.html.erb@ file,
+you will not see your new page part until you set that page part to display in
+the view.
-If you have modified your @home.html.erb@ file, you can use the following snippet to output the new part's content in your page:
+If you have modified your @home.html.erb@ file, you can use the following
+snippet to output the new part's content in your page:
<erb>
<%= raw @page.content_for(:middle_body) %>
</erb>
+
+NOTE: If you don't have a +app/views/refinery/pages/home.html.erb+ view already,
+run +rake refinery:override view=pages/home+ to copy it into your app.
Oops, something went wrong.

0 comments on commit 4f48bb6

Please sign in to comment.