Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Merge branch 'feature/true-2.5.1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zufrieden committed Feb 10, 2015
2 parents 8497d9a + cf957fd commit 4a88bad
Show file tree
Hide file tree
Showing 16 changed files with 238 additions and 29 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ CHANGELOG

This changelog references the relevant changes and bug fixes.

* 2.5.1 (2015-03-05)
* #353 Improve print styles
* #348 #347 Fix errors with image flow in Publications
* #339 Fix error with buttons in main navbar
* #271 Change alt text of main logo

* 2.5.0 (2015-01-20)
* #325 [CONTRAST] fix contrast in carets
* #279 [CONTRAST] fix input placeholders color
Expand Down
4 changes: 2 additions & 2 deletions assets/examples/gallery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ The single view mode allows the user to browse through the complete contents of
<div class="row">
<div class="col-sm-12">
<hr>
<a href="#" class="icon icon--before icon--less">Back to Overview</a>
<a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a>
<nav class="pull-right">
<ul>
<li><a href="#">Previous</a></li>
Expand Down Expand Up @@ -252,7 +252,7 @@ The single view mode allows the user to browse through the complete contents of
<div class="row">
<div class="col-sm-12">
<hr>
<a href="#" class="icon icon--before icon--less">Back to Overview</a>
<a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a>
<nav class="pull-right">
<ul>
<li><a href="#">Previous</a></li>
Expand Down
109 changes: 109 additions & 0 deletions assets/js/print.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/* ==========================================================
* print.js
* Add print preview windows
*
* Author: Yann, yann@antistatique.net
* Date: 2015-02-02
*
* Copyright 2014 Federal Chancellery of Switzerland
* Licensed under MIT
========================================================== */

(function($) {

// Initialization
$.fn.printPreview = function() {
return this;
};

$.printPreview = {

printPreview: function() {
var $body = $('body'),
$container = $('.container-main'),
footnoteLinks = "",
linksIndex = 0;

$body.find('.nav-mobile, .drilldown, .nav-main, .header-separator, .nav-service, .nav-lang, .form-search, .yamm--select, header > div:first-child, footer, .alert, .icon--print, .social-sharing, form, .nav-process, .carousel-indicators, .carousel-control, .breadcrumb, .pagination-container').remove();
$body.addClass('print-preview');

$container.prepend('<div class="row" id="print-settings">'+
'<div class="col-sm-12">'+
'<nav class="pagination-container clearfix">'+
'<span class="pull-left">'+
'<input type="checkbox" id="footnote-links">&nbsp;&nbsp;'+
'<label for="footnote-links">Links as footnotes</label>'+
'</span>'+
'<ul class="pull-right pagination">'+
'<li>'+
'<button id="print-button" title="print" class="btn"><span class="icon icon--print"></span></button>'+
'&nbsp;&nbsp;'+
'<button id="close-button" title="close" class="btn btn-secondary"><span class="icon icon--close"></span></button>'+
'</li>'+
'</ul>'+
'</nav>'+
'</div>'+
'</div>');

$('#print-button').click(function () {
$.printPreview.printProcess();
});

$('#close-button').click(function () {
$.printPreview.printClose();
});


$('a').not('.access-keys a').each(function () {
var target = $(this).attr('href');
target = String(target);

if (target != "undefined" && target.indexOf("http") >= 0) {
linksIndex ++;
footnoteLinks += '<li>'+target+'</li>';
$('<sup class="link-ref">('+linksIndex+')</sup>').insertAfter(this);
}
});


$('#footnote-links').change(function(){
if (this.checked) {
$container.append('<div id="footnote-links-wrapper" class="row footnote-links-wrapper">'+
'<div class="col-sm-12">'+
'<h3>Page Links</h3><hr>'+
'<ol>'+
footnoteLinks+
'</ol>'+
'</div>'+
'</div>');
$body.addClass('print-footnotes');
} else {
$('#footnote-links-wrapper').remove();
$body.removeClass('print-footnotes');
}
});
},

printProcess: function() {
window.print();
},

printClose: function() {
window.location.reload();
}

};

$('a.truc').printPreview();
$(document).bind('keydown', function(e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 80 && !$('body').hasClass('print-preview')) {
$.printPreview.printPreview();
return false;
}
});

// To test print preview mode
// $.printPreview.printPreview();

}) (jQuery);
6 changes: 3 additions & 3 deletions assets/pages/detail.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="visible-xs visible-sm">
<p><a href="#context-sidebar" class="icon icon--before icon--root">Context sidebar</a></p>
</div>
<a href="#" onclick="window.print()" class="icon icon--before icon--print pull-right"></a>
<a href="#" onclick="$.printPreview.printPreview()" class="icon icon--before icon--print pull-right"></a>
<h1 class="text-inline">This is the page title, and it can be really quite long.</h1>
<figure>
<img src="http://placehold.it/588x368" alt="image description">
Expand Down Expand Up @@ -165,10 +165,10 @@

