app/views/pages/edit.slim
- content_for(:title, @page.title)
= render 'edit_sidebar', page: @page
- low_priority_plugins = [Plugins::ActionsThermometer, Plugins::DonationsThermometer]
section.page-edit-step#basics data-icon='paragraph'
h1.page-edit-step__title = t('.content')
- if (@page.ak_petition_resource_uri.blank? || @page.ak_donation_resource_uri.blank?) && @page.created_at < (DateTime.now - 2.minutes)
.alert.alert-warning.ak-resource-pending role="alert" style="margin-top:-25px" id="ak-warning-msg"
p = t('pages.edit.ak_resource_missing')
= render 'form', page: @page
section.page-edit-step#layout data-icon='cog'
h1.page-edit-step__title = t('.settings')
= render 'settings_form', page: @page
- @page.plugins.each do |plugin|
- next if low_priority_plugins.include? plugin.class
section.page-edit-step id=plugin_section_id(plugin) data-icon=plugin_icon(plugin)
h1.page-edit-step__title= plugin_title(plugin)
= render "#{plugin.class.name.underscore.pluralize}/form", plugin: plugin, page: @page
section.page-edit-step#pictures data-icon='camera-retro'
h1.page-edit-step__title = t('.pictures')
= render 'photo_form', page: @page
section.page-edit-step#shares data-icon='share-square-o'
h1.page-edit-step__title = t('.shares')
= render 'shares_editor', page: @page
section.page-edit-step#sources data-icon='link'
h1.page-edit-step__title = t('.sources')
= render 'link_form', page: @page
section.page-edit-step.hidden-irrelevant#postActionSettings data-icon='cog'
h1.page-edit-step__title = t('.post_donate_settings')
= render 'follow_up_action_settings', page: @page
- @page.plugins.each do |plugin|
- next unless low_priority_plugins.include? plugin.class
section.page-edit-step id=plugin_section_id(plugin) data-icon=plugin_icon(plugin)
h1.page-edit-step__title= plugin_title(plugin)
= render "#{plugin.class.name.underscore.pluralize}/form", plugin: plugin, page: @page
section.page-edit-step.page-edit-step--just-title#review data-icon='eye' data-link-to=member_facing_page_url(@page)
h1.page-edit-step__title
= t('.view')
.btn-group.pull-right
= link_to 'Desktop', member_facing_page_path(@page), target: "_blank", class: 'btn btn-default'
= link_to 'Mobile', preview_page_path(@page), target: "_blank", class: 'btn btn-default'
javascript:
$(document).ready(function(){
window.ee.emit("pages:edit", #{@page.id});
window.ee.emit("activation:toggle");
window.ee.emit("shares:edit");
new PageEditBar();
if(#{@page.follow_up_liquid_layout.present?} && #{@page.follow_up_liquid_layout&.title == "Post Donate Page With Recurring Ask"}) {
$("#postActionSettings").removeClass('hidden-irrelevant');
}
$(".radio-group__option").on("click", function() {
try {
var selectedFollowUpTemplate = $(this).find('.layout-settings__title')[0].innerText;
if(selectedFollowUpTemplate === "Post Donate Page With Recurring Ask") {
console.log('Recurring ask');
$("#postActionSettings").removeClass('hidden-irrelevant');
} else {
$("#postActionSettings").addClass('hidden-irrelevant');
}
} catch (err){
console.log(err);
}
});
});