<%= labelled_field(f.select(:status,
Page.status_labels.invert,
{},
data: {
"page-options-target": "published",
action: "change->page-options#checkPublishedDate"
}),
"Status",
errors: @page.errors[:status]) %>
<%= labelled_field (
f.date_select(
:published_at,
{ start_year: (Time.now.year - 20),
end_year: (Time.now.year + 5),
with_css_classes: true },
data: { action: "change->page-options#checkAutoPublish" }
) +
'
'.html_safe +
f.time_select(:published_at,
{ with_css_classes: true,
ignore_date: true },
data: { action: "change->page-options#checkAutoPublish" })
),
"Date",
errors: @page.errors[:published_at]
%>
This page will publish later
<%= labelled_field (
f.select(:user_id, page_authors(@page).map{|a| [a.name, a.id]})
),
"Author",
errors: @page.errors[:user_id]
%>
<%= f.check_box(:pinned) %>
Make post featured
<% if @categories.length > 0 %>
<% @categories.each do |category| %>
<%= check_box_tag("category[#{category.id}]",
"1",
@page.categories.map { |c| c.id }.include?(category.id)) %>
<%= category.name %>
<% end %>
<% end %>
<%= labelled_field(f.select(:template, available_templates_for_select),
"Template",
errors: @page.errors[:template]) %>
<%= link_to("Advanced options",
"#",
class: "advanced-toggle",
data: { action: "click->page-options#toggleAdvancedOptions" }) %>
<%= f.check_box(:feed_enabled) %> RSS feed enabled
<%= f.check_box(:news_page) %> Show in News
<%= labelled_field f.text_field(:unique_name), "Unique name", errors: @page.errors[:unique_name] %>
<%= labelled_field f.text_field(:redirect_to), "Redirect", errors: @page.errors[:redirect_to] %>
<% if @page.id? && @page.name? %>
<%= link_to(page_path(@page.locale, @page),
page_path(@page.locale, @page)) %>
<% end %>