<br>

<p><small><a href="#" class="icon icon--before icon--less">Back to Overview</a></small></p>
<p><small><a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a></small></p>

<!-- End Page Link -->
<p><small><a href="#" class="icon icon--before icon--power">Back to top</a><span class="text-dimmed">Last edition: 21.03.2014</span></small></p>
<p><small class="hidden-print"><a href="#" class="icon icon--before icon--power">Back to top</a><span class="text-dimmed">Last edition: 21.03.2014</span></small></p>

<div class="social-sharing">
<a href="#" aria-label="Facebook"
Expand Down
6 changes: 3 additions & 3 deletions assets/pages/homepage-global-nav.twig
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
</p>
<div class="spacer"></div>
<h4><a href="#">Strassenbau in Nepal 1: ein Weg aus der Armut</a></h4>
<figure class="pull-left">
<img src="http://placehold.it/130x81" alt="image description">
</figure>
<h4><a href="#">Strassenbau in Nepal 1: ein Weg aus der Armut</a></h4>
<p>
<small>
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae.
Expand All @@ -278,10 +278,10 @@
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
</p>
<div class="spacer"></div>
<h4><a href="#">Strassenbau in Nepal 2: ein Weg aus der Armut</a></h4>
<figure class="pull-left">
<img src="http://placehold.it/130x81" alt="image description">
</figure>
<h4><a href="#">Strassenbau in Nepal 2: ein Weg aus der Armut</a></h4>
<p>
<small>
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae.
Expand All @@ -294,10 +294,10 @@
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
</p>
<div class="spacer"></div>
<h4><a href="#">Strassenbau in Nepal 3: ein Weg aus der Armut</a></h4>
<figure class="pull-left">
<img src="http://placehold.it/130x81" alt="image description">
</figure>
<h4><a href="#">Strassenbau in Nepal 3: ein Weg aus der Armut</a></h4>
<p>
<small>
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Lorem porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a.
Expand Down
4 changes: 2 additions & 2 deletions assets/pages/layout.twig
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
</div>

<a href="#" class="brand hidden-xs" title="back to home">
<img src="../img/logo-CH.svg" onerror="this.onerror=null; this.src='../img/logo-CH.png'" alt="The Federal Authorities of the Swiss Confederation, www.admin.ch" />
<img src="../img/logo-CH.svg" onerror="this.onerror=null; this.src='../img/logo-CH.png'" alt="back to home" />
<h1>Department of the Environment, Transport, Energy and Communications</h1>
</a>

Expand Down Expand Up @@ -668,7 +668,7 @@
</select>
</p>
<hr class="footer-line visible-xs">
<img class="visible-xs" src="../img/logo-CH.svg" onerror="this.onerror=null; this.src='../img/logo-CH.png'" alt="The Federal Authorities of the Swiss Confederation, www.admin.ch" />
<img class="visible-xs" src="../img/logo-CH.svg" onerror="this.onerror=null; this.src='../img/logo-CH.png'" alt="back to home" />
</div>

<address>
Expand Down
6 changes: 3 additions & 3 deletions assets/pages/publications.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<p><a href="#context-sidebar" class="icon icon--before icon--root">Context sidebar</a></p>
</div>
<article>
<a href="#" class="icon icon--before icon--less">Back to Overview</a>
<a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a>
<button type="button" class="btn btn-link pull-right"><span class="icon icon--print"></span></button>
<h1>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</h1>
<br>
Expand Down Expand Up @@ -112,8 +112,8 @@


<p><a href="#" class="icon icon--after icon--external">External link</a></p>
<p><a href="#" class="icon icon--before icon--less">Back to Overview</a></p>
<p><small><a href="#" class="icon icon--before icon--power">Back to top</a><span class="text-dimmed">Last edition: 21.03.2014</span></small></p>
<p><a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a></p>
<p><small class="hidden-print"><a href="#" class="icon icon--before icon--power">Back to top</a><span class="text-dimmed">Last edition: 21.03.2014</span></small></p>
</article>

</div>
Expand Down
2 changes: 1 addition & 1 deletion assets/pages/results.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% block content %}
<div class="col-sm-12">
<a href="#" onclick="window.print()" class="icon icon--before icon--print pull-right"></a>
<a href="#" onclick="$.printPreview.printPreview()" class="icon icon--before icon--print pull-right"></a>
<h1 class="text-inline">Search</h1>

