Commit ae57a151 authored by Nicolas Daugas's avatar Nicolas Daugas
Browse files

elea/platform#650 Modal de confirmation avant d'écrire au support

parent 39522e68
......@@ -43,10 +43,12 @@ class core_controller {
}
protected function render($view, $variables = []) {
global $CFG;
extract($variables);
ob_start();
require($this->viewpath . str_replace('.', '/', $view) . '.php');
$classname = substr(strrchr(get_class($this), '\\'), 1);
include($CFG->dirroot . '/local/mooring/views/templates/mail_to_support_modal.php');
if (strpos($classname, 'page')) {
$content = ob_get_clean();
require($this->viewpath . 'templates/' . $this->template . '.php');
......
......@@ -32,3 +32,6 @@ $string['mooring:services'] = "Accéder aux services Web";
/*$string['title'] = "Mooring";
$string['heading'] = "Gérer les établissements";*/
$string['consultqabeforemailing'] = "<p>Les réponses aux questions les plus régulièrement posées au support ont été regroupées dans la <a href='/local/faq/' target='_blank'>Foire aux questions</a>.</p><p>Si vous n'y trouvez pas votre bonheur, écrivez-nous en pensant bien à joindre une ou plusieurs captures d'écran ainsi que les adresses des pages concernées, le nom de votre établissement et la ville où il se trouve</a>.</p>";
$string['confirmmailtosupport'] = "Je veux écrire au support";
......@@ -115,4 +115,35 @@ input[type="button"] {
#page-header {
display: none;
}
\ No newline at end of file
}
#mailsupport-modal .modal-dialog {
background-color: #F5EFEF;
}
#mailsupport-modal .modal-header {
background-color: #718DA3;
color: white;
margin: 0px;
font-size: xx-large;
}
#mailsupport-modal .close {
color: white;
opacity: 1;
vertical-align: text-bottom;
font-size: xx-large;
}
#mailsupport-modal .modal-content {
padding: 0;
}
#mailsupport-modal .modal-header h3 {
color: white;
}
#confirmmailingtosupport {
text-align: center;
}
/*
* Listeners
*/
let onMailToSupportButtonClick = ev => {
ev.preventDefault()
$('#mailsupport-modal').modal({
show: 'true',
backdrop: true,
keyboard: true
});
}
let onConfirmMailToSupportButtonClick = ev => {
$('#popup_mailsupport').modal('hide')
}
/*
* Binding
*/
let mailToSupportLink = document.querySelector('[href="mailto:support-elea@ac-versailles.fr"]')
mailToSupportLink.parentElement.addEventListener('click', onMailToSupportButtonClick)
let confirmMailToSupportButton = document.getElementById('confirmmailingtosupport')
confirmMailToSupportButton.addEventListener('click', confirmMailToSupportButton)
\ No newline at end of file
......@@ -27,5 +27,5 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'local_mooring';
$plugin->version = 2020112000;
$plugin->version = 2021040100;
$plugin->requires = 2016052300;
<?php
$modal = '<div class="modal fade" id="mailsupport-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content container-fluid" id="yui_3_17_2_1_1617251978932_45">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="close"><span>&times</span></button>
<div><h3 id="popup_mailsupport_title">Ecrire au support</h3></div>
</div>
<div class="modal-body"><div style="font-size: large; margin-top: 15px; margin-bottom: 15px">' . get_string('consultqabeforemailing', 'local_mooring') . '</div>
<div id="confirmmailingtosupport" class="d-flex newcourse-modal-valbtn"><a class="btn btn-primary" href="mailto:support-elea@ac-versailles.fr">' . get_string('confirmmailtosupport', 'local_mooring') . '</a></div></div>
</div>
</div>
</div>';
echo $modal;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment