Permalink
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...
1 parent 9ce22aa commit 222f639e1fe06d218e36134be4adb901a3420665 @fdv fdv committed Mar 2, 2014
@@ -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
@@ -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
@@ -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'>
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:

0 comments on commit 222f639

Please sign in to comment.