Commit 8c43fcf6 authored by agnez's avatar agnez

problème js pour 3-producteurs

parent 7017b5bb
jQuery( document ).ready(function(){
<?php if(isset($_REQUEST['gmw_post'])) {
if($_REQUEST['gmw_post'] == 'gasap'){ ?>
jQuery('input[type="checkbox"]').on('change', function() {
if($(this).attr('name') != 'tax_gasaptype[]')
{
jQuery(this).siblings('input[type="checkbox"]').not(this).prop('checked', false);
}
});
<?php }
else if($_REQUEST['gmw_post'] == 'producer'){ ?>
jQuery('input[type="checkbox"]').on('change', function() {
if($(this).attr('name') != 'tax_producertype[]')
{
jQuery(this).siblings('input[type="checkbox"]').not(this).prop('checked', false);
}
});
<?php } ?>
$(function() {
$('html, body').animate({
scrollTop: $("#uk-grid").offset().top
}, 2000);
});
<?php } ?>
$("#getmap1").click(function() {
window.location.href = "?gmw_post=gasap";
});
$("#getmap2").click(function() {
window.location.href = "?gmw_post=producer";
});
});
\ No newline at end of file
function gasap_post_id (post) {
var postid = (post.id);
$.ajax({
type: 'POST',
action: gasap_get_activepost,
url: gasap_frontend_ajax.ajaxurl,
data: { postid : postid },
});
};
\ No newline at end of file
......@@ -38,7 +38,7 @@ h1, h2, h3, h4, h5, h6{
text-align: left;
}
&.espacer{
margin: @global-grid-gutter-large; auto;
margin: @global-grid-gutter-large auto;
}
}
h1,
......@@ -505,16 +505,40 @@ main .uk-container{
display: none;
}
}
#snippet_next_three_news{
padding-top: @global-grid-gutter-large;
padding-bottom: @global-grid-gutter-large;
}
#snippet_contact_calendrier{
background-color: @bleu-ciel;
padding: 3em 0;
}
#snippet_event_calendar{
background-color: @bleu-ciel;
padding: 1em 0;
margin-bottom: 3em;
border-top: 2px solid @global-muted-color;
padding: @global-grid-gutter-large 0;
.uk-panel{
background-color: white;
padding: @global-grid-gutter-large;
&.image{
padding: 0;
}
}
h2{
padding-bottom: @global-grid-gutter-large;
}
h3,
caption{
font-size: 22px;
font-weight: 800;
margin: 0;
padding-bottom: .5em;
line-height: 1;
border-bottom: 1px solid @global-muted-color;
color: @global-color;
}
thead{
margin-top: 15px;
}
}
#gasap-footer{
......@@ -554,6 +578,9 @@ main .uk-container{
}
}
}
main .uk-container.credits{
padding: 20px 0 0;
}
.largeur1{
max-width:950px;
......
// Variables modifiers
// ========================================================================
/* Font
========================================================================== */
@import url(http://fonts.googleapis.com/css?family=Roboto:400,300,500,700,300italic,400italic,500italic);
@global-font-family: Roboto, Helvetica, Arial, sans-serif;
@breakpoint-xlarge: 1123px;
@global-color: red;
@global-link-color: blue;
@global-link-hover-color: #4A545F;
@global-border: green;
@global-border-radius: 4px;
@global-primary-background: gold;
@global-success-background: #79935E;
@global-grid-gutter: 30px;
@global-grid-gutter-large: 40px;
@gris : #95989a;
@vert : #00686b;
@vert-claire : #7dab87;
@vert-claire2 : #99ccbb;
@rose : #ff8f73;
......@@ -7,11 +7,11 @@
</a></div>
<div><a href="<?php echo esc_url( get_permalink(87) ); ?>" class="uk-button uk-button-primary"><?php esc_html_e( 'Contact', 'beans_gasap' ) ?></a></div>
</div>
<div class="uk-width-1 uk-width-small-1-2 parked">
<div class="uk-width-1 uk-width-small-1-2">
<div><a href="<?php echo esc_url( get_permalink(14) ); ?>">
<img src="<?php echo get_stylesheet_directory_uri() . '/assets/img/pic_calendar.png'?>">
</a></div>
<div><a href="<?php echo esc_url( get_permalink(14) ); ?>" class="uk-button uk-button-primary"><?php esc_html_e( 'Calendar', 'beans_gasap' ) ?></a></div>
<div><a href="<?php echo esc_url( get_permalink(14) ); ?>#snippet_event_calendar" class="uk-button uk-button-primary"><?php esc_html_e( 'Calendar', 'beans_gasap' ) ?></a></div>
</div>
</div>
</div>
......
<?php
$argsevent_one = array(
'post_type' => 'event',
'posts_per_page' => 1,
'orderby' => 'eventstart',
'event_end_after' => 'now',
'order' => 'ASC'
);
$argsevents = array(
'post_type' => 'event',
'offset' => 1,
'posts_per_page' => 2,
'orderby' => 'eventstart',
'event_end_after' => 'now',
'order' => 'ASC'
);
$event_one = new WP_Query( $argsevent_one );
$events = new WP_Query( $argsevents ); ?>
<section id="snippet_event_calendar">
<h2 class="h1"><?php esc_html_e( 'Calendrier', 'beans_gasap' ); ?></h2>
<div class="uk-grid uk-grid-small uk-grid-match largeur1" data-uk-grid-match>
<div class="uk-width-1 uk-width-medium-1-3">
<div class="uk-panel"><?php the_widget( 'EO_Calendar_Widget','','widget_id=1'); ?></div>
</div><?php
while ( $event_one->have_posts() ) : $event_one->the_post();?>
<div class="uk-width-1 uk-width-medium-1-3">
<div class="uk-panel image">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'calendarthumb', array( 'alt' => '-' ) ); } ?>
</div>
</div>
<div class="uk-width-1 uk-width-small-1-3">
<div class="uk-panel">
<h3><?php the_title(); ?></h3><?php
the_content();
edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<span class="edit-link">', '</span>' );?>
</div>
</div><?php
endwhile; ?>
</div>
<div class="uk-grid uk-grid-small uk-grid-match largeur1" data-uk-grid-match><?php
while ( $events->have_posts() ) : $events->the_post();?>
<div class="uk-width-1 uk-width-small-1-2">
<div class="uk-panel">
<h3><?php the_title(); ?></h3><?php
the_content();
edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<span class="edit-link">', '</span>' );?>
</div>
</div><?php
endwhile;
wp_reset_postdata();?>
</div>
</section>
......@@ -43,5 +43,10 @@
</div>
</div>
</footer>
<div class="credits uk-container uk-container-center uk-text-center">
<div class="uk-panel">
<?php esc_html_e( 'Site web fait par', 'beans_gasap' ) ?> <a href="http://daresee.com">DARE.SEE</a> (<?php esc_html_e( 'graphisme', 'beans_gasap' ) ?>) & <a href="http://mipsum.be/">Lore Mipsum</a> (<?php esc_html_e( 'réalisation', 'beans_gasap' ) ?>), <?php esc_html_e( 'avec', 'beans_gasap' ) ?> <a href="https://wordpress.org/">Wordpress</a> & <a href="http://www.getbeans.io/">Beans</a>.
</div>
</div>
<?php
wp_reset_postdata();
<section id="snippet_la_carte">
<div class="uk-grid" id="uk-grid">
<div class="uk-width-1-1 uk-width-medium-2-3"><!-- left side -->
<h2 class="textegauche trouver"><?php esc_html_e( 'Trouvez', 'beans_gasap' ) ?>&nbsp;<?php esc_html_e( 'un GASAP ', 'beans_gasap' ) ?></h2>
<div>
<div class="largeur3 mieuxcomprendre">
<h4><?php esc_html_e( 'Mieux comprendre :', 'beans_gasap' ) ?></h4>
<?php
$argsmieux_comprendre = array(
'post_type' => 'contentpiece',
'orderby'=> 'date',
'order' => 'ASC',
'tax_query' => array(
array(
'taxonomy' => 'contentpiecetype',
'field' => 'term_id',
'terms' => 41 //FIX
)
)
);
$mieux_comprendre = new WP_Query( $argsmieux_comprendre );
?><div class="uk-grid uk-grid-match"> <?php
while ( $mieux_comprendre->have_posts() ) : $mieux_comprendre->the_post();
?><div class="uk-width-1 uk-width-medium-1-2">
<div><?php the_content(); ?></div><?php
edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<span class="edit-link">', '</span>' );?>
</div><?php
endwhile;
wp_reset_postdata();?>
</div>
</div>
<?php echo do_shortcode('[gmw form="1" name="form_id_1"]'); ?>
</div>
</div><!-- end left side -->
<div class="uk-width-1-1 uk-width-medium-1-3 leftmap">
<span id="map1"><?php echo do_shortcode('[gmw map="1"]'); ?></span>
</div>
</div>
</section>
\ No newline at end of file
<section id="snippet_la_carte">
<div class="uk-grid" id="uk-grid">
<div class="uk-width-1-1 uk-width-medium-2-3"><!-- left side -->
<h2 class="textegauche trouver"><?php esc_html_e( 'Trouvez', 'beans_gasap' ) ?>&nbsp;<?php esc_html_e( 'un producteur', 'beans_gasap' ) ?></h2>
<div>
<?php echo do_shortcode('[gmw form="2" name="form_id_2"]'); ?>
</div>
</div><!-- end left side -->
<div class="uk-width-1-1 uk-width-medium-1-3 leftmap">
<span id="map2"><?php echo do_shortcode('[gmw map="2"]'); ?></span>
</div>
</div>
</section>
\ No newline at end of file
<?php
add_action( 'wp_ajax_gasap_get_activepost', 'gasap_get_activepost' );
add_action( 'wp_ajax_nopriv_gasap_get_activepost', 'gasap_get_activepost' );
function gasap_get_activepost() {
if(isset($_POST['postid'])) {
$activepost = get_posts(array('postid' => $_POST['postid']));
return $activepost;
die();
}
else {
$activepost = '';
return $activepost;
die();
}
}?>
<section id="3producteurs" class="uk-block">
<div class="largeur1">
<div class="uk-text-center"><?php
......@@ -10,10 +26,11 @@
wp_reset_postdata();?>
</div>
<?php //deux producteurs
<?php
$do_not_duplicate = array();
$active_prod = get_query_var( 'prod','' );
$active_prod = $activepost;
//deux producteurs
$short_producteurs = new WP_Query( array(
'post_type' => 'producer',
'orderby' => 'rand',
......@@ -28,7 +45,7 @@
if ( has_post_thumbnail() ) { the_post_thumbnail('medium2'); } ?>
<h2><?php echo get_the_title(); ?></h2>
<?php echo get_the_term_list( get_the_ID(), 'producertype', '<div>', ', ', '</div>' ); ?>
<a class="uk-button uk-button-success" href="<?php echo esc_url( add_query_arg( 'prod', get_the_ID(), '' ) ) ?>#presentation_producteur" data-uk-smooth-scroll><?php esc_html_e( 'Discover', 'beans_gasap' ); ?></a>
<a id="<?php echo get_the_ID(); ?>" class="uk-button uk-button-success" onclick="gasap_post_id(this);" href="#presentation_producteur" data-uk-smooth-scroll><?php esc_html_e( 'Discover', 'beans_gasap' ); ?></a>
<?php edit_post_link( esc_html__( 'Edit producer', 'beans_gasap' ), '<span class="edit-link">', '</span>' ); ?>
</div>
<?php $do_not_duplicate[] = get_the_ID();
......@@ -38,7 +55,7 @@
// fiche producteur
if(get_query_var($active_prod) !== '') {
$fiche_producteur = new WP_Query( array( 'p' => $active_prod) );
$fiche_producteur = new WP_Query( array( 'p' => $active_prod) );
} else {
$fiche_producteur = new WP_Query( array(
'post_type' => 'producer',
......@@ -47,9 +64,9 @@
'post__not_in' => $do_not_duplicate
));
}
while ( $fiche_producteur->have_posts() ) : $fiche_producteur->the_post();?>
while ( $fiche_producteur->have_posts() ) : $fiche_producteur->the_post(); ?>
<div id="presentation_producteur" class="uk-block">
<div class="uk-grid">
<div class="uk-grid"><?php echo 'kkkkkkk'. $active_prod; ?>
<div class="uk-width-1 uk-width-medium-1-2">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?>
</div>
......
......@@ -3,37 +3,43 @@
// Include Beans. Do not remove the line below.
require_once( get_template_directory() . '/lib/init.php' );
add_action( 'after_setup_theme', 'gasap_setup' );
function gasap_setup() {
load_child_theme_textdomain( 'beans_gasap', get_stylesheet_directory() . '/languages' );//Loads the child theme textdomain.
}
/* Image formats */
add_action( 'after_setup_theme', 'gasap_formats', 20 );
function gasap_formats(){
add_theme_support( 'post-thumbnails' );
add_image_size( 'diaporama', 1200, 370, true );
add_image_size( 'newsthumb', 230, 210, true );
add_image_size( 'medium2', 500, 500, true );
}
add_action( 'after_setup_theme', 'gasap_setup' );
function gasap_setup() {
load_child_theme_textdomain( 'beans_gasap', get_stylesheet_directory() . '/languages' );//Loads the child theme textdomain.
}
/* Image formats */
add_action( 'after_setup_theme', 'gasap_formats', 20 );
function gasap_formats(){
add_theme_support( 'post-thumbnails' );
add_image_size( 'diaporama', 1200, 370, true );
add_image_size( 'newsthumb', 230, 210, true );
add_image_size( 'calendarthumb', 310, 310, true );
add_image_size( 'medium2', 500, 500, true );
}
/*
* Remove this action and callback function if you do not whish to use LESS to style your site or overwrite UIkit variables.
* If you are using LESS, make sure to enable development mode via the Admin->Appearance->Settings option. LESS will then be processed on the fly.
* Useing LESS + UIkit variables + js
*/
add_action( 'beans_uikit_enqueue_scripts', 'gasap_enqueue_uikit_assets' );
function gasap_enqueue_uikit_assets() {
// Enqueue uikit overwrite theme folder
//beans_uikit_enqueue_theme( 'beans_gasap', get_stylesheet_directory_uri() . '/assets/less/uikit' );
beans_uikit_enqueue_theme( 'beans_gasap', get_stylesheet_directory_uri() . '/assets/less/uikit' );
// Add the theme style as a uikit fragment to have access to all the variables
beans_uikit_enqueue_components( array( 'switcher', 'modal', 'tab', 'overlay', 'cover' ) );
beans_uikit_enqueue_components( array( 'slider', 'slideshow', 'grid', 'accordion' ), 'add-ons' );
beans_compiler_add_fragment( 'uikit', get_stylesheet_directory_uri() . '/assets/less/style.less', 'less' );
beans_compiler_add_fragment( 'uikit', get_stylesheet_directory_uri() . '/assets/less/gasap.less', 'less' );
// Remove unnecessary components.
//beans_uikit_dequeue_components( array( 'breadcrumb', 'comment', 'pagination', 'form', 'table' ) );
//beans_uikit_dequeue_components( array( 'breadcrumb', 'comment', 'pagination', 'form', 'table' ) );
}
add_action( 'wp_enqueue_scripts', 'gasap_js_scripts' );
function gasap_js_scripts() {
wp_enqueue_script( 'gasap_map_script', get_stylesheet_directory_uri() . '/assets/js/gasap_post_id.js', array('jquery') );
wp_enqueue_script( 'gasap_map_script', get_stylesheet_directory_uri() . '/assets/js/gasap_map.js', array('jquery') );// pour GASAP map
wp_enqueue_script( 'google_map', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js' );// pour GASAP map
wp_localize_script( 'frontend-ajax', 'gasap_frontend_ajax',array('ajaxurl' => admin_url( 'admin-ajax.php' ),));
}
//overwrite beans site branding
......@@ -79,6 +85,13 @@ add_action( 'wp', 'gasap_setup_document' );
function gasap_setup_document() {
beans_remove_action( 'beans_breadcrumb' );
beans_remove_action( 'beans_footer_partial_template' );
beans_remove_action( 'beans_post_meta_categories' );
}
// remove author from posts
add_filter( 'beans_post_meta_items', 'beans_child_remove_post_meta_items' );
function beans_child_remove_post_meta_items( $items ) {
unset( $items['author'] );
return $items;
}
require_once( get_stylesheet_directory() . '/assets/helpers/cleaner.php' );
......@@ -131,13 +144,20 @@ function wp_get_attachment( $attachment_id ) {
// Register calendar widget area to use in home.php
add_action( 'widgets_init', 'calendar_widget_areas' );
function calendar_widget_areas() {
beans_register_widget_area( array(
'name' => __( 'Calendar Widget Area', 'beans_gasap' ),
'id' => 'calendar_widget_area',
) );
beans_register_widget_area( array(
'name' => __( 'Calendar Widget Area', 'beans_gasap' ),
'id' => 'calendar_widget_area',
) );
}
//pour three_producers
add_filter( 'query_vars', 'add_gasap_query_vars_filter' );
function add_gasap_query_vars_filter( $vars ){
$vars[] = "prod";
return $vars;
}
// GASAP map - code by Smita
// pour GASAP map
add_action( 'gmw_before_no_results', 'nen_communities_no_results_show_map' );
function nen_communities_no_results_show_map( $form ) {
//exit;
......
<?php
add_action( 'beans_content_prepend_markup', 'gasap_newsslider' );
//function gasap_newsslider() {
// include (get_stylesheet_directory() . '/assets/template_parts/news_slider.php');
//}
add_action( 'beans_content_prepend_markup', 'gasap_latest_news' );
function gasap_latest_news() {
$do_not_duplicate = array();?>
......@@ -66,67 +61,12 @@ $loop2 = new WP_Query( array(
}
add_action( 'beans_content_after_markup', 'calendar_section_with_widget_area' );
function calendar_section_with_widget_area() {
$argsevent_one = array(
'post_type' => 'event',
'posts_per_page' => 1,
'orderby' => 'eventstart',
'event_end_after' => 'now',
'order' => 'ASC'
);
$argsevents = array(
'post_type' => 'event',
'offset' => 1,
'posts_per_page' => 2,
'orderby' => 'eventstart',
'event_end_after' => 'now',
'order' => 'ASC'
);
$event_one = new WP_Query( $argsevent_one );
$events = new WP_Query( $argsevents ); ?>
<section id="snippet_event_calendar">
<h2><?php esc_html_e( 'Calendrier', 'beans_gasap' ); ?></h2>
<div class="uk-grid uk-grid-small uk-grid-match largeur1" data-uk-grid-match>
<div class="uk-width-1 uk-width-medium-1-3">
<div class="uk-panel"><?php echo beans_widget_area( 'calendar_widget_area' ); // Output widget area above the footer. ?></div>
</div><?php
while ( $event_one->have_posts() ) : $event_one->the_post();?>
<div class="uk-width-1 uk-width-medium-1-3">
<div class="uk-panel"><?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?></div>
</div>
<div class="uk-width-1 uk-width-small-1-3">
<div class="uk-panel">
<h3><?php the_title(); ?></h3><?php
the_content();
edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<span class="edit-link">', '</span>' );?>
</div>
</div><?php
endwhile;
while ( $events->have_posts() ) : $events->the_post();?>
<div class="uk-width-1 uk-width-small-1-2">
<div class="uk-panel">
<h3><?php the_title(); ?></h3><?php
the_content();
edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<span class="edit-link">', '</span>' );?>
</div>
</div><?php
endwhile;
wp_reset_postdata();?>
</div>
</section><?php
}
beans_remove_action( 'beans_loop_template' );
add_action( 'beans_content_after_markup', 'gasap_bottom' );
function gasap_bottom() {
include (get_stylesheet_directory() . '/assets/template_parts/contact_calendar.php');
include (get_stylesheet_directory() . '/assets/template_parts/event_calendar.php');
include (get_stylesheet_directory() . '/assets/template_parts/footer.php');
}
......
......@@ -175,7 +175,7 @@ function add_contentpieces_after_les_mangeurs() { ?>
<?php
include (get_stylesheet_directory() . '/assets/template_parts/three_steps.php');// Comment devenir membre en 3 étapes ?
include (get_stylesheet_directory() . '/assets/template_parts/gasap_map.php');
include (get_stylesheet_directory() . '/assets/template_parts/map_gasap.php'); //TODO!!!
//include (get_stylesheet_directory() . '/assets/template_parts/three_producers.php');
include (get_stylesheet_directory() . '/assets/template_parts/news_slider.php');
include (get_stylesheet_directory() . '/assets/template_parts/latest_news.php');
......
......@@ -45,7 +45,7 @@ function add_page_le_gasap_content_pieces() {
//la carte
include (get_stylesheet_directory() . '/assets/template_parts/gasap_map.php');
//include (get_stylesheet_directory() . '/assets/template_parts/map_gasap.php');
// Le Réseau
?>
......@@ -68,7 +68,7 @@ function add_page_le_gasap_content_pieces() {
</div></section>
<?php
include (get_stylesheet_directory() . '/assets/template_parts/three_steps.php');// Comment devenir membre en 3 étapes ?
//include (get_stylesheet_directory() . '/assets/template_parts/three_producers.php');
include (get_stylesheet_directory() . '/assets/template_parts/three_producers.php');
include (get_stylesheet_directory() . '/assets/template_parts/news_slider.php');
include (get_stylesheet_directory() . '/assets/template_parts/latest_news.php');
include (get_stylesheet_directory() . '/assets/template_parts/contact_calendar.php');
......
......@@ -116,7 +116,7 @@ function add_contentpieces_after_les_producteurs() { ?>
</div></article>
Comment devenir producteur pour les GASAP ?
<?php
include (get_stylesheet_directory() . '/assets/template_parts/gasap_map.php');
include (get_stylesheet_directory() . '/assets/template_parts/map_prod.php'); //TODO!!!
//include (get_stylesheet_directory() . '/assets/template_parts/three_producers.php');
include (get_stylesheet_directory() . '/assets/template_parts/news_slider.php');
include (get_stylesheet_directory() . '/assets/template_parts/latest_news.php');
......
......@@ -15,5 +15,11 @@ function add_single_content_pieces() {
include (get_stylesheet_directory() . '/assets/template_parts/latest_news.php');
include (get_stylesheet_directory() . '/assets/template_parts/contact_calendar.php');
include (get_stylesheet_directory() . '/assets/template_parts/footer.php');
}
}
add_action( 'beans_content_after_markup', 'gasap_bottom' );
function gasap_bottom() {
include (get_stylesheet_directory() . '/assets/template_parts/event_calendar.php');
include (get_stylesheet_directory() . '/assets/template_parts/footer.php');
}
beans_load_document();
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