Merge branch 'simplify-front-page' into 'master'

Simplify front page

See merge request agaric/patternlibrary!5
This commit is contained in:
Clayton Dewey 2018-10-16 22:15:58 +00:00
commit ac3fe87aa1
2 changed files with 4 additions and 257 deletions

View file

@ -1,257 +0,0 @@
{#
/**
* @file
* Default theme implementation to display a single page.
*/
#}
{#
Limit the main content column to a max of 10 units at widescreen and above.
@see system/page.html.twig in the Bulma theme.
#}
{% if not page.content_attributes %}
{%
set page = page|merge({
'content_attributes': create_attribute().addClass([
'main-content',
'column',
'is-10-widescreen',
]),
})
%}
{% endif %}
{% block navbar %}
{% if page.navbar_branding or page.navbar_social or page.primary_menu %}
{# Top navbar #}
<div class="is-fixed">
<nav id="navbar" class="navbar transparent-header">
<div class="navbar-brand">
{% if page.navbar_branding %}
{# TODO: remove this link if is_front and *probably* add visually-hidden h1
with "agaric", again only on the front page, and only if we can't put our
name in an h1 on the front page in some other way. #}
<a href="{{ front_page }}" title="{{ 'Home'|t }}" rel="home" class="navbar-item">
{{ page.navbar_branding }}
</a>
{% endif %}
<div class="navbar-burger burger" data-target="navbar-menu">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div id="navbar-menu" class="navbar-menu">
{% if page.navbar_social %}
<div class="navbar-start">
{{ page.navbar_social }}
</div>
{% endif %}
{% if page.primary_menu %}
{{ page.primary_menu }}
{% endif %}
</div>
</nav>
</div>
{% endif %}
{% endblock navbar %}
{% block header %}
<section class="hero is-primary hero-main is-dark is-large" data-headerbg="transparent" style="background-image:url(/themes/custom/agarica/patternlibrary/agaric/images/fpo-video-poster.png)">
{% block header_and_search %}
{% if page.header or page.header_search %}
{# Header hero region + search #}
<div class="hero-body is-primary">
<div class="container">
<div class="columns is-vcentered">
<div class="column">
{{ page.header }}
{% if is_front and site_slogan %}
<h1 class="title is-2">{{ site_slogan }}</h1>
{% endif %}
</div>
<div class="column is-narrow">
{{ page.header_search }}
</div>
</div>
</div>
</div>
{% endif %}
{% endblock header_and_search %}
{% block tabs %}
{# Drupal tabs #}
{% if page.header_tabs %}
<div class="hero-footer">
<div class="container">
{{ page.header_tabs }}
</div>
</div>
{% endif %}
{% endblock tabs %}
</section>
{% endblock header %}
{% block secondary_menu %}
{# Secondary menu #}
{% if page.secondary_menu %}
<nav class="nav has-shadow">
<div class="container">
{{ page.secondary_menu }}
</div>
</nav>
{% endif %}
{% endblock secondary_menu %}
{% block tiles %}
{# Pinterest blocks style #}
{% if page.tile_one %}
<div class="blocks tiles">
<div class="container">
<div class="tile is-ancestor">
<div class="tile is-vertical is-8">
<div class="tile">
{% if page.tile_one or page.tile_two %}
<div class="tile is-parent is-vertical">
<div class="tile is-child notification is-primary">
{{ page.tile_one }}
</div>
<div class="tile is-child notification is-warning">
{{ page.tile_two }}
</div>
</div>
{% endif %}
{% if page.tile_three %}
<div class="tile is-parent">
<div class="tile is-child notification is-info">
{{ page.tile_three }}
</div>
</div>
{% endif %}
</div>
{% if page.tile_four %}
<div class="tile is-parent">
<div class="tile is-child notification is-danger">
{{ page.tile_four }}
</div>
</div>
{% endif %}
</div>
{% if page.tile_five %}
<div class="tile is-parent">
<div class="tile is-child notification is-success">
{{ page.tile_five }}
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% endif %}
{% endblock tiles %}
{% block main %}
{# Main section #}
{{ page.highlighted }}
{{ page.help }}
<div class="section">
{% block main_content %}
{# Set attributes for content. #}
{% if not page.content_attributes %}
{%
set page = page|merge({
'content_attributes': create_attribute().addClass([
'main-content',
'column',
]),
})
%}
{% endif %}
{# Main content #}
<div{{page.content_attributes}}>
{{ page.content }}
</div>
{% endblock main_content %}
{% block sidebar_first %}
{# Sidebar first #}
{% if page.sidebar_first %}
{# Set attributes for content. #}
{% if not page.sidebar_first_attributes %}
{%
set page = page|merge({
'sidebar_first_attributes': create_attribute().addClass([
'sidebar-first',
'column',
'is-2',
]),
})
%}
{% endif %}
<aside{{page.sidebar_first_attributes|without('role')}} role="complimentary">
{{ page.sidebar_first }}
</aside>
{% endif %}
{% endblock sidebar_first %}
{% block sidebar_second %}
{# Sidebar second #}
{% if page.sidebar_second %}
{% if not page.sidebar_second_attributes %}
{%
set page = page|merge({
'sidebar_second_attributes': create_attribute().addClass([
'sidebar-second',
'column',
'is-2',
]),
})
%}
{% endif %}
<aside{{page.sidebar_second_attributes|without('role')}} role="complimentary">
{{ page.sidebar_second }}
</aside>
{% endif %}
{% endblock sidebar_second %}
</div>
{% endblock main %}
{% block content_bottom %}
{# First bottom section #}
{% if page.content_bottom %}
<section class="section related">
<div class="container">
{{ page.content_bottom }}
</div>
</section>
{% endif %}
{% endblock content_bottom %}
{# Second bottom section #}
{% block bottom %}
{% if page.bottom %}
<section class="section related">
<div class="container">
<div class="titlebar titlebar-bigborder content">
<div class="titlebar_title">
<h3 class="subtitle is-4 is-mono">Our Initiatives</h3>
</div>
</div>
<div class="columns"
{{ page.bottom }}
</div>
</div>
</section>
{% endif %}
{% endblock bottom %}
{% block footer %}
{% if page.footer %}
<footer role="contentinfo" class="footer">
<div class="container">
{{ page.footer }}
</div>
</footer>
{% endif %}
{% endblock footer %}

View file

@ -36,6 +36,10 @@
{% endblock navbar %} {% endblock navbar %}
{% set header_section_attributes = create_attribute({'class': ['hero', 'is-dark']}) %} {% set header_section_attributes = create_attribute({'class': ['hero', 'is-dark']}) %}
{% if is_front %}
{# TODO set a variable for background image so we can use base_path rather than / #}
{% set header_section_attributes = header_section_attributes.addClass('hero-main is-large').setAttribute('data-headerbg', 'transparent').setAttribute('style', 'background-image:url(/themes/custom/agarica/patternlibrary/agaric/images/fpo-video-poster.png)') %}
{% endif %}
{% if false %} {% if false %}
{% set header_section_attributes = header_section_attributes.removeClass('is-dark').setAttribute('data-headerbg', 'light') %} {% set header_section_attributes = header_section_attributes.removeClass('is-dark').setAttribute('data-headerbg', 'light') %}
{% endif %} {% endif %}