Commit 7f4280d3 authored by Mindiell's avatar Mindiell

Mise en place d'une base de vue par défaut

parent 40984d76
Pipeline #1966 failed with stages
in 6 seconds
......@@ -6,24 +6,6 @@ class Campaign extends Controller
/*
Page principale du site
*/
public function beforeRoute($f3, $args)
{
parent::beforeRoute($f3, $args);
// Valeur par défaut du bloc de contenu
$f3->set('block_content', 'campaign/empty.html');
// Get the database
$f3->set('SESSION.errors', []);
}
public function afterRoute($f3, $args)
{
parent::afterRoute($f3, $args);
// Rendu HTML de la page
echo \Template::instance()->render('campaign/base.html');
}
public static function show($f3, $args)
{
// Let's do some math first
......@@ -75,8 +57,7 @@ class Campaign extends Controller
// Page d'attente
public function wait($f3)
{
echo \Template::instance()->render('campaign/wait.html');
exit;
$f3->set('block_content', 'campaign/wait.html');
}
// Que fait la Quadrature ?
......
......@@ -12,6 +12,9 @@ class Controller
// Fonction appelée avant routage
public function beforeRoute($f3, $args)
{
// Template de base par défaut
$this->template = "base.html";
if (php_sapi_name() == 'cli') {
$HTTP_HOST = 'localhost';
} else {
......@@ -62,9 +65,6 @@ class Controller
$this->sanitizeForms($f3);
}
// Log dir
//$f3->set('LOGS', LOGS);
$f3->set('mail', array(
"from" => "contact@laquadrature.net",
"fromName" => "La Quadrature du Net"
......@@ -83,11 +83,27 @@ class Controller
);
asort($atailles);
$f3->set('atailles', $atailles);
// Ceci n'est valable que pour les tests en CLI
if (strlen($f3["RESPONSE"])>0) {
$f3->clear("RESPONSE");
return;
}
}
// Fonction appelée après routage
public function afterRoute($f3, $args)
{
// Ceci n'est valable que pour les tests en CLI
if (strlen($f3["RESPONSE"])>0) {
echo $f3["RESPONSE"];
return;
}
// Rendu de la page
if ($this->template!='') {
echo \Template::instance()->render($this->template);
}
}
// Fonction utilisée pour sanitiser les données
......
<!DOCTYPE html>
<html>
<include href="header.html" />
<body>
<include href="toolbar.html" />
<include href="{{ @block_content }}" />
<include href="footer.html" />
</check>
</body>
</html>
<section id="footer" class="container-fluid dark-blue">
<div class="row">
<div class="col-md-4">
<p>{{ _("Site hébergé par <a href=\"https://laquadrature.net\">La Quadrature du Net</a>") }}</p>
</div>
<div class="col-md-4">
<p>{{ _("Nous ne gardons que les données qui nous sont nécessaires à la gestion de votre don&nbsp;: le nom ou pseudo que vous nous renseignez ainsi que l'email.")}}</p>
</div>
<div class="col-md-4">
<a href="https://git.laquadrature.net">{{ _("Code source du site") }}</a> <br />
<a href="mailto:contact@laquadrature.net">{{ _("contact@laquadrature.net") }}</a>
</div>
</div>
</section>
<div class="btn-bottom hidden-xs hidden-sm">
<a class="btn btn-lg btn-default pull-right" href="#"><span class="btn-icon btn-icon-top"></span>{{ _("Revenir en haut")}}</a>
<check if="{{ @block_content == 'campaign/home.html' }}">
<false>
<a class="btn btn-lg btn-default pull-right" href="/#"><span class="btn-icon btn-icon-pig"></span>{{ _("Revenir aux dons")}}</a>
</false>
</check>
</div>
<head>
<title>{{ _("Soutenez La Quadrature du Net !") }}</title>
<meta charset="utf-8" />
<meta name="author" content="La Quadrature du Net" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Open graph -->
<meta property="og:title" content="{{ _('Soutenez La Quadrature du Net !') }}" />
<meta property="og:url" content="https://soutien.laquadrature.net/" />
<!-- FIXME: Change the OG image -->
<meta property="og:image" content="https://soutien.laquadrature.net/static/img/anim_3.gif" />
<meta property="og:site_name" content="La Quadrature du Net" />
<meta property="og:description" content="{{ _("Depuis sa création, La Quadrature du Net agit sans relâche pour qu'Internet demeure un outil de partage, de libre expression, dmancipation et permette la participation de tous au débat démocratique.") }}" />
<!-- Twitter cards -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@laquadrature" />
<meta name="twitter:title" content="{{ _("Soutenez la Quadrature du Net&nbsp!") }}">
<meta name="twitter:image" content="https://soutien.laquadrature.net/static/img/anim_3.gif">
<meta name="twitter:description" content="{{ _("Depuis sa création, La Quadrature du Net agit sans relâche pour qu'Internet demeure un outil de partage, de libre expression, dmancipation et permette la participation de tous au débat démocratique.") }}">
<!-- Styles -->
<link rel="stylesheet" href="/static/css/bootstrap.css" media="all">
<link rel="stylesheet" href="/static/css/fonts.css" media="all">
<link rel="stylesheet" href="/static/css/forms.css" media="all">
<link rel="stylesheet" href="/static/css/modals.css" media="all">
<link rel="stylesheet" href="/static/css/collapsibles.css" media="all">
<link rel="stylesheet" href="/static/css/layouts.css" media="all">
</head>
<div class="modal-form <check if="{{ @@form_visible == 'login' }}">visible</check>" id="login">
<div class="modal-form-title modal-form-only">
<a class="close modal-form-only" href="/#"><span>{{ _("Fermer") }}</span></a>
<h1>{{_("Se connecter")}}</h1>
</div>
<form method="POST" class="form-inline" action="{{ 'login' | alias }}">
<div class="modal-form-body">
<input type="hidden" name="csrf" id="csrf" value="{{ @CSRF }}" />
<fieldset class="form-group modal-form-only">
<div class="modal-row form-group">
<label for="email">{{ _("Adresse mail") }}</label>
<input class="form-control" type="email" name="email" id="email" required>
</div>
<div class="modal-row form-group">
<label for="password">{{ _("Mot de passe") }}</label>
<input class="form-control" type="password" name="password" id="password" required>
</div>
<div class="modal-row">
<a href="#password-reset">{{ _("Réinitialiser votre mot de passe") }}</a>
<input class="btn btn-lg btn-modal" type="submit" name="submit" id="submit" value="{{ _("Connexion") }}">
</div>
</fieldset>
</div>
</form>
</div>
<div class="modal-form" id="add-account">
<div class="modal-form-title modal-form-only">
<a class="close modal-form-only" href="#"><span>{{ _("Fermer") }}</span></a>
<h1>{{_("Créer un compte")}}</h1>
</div>
<form method="POST" class="form-inline" action="{{ 'login' | alias }}">
<div class="modal-form-body">
<input type="hidden" name="csrf" id="csrf" value="{{ @CSRF }}" />
<input type="hidden" name="action" id="action" value="create_account" />
<fieldset class="form-group modal-form-only">
<div class="modal-row form-group">
<label for="email">{{ _("Adresse mail") }}</label>
<input class="form-control" type="email" name="email" id="email" required>
</div>
<div class="modal-row form-group">
<label for="password">{{ _("Mot de passe") }}</label>
<input class="form-control" type="password" name="password" id="password" required>
</div>
<div class="modal-row">
<input class="btn btn-lg btn-modal" type="submit" name="submit" id="submit" value="{{ _("Création du compte") }}">
</div>
</fieldset>
</div>
</form>
</div>
<div class="modal-form <check if="{{ @@form_visible == 'merci' }}">visible</check>" id="merci">
<div class="modal-form-title modal-form-only">
<a class="close modal-form-only" href="/#"><span>{{ _("Fermer") }}</span></a>
<h1>{{ _("Merci &lt;3") }}</h1>
</div>
<div class="modal-form-body modal-form-only">
<div class="modal-row">
<p>{{ _("Merci de votre soutien") }}</p>
</div>
</div>
</div>
<div class="modal-form" id="password-reset">
<div class="modal-form-title modal-form-only">
<a class="close modal-form-only" href="/#"><span>{{ _("Fermer") }}</span></a>
<h1>{{ _("Réinitialiser votre mot de passe") }}</h1>
</div>
<form method="POST" class="form-inline" action="{{ 'login' | alias }}">
<div class="modal-form-body">
<input type="hidden" name="csrf" id="csrf" value="{{ @CSRF }}" />
<input type="hidden" name="action" id="action" value="renew_password" />
<fieldset class="form-group modal-form-only">
<div class="modal-row form-group">
<label for="email">{{ _("Adresse mail") }}</label>
<input class="form-control" type="email" name="email" id="email" required>
</div>
<div class="modal-row">
<input class="btn btn-lg btn-modal" type="submit" name="submit" id="submit" value="{{ _("Réinitialiser le mot de passe") }}">
</div>
</fieldset>
</div>
</form>
</div>
<div class="hidden-xs hidden-sm">
<nav id="up-bar" class="navbar navbar-default dark-blue">
<ul class="nav navbar-nav navbar-right blue">
<li><a href="{{ 'https://soutien.' . BASE_DOMAIN }}">{{ _("[FR]")}}</a></li>
<li><a href="{{ 'https://support.' . BASE_DOMAIN }}">{{ _("[EN]")}}</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<check if="{{ array_key_exists('user', @SESSION) }}">
<true><li><a href="{{ 'logout' | alias }}">{{ _("Se déconnecter") }}</a></li>
<li><a href="{{ 'perso' | alias }}">{{ _("Réclamer les contreparties") }}</a></li></true>
<false><li><a href="#add-account">{{ _("Créer un compte")}}</a></li>
<li><a href="#login">{{ _("Se connecter")}}</a></li></false>
</check>
</ul>
</nav>
<nav id="toolbar" class="navbar navbar-default navbar-white">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="{{ 'home' | alias }}">
<img src="/static/img/logo.png" alt="">
</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li> <a href="{{ @ALIASES.why }}" <check if="{{ @block_content=='campaign/why.html' }}">class="on"</check> >{{ _("À quoi sert votre don&nbsp;?") }}</a></li>
<li> <a href="{{ @ALIASES.what }}" <check if="{{ @block_content=='campaign/what.html' }}">class="on"</check> >{{ _("Que fait LQDN&nbsp;?") }}</a></li>
<li> <a href="{{ @ALIASES.who }}" <check if="{{ @block_content=='campaign/who.html' }}">class="on"</check> >{{ _("Comment fonctionne LQDN&nbsp;?") }}</a></li>
<li> <a href="{{ @ALIASES.faq }}" <check if="{{ @block_content=='campaign/faq.html' }}">class="on"</check> >{{ _("FAQ") }}</a></li>
<li> <a href="{{ @ALIASES.material }}" <check if="{{ @block_content=='campaign/material.html' }}">class="on"</check> >{{ _("Relayer") }}</a></li>
</ul>
</div>
</nav>
</div>
<div class="visible-xs visible-sm">
<nav id="toolbar" class="navbar navbar-default navbar-white">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="{{ 'home' | alias }}">
<img src="/static/img/logo.png" alt="">
</a>
</div>
<ul class="nav navbar-nav">
<check if="{{ array_key_exists('user', @SESSION) }}">
<true><li class="pull-right collapsible-menu"><a href="#perso-menu">{{ _("Perso") }}</a></li></true>
<false><li class="pull-right"><a href="#login">{{ _("Se connecter")}}</a></li></false>
</check>
<li class="pull-right collapsible-menu"><a href="#action-menu">{{ _("Menu") }}</a>
</li>
</ul>
</div>
<span class="menu-collapsed-target" id="perso-menu"></span>
<div class="menu-collapsed">
<ul class="nav navbar-nav">
<li><a href="{{ 'logout' | alias }}">{{ _("Déconnexion") }}</a></li>
<li><a href="{{ 'perso' | alias }}">{{ _("Page Perso") }}</a></li>
<li><a href="#">{{ ("Fermer") }}</a></li>
</ul>
</div>
<span class="menu-collapsed-target" id="action-menu"></span>
<div class="menu-collapsed">
<ul class="nav navbar-nav">
<li> <a href="{{ @ALIASES.why }}" >{{ _("À quoi sert votre don&nbsp;?") }}</a></li>
<li> <a href="{{ @ALIASES.what }}" >{{ _("Que fait LQDN&nbsp;?") }}</a></li>
<li> <a href="{{ @ALIASES.who }}" >{{ _("Comment fonctionne LQDN&nbsp;?") }}</a></li>
<li> <a href="{{ @ALIASES.faq }}" >{{ _("FAQ") }}</a></li>
<li> <a href="{{ @ALIASES.material }}" >{{ _("Relayer") }}</a></li>
<li> <a href="{{ @ALIASES.home }}" >{{ _("Home") }}</a></li>
<li><a href="#">{{ ("Fermer") }}</a></li>
</ul>
</div>
</nav>
</div>
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