<br>
Expand Down
13 changes: 10 additions & 3 deletions assets/sass/components/carousel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ The carousel consists of various information blocks, each of which contains a la
The carousel component is not totally compliant with accessibility standards. If you need to be compliant, please consider other options for presenting your content.
<br>
<div class="alert alert-warning">
**2.5.1**
- put `<figure>` element after `<h4>` to avoid ungraceful alignment
</div>
```html_example
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
Expand Down Expand Up @@ -56,10 +63,10 @@ The carousel component is not totally compliant with accessibility standards. If
<img class="carousel-img" src="http://placehold.it/588x331">
</p>
<div class="spacer"></div>
<h4><a href="#">Strassenbau in Nepal 1: ein Weg aus der Armut</a></h4>
<figure class="pull-left">
<img src="http://placehold.it/130x81" alt="image description">
</figure>
<h4><a href="#">Strassenbau in Nepal 1: ein Weg aus der Armut</a></h4>
<p>
<small>
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae.
Expand All @@ -72,10 +79,10 @@ The carousel component is not totally compliant with accessibility standards. If
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
</p>
<div class="spacer"></div>
<h4><a href="#">Strassenbau in Nepal 2: ein Weg aus der Armut</a></h4>
<figure class="pull-left">
<img src="http://placehold.it/130x81" alt="image description">
</figure>
<h4><a href="#">Strassenbau in Nepal 2: ein Weg aus der Armut</a></h4>
<p>
<small>
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae.
Expand All @@ -88,10 +95,10 @@ The carousel component is not totally compliant with accessibility standards. If
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
</p>
<div class="spacer"></div>
<h4><a href="#">Strassenbau in Nepal 3: ein Weg aus der Armut</a></h4>
<figure class="pull-left">
<img src="http://placehold.it/130x81" alt="image description">
</figure>
<h4><a href="#">Strassenbau in Nepal 3: ein Weg aus der Armut</a></h4>
<p>
<small>
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Lorem porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a.
Expand Down
7 changes: 7 additions & 0 deletions assets/sass/components/list-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,11 @@ The elements list is a very generic element that groups content elements in a li
font-size: 14px;
margin-bottom: 0;
a, p {font-size: 14px;}
&:after {
content: '\00a0';
display: block;
height: 0px;
overflow: hidden;
clear: both;
}
}
6 changes: 6 additions & 0 deletions assets/sass/components/mega-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,10 @@
.nav-page-list & {
width: 100px;
}
}

// fix to display links correctly in main nav dropdown on hover
.nav-main.yamm .nav .dropdown-menu li:hover a {
padding-bottom: auto !important;
border-top: auto !important;
}
2 changes: 1 addition & 1 deletion assets/sass/layout/brand.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The logo is a CD element. Its use is mandatory, and its representation may not b
```html_example
<a href="#" class="brand hidden-xs" title="back to home">
<img src="img/logo-CH.svg" onerror="this.onerror=null; this.src='img/logo-CH.png'" alt="The Federal Authorities of the Swiss Confederation, www.admin.ch" />
<img src="img/logo-CH.svg" onerror="this.onerror=null; this.src='img/logo-CH.png'" alt="back to home" />
<h1>Swiss Confederation Web Guidelines</h1>
</a>
```
Expand Down
2 changes: 1 addition & 1 deletion assets/sass/layout/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The Confederation logo with the coat of arms and the four-language wordmark as w
<header>
<a href="#" class="brand hidden-xs" title="back to home">
<img src="img/logo-CH.png" alt="The Federal Authorities of the Swiss Confederation, www.admin.ch" />
<img src="img/logo-CH.png" alt="back to home" />
<h1>Department of the Environment, Transport, Energy and Communications</h1>
</a>
</header>
Expand Down
2 changes: 1 addition & 1 deletion assets/sass/layout/images.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ category: Base Layout - General
*/

figure {
margin-top: 1.2em;
margin-top: 0.2em;
&.pull-left {
padding-right: 10px;
display: table;
Expand Down
4 changes: 2 additions & 2 deletions assets/sass/layout/links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The link at the end of the page is a special top link. Each page (with the excep
```html_example
<!-- End Page Link -->
<small><a href="#" class="icon icon--before icon--power">Back to top</a><span class="text-dimmed">Last edition: 21.03.2014</span></small>
<small class="hidden-print"><a href="#" class="icon icon--before icon--power">Back to top</a><span class="text-dimmed">Last edition: 21.03.2014</span></small>
```
For a print button, check the [buttons section](base_layout_-_forms_elements.html#f-buttons).
Expand Down Expand Up @@ -135,7 +135,7 @@ The “back to overview” navigation links pages that do not appear in the navi
The “back to overview” link appears before the page title at the top of the content pane, and at the end of the page before the page-end navigation.
```html_example
<a href="#" class="icon icon--before icon--less">Back to Overview</a>
<a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a>
```
*/

Expand Down

0 comments on commit 4a88bad

Please sign in to comment.