Commit 73f9c429 authored by Matthieu FAURE's avatar Matthieu FAURE
Browse files

Merge branch '17-integration-html-page-d-accueil' into 'master'

Resolve "Integration HTML Page d'accueil"

Closes #17

See merge request !28
parents bd56efac baf12dac
......@@ -7,6 +7,92 @@ $order = "asc";
$link = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER["REDIRECT_URL"];
$pagination = true;
/**On affiche les boutons pour trier les membres en fonction du type de collectivité
* @param string $category_to_select
*/
function childrens_of_member_category($category_to_select)
{
$member_category_object = get_category_by_slug("membres");
$id = $member_category_object->cat_ID;
$server_link = $_SERVER["SERVER_NAME"];
$link_Category = "http://" . $server_link . "/category/";
$current_category = $category_to_select;
dump_debug($_SERVER);
echo_debug("\n----------------------\n");
dump_debug($member_category_object);
$childrens = get_term_children($id, "category"); //contiendra les id de tous les enfants de adhérent
if ($current_category == "membres" || $current_category == "") {
echo " <li class='adullact-sort-button adullact-selected'><a href='" . $link_Category . "membres/'>Tout</a></li>";
} else {
echo " <li class='adullact-sort-button'><a href='" . $link_Category . "membres/'>Tout</a></li>";
}
foreach ($childrens as $c) {
$temp_category = get_category($c); //objet contenant les infos de la catégorie enfant
$my_link = "<li class='adullact-sort-button";
if ($temp_category->slug == $category_to_select) {
//si on est en train d'afficher la catégorie sélectionnée
$my_link .= " adullact-selected";
} else {
echo_debug($temp_category->slug . "=/=" . $category_to_select);
}
$my_link .= "'><a href = \"http://" . $server_link . "/category/";
$my_link .= $temp_category->slug;
$my_link .= "\"";
$my_link .= "\">";
$my_link .= $temp_category->name;
$my_link .= "</a></li>";
echo $my_link;
}
}
/**on génère les boutons pour trier les membres par ordre croissant / décroissant
* @param string $order
* @param string $page
* @param string $link
*/
function sort_page($order, $page, $link)
{
$for_asc_link = $link . "?page=" . $page . "&order=asc";
$for_desc_link = $link . "?page=" . $page . "&order=desc";
if ($order == "desc") {
?>
<li class="adullact-sort-button">
<a href="<?php echo $for_asc_link; ?>">
Croissant
</a>
</li>
<li class="adullact-sort-button adullact-selected">
<a href="<?php echo $for_desc_link; ?>">
Décroissant
</a>
</li>
<?php
} else {
?>
<li class="adullact-sort-button adullact-selected">
<a href="<?php echo $for_asc_link; ?>">
Croissant
</a>
</li>
<li class="adullact-sort-button">
<a href="<?php echo $for_desc_link; ?>">
Décroissant
</a>
</li>
<?php
}
}
//on vérifie bien le numéro de la page
if (isset($_GET["page"])) {
if (is_numeric($_GET["page"])) {
......@@ -27,7 +113,7 @@ get_header();
$min_member_numero = 1 + ($page * $maxMembersPerPage) - $maxMembersPerPage;
$max_member_numero = ($page * $maxMembersPerPage);
?>
<div class="wrap">
<div class="wrap adullact-no-height-padding">
<main id="main" class="site-main" role="main">
<div class="adullact-line">
<div id="adullact-sort-by-type-buttons">
......
</div><!-- #content -->
<footer id="colophon" class="site-footer" role="contentinfo">
<div id="adullact-footer" class="wrap">
<ul>
<li><?php get_adullact_page("mentions-legales")?></li>
<li><?php get_adullact_page("accessibilite")?></li>
<li><?php get_adullact_page("contact")?></li>
<li><?php get_adullact_page("plan-du-site")?></li>
</ul>
<ul>
<li><?php get_adullact_page("mentions-legales") ?></li>
<li><?php get_adullact_page("accessibilite") ?></li>
<li><?php get_adullact_page("contact") ?></li>
<li><?php get_adullact_page("plan-du-site") ?></li>
</ul>
<p id="adullact-contact-informations">
Association ADULLACT, 5 Rue du Plan du Palais, 34000 Montpellier<br>
......
......@@ -7,7 +7,7 @@ require_once "formulaire-adhesion-functions.php";
get_header();
?>
<div class="wrap">
<div class="wrap adullact-no-height-padding">
<div id="primary" class="content-area">
<?php
if ($isFormulaireValide) {
......
......@@ -5,11 +5,12 @@ function my_theme_enqueue_styles()
{
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
}
add_action('wp_enqueue_scripts', 'my_theme_enqueue_styles');
define("DEBUG_FUNCTIONS",false);
define("DEBUG_FUNCTIONS", false);
function get_adullact_page($slug,$class="")
function get_adullact_page($slug, $class = "")
{
$args = array(
"post_type" => "page",
......@@ -39,89 +40,12 @@ function dump_debug($list)
}
}
function childrens_of_member_category($category_to_select)
/**on supprime du texte inutile généré sur certaines pages
* @return string
*/
function wpc_remove_archive_title_prefix()
{
//cette fonction affiche la liste des catégories enfants de la catégorie mère Adhérent
$member_category_object = get_category_by_slug("membres");
$id = $member_category_object->cat_ID;
$server_link = $_SERVER["SERVER_NAME"];
$link_Category = "http://" . $server_link . "/category/";
$current_category = $category_to_select;
dump_debug($_SERVER);
echo_debug("\n----------------------\n");
dump_debug($member_category_object);
//SERVER_NAME
$childrens = get_term_children($id, "category"); //contiendra les id de tous les enfants de adhérent
if ($current_category == "membres" || $current_category == "") {
echo " <li class='adullact-sort-button adullact-selected'><a href='" . $link_Category . "membres/'>Tout</a></li>";
} else {
echo " <li class='adullact-sort-button'><a href='" . $link_Category . "membres/'>Tout</a></li>";
}
foreach ($childrens as $c) {
$temp_category = get_category($c); //objet contenant les infos de la catégorie enfant
$my_link = "<li class='adullact-sort-button";
if ($temp_category->slug == $category_to_select) {
//si on est en train d'afficher la catégorie sélectionnée
$my_link .= " adullact-selected";
} else {
echo_debug($temp_category->slug . "=/=" . $category_to_select);
}
$my_link .= "'><a href = \"http://" . $server_link . "/category/";
$my_link .= $temp_category->slug;
$my_link .= "\"";
$my_link .= "\">";
$my_link .= $temp_category->name;
$my_link .= "</a></li>";
echo $my_link;
}
}
function sort_page($order, $page, $link)
{
$for_asc_link = $link . "?page=" . $page . "&order=asc";
$for_desc_link = $link . "?page=" . $page . "&order=desc";
if ($order == "desc") {
?>
<li class="adullact-sort-button">
<a href="<?php echo $for_asc_link; ?>">
Croissant
</a>
</li>
<li class="adullact-sort-button adullact-selected">
<a href="<?php echo $for_desc_link; ?>">
Décroissant
</a>
</li>
<?php
} else {
?>
<li class="adullact-sort-button adullact-selected">
<a href="<?php echo $for_asc_link; ?>">
Croissant
</a>
</li>
<li class="adullact-sort-button">
<a href="<?php echo $for_desc_link; ?>">
Décroissant
</a>
</li>
<?php
}
}
//retirer le texte inutile "Catégorie : Actualités"
function wpc_remove_archive_title_prefix() {
return "";
}
add_filter('get_the_archive_title', 'wpc_remove_archive_title_prefix');
\ No newline at end of file
......@@ -57,10 +57,12 @@
<div class="site-content-contain">
<div id="content" class="site-content">
<!-- personnalisation du plugin de fil d'ariane -->
<div class="breadcrumbs wrap" typeof="BreadcrumbList" vocab="https://schema.org/">
<?php if (function_exists('bcn_display')) {
if (!is_front_page()) {
bcn_display();
}
} ?>
</div>
<?php if (function_exists('bcn_display')) {
if (!is_front_page()) {
echo '<div class="breadcrumbs wrap" typeof="BreadcrumbList" vocab="https://schema.org/">';
bcn_display();
echo '</div>';
}
}
?>
\ No newline at end of file
......@@ -4,45 +4,129 @@
* ce fichier a pour objectif d'afficher les actualités, malgré son nom "index.php" qui pourrait laisser penser
* que c'est la page d'accueil.
*/
$theme_directory = get_stylesheet_directory_uri();
$adullact_icons_directory = $theme_directory . "/media/icons/";
$comptoir_icon = $adullact_icons_directory . "comptoir.png";
$faq_icon = $adullact_icons_directory . "faq.png";
$forge_icon = $adullact_icons_directory . "forge.png";
$labelTNL_icon = $adullact_icons_directory . "labelTNL.png";
$services_icon = $adullact_icons_directory . "services.png";
$newsletter_icon = $adullact_icons_directory . "newsletter.png";
get_header(); ?>
<div class="wrap">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<p class="adullact-justify">
Fondée en 2002, l'ADULLACT (Association des Développeurs et Utilisateurs de Logiciels Libres pour
les Administrations et les Collectivités Territoriales) a pour objectifs de promouvoir, développer
et maintenir un patrimoine de logiciels libres utiles aux missions de service public.
</p>
<p class="adullact-justify">
Structure unique en Europe, est une initiative née de la nécessité de voir apparaître une
alternative au système des licences propriétaires, en particulier dans le domaine des logiciels
métiers.
</p>
<?php
if (have_posts()) :
global $post;
/* Start the Loop */
while (have_posts()) :
the_post(); //on charge le post dans la boucle.
//affiche le post avec le comportement wordpress par défaut. on peut supprimer cette ligne pour
//faire ca nous même.
get_template_part('content', "adullact");
endwhile;
the_posts_pagination(
array(
'prev_text' => twentyseventeen_get_svg(array('icon' => 'arrow-left')) . '<span class="screen-reader-text">' . __('Previous page', 'twentyseventeen') . '</span>',
'next_text' => '<span class="screen-reader-text">' . __('Next page', 'twentyseventeen') . '</span>' . twentyseventeen_get_svg(array('icon' => 'arrow-right')),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'twentyseventeen') . ' </span>',
)
);
else :
get_template_part('template-parts/post/content', 'none');
endif;
?>
<div class="adullact-cadres-column">
<div class="adullact-cadres-ligne-space">
<div class="adullact-cadre">
<a href="https://comptoir-du-libre.org/">
<img src="<?= $comptoir_icon ?>" alt="">
<p>Le Comptoir</p>
</a>
</div>
<div class="adullact-cadre">
<a href="https://gitlab.adullact.net/">
<img src="<?= $forge_icon ?>" alt="">
<p>Les Forges</p>
</a>
</div>
<div class="adullact-cadre">
<a href="http://www.s2low.org/">
<img src="<?= $services_icon ?>" alt="">
<p>Les services</p>
</a>
</div>
<div class="adullact-cadre">
<a href="#">
<img src="<?= $labelTNL_icon ?>" alt="">
<p>Le Label TNL</p>
</a>
</div>
<div class="adullact-cadre">
<a href="#">
<img src="<?= $newsletter_icon ?>" alt="">
<p>La lettre</p>
</a>
</div>
<div class="adullact-cadre">
<a href="#">
<img src="<?= $faq_icon ?>" alt="">
<p>La FAQ</p>
</a>
</div>
</div>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .wrap -->
<!-- effet parallax-->
<div id="adullact-parallax-1">>
<div class="wrap">
<div class="adullact-cadres-ligne-center">
<div class="adullact-cadre-texte">
<p class="adullact-front-page-number">342</p>
<p>Adhérents directs</p>
</div>
<div class="adullact-cadre-texte">
<p class="adullact-front-page-number">5200</p>
<p>Collectivités touchées</p>
</div>
<div class="adullact-cadre-texte">
<p class="adullact-front-page-number">17</p>
<p>Ans d'expérience</p>
</div>
</div>
</div>
</div>
<div class="wrap adullact-no-height-padding">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<div class="adullact-cadres-ligne-space">
<?php
$args = array(
"post_type" => "post",
"order" => "DESC",
"category_name" => "actualite",
"orderby" => "date",
"posts_per_page" => 3);
$my_posts = get_posts($args);
if (count($my_posts) > 0) {
foreach ($my_posts as $post) : setup_postdata($post);
?>
<div class="adullact-cadre-article">
<a href="<?php echo get_permalink($post); ?>" title="Lire l'article...">
<?php the_post_thumbnail(array("200", "200")) ?>
<p><?php the_title() ?></p>
</a>
</div>
<?php
endforeach;
wp_reset_postdata();
}
?>
</div>
</main>
</div>
</div>
<?php
get_footer();
......@@ -5,7 +5,7 @@ Template Name: Adhésion individuelle
get_header();
?>
<div class="wrap">
<div class="wrap adullact-no-height-padding">
<div id="primary" class="content-area">
<h1 class="adullact-blue">Adhésion individuelle</h1>
<p>Les adhésions individuelles se font sur le site HelloAsso.</p>
......
......@@ -7,11 +7,17 @@
Template: twentyseventeen
Version: 0.8
*/
/*************************************************************/
/*classes wordpress*/
/*************************************************************/
@font-face {
font-family: "GravityAdullact";
src: url("fonts/Gravity-Regular.otf");
}
/*couleurs :
bleu adullact : #4891bf
erreur (rouge) : red
*/
* {
font-family: GravityAdullact, serif;
}
/*************************************************************/
......@@ -19,62 +25,48 @@ erreur (rouge) : red
/*************************************************************/
@media screen and ( min-width: 67em ) {
.wrap {
max-width: 1200px;
padding: 28px;
}
.navigation-top .wrap {
max-width: 1200px;
}
.archive:not(.page-one-column):not(.has-sidebar) #primary article {
float: none;
width: 70%;
}
}
@media screen and ( max-width: 66.99em ) {
.archive:not(.page-one-column):not(.has-sidebar) #primary article {
float: none;
width: 100%;
}
.entry-title {
color: #4891bf;
}
.page-header {
display: none;
padding-bottom: 0;
}
.entry-title {
color: #4891bf;
.archive:not(.page-one-column):not(.has-sidebar) #primary article {
width: 100%;
float: none;
}
.wrap {
padding-top: 0;
body:not(.has-sidebar):not(.page-one-column) .page-header {
float: none;
}
/*************************************************************/
/*classes de base adullact individuelle*/
/*************************************************************/
.adullact-blue {
color: #4891bf;
input[type="search"] {
padding: 0.3em;
font-size: 0.8em;
}
.adullact-button {
border-radius: 3px;
border: 1px solid grey;
color: grey;
transition: background-color 0.2s ease;
padding: 7px;
font-size: 1em;
.search-form .search-submit .icon {
height: 18px;
top: -10px;
width: 18px;
}
.adullact-button:hover {
color: dimgrey;
background-color: lightgrey;
.search-form .search-submit {
padding: 0.5em 0.5em;
}
/*************************************************************/
/*header*/
/*************************************************************/
.adullact-blue {
color: #4891bf;
}
#logo-adullact-big, #logo-adullact-small {
max-width: 400px;
......@@ -84,6 +76,165 @@ erreur (rouge) : red
padding: 0;
}
.adullact-no-height-padding {
padding-top: 0;
padding-bottom: 0;
}
.adullact-header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.adullact-searchbar-parent {
display: flex;
flex-direction: column;
width: 50%;
align-items: end;
}
.adullact-reseaux-sociaux {
display: flex;
flex-direction: row;
}
.adullact-reseaux-sociaux img {
max-width: 2em;
max-height: 2em;
margin-left: 0.7em;
margin-right: 0.7em;
}
.adullact-searchbar {
width: 100%;
margin-right: 0.7em;
}
@media screen and ( max-width: 66.99em ) {
.adullact-header {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.adullact-searchbar-parent {
display: flex;
flex-direction: column;
width: 80%;
max-width: 20em;
align-items: center;
}
.adullact-searchbar {
margin-bottom: 3em;
width: 100%;
}
}
@media screen and (max-width: 30em) {
input[type="search"] {
font-size: 1em;