-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modifs #4869 (problèmes affichage organisations)
- Loading branch information
Barbara ROMEO
committed
Mar 16, 2018
1 parent
9bea580
commit 21e47eb
Showing
4 changed files
with
98 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,45 @@ | ||
$('.primary').on('click', '#affich-mode button', function () { | ||
var selected_value = $(this).attr('data-affich'); | ||
$('.media-grid').removeClass('affich-grille affich-liste'); | ||
if (selected_value === 'grille') { | ||
$('.media-grid').addClass('affich-grille'); | ||
} else if (selected_value === 'liste') { | ||
$('.media-grid').addClass('affich-liste'); | ||
var var_display; | ||
|
||
function getUrlParameter(sParam) { | ||
var sPageURL = decodeURIComponent(window.location.search.substring(1)), | ||
sURLVariables = sPageURL.split('&'), | ||
sParameterName, | ||
i; | ||
for (i = 0; i < sURLVariables.length; i++) { | ||
sParameterName = sURLVariables[i].split('='); | ||
if (sParameterName[0] === sParam) { | ||
return sParameterName[1] === undefined ? true : sParameterName[1]; | ||
} | ||
} | ||
$('#affich-mode button').removeClass('active'); | ||
$(this).addClass('active'); | ||
}; | ||
|
||
$(document).ready(function() { | ||
var_display = getUrlParameter('view_mode'); | ||
if (var_display) { | ||
$('.media-grid').removeClass('affich-grille affich-liste'); | ||
if (var_display === 'grid') { | ||
$('.media-grid').addClass('affich-grille'); | ||
} else if (var_display === 'list') { | ||
$('.media-grid').addClass('affich-liste'); | ||
} | ||
$('#affich-mode button').removeClass('active'); | ||
$('#affich-mode button[data-affich='+var_display+']').addClass('active'); | ||
} | ||
}); | ||
|
||
$('.primary').on('click', '#affich-mode button', function () { | ||
var selected_value = $(this).attr('data-affich'); | ||
var newUrl; | ||
// Update URL | ||
if (var_display) { | ||
newUrl = location.href.replace("view_mode="+var_display, "view_mode="+selected_value); | ||
} else { | ||
if (window.location.search) { | ||
newUrl = window.location.href + '&view_mode=' + selected_value; | ||
} else { | ||
newUrl = window.location.href + '?view_mode=' + selected_value; | ||
} | ||
} | ||
// Reload page with new URL | ||
window.location.href = newUrl; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{% extends "page.html" %} | ||
|
||
{% block subtitle %}{{ gettext('Error %(error_code)s', error_code=c.code[0]) }}{% endblock %} | ||
|
||
{% block primary %} | ||
<article class="module"> | ||
<div class="module-content"> | ||
{% set error_code = c.code[0] %} | ||
<div class="error_message"> | ||
<h1> | ||
Erreur {{ error_code }} <i class="fa fa-exclamation" aria-hidden="true"></i> | ||
</h1> | ||
<i class="fa fa-chevron-right" aria-hidden="true"></i> | ||
<span> | ||
{% if error_code == '400' %} | ||
La syntaxe de la requête est incorrecte. | ||
{% elif error_code == '401' or error_code == '403' %} | ||
Vous n'êtes pas autorisé à acceder à cette page. | ||
{% elif error_code == '404' %} | ||
La ressource demandée est introuvable. | ||
{% elif error_code == '500' %} | ||
Une erreur interne est survenue. | ||
{% else %} | ||
Une erreur s'est produite. | ||
{% endif %} | ||
</span> | ||
<div> | ||
</div> | ||
</article> | ||
{% endblock %} | ||
|
||
{% block breadcrumb %} | ||
{% endblock %} | ||
|
||
{% block flash %} | ||
{# eat the flash messages caused by the 404 #} | ||
{% set flash_messages = h.flash.pop_messages() %} | ||
{% endblock %} | ||
|
||
{% block secondary %}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters