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

Application: adding application template and examples #2267

Merged
merged 1 commit into from
Dec 12, 2023
Merged
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
7 changes: 6 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -40,7 +40,12 @@ global:
fr:
- link: "index-fr.html"
title: "GCWeb"

applicationName:
en: "My application"
fr: "Mon application"
applicationURL:
en: "#"
fr: "#"
#
# Override include to use
# includes:
56 changes: 56 additions & 0 deletions _data/templates.json
Original file line number Diff line number Diff line change
@@ -83,6 +83,62 @@
]
}
}
,{
"@context": {
"@version": 1.1,
"dct": "http://purl.org/dc/terms/",
"title": { "@id": "dct:title", "@container": "@language" },
"description": { "@id": "dct:description", "@container": "@language" },
"modified": "dct:modified"
},
"title": {
"en": "Application",
"fr": "Application"
},
"description": {
"en": "Application templates samples.",
"fr": "Exemples de pages d'application."
},
"modified": "2023-10-13",
"componentName": "application",
"status": "stable",
"pages": {
"docs": [
{
"title": "Application template documentation",
"language": "en",
"path": "application-docs-en.html"
},
{
"title": "Documentation du gabarit de page d'application",
"language": "fr",
"path": "application-docs-fr.html"
}
],
"examples": [
{
"title": "Default application page",
"language": "en",
"path": "default-application-en.html"
},
{
"title": "Page d'application par défaut",
"language": "fr",
"path": "default-application-fr.html"
},
{
"title": "Application page with informational banner",
"language": "en",
"path": "application-with-banner-en.html"
},
{
"title": "Page d'application avec bannière informative",
"language": "fr",
"path": "application-with-banner-fr.html"
}
]
}
}
,{
"@context": {
"@version": 1.1,
3 changes: 1 addition & 2 deletions sites/breadcrumbs/includes/breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- unless page.pageclass contains "home" or page.breadcrumbs == false -%}

{%- unless page.pageclass contains "home" or page.breadcrumbs == false or layout.breadcrumbs == false -%}
<nav id="wb-bc" property="breadcrumb">
<h2>{{ i18nText-breadcrumb }}</h2>
<div class="container">
6 changes: 3 additions & 3 deletions sites/footers/includes/footer.html
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@

<footer id="wb-info">
<h2 class="wb-inv">{{ i18nText-footerSite }}</h2>
{% unless page.noFooterContextual %}
{% unless page.noFooterContextual or layout.noFooterContextual %}
{%- if contextualFooterTitle != "" and site.global.contextualFooter.links[i18nText-lang] or page.contextualFooter.links -%}
<div class="gc-contextual">
<div class="container">
@@ -72,7 +72,7 @@ <h3>{{ contextualFooterTitle }}</h3>
</div>
{%- endif -%}
{% endunless %}
{% unless page.noFooterMain %}
{% unless page.noFooterMain or layout.noFooterMain %}
<div class="gc-main-footer">
<div class="container">
<nav>
@@ -139,7 +139,7 @@ <h4><span class="wb-inv">{{ i18nText-themeLinks }}</span></h4>
<nav>
<h3 class="wb-inv">{{ i18nText-gocCorporate }}</h3>
<ul>
{% unless page.noFooterCorporate %}
{% unless page.noFooterCorporate or layout.noFooterCorporate %}
{%- if i18nText-lang == "fr" -%}
<li><a href="https://www.canada.ca/fr/sociaux.html">Médias sociaux</a></li>
<li><a href="https://www.canada.ca/fr/mobile.html">Applications mobiles</a></li>
4 changes: 3 additions & 1 deletion sites/header/includes/header.html
Original file line number Diff line number Diff line change
@@ -5,11 +5,12 @@
{% include language/languagetoggle.html %}
{% endif %}
{% include headers-includes/brand.html %}
{% unless page.nositesearch %}
{% unless page.nositesearch or layout.nositesearch %}
{% include headers-includes/sitesearch.html %}
{% endunless %}
</div>
</div>
{% unless page.layout == "application" %}
<hr>
<div class="container">
<div class="row">
@@ -29,5 +30,6 @@
{%- endif -%}
</div>
</div>
{% endunless %}
{% include breadcrumbs/breadcrumbs.html %}
</header>
3 changes: 3 additions & 0 deletions sites/theme.scss
Original file line number Diff line number Diff line change
@@ -200,6 +200,7 @@
@import "../templates/mobile-centre/base";
@import "../templates/campaign/base";
@import "../templates/news/base";
@import "../templates/application/base";


/*! Core - Utilities */
@@ -244,6 +245,7 @@
@import "../components/toc/screen-xs-max";

@import "../templates/campaign/screen-xs-max";
@import "../templates/application/screen-xs-max";
}

/* Small view and under */
@@ -429,6 +431,7 @@

@import "../templates/pagebrand/print";
@import "../templates/campaign/print";
@import "../templates/application/print";
}

/* Testing WCAG Spacing */
51 changes: 51 additions & 0 deletions templates/application/_base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
*
* Application template
*
*/

