Compare commits
1 Commits
master
...
feat/test-
Author | SHA1 | Date |
---|---|---|
|
a56eb09204 | 2 years ago |
@ -1,26 +0,0 @@ |
||||
SeaCMS Default Theme |
||||
================== |
||||
|
||||
- [English](README.md) |
||||
|
||||
Ce paquet est le thème principal de SeaCMS. |
||||
|
||||
**Attention : le nom SeaCMS va changer car il semble déjà utilisé dans d'autres pays** |
||||
|
||||
## Auteurs |
||||
|
||||
- Jérémy Dufraisse (2022-2023) |
||||
- Thatoo (2022-2023) |
||||
- Marion Bouder (2022-2023) |
||||
- Association Defis (2022-2023) |
||||
|
||||
## Documentation |
||||
|
||||
Quelques brides de documentation sont disponibles dans le fichier [doc/en/dev.md](doc/en/dev.md) |
||||
|
||||
## Licence et garanties |
||||
|
||||
Voir le fichier [LICENCE](./LICENCE) (et sa traduction française [LICENCE_FR](./LICENCE_FR)) |
||||
|
||||
**IMPORTANT**: Le fichier LICENCE file ne couvre pas le contenu des dossiers `vendor`. Voir le fichier LICENCE fournis dans chaque sous-dossier concerné par la bibliothèque importée. |
||||
|
@ -1,8 +0,0 @@ |
||||
{# seacms-theme |
||||
# SPDX-License-Identifier: EUPL-1.2 #} |
||||
|
||||
{% extends "index.twig" %} |
||||
|
||||
{% block content %} |
||||
{% include "includes/_contact_content.twig" %} |
||||
{% endblock content %} |
File diff suppressed because it is too large
Load Diff
@ -1,25 +0,0 @@ |
||||
# Documentation on development |
||||
|
||||
## Using `yarn` |
||||
|
||||
[`yarn`](https://yarnpkg.com) is a package manager running on [`nodejs`](https://nodejs.org). It is veru useful to manage `javascript` or `css` projects. |
||||
|
||||
### Adding a new package |
||||
|
||||
1. find the name of the wanted package on the website <https://www.npmjs.com> |
||||
2. on command line interface, on the root folder of this project, type `yarn add --dev name-of-the-package` |
||||
3. Identify the needed files into folder `node_modules/name-of-the-package` ; most of time, files are into folder `node_modules/name-of-the-package/dist` |
||||
4. modifify the file `js/extract-files-from-node-modules` to a new line for each file to import in the theme : |
||||
- `copySync('node_modules/name-of-the-package/dist/js/file.min.js','js/vendor/name-of-the-package/file.min.js',{ overwrite: true })` for `javascript` file |
||||
- `copySync('node_modules/name-of-the-package/dist/css/file.min.css','css/vendor/name-of-the-package/file.min.css',{ overwrite: true })` for `css` file |
||||
- do not forget `LICENCE` file of the package, `copySync('node_modules/name-of-the-package/dist/LICENCE','css/vendor/name-of-the-package/LICENCE',{ overwrite: true })` for `css` (and for `javascript`) |
||||
5. type `yarn install` in commpand line interface to start this script |
||||
6. add a new line in concerned `twig` file (example : `includes/_head.twig`) to use the new file (example : `<link href="{{ theme_url }}/css/vendor/name-of-the-package/file.min.css" rel="stylesheet" type="text/css" />`) |
||||
|
||||
### Removing a new package |
||||
|
||||
1. find the name of the wanted package into file `package.json` |
||||
2. on command line interface, on the root folder of this project, type `yarn remove name-of-the-package` |
||||
3. Identify the associated files into folders `js/vendor` and `css/vendor` and delete them |
||||
4. modifify the file `js/extract-files-from-node-modules` to remove lines related to this package |
||||
5. remove line in concerned `twig` file (example : `includes/_head.twig`) that uses the new file (example : `<link href="{{ theme_url }}/css/vendor/name-of-the-package/file.min.css" rel="stylesheet" type="text/css" />`) |
@ -1,192 +0,0 @@ |
||||
{# SPDX-License-Identifier: EUPL-1.2 #} |
||||
|
||||
<section id="contact"> |
||||
<div class="layout-contact layout-maxed"> |
||||
<div class="md:flex p-36"> |
||||
|
||||
<article class="contact-card border-rounded flex flex-col justify-between flex-grow bg-blue bg-section bg-overlay bg-glazient color-white sm:p-24 md:m-24"> |
||||
<div class="card-content-top"> |
||||
<h3 id="title-card" class="color-white mt-8">{{ meta.titlecard }}</h3> |
||||
<?php h3('title-card', 'color-white mt-8')?> |
||||
<?php txt('intro-card', 'text-bold md:mt-24')?> |
||||
</div> |
||||
<div class="card-content-bottom"> |
||||
<ul class="card-info is-unstyled text-smaller text-bold mt-24 md:mb-24"> |
||||
<li><?php txt('item-1', 'ml-8')?></li> |
||||
<li><?php txt('item-2', 'ml-8')?></li> |
||||
<li><?php txt('item-3', 'ml-8')?></li> |
||||
</ul> |
||||
</div> |
||||
</article> |
||||
|
||||
<article class="contact-form sm:p-24 md:m-24"> |
||||
|
||||
<form id="form-contact"> |
||||
|
||||
<?php h2('title-form', 'color-blue')?> |
||||
<?php txt('intro-form', 'mb-16')?> |
||||
|
||||
<div class="editable-hidden"> |
||||
|
||||
<label for="email-to"><?php _e("Email to")?> (your@domain.com)<span class="color-red">*</span></label><br> |
||||
<?input("email-to", array('name' => 'email-to', 'placeholder' => __("Email to"), 'class' => 'w100'));?> |
||||
<?input("email-hash", array('name' => 'email-hash', 'type' => 'hidden', 'class' => 'hidden'));?> |
||||
|
||||
</div> |
||||
|
||||
<div class="grid grid-cols-2 gap-36 mt-24"> |
||||
<div> |
||||
<input type="text" name="name" id="name" placeholder="<?php _e("Name / Forname")?> *" class="w100" required> |
||||
</div> |
||||
<div> |
||||
<input type="email" name="email-from" id="email-from" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,3}$" autocomplete="email" placeholder="<?php _e("Email")?> *" class="w100" required> |
||||
</div> |
||||
<div class="col-span-full"> |
||||
<input type="text" name="subject" id="subject" placeholder="<?php _e("Subject")?> *" class="w100" required> |
||||
</div> |
||||
<div class="col-span-full"> |
||||
<textarea name="message" id="message" placeholder="<?php _e("Message")?> *" rows="5" cols="150" class="mb-8" required></textarea> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<div class=""> |
||||
|
||||
<!-- Captcha --> |
||||
<? |
||||
$chiffre = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'); |
||||
$operators = array("+", "-"); |
||||
$operator = $operators[array_rand($operators)]; |
||||
$nb1 = rand(1, 5);//10 |
||||
$nb2 = ($operator === '-') ? mt_rand(1, $nb1) : mt_rand(1, 5);// on évite les résultats négatifs en cas de soustraction |
||||
eval('$captcha = strval('.$nb1.$operator.$nb2.');'); |
||||
$captcha_hash = hash('sha256', $captcha.$GLOBALS['pub_hash']); |
||||
// On change le signe "-" moins de calcul en "−" lisible en accessibilité |
||||
?> |
||||
<div> |
||||
<label for="captcha"> |
||||
<?php _e("For security reasons please solve the following calculation")?><span class="color-red">*</span> : |
||||
<?=(__($chiffre[$nb1])." ".($operator=='-'?'−':$operator)." ".__($chiffre[$nb2]));?> = |
||||
</label> |
||||
<input type="text" name="captcha" id="captcha" placeholder="?" class="text-center" autocomplete="off" required> |
||||
|
||||
<input type="hidden" name="captcha_hash" value="<?=$captcha_hash;?>"> |
||||
</div> |
||||
|
||||
<!-- RGPD --> |
||||
<div class="mt-24"> |
||||
<label for="rgpdcheckbox" class="inline"><?php _e("Please verify your entry and check the box to accept the storage and processing of this information.")?><span class="color-red">*</span></label> |
||||
<input type="checkbox" name="rgpdcheckbox" id="rgpdcheckbox" required> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
|
||||
<!-- Bouton envoyer --> |
||||
<div class="foat-right mt-36"> |
||||
<button type="submit" id="send" class="btn btn--line border-rounded text-bold"> |
||||
<?php _e("Send")?> |
||||
<i class="icon moon-arrow-right ml-24" aria-hidden="true"></i> |
||||
</button> |
||||
</div> |
||||
|
||||
<?php txt('texte-rgpd', 'mt-36')?> |
||||
|
||||
<input type="hidden" name="rgpd_text" value="<?=htmlspecialchars(@$GLOBALS['content']['rgpd']);?>"> |
||||
|
||||
<input type="hidden" name="nonce_contact" value="<?=nonce("nonce_contact");?>"> |
||||
|
||||
<input type="hidden" name="referer" value="<?=htmlspecialchars((isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:""));?>"> |
||||
|
||||
</form> |
||||
|
||||
</article> |
||||
|
||||
</div> |
||||
</div> |
||||
</section> |
||||
|
||||
|
||||
<script> |
||||
// Titre de la page en cours |
||||
// title = document.title; |
||||
|
||||
// Pour rétablir le fonctionnement du formulaire |
||||
function activation_form(){ |
||||
desactive = false; |
||||
|
||||
$("#form-contact #send .moon-settings").removeClass("icon-spin moon-settings").addClass("moon-arrow-right"); |
||||
|
||||
// Activation des champs du formulaire |
||||
$("#form-contact input, #form-contact textarea, #form-contact button").attr("readonly", false).removeClass("disabled"); |
||||
|
||||
// On peut soumettre le formulaire avec la touche entrée |
||||
//$("#form-contact").on("submit", function(event) { send_mail(event) }); |
||||
$("#form-contact button").attr("disabled", false); |
||||
} |
||||
|
||||
desactive = false; |
||||
function send_mail(event) |
||||
{ |
||||
event.preventDefault(); |
||||
|
||||
if($("#captcha").val()=="" || $("#name").val()=="" || $("#subject").val()=="" || $("#message").val()=="" || $("#email-from").val()=="" || $("#rgpdcheckbox").prop("checked") == false) |
||||
error(__("Thank you for completing all the required fields!")); |
||||
else if(!desactive) |
||||
{ |
||||
desactive = true; |
||||
|
||||
// Icone envoi en cours |
||||
$("#form-contact #send .moon-settings").removeClass("moon-settings").addClass("icon-spin moon-settings"); |
||||
|
||||
// Désactive le formulaire |
||||
$("#form-contact input, #form-contact textarea, #form-contact button").attr("readonly", true).addClass("disabled"); |
||||
|
||||
// Désactive le bouton submit (pour les soumissions avec la touche entrée) |
||||
//$("#form-contact").off("submit"); |
||||
//$("#form-contact button").attr("disabled", true);// => ne permet pas le focus sur le btn une fois envoyer |
||||
|
||||
$.ajax( |
||||
{ |
||||
type: "POST", |
||||
url: path+"theme/"+theme+(theme?"/":"")+"tpl/contact.php?mode=send-mail", |
||||
data: $("#form-contact").serializeArray(), |
||||
success: function(html){ $("body").append(html); } |
||||
}); |
||||
} |
||||
} |
||||
|
||||
$(function() |
||||
{ |
||||
// Message d'erreur en cas de mauvaise saisie du mail. Pour l'accessibilité |
||||
var email_from = document.getElementById("email-from"); |
||||
email_from.addEventListener("invalid", function() { |
||||
email_from.setCustomValidity("<?_e("Invalid email")?>. <?_e("Expected format")?> : name@example.com") |
||||
}, false); |
||||
email_from.addEventListener("input", function() { |
||||
email_from.setCustomValidity(""); |
||||
}, false); |
||||
|
||||
// Soumettre le formulaire |
||||
$("#form-contact").submit(function(event) |
||||
{ |
||||
send_mail(event) |
||||
}); |
||||
// Avant la sauvegarde |
||||
before_save.push(function() { |
||||
// Encode |
||||
if(data["content"]["email-to"] != undefined) |
||||
data["content"]["email-to"] = btoa(data["content"]["email-to"]); |
||||
}); |
||||
|
||||
// Edit |
||||
edit.push(function() |
||||
{ |
||||
// Décode |
||||
$("#email-to").val(function(index, value) { |
||||
if(value) return atob(value); |
||||
}); |
||||
}); |
||||
|
||||
}); |
||||
</script> |
@ -1,8 +0,0 @@ |
||||
{# seacms-theme |
||||
# SPDX-License-Identifier: EUPL-1.2 #} |
||||
|
||||
{% extends "index.twig" %} |
||||
|
||||
{% block content %} |
||||
{{ content }} |
||||
{% endblock content %} |
Loading…
Reference in new issue