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

Commit 089df40

Browse files
committed
Merge branch 'release/2.5.1'
Conflicts: CHANGELOG.md VERSION build/css/admin.css build/css/print.css build/css/vendors.css build/js/vendors.min.js styleguide/README.html styleguide/base_layout_-_forms_elements.html styleguide/base_layout_-_general.html styleguide/base_layout_-_tables.html styleguide/base_layout_-_typography.html styleguide/content_modules_-_content_containers.html styleguide/content_modules_-_functions.html styleguide/content_modules_-_multimedia.html styleguide/content_modules_-_ordering_and_check-out.html styleguide/content_modules_-_search.html styleguide/content_modules_-_standard_elements.html styleguide/content_modules_-_teaser.html styleguide/content_modules_-_widgets.html styleguide/css/admin.css styleguide/css/print.css styleguide/css/vendors.css styleguide/design_principles_-_barrier-free_accessibility.html styleguide/design_principles_-_basic_grid_and_page_types.html styleguide/design_principles_-_cd_elements.html styleguide/design_principles_-_glossary.html styleguide/design_principles_-_guidelines.html styleguide/design_principles_-_header_and_footer.html styleguide/design_principles_-_output_across_a_range_of_end_devices.html styleguide/design_principles_-_sample_pages.html styleguide/index.html styleguide/js/vendors.min.js styleguide/navigation_modules_-_content_navigation.html styleguide/navigation_modules_-_footer.html styleguide/navigation_modules_-_header.html styleguide/navigation_modules_-_hierarchical_navigation.html styleguide/pages/detail.html styleguide/pages/forms.html styleguide/pages/home-without-nav.html styleguide/pages/homepage-global-nav.html styleguide/pages/preview-without-nav.html styleguide/pages/preview.html styleguide/pages/publications.html styleguide/pages/results.html styleguide/pages/subpage.html
2 parents 5bfce49 + 97db0ed commit 089df40

File tree

70 files changed

+3068
-24745
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+3068
-24745
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ CHANGELOG
33

44
This changelog references the relevant changes and bug fixes.
55

6-
* 2.5.1 (2015-01-21)
6+
* 2.5.1 (2015-02-10)
7+
* #353 Improve print styles
8+
* #348 #347 Fix errors with image flow in Publications
9+
* #339 Fix error with buttons in main navbar
10+
* #271 Change alt text of main logo
11+
* #333 Slideshow
12+
13+
* 2.5.0 (2015-01-20)
714
* #325 [CONTRAST] fix contrast in carets
815
* #279 [CONTRAST] fix input placeholders color
916
* #324 [CONTRAST] fix tabs background contrast

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.0
1+
2.5.1

assets/examples/gallery.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ The single view mode allows the user to browse through the complete contents of
219219
<div class="row">
220220
<div class="col-sm-12">
221221
<hr>
222-
<a href="#" class="icon icon--before icon--less">Back to Overview</a>
222+
<a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a>
223223
<nav class="pull-right">
224224
<ul>
225225
<li><a href="#">Previous</a></li>
@@ -252,7 +252,7 @@ The single view mode allows the user to browse through the complete contents of
252252
<div class="row">
253253
<div class="col-sm-12">
254254
<hr>
255-
<a href="#" class="icon icon--before icon--less">Back to Overview</a>
255+
<a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a>
256256
<nav class="pull-right">
257257
<ul>
258258
<li><a href="#">Previous</a></li>

assets/js/carousel.js

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,37 @@
1919
carouselInit(jQuery);
2020
});
2121

22+
// slideshow counter
23+
var slideshow_total = $('.carousel-slideshow .item').length;
24+
$('#carousel-total').text(slideshow_total);
25+
26+
$('.carousel-slideshow').on('slid.bs.carousel', function () {
27+
28+
var carouselData = $(this).data('bs.carousel');
29+
var currentIndex = carouselData.getItemIndex(carouselData.$element.find('.item.active'));
30+
var total = carouselData.$items.length;
31+
32+
var text = (currentIndex + 1);
33+
34+
$('#carousel-index').text(text);
35+
$('#carousel-total').text(total);
36+
});
37+
2238
}) (jQuery);
2339