.info-banner {
background-color: $alert-info-bg;
color: $text-color;
font-size: 20px;
line-height: 1.65em;
padding: 15px 0;

h2 {
float: left;
font-size: 1em;
line-height: 1.65em;
margin: 0 .25em 0 0;

&:after {
content: ":";
margin-left: .125em;
}
}

.info-banner-actions {
align-items: center;
display: flex;
justify-content: space-between;
}
}

.application-bar {
background-color: #38414d;
color: #fff;
margin-top: 15px;

h2 {
border: none;
margin: 10px 0 8px;

a {
color: #fff;
text-decoration: none;

&:hover {
text-decoration: underline;
}
}
}
}
11 changes: 11 additions & 0 deletions templates/application/_print.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
*
* Application template
*
*/

.application-bar {
h2 {
font-size: 34px;
}
}
12 changes: 12 additions & 0 deletions templates/application/_screen-xs-max.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
*
* Application template
*
*/

.application-bar {
h2 {
font-size: 18px;
margin: 12px 0 9px;
}
}
34 changes: 34 additions & 0 deletions templates/application/application-docs-en.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
{
"title": "Application template documentation",
"language": "en",
"altLangPage": "application-docs-fr.html",
"dateModified": "2023-11-02"
}
---

<dl class="horizontal">
<dt>Status</dt>
<dd>Stable</dd>

<dt>Version</dt>
<dd>1.0</dd>

<dt>Type</dt>
<dd>Template</dd>

<dt>Last review</dt>
<dd>2023-11-02</dd>

<dt>Specification</dt>
<dd>There is no specification yet</dd>
</dl>

<h2>Working examples</h2>
<ul>
<li><a href="default-application-en.html">Application page</a></li>
<li><a href="application-with-banner-en.html">Page d'application avec bannière informative</a></li>
</ul>

<h2>Accessiblity</h2>
<p>No accessiblity conformance report yet.</p>
34 changes: 34 additions & 0 deletions templates/application/application-docs-fr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
{
"title": "Documentation du gabarit de page d'application",
"language": "fr",
"altLangPage": "application-docs-en.html",
"dateModified": "2023-11-02"
}
---

<dl class="horizontal">
<dt>Statut</dt>
<dd>Stable</dd>

<dt>Version</dt>
<dd>1.0</dd>

<dt>Type</dt>
<dd>Gabarit</dd>

<dt>Dernière révision</dt>
<dd>2023-11-02</dd>

<dt>Spécification</dt>
<dd>Aucune spécification à ce jour.</dd>
</dl>

<h2>Exemples pratiques</h2>
<ul>
<li><a href="default-application-fr.html">Page d'application</a></li>
<li><a href="application-with-banner-fr.html">Application page with informational banner</a></li>
</ul>

<h2>Accessiblité</h2>
<p>Aucun rapport sur la conformance en accessibilité à ce jour.</p>
67 changes: 67 additions & 0 deletions templates/application/application-with-banner-en.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
{
"layout": "application",
"title": "Application page with informational banner",
"language": "en",
"altLangPage": "application-with-banner-fr.html",
"dateModified": "2023-10-13",
"infoBanner": {
"title": "Beta version",
"message": "We've made some changes to improve your experience with My Service Canada Account.",
"link": {
"text": "Learn more about the beta version",
"href": "https://www.canada.ca/en",
"external": true
},
"button": {
"text": "Try beta version",
"href": "https://www.canada.ca/en"
}
}
}
---

{% include alert-community-stable.html %}

<h2>Configuration options (GCWeb Jekyll specific)</h2>
<ul>
<li><code>"infoBanner"</code> (optional, <code>Object</code>): contains the informational banner properties.
<ul>
<li><code>"title"</code> (mandatory): the banner's title.</li>
<li><code>"message"</code> (mandatory): the banner's message.</li>
<li><code>"link"</code> (optional, <code>Object</code>): contains the link properties.
<ul>
<li><code>"text"</code> (mandatory, <code>String</code>): the text of the link that is displayed.</li>
<li><code>"href"</code> (mandatory, <code>String</code>): the url of the link that is displayed.</li>
<li><code>"external"</code> (optional, <code>Boolean</code>): open the link in a new window.</li>
</ul>
</li>
<li><code>"button"</code>(optional, <code>Object</code>): contains the button properties.
<ul>
<li><code>"text"</code> (mandatory, <code>String</code>): the text of the button that is displayed.</li>
<li><code>"href"</code> (mandatory, <code>String</code>): the url of the button that is displayed.</li>
<li><code>"external"</code> (optional, <code>Boolean</code>): open the link in a window.</li>
</ul>
</li>
</ul>
</li>
</ul>

<h3>Code</h3>
<pre class="wb-prettify prettyprint"><code>{
...
"infoBanner": {
"title": "Beta version",
"message": "We've made some changes to improve your experience with My Service Canada Account.",
"link": {
"text": "Learn more about the beta version",
"href": "https://www.canada.ca/en",
"external": true
},
"button": {
"text": "Try beta version",
"href": "https://www.canada.ca/en"
}
}
...
}</code></pre>
Loading