Commit 04562b52 authored by Nathan Peraldi's avatar Nathan Peraldi

reformat code

parent fc51d346
//liste des blocs qui peuvent être affichés / cachés
var blocks = ["link", "paraSecondSelection", "cotisation", "informationsCollectivite", "formulaireEPCIMutualisant", "boutonEnvoyer","chorus_pro"];
var blocks = ["link", "paraSecondSelection", "cotisation", "informationsCollectivite", "formulaireEPCIMutualisant", "boutonEnvoyer", "chorus_pro"];
var maxCotisation = 12000;
......@@ -35,16 +35,16 @@ function displayMaskOptions(display) {
toutesLesOptions[j].hidden = false;
//on affiche le label
document.getElementById("TYPENBR-"+toutesLesOptions[j].getAttribute("class")).style.display="block";
document.getElementById("TYPENBR-" + toutesLesOptions[j].getAttribute("class")).style.display = "block";
console.log ("on affiche " + document.getElementById("TYPENBR-"+display));
console.log("on affiche " + document.getElementById("TYPENBR-" + display));
} else {
console.log(display + "=/=" + toutesLesOptions[j].getAttribute("class"));
toutesLesOptions[j].hidden = true;
//On cache le label
document.getElementById("TYPENBR-"+toutesLesOptions[j].getAttribute("class")).style.display="none";
document.getElementById("TYPENBR-" + toutesLesOptions[j].getAttribute("class")).style.display = "none";
}
}
}
......@@ -173,7 +173,7 @@ function secondAction() {
setCotisation(selectedTranch);
displayMask(["paraSecondSelection", "cotisation", "informationsCollectivite", "boutonEnvoyer","chorus_pro"]);
displayMask(["paraSecondSelection", "cotisation", "informationsCollectivite", "boutonEnvoyer", "chorus_pro"]);
} else {
displayMask(["paraSecondSelection"]);
}
......@@ -202,7 +202,7 @@ function setCotisation(id, x = 0) {
}
}
function setChorusProRequired(boolean){
function setChorusProRequired(boolean) {
document.getElementById("siretCollectivite").required = boolean;
document.getElementById("numeroEngagementCollectivite").required = boolean;
document.getElementById("codeCollectivite").required = boolean;
......@@ -237,7 +237,7 @@ function traitementEPCIMutualisant() {
}
setCotisation("EPCIMutualisant", resultat);
displayMask(["cotisation", "informationsCollectivite", "formulaireEPCIMutualisant", "boutonEnvoyer","chorus_pro"]);
displayMask(["cotisation", "informationsCollectivite", "formulaireEPCIMutualisant", "boutonEnvoyer", "chorus_pro"]);
}
}
}
\ No newline at end of file
......@@ -6,64 +6,62 @@ $maxMembersPerLine = 3;
get_header();
?>
<ul>
<?php
global $post; //variable wp
$order = "asc";
<ul>
<?php
global $post; //variable wp
$order = "asc";
//on récup l'id de la catégorie de l'url
$currentCategoryID = explode("=", $_SERVER['REQUEST_URI'])[1];
//et on récup le nom à partir de l'id
$category = get_the_category_by_id($currentCategoryID);
//il se peut que l'id de la catégorie ne soit pas précisée dans l'url et get_the_category retourne un tableau d'erreurs.
if (gettype($category) == "object") {
$category = "Adhérent";
}
//on récup l'id de la catégorie de l'url
$currentCategoryID = explode("=", $_SERVER['REQUEST_URI'])[1];
//on récup le tri croissant / décroissant
if (isset($_GET["order"])) {
$order = $_GET["order"];
//et on récup le nom à partir de l'id
$category = get_the_category_by_id($currentCategoryID);
if ($order != "asc" && $order != "desc") {
$order = "asc";
//il se peut que l'id de la catégorie ne soit pas précisée dans l'url et get_the_category retourne un tableau d'erreurs.
if (gettype($category) == "object") {
$category = "Adhérent";
}
}
$args = array('posts_per_page' => 10, 'offset' => 0, 'cat' => $currentCategoryID, 'orderby' => 'title', 'order' => $order);
$myposts = get_posts($args);
echo "<br>";
$count = 0; //va servir pour les retour à la ligne lorsqu'on a affiché le max d'éléments par ligne
childrens_of_member_category($category);
echo "<div class='adullact-members-list'>";
//on récup le tri croissant / décroissant
if (isset($_GET["order"])) {
$order = $_GET["order"];
echo "<div class='adullact-line'>";
foreach ($myposts as $post) : setup_postdata($post);
$id = get_the_id();
$url = get_metadata("post", $id, "project_url")[0];
$count += 1;
?>
<a href="<?php echo $url; ?>" target="_blank" class="adullact-member">
<?php the_post_thumbnail(array("200", "200")); ?> <br>
<?php the_title(); ?> <br>
<?php the_tags($before = ''); ?>
</a>
<?php
if ($count >= $maxMembersPerLine) {
$count = 0;
echo "</div>";
echo "<div class='adullact-line'>";
if ($order != "asc" && $order != "desc") {
$order = "asc";
}
}
endforeach;
echo "</div></div>";
wp_reset_postdata(); ?>
</ul>
$args = array('posts_per_page' => 10, 'offset' => 0, 'cat' => $currentCategoryID, 'orderby' => 'title', 'order' => $order);
$myposts = get_posts($args);
echo "<br>";
$count = 0; //va servir pour les retour à la ligne lorsqu'on a affiché le max d'éléments par ligne
childrens_of_member_category($category);
echo "<div class='adullact-members-list'>";
echo "<div class='adullact-line'>";
foreach ($myposts as $post) : setup_postdata($post);
$id = get_the_id();
$url = get_metadata("post", $id, "project_url")[0];
$count += 1;
?>
<a href="<?php echo $url; ?>" target="_blank" class="adullact-member">
<?php the_post_thumbnail(array("200", "200")); ?> <br>
<?php the_title(); ?> <br>
<?php the_tags($before = ''); ?>
</a>
<?php
if ($count >= $maxMembersPerLine) {
$count = 0;
echo "</div>";
echo "<div class='adullact-line'>";
}
endforeach;
echo "</div></div>";
wp_reset_postdata(); ?>
</ul>
<?php get_footer(); ?>
\ No newline at end of file
This diff is collapsed.
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