2440
function carouselInit ($) {
25-
var $carousel = $('.carousel');
41+
var $carousel = $('.carousel:not(.carousel-slideshow)');
42+
43+
$('.carousel .item:first-child').addClass('first');
44+
$('.carousel .item:last-child').addClass('last');
45+
46+
$('.carousel').each(function() {
47+
disableControl($(this));
48+
});
49+
$('.carousel').on('slid.bs.carousel', function () {
50+
disableControl($(this));
51+
});
52+
2653
if($carousel) {
2754
$carousel.each(function () {
2855
var biggestHeight = 0,
@@ -40,4 +67,17 @@ function carouselInit ($) {
4067
$(this).find('.item').height(biggestHeight);
4168
});
4269
}
70+
}
71+
72+
function disableControl(element) {
73+
if (element.find('.first').hasClass('active')) {
74+
element.find('.left').addClass('disabled').attr('aria-disabled', 'true');
75+
} else {
76+
element.find('.left').removeClass('disabled').attr('aria-disabled', 'false');
77+
}
78+
if (element.find('.last').hasClass('active')) {
79+
element.find('.right').addClass('disabled').attr('aria-disabled', 'true');
80+
} else {
81+
element.find('.right').removeClass('disabled').attr('aria-disabled', 'false');
82+
}
4383
}

assets/js/print.js

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/* ==========================================================
2+
* print.js
3+
* Add print preview windows
4+
*
5+
* Author: Yann, yann@antistatique.net
6+
* Date: 2015-02-02
7+
*
8+
* Copyright 2014 Federal Chancellery of Switzerland
9+
* Licensed under MIT
10+
========================================================== */
11+
12+
(function($) {
13+
14+
// Initialization
15+
$.fn.printPreview = function() {
16+
return this;
17+
};
18+
19+
$.printPreview = {
20+
21+
printPreview: function() {
22+
var $body = $('body'),
23+
$container = $('.container-main'),
24+
footnoteLinks = "",
25+
linksIndex = 0;
26+
27+
$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();
28+
$body.addClass('print-preview');
29+
30+
$container.prepend('<div class="row" id="print-settings">'+
31+
'<div class="col-sm-12">'+
32+
'<nav class="pagination-container clearfix">'+
33+
'<span class="pull-left">'+
34+
'<input type="checkbox" id="footnote-links">&nbsp;&nbsp;'+
35+
'<label for="footnote-links">Links as footnotes</label>'+
36+
'</span>'+
37+
'<ul class="pull-right pagination">'+
38+
'<li>'+
39+
'<button id="print-button" title="print" class="btn"><span class="icon icon--print"></span></button>'+
40+
'&nbsp;&nbsp;'+
41+
'<button id="close-button" title="close" class="btn btn-secondary"><span class="icon icon--close"></span></button>'+
42+
'</li>'+
43+
'</ul>'+
44+
'</nav>'+
45+
'</div>'+
46+
'</div>');
47+
48+
$('#print-button').click(function () {
49+
$.printPreview.printProcess();
50+
});
51+
52+
$('#close-button').click(function () {
53+
$.printPreview.printClose();
54+
});
55+
56+
57+
$('a').not('.access-keys a').each(function () {
58+
var target = $(this).attr('href');
59+
target = String(target);
60+
61+
if (target != "undefined" && target.indexOf("http") >= 0) {
62+
linksIndex ++;
63+
footnoteLinks += '<li>'+target+'</li>';
64+
$('<sup class="link-ref">('+linksIndex+')</sup>').insertAfter(this);
65+
}
66+
});
67+
68+
69+
$('#footnote-links').change(function(){
70+
if (this.checked) {
71+
$container.append('<div id="footnote-links-wrapper" class="row footnote-links-wrapper">'+
72+
'<div class="col-sm-12">'+
73+
'<h3>Page Links</h3><hr>'+
74+
'<ol>'+
75+
footnoteLinks+
76+
'</ol>'+
77+
'</div>'+
78+
'</div>');
79+
$body.addClass('print-footnotes');
80+
} else {
81+
$('#footnote-links-wrapper').remove();
82+
$body.removeClass('print-footnotes');
83+
}
84+
});
85+
},
86+
87+
printProcess: function() {
88+
window.print();
89+
},
90+
91+
printClose: function() {
92+
window.location.reload();
93+
}
94+
95+
};
96+
97+
$('a.truc').printPreview();
98+
$(document).bind('keydown', function(e) {
99+
var code = (e.keyCode ? e.keyCode : e.which);
100+
if (code == 80 && !$('body').hasClass('print-preview')) {
101+
$.printPreview.printPreview();
102+
return false;
103+
}
104+
});
105+
106+
// To test print preview mode
107+
// $.printPreview.printPreview();
108+
109+
}) (jQuery);

assets/pages/detail.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="visible-xs visible-sm">
99
<p><a href="#context-sidebar" class="icon icon--before icon--root">Context sidebar</a></p>
1010
</div>
11-
<a href="#" onclick="window.print()" class="icon icon--before icon--print pull-right"></a>
11+
<a href="#" onclick="$.printPreview.printPreview()" class="icon icon--before icon--print pull-right"></a>
1212
<h1 class="text-inline">This is the page title, and it can be really quite long.</h1>
1313
<figure>
1414
<img src="http://placehold.it/588x368" alt="image description">
@@ -165,10 +165,10 @@
165165

166166
<br>
167167

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

170170
<!-- End Page Link -->
171-
<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>
171+
<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>
172172

173173
<div class="social-sharing">
174174
<a href="#" aria-label="Facebook"

assets/pages/homepage-global-nav.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@
262262
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
263263
</p>
264264
<div class="spacer"></div>
265+
<h4><a href="#">Strassenbau in Nepal 1: ein Weg aus der Armut</a></h4>
265266
<figure class="pull-left">
266267
<img src="http://placehold.it/130x81" alt="image description">
267268
</figure>
268-
<h4><a href="#">Strassenbau in Nepal 1: ein Weg aus der Armut</a></h4>
269269
<p>
270270
<small>
271271
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.
@@ -278,10 +278,10 @@
278278
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
279279
</p>
280280
<div class="spacer"></div>
281+
<h4><a href="#">Strassenbau in Nepal 2: ein Weg aus der Armut</a></h4>
281282
<figure class="pull-left">
282283
<img src="http://placehold.it/130x81" alt="image description">
283284
</figure>
284-
<h4><a href="#">Strassenbau in Nepal 2: ein Weg aus der Armut</a></h4>
285285
<p>
286286
<small>
287287
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.
@@ -294,10 +294,10 @@
294294
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
295295
</p>
296296
<div class="spacer"></div>
297+
<h4><a href="#">Strassenbau in Nepal 3: ein Weg aus der Armut</a></h4>
297298
<figure class="pull-left">
298299
<img src="http://placehold.it/130x81" alt="image description">
299300
</figure>
300-
<h4><a href="#">Strassenbau in Nepal 3: ein Weg aus der Armut</a></h4>
301301
<p>
302302
<small>
303303
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.

assets/pages/layout.twig

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
</div>
128128

129129
<a href="#" class="brand hidden-xs" title="back to home">
130-
<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" />
130+
<img src="../img/logo-CH.svg" onerror="this.onerror=null; this.src='../img/logo-CH.png'" alt="back to home" />
131131
<h1>Department of the Environment, Transport, Energy and Communications</h1>
132132
</a>
133133

@@ -668,7 +668,7 @@
668668
</select>
669669
</p>
670670
<hr class="footer-line visible-xs">
671-
<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" />
671+
<img class="visible-xs" src="../img/logo-CH.svg" onerror="this.onerror=null; this.src='../img/logo-CH.png'" alt="back to home" />
672672
</div>
673673

674674
<address>
@@ -683,6 +683,39 @@
683683
</footer>
684684

685685

686+
</div>
687+
<div id="blueimp-gallery" class="blueimp-gallery" data-use-bootstrap-modal="false">
688+
<!-- The container for the modal slides -->
689+
<div class="slides"></div>
690+
<!-- Controls for the borderless lightbox -->
691+
<h3 class="title"></h3>
692+
<a class="prev">‹</a>
693+
<a class="next">›</a>
694+
<a class="close">×</a>
695+
<a class="play-pause"></a>
696+
<ol class="indicator"></ol>
697+
<!-- The modal dialog, which will be used to wrap the lightbox content -->
698+
<div class="modal fade">
699+
<div class="modal-dialog">
700+
<div class="modal-content">
701+
<div class="modal-header">
702+
<button type="button" class="close" aria-hidden="true">&times;</button>
703+
<h4 class="modal-title"></h4>
704+
</div>
705+
<div class="modal-body next"></div>
706+
<div class="modal-footer">
707+
<button type="button" class="btn btn-default pull-left prev">
708+
<i class="glyphicon glyphicon-chevron-left"></i>
709+
Previous
710+
</button>
711+
<button type="button" class="btn btn-primary next">
712+
Next
713+
<i class="glyphicon glyphicon-chevron-right"></i>
714+
</button>
715+
</div>
716+
</div>
717+
</div>
718+
</div>
686719
</div>
687720
<script type="text/javascript" src="../js/vendors.min.js"></script>
688721
<script type="text/javascript" src="../js/main.min.js"></script>

assets/pages/publications.twig

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<p><a href="#context-sidebar" class="icon icon--before icon--root">Context sidebar</a></p>
99
</div>
1010
<article>
11-
<a href="#" class="icon icon--before icon--less">Back to Overview</a>
11+
<a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a>
1212
<button type="button" class="btn btn-link pull-right"><span class="icon icon--print"></span></button>
1313
<h1>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</h1>
1414
<br>
@@ -77,9 +77,44 @@
7777
<p>
7878
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. <a href="#">Donec pede justo</a>, fringilla vel, aliquet nec, vulputate eget, arcu. Lorem porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a.
7979
</p>
80+
81+
82+
<h3>Slideshow</h3>
83+
<div id="carousel-slideshow" class="carousel carousel-slideshow slide" data-ride="carousel">
84+
85+
<!-- Wrapper for slides -->
86+
<div class="carousel-inner" role="listbox">
87+
<div class="item active">
88+
<a href="http://placehold.it/1200x800" title="Banana" data-gallery>
89+
<img src="http://placehold.it/800x600" alt="Banana">
90+
</a>
91+
<div class="carousel-caption">
92+
<h4>Image Title</h4>
93+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minus atque quas, dignissimos quo tempora, consectetur. Odio tempore nulla odit ab impedit dignissimos unde, alias error harum animi laboriosam repudiandae quaerat.</p>
94+
</div>
95+
</div>
96+
<div class="item">
97+
<a href="http://placehold.it/1200x800" title="Apple" data-gallery>
98+
<img src="http://placehold.it/800x600" alt="Apple">
99+
</a>
100+
<div class="carousel-caption">
101+
</div>
102+
</div>
103+
</div>
104+
<div class="carousel-controls">
105+
<div class="pull-right">
106+
<a class="left icon icon--before icon--less" href="#carousel-slideshow" data-slide="prev" aria-label="previous"></a><a class="right icon icon--before icon--greater" href="#carousel-slideshow" data-slide="next" aria-label="next"></a>
107+
</div>
108+
<small class="pull-right"><span id="carousel-index">1</span> of <span id="carousel-total"></span></small>
109+
</div>
110+
111+
</div>
112+
113+
80114
<p><a href="#" class="icon icon--after icon--external">External link</a></p>
81-
<p><a href="#" class="icon icon--before icon--less">Back to Overview</a></p>
82-
<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>
115+
<p><a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a></p>
116+
<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>
83117
</article>
118+
84119
</div>
85120
{% endblock %}

assets/pages/results.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

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

1313
<br>

0 commit comments

Comments
 (0)