Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Finally solving an issue where pages were created offline despite all…

… other content being online. For what I know, this issue has been present since about 9 years.

It was time wasn't it?

Fixes #383
  • Loading branch information...
commit 222f639e1fe06d218e36134be4adb901a3420665 1 parent 9ce22aa
Frédéric de Villamil fdv authored
3  app/controllers/admin/pages_controller.rb
View
@@ -18,7 +18,8 @@ def new
@page = Page.new(params[:page])
@page.user_id = current_user.id
@page.text_filter ||= default_textfilter
-
+ @page.published = true unless params[:page].present?
+
if request.post?
@page.published_at = Time.now
if @page.save
2  app/controllers/setup_controller.rb
View
@@ -57,7 +57,7 @@ def update_or_create_first_post_with_user user
end
def create_first_page user
- Page.create(name: "about", title: I18n.t("setup.page.about"), user: user, body: I18n.t("setup.page.body"))
+ Page.create(name: "about", published: true, title: I18n.t("setup.page.about"), user: user, body: I18n.t("setup.page.body"))
end
def check_config
2  app/views/admin/pages/_form.html.erb
View
@@ -59,7 +59,7 @@
<fieldset>
<legend><%= t(".publish_settings") %></legend>
<div class='control-group'>
- <%= t(".status") %>: <strong><%= @page.state.to_s.downcase %></strong>
+ <%= t(".status") %>: <strong><%= (@page.published) ? t(".published") : t(".offline") %></strong>
<%= toggle_element('status') %>
<div id='status' class='collapse'>
<label for="page_published" class='checkbox'>
2  config/locales/da.yml
View
@@ -521,6 +521,8 @@ da:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "There are no pages yet. Why don't you start and create one?"
feedback:
2  config/locales/de.yml
View
@@ -522,6 +522,8 @@ de:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "There are no pages yet. Why don't you start and create one?"
feedback:
2  config/locales/en.yml
View
@@ -524,6 +524,8 @@ en:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "There are no pages yet. Why don't you start and create one?"
feedback:
2  config/locales/es-MX.yml
View
@@ -522,6 +522,8 @@ es-MX:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "There are no pages yet. Why don't you start and create one?"
feedback:
2  config/locales/fr.yml
View
@@ -524,6 +524,8 @@ fr:
permanent_link: "Lien permanent"
page_with_action_name: "%{action} page"
type_your_post: "Tapez votre texte"
+ published: "publiée"
+ offline: "hors ligne"
pages:
no_pages: "Il n'y a pas encore de pages, pourquoi ne pas en créer une ? "
feedback:
2  config/locales/he-IL.yml
View
@@ -522,6 +522,8 @@ he-IL:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "There are no pages yet. Why don't you start and create one?"
feedback:
2  config/locales/it.yml
View
@@ -522,6 +522,8 @@ it:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "There are no pages yet. Why don't you start and create one?"
feedback:
2  config/locales/ja.yml
View
@@ -522,6 +522,8 @@ ja:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "There are no pages yet. Why don't you start and create one?"
feedback:
2  config/locales/lt.yml
View
@@ -521,6 +521,8 @@ lt:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "There are no pages yet. Why don't you start and create one?"
feedback:
2  config/locales/nb-NO.yml
View
@@ -522,6 +522,8 @@ nb-NO:
permanent_link: "Permanent lenke"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "Det finnes ingen pages enda. Hva med å opprette en?"
feedback:
2  config/locales/nl.yml
View
@@ -522,6 +522,8 @@ nl:
permanent_link: "Permanente link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "Er zijn nog geen pages. Waarom begin je er niet een te maken?"
feedback:
2  config/locales/pl.yml
View
@@ -522,6 +522,8 @@ pl:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "There are no pages yet. Why don't you start and create one?"
feedback:
2  config/locales/pt-BR.yml
View
@@ -522,6 +522,8 @@ pt-BR:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "Não existem pages ainda. Por que você não inicia e cria um?"
feedback:
2  config/locales/ro.yml
View
@@ -522,6 +522,8 @@ ro:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "There are no pages yet. Why don't you start and create one?"
feedback:
2  config/locales/ru.yml
View
@@ -522,6 +522,8 @@ ru:
permanent_link: "Постоянная ссылка"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "Ничего нет. Почему бы не начать и не добавить?"
feedback:
2  config/locales/zh-CN.yml
View
@@ -522,6 +522,8 @@ zh-CN:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "这儿并不存在Pages。让我们开始创建它。"
feedback:
2  config/locales/zh-TW.yml
View
@@ -521,6 +521,8 @@ zh-TW:
permanent_link: "Permanent link"
page_with_action_name: "%{action} page"
type_your_post: "Type your post"
+ published: "published"
+ offline: "offline"
pages:
no_pages: "There are no pages yet. Why don't you start and create one?"
feedback:
Please sign in to comment.
Something went wrong with that request. Please try again.