Skip to content
Snippets Groups Projects
Commit f14f7c28 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

statics

parent 825359c7
No related branches found
No related tags found
No related merge requests found
Showing
with 110 additions and 24 deletions
......@@ -10,6 +10,19 @@ module WithBlocks
blocks.collect &:git_dependencies
end
def content
unless @content
@content = []
blocks.with_no_heading.published.ordered.each do |block|
@content << block
end
headings.ordered.each do |heading|
@content << heading
end
end
@content
end
# Basic rule is: TOC if 2 titles or more
def show_toc?
blocks.published
......
best_featured_image = @about.best_featured_image
json.image do
json.id best_featured_image.blob.id
json.alt @about.best_featured_image_alt
json.credit @about.best_featured_image_credit
end if best_featured_image&.attached?
json.translation_key @about.static_translation_key
json.meta_description @about.meta_description
full_width = local_assigns.has_key?(:full_width) ? local_assigns[:full_width]
: @about.full_width
toc_offcanvas = local_assigns.has_key?(:toc_offcanvas) ? local_assigns[:toc_offcanvas]
: @about.full_width
toc_present = local_assigns.has_key?(:toc_present) ? local_assigns[:toc_present]
: @about.show_toc?
json.design do
json.full_width full_width
json.toc do
json.present toc_present
json.offcanvas toc_offcanvas
end
end
json.summary @about.summary
json.kind 'block'
json.position block.position
json.template block.template_kind
json.data do
json.partial! "admin/communication/blocks/templates/#{block.template_kind}/static", block: block
end
\ No newline at end of file
json.content about.content do |block_or_heading|
if block_or_heading.is_a? Communication::Block
json.partial! 'admin/communication/blocks/block_static', block: block_or_heading
else
end
end
\ No newline at end of file
json.extract! @block,
:template_kind,
:published,
:position,
:data
heading = @block.heading
json.heading do
json.extract! heading, :id, :title
end if heading
\ No newline at end of file
json.layout block.template.layout
json.description block.template.description
json.with_link block.template.with_link
json.partners block.template.elements do |element|
if element.organization
json.slug element.organization.slug
end
end
\ No newline at end of file
<% content_for :title, @page %>
<%= render 'admin/communication/websites/sidebar' do %>
<div class="row">
<div class="col-lg-7">
<%= osuny_panel Communication::Website::Page.human_attribute_name(:title), small: true do %>
<p class="lead"><%= @page.title %></p>
<% end %>
</div>
<div class="offset-lg-1 col-lg-4">
<%= render 'admin/application/featured_image/show', about: @page, small: true %>
</div>
</div>
<%= render 'admin/communication/websites/pages/show/heading' %>
<hr class="my-5">
<%= render 'admin/application/a11y/widget', about: @page, horizontal: true, small: true %>
<hr class="my-5">
<div class="row">
<div class="col-lg-4">
<%= render 'admin/communication/websites/pages/show/metadata' %>
<%= render 'admin/application/i18n/widget', about: @page, small: true %>
</div>
<div class="col-lg-8">
<%= render 'admin/application/summary/show', about: @page, small: true %>
<%= render 'admin/application/meta_description/show', about: @page, small: true %>
</div>
</div>
<%= render 'admin/communication/websites/pages/show/details' %>
<%= render 'admin/communication/blocks/index_edit', about: @page %>
<% end %>
......
<div class="row">
<div class="col-lg-4">
<%= render 'admin/communication/websites/pages/show/metadata' %>
<%= render 'admin/application/i18n/widget', about: @page, small: true %>
</div>
<div class="col-lg-8">
<%= render 'admin/application/summary/show', about: @page, small: true %>
<%= render 'admin/application/meta_description/show', about: @page, small: true %>
</div>
</div>
<div class="row">
<div class="col-lg-7">
<%= osuny_panel Communication::Website::Page.human_attribute_name(:title), small: true do %>
<p class="lead"><%= @page.title %></p>
<% end %>
</div>
<div class="offset-lg-1 col-lg-4">
<%= render 'admin/application/featured_image/show', about: @page, small: true %>
</div>
</div>
json.extract! @page,
json.extract! @about,
:title,
:breadcrumb_title
json.partial! 'admin/application/static/permalink'
\ No newline at end of file
:breadcrumb_title,
:position
json.partial! 'admin/application/static/permalink'
json.partial! 'admin/application/static/design'
json.layout @about.static_layout if @about.static_layout
json.has do
json.administrators @website.has_administrators?
json.authors @website.has_authors?
json.researchers @website.has_researchers?
json.teachers @website.has_teachers?
end if @about.is_a?(Communication::Website::Page::Person)
json.partial! 'admin/application/i18n/static'
json.bodyclass @about.best_bodyclass
json.partial! 'admin/application/featured_image/static'
json.children @about.children
.published
.ordered
.select { |child| child.is_listed_among_children? }
.collect(&:path)
json.partial! 'admin/application/meta_description/static'
json.partial! 'admin/application/summary/static'
json.header_text @about.header_text
json.partial! 'admin/communication/blocks/static', about: @about
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment