Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(headers): rename and update doc --INNO-662 #234

Merged
merged 4 commits into from
Jul 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions framework/components/ecl-page-headers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Page header

## Why and how to use this component
Users need a way to easily identify the branding, to search and change the language if needed.
* the page title functions as the top level H1.
* it is also used to construct the < title \> element (mandatory).
* gives context and confidence to the user so they know they are looking at the right piece of content.
* provides an H1 title for accessibility and SEO purposes.

## Page header types

| Default page header | Basic page header |
|------------|------------|
| Mandatory components | Mandatory components |
| Breadcrumb | Breadcrumb |
| Page title | - |
| Optional components | Optional components |
| Meta items | Meta items |
| Site identification | Site identification |
| Page introduction | - |

## When to use this component

| Default page header | Basic page header |
| --------------- | ---------- |
| detail pages and landing pages | detail pages and landing pages|
| no corporate menu | corporate menu |
| default implementation | page title and page introduction elements should be placed on the body of the page |
9 changes: 0 additions & 9 deletions framework/components/ecl-page-headers/corporate/README.md

This file was deleted.

This file was deleted.

27 changes: 0 additions & 27 deletions framework/components/ecl-page-headers/corporate/corporate.twig

This file was deleted.

5 changes: 0 additions & 5 deletions framework/components/ecl-page-headers/default/README.md

This file was deleted.

33 changes: 0 additions & 33 deletions framework/components/ecl-page-headers/default/default.config.js

This file was deleted.

8 changes: 0 additions & 8 deletions framework/components/ecl-page-headers/default/default.twig

This file was deleted.

33 changes: 33 additions & 0 deletions framework/components/ecl-page-headers/ecl-page-headers.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,37 @@ module.exports = {
label: 'Page Headers',
tags: ['organism'],
status: 'ready',
variants: [
{
name: 'default',
context: {
variant: 'default',
identity: 'Digital single market',
title: 'Business, Economy, Euro',
introduction:
'EU economy, finance and the euro, and practical information for EU businesses and entrepreneurs on product safety, environmental regulations, trade with non-EU countries and competition rules.',
meta: {
type: 'News article',
date: '6 July 2015',
timestamp: '2015-07-06T17:44:28+02:00',
location: 'Brussels',
},
},
},
{
name: 'basic',
context: {
identity: 'Digital single market',
},
},
{
name: 'highlight',
context: {
variant: 'highlight',
label: 'Highlight',
highlight:
'Maecenas at mi <strong>molestie nulla</strong> tempor interdum sed sit amet ipsum.',
},
},
],
};
48 changes: 48 additions & 0 deletions framework/components/ecl-page-headers/ecl-page-headers.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% if variant is defined and variant == "highlight" %}
<div class="ecl-page-header ecl-page-header--highlight">
<div class="ecl-page-header__body">
<div class="ecl-page-header__label">{{ label }}</div>
<div class="ecl-page-header__highlight">
{{ highlight }}
</div>
</div>
</div>
{% else %}
<div class="ecl-page-header">
{% include '@ec-europa/ecl-breadcrumbs' with { 'extraClass':'ecl-u-mh-xxs','segments': [{'target':'#','title':'European Commission'},{'target':'#','title':'Announcements'}] } %}

<div class="ecl-page-header__body">

{% if identity is defined %}
<div class="ecl-page-header__identity">
{{ identity }}
</div>
{% endif %}

{% if meta is defined %}
<div class="ecl-page-header__meta">
<div class="ecl-meta ecl-meta--header">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can create a follow-up ticket to improve the @ec-europa/ecl-meta to be to use it here as:

      {% include '@ec-europa/ecl-meta' with {
        'modifier': 'ecl-meta--header',
        'meta_item_type_data': meta.type,
        'meta_item_data': '....',
      } %}

However, the component is not ready to have multiple ecl-meta__item and cannot accommodate date-display-single at the moment, which is definitely out of scope.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up ticket INNO-668

<span class="ecl-meta__item ecl-u-f-up">{{ meta.type }}</span>
<span class="ecl-meta__item">
<span class="date-display-single" property="dc:date" datatype="xsd:dateTime" content="{{ meta.timestamp }}">{{ meta.date }}</span>
</span>
<span class="ecl-meta__item">{{ meta.location }}</span>
</div>
</div>
{% endif %}

{% if title is defined %}
<div class="ecl-page-header__title">
<h1 class=" ecl-heading ecl-heading--h1 ecl-u-color-white">{{ title }}</h1>
</div>
{% endif %}

{% if introduction is defined %}
<div class="ecl-page-header__intro">
<p class="{{paragraph_class}}">{{ introduction }}</p>
</div>
{% endif %}

</div>
</div>
{% endif %}
3 changes: 0 additions & 3 deletions framework/components/ecl-page-headers/highlight/README.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions framework/components/ecl-page-headers/improved-complete/README.md

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 1 addition & 7 deletions test/functional/page-headers.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
const variants = [
'corporate',
'default',
'highlight',
'improved-basic',
'improved-complete',
];
const variants = ['basic', 'default', 'highlight'];

variants.forEach(variant => {
describe(`ecl-page-headers--${variant}`, () => {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.