Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
[OYPD-505] rationalise the Multiple empty article regions and other e…
Browse files Browse the repository at this point in the history
…mpty regions in the page structure. (#664)

* [OYPD-505] Replace tags in the template for HTML semantic.

* [OYPD-505] Fix template for loading page.

* [OYPD-505] Fix tests

* [OYPD-505] Fix behat test.

* [OYPD-505] Improve template.

[OYPD-505] Fix templates for programm and sub programm.

* [OYPD-505] Add translate for menu name in camp menu.
  • Loading branch information
ivan-berezhnov authored and alexschedrov committed Aug 10, 2017
1 parent fa2d752 commit 9f6e483
Show file tree
Hide file tree
Showing 31 changed files with 204 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@

<div class="camp-menu-wrapper">
<div class="container">
<div class="columns">
<nav class="columns">
<h2 class="visually-hidden">{{ 'Camp Menu'|t }}</h2>
<ul class="camp-menu">
{% for link in links %}
<li class="camp-menu__item">
{{ link }}
</li>
{% endfor %}
</ul>
</div>
</nav>
</div>
</div>
4 changes: 2 additions & 2 deletions tests/features/media/wysiwyg.feature
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Feature: WYSIWYG
And I select "Full" from "Display as"
And I click "//button/span[.='Embed']" xpath element
Then I press "Save and keep published"
And I should see an "article.media-video .video-embed-field-responsive-video iframe" element
And I should see an "div.media-video .video-embed-field-responsive-video iframe" element

Scenario: Embed Document
When I click "//*[@id='edit-group-content-area']/summary" xpath element
Expand All @@ -65,4 +65,4 @@ Feature: WYSIWYG
And I select "Full" from "Display as"
And I click "//button/span[.='Embed']" xpath element
Then I press "Save and keep published"
And I should see an "article.media-document .field-media-document iframe" element
And I should see an "div.media-document .field-media-document iframe" element
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{#
/**
* @file
* Default theme implementation to display a block.
*
* Available variables:
* - plugin_id: The ID of the block implementation.
* - label: The configured label of the block if visible.
* - configuration: A list of the block's configuration values.
* - label: The configured label for the block.
* - label_display: The display settings for the label.
* - provider: The module or other provider that provided this block plugin.
* - Block plugin specific settings will also be stored here.
* - content: The content of this block.
* - attributes: array of HTML attributes populated by modules, intended to
* be added to the main container tag of this template.
* - id: A valid HTML ID and guaranteed unique.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
*
* @see template_preprocess_block()
*
* @ingroup themeable
*/
#}
<main{{ attributes }}>
{{ title_prefix }}
{% if label %}
<h2{{ title_attributes }}>{{ label }}</h2>
{% endif %}
{{ title_suffix }}
{% block content %}
{{ content }}
{% endblock %}
</main>
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
{% if not settings.unslick %}
</div>
{% block slick_arrow %}
<nav{{ arrow_attributes.addClass(arrow_classes) }}>
<div{{ arrow_attributes.addClass(arrow_classes) }}>
<a href="#" data-role="none" class="slick-prev slick-arrow" role="button" aria-disabled="false">Previous</a>
{% if arrow_down_attributes is defined %}
<button{{ arrow_down_attributes.addClass('slick-down')
Expand All @@ -77,7 +77,7 @@
.setAttribute('data-offset', settings.downArrowOffset) }}></button>
{% endif %}
<a href="#" data-role="none" class="slick-next slick-arrow" role="button" aria-disabled="false">Next</a>
</nav>
</div>
{% endblock %}
{% endif %}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{#
/**
* @file
* Default theme implementation for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
* Drupal templates such as page.html.twig or node.html.twig.
*
* Instead of overriding the theming for all fields, you can also just override
* theming for a subset of fields using
* @link themeable Theme hook suggestions. @endlink For example,
* here are some theme hook suggestions that can be used for a field_foo field
* on an article node type:
* - field--node--field-foo--article.html.twig
* - field--node--field-foo.html.twig
* - field--node--article.html.twig
* - field--field-foo.html.twig
* - field--text-with-summary.html.twig
* - field.html.twig
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
* - entity_type: The entity type to which the field belongs.
* - field_name: The name of the field.
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*
* @see template_preprocess_field()
*
* @ingroup themeable
*/
#}

<address{{ attributes.addClass('wrapper-' ~ field_name|clean_class) }}>
{% if multiple %}
<div>
{% endif %}
{% for item in items %}
<div{{ attributes.addClass(field_name|clean_class).removeClass('wrapper-' ~ field_name|clean_class) }}>{{ item.content }}</div>
{% endfor %}
{% if multiple %}
</div>
{% endif %}
</address>
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
] %}

{% for item in items %}
<div{{ attributes.addClass(classes) }}>
<aside{{ attributes.addClass(classes) }}>
<h2>
{{ 'Related content'|t }}
</h2>
<div class="description">
<h3> {{ item.content }} </h3>
</div>
</div>
</aside>
{% endfor %}


Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@

{% if label_hidden %}
{% if multiple %}
<div{{ attributes.addClass('wrapper-' ~ field_name|clean_class) }}>
<section{{ attributes.addClass('wrapper-' ~ field_name|clean_class) }}>
{% for item in items %}
<div{{ attributes.addClass(field_name|clean_class).removeClass('wrapper-' ~ field_name|clean_class) }}>{{ item.content }}</div>
{% endfor %}
</div>
</section>
{% else %}
{% for item in items %}
<div{{ attributes.addClass(field_name|clean_class) }}>{{ item.content }}</div>
{% endfor %}
{% endif %}
{% else %}
<div{{ attributes.addClass('wrapper-' ~ field_name|clean_class) }}>
<section{{ attributes.addClass('wrapper-' ~ field_name|clean_class) }}>
<div{{ title_attributes.addClass('label-for-' ~ field_name|clean_class) }}>{{ label }}</div>
{% if multiple %}
<div>
Expand All @@ -63,5 +63,5 @@
{% if multiple %}
</div>
{% endif %}
</div>
</section>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @ingroup themeable
*/
#}
<article{{ attributes }}>
<div{{ attributes }}>
{% if content %}
{{ content }}
{% endif %}
</article>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @ingroup themeable
*/
#}
<article{{ attributes }}>
<div{{ attributes }}>
{% if content %}
{{ content }}
{% endif %}
</article>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @ingroup themeable
*/
#}
<article{{ attributes }}>
<div{{ attributes }}>
{% if content %}
{{ content }}
{% endif %}
</article>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @ingroup themeable
*/
#}
<article{{ attributes }}>
<div{{ attributes }}>
{% if content %}
{{ content }}
{% endif %}
</article>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @ingroup themeable
*/
#}
<article{{ attributes }}>
<div{{ attributes }}>
{% if content %}
{{ content }}
{% endif %}
</article>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @ingroup themeable
*/
#}
<article{{ attributes }}>
<div{{ attributes }}>
{% if content %}
{{ content }}
{% endif %}
</article>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @ingroup themeable
*/
#}
<article{{ attributes }}>
<div{{ attributes }}>
{% if content %}
{{ content }}
{% endif %}
</article>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @ingroup themeable
*/
#}
<article{{ attributes }}>
<div{{ attributes }}>
{% if content %}
{{ content }}
{% endif %}
</article>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @ingroup themeable
*/
#}
<article{{ attributes }}>
<div{{ attributes }}>
{% if content %}
{{ content }}
{% endif %}
</article>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @ingroup themeable
*/
#}
<article{{ attributes }}>
<div{{ attributes }}>
{% if content %}
{{ content }}
{% endif %}
</article>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ set classes = [
{% set fax_suffix = content.field_location_fax.0['#title'] ? '(fax)'|t %}

{# Branch header #}
<article{{ attributes.addClass('branch-header') }}>
<div class="hidden-xs desktop">
<div{{ attributes.addClass('branch-header') }}>
<section class="hidden-xs desktop">
<div class="container">
<div class="row branch-header-inner branch-info" data-branch-name="{{ node.label }}">
<address class="row branch-header-inner branch-info" data-branch-name="{{ node.label }}">
<div class="column col-sm-3 col-md-2 branch-header__item">
<h4>{{ 'WELCOME TO THE'|t }}</h4>
<p>{{ label }}</p>
Expand All @@ -112,12 +112,12 @@ set classes = [
{# @see openy_branch_selector module #}
{{ content.openy_branch_selector }}
</div>
</div>
</address>
</div>
</div>
</section>

<div class="hidden-sm hidden-md hidden-lg mobile">
<div class="container">
<blockquote class="hidden-sm hidden-md hidden-lg mobile">
<address class="container">
<div class="row">
<div class="col-xs-12">
<h4>{{ 'WELCOME TO THE'|t }}</h4>
Expand Down Expand Up @@ -149,10 +149,12 @@ set classes = [
{{ content.openy_branch_selector }}
</div>
</div>
</div>
</div>
</article>
{{ content.field_header_content }}
</address>
</blockquote>
</div>
<header>
{{ content.field_header_content }}
</header>

{# Branch content #}
<div class="container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
{% set title_url = url %}
{% endif %}

<article{{ attributes.addClass(classes) }}>
<div{{ attributes.addClass(classes) }}>
{{ title_prefix }}
{% if not page %}
<div class="associated-branch-title">
Expand All @@ -105,4 +105,4 @@
{{ content|without('field_location_area', 'field_location_state') }}
</div>

</article>
</div>
Loading

0 comments on commit 9f6e483

Please sign in to comment.