Commit 02ebdf25 authored by agnez's avatar agnez

clean up mess with plugin GMW - wip

parent 5301c4a6
......@@ -10,7 +10,9 @@ plugins/posts/
includes/
gmw-pt-search-query-class.php
gmw-pt-template-functions.php
search-forms/default/search-form.php
search-results/default/
css/style.css
results.php
** search-forms/default/search-form.php
** search-results/default/
** css/style.css
** results.php
**ok copié dans theme
\ No newline at end of file
......@@ -63,10 +63,9 @@ jQuery( document ).ready(function()
arr_ids_deuxprod = choix_prods(2);
fiche_prod_id = fiche_prod_id_temp;
var deuxprod_titre1 = jQuery( "#deuxprods_titre1" );
var deuxprod_thumb1 = jQuery( "#deuxprods_thumb1" );
var deuxprod_thumb1src;
var deuxprods_terms1 = jQuery( "#deuxprods_terms1" );
;
var deuxprod_edit1 = jQuery( "#deuxprods_edit1" );
var deuxprod_titre2 = jQuery( "#deuxprods_titre2" );
......@@ -79,9 +78,9 @@ jQuery( document ).ready(function()
var ficheprod_content = jQuery( "#ficheprod_content" );
//prod1
deuxprod_titre1.html(lesproducteurs[arr_ids_deuxprod[0]].title);
deuxprods_terms1.html(lesproducteurs[arr_ids_deuxprod[0]].terms);
deuxprod_thumb1src=lesproducteurs[arr_ids_deuxprod[0]].thumb_medium;
var deuxprod_titre1 = jQuery( "#deuxprods_titre1" ).html(lesproducteurs[arr_ids_deuxprod[0]].title);
var deuxprods_terms1 = jQuery( "#deuxprods_terms1" ).html(lesproducteurs[arr_ids_deuxprod[0]].terms);
var deuxprod_thumb1src = lesproducteurs[arr_ids_deuxprod[0]].thumb_medium;
deuxprod_thumb1.attr("src", deuxprod_thumb1src);
deuxprod_thumb1.attr("alt", lesproducteurs[arr_ids_deuxprod[0]].title);
//deuxprod_edit1.html( "<a "+(lesproducteurs[arr_ids_deuxprod[0]].edit)+">ggg edit</a>" );
......@@ -96,11 +95,6 @@ jQuery( document ).ready(function()
ficheprod_content.html(lesproducteurs[fiche_prod_id].content);
ficheprod_thumbsrc=lesproducteurs[fiche_prod_id].thumb;
ficheprod_thumb.attr("src", ficheprod_thumbsrc);
console.log("edit: "+(lesproducteurs[arr_ids_deuxprod[0]].edit));
console.log("thumb: "+(lesproducteurs[arr_ids_deuxprod[0]].thumb));
console.log("content: "+(lesproducteurs[fiche_prod_id].content));
}
jQuery( '#clickme1' ).on('click', function(e){
......
......@@ -25,6 +25,10 @@
}
}
em{
color: @attention;
}
/* headers */
h1, h2, h3, h4, h5, h6{
color: @global-muted-color;
......
......@@ -33,7 +33,7 @@
</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>
<span id="map_gasap"><?php echo do_shortcode('[gmw map="1"]'); ?></span>
</div>
</div>
</section>
\ No newline at end of file
......@@ -47,7 +47,9 @@ function gasap_3prods() {
<img id='deuxprods_thumb1' width="500" height="240" src="" class="attachment-medium2 size-medium2 wp-post-image" alt="" />
<h2 id="deuxprods_titre1"></h2>
<div id="deuxprods_terms1"></div>
<a class="uk-button uk-button-success" id="clickme1" href="#fiche_producteur" data-uk-smooth-scroll><?php esc_html_e( 'Discover', 'beans_gasap' ); ?></a>
<div class="uk-text-center">
<a class="uk-button uk-button-success" id="clickme1" href="#fiche_producteur" data-uk-smooth-scroll><?php esc_html_e( 'Discover', 'beans_gasap' ); ?></a>
</div>
<span id="deuxprods_edit1" class="edit-link"></span>
</div>
......@@ -55,7 +57,9 @@ function gasap_3prods() {
<img id='deuxprods_thumb2' width="500" height="240" src="" class="attachment-medium2 size-medium2 wp-post-image" alt="" />
<h2 id="deuxprods_titre2"></h2>
<div id="deuxprods_terms2"></div>
<a class="uk-button uk-button-success" id="clickme2" href="#fiche_producteur" data-uk-smooth-scroll><?php esc_html_e( 'Discover', 'beans_gasap' ); ?></a>
<div class="uk-text-center">
<a class="uk-button uk-button-success" id="clickme2" href="#fiche_producteur" data-uk-smooth-scroll><?php esc_html_e( 'Discover', 'beans_gasap' ); ?></a>
</div>
<span id="deuxprods_edit2" class="edit-link"></span>
</div>
</div>
......
......@@ -183,9 +183,10 @@ function add_gasap_query_vars_filter( $vars ){
return $vars;
} */
// pour GASAP map
add_action( 'gmw_before_no_results', 'nen_communities_no_results_show_map' );
function nen_communities_no_results_show_map( $form ) {
// ----------- pour GASAP map
add_action( 'gmw_before_no_results', 'gasap_no_results_show_map' );
function gasap_no_results_show_map( $form ) {
//exit;
$form['your_lat'] = "51.103210";
$form['your_lng'] = "4.729270";
......@@ -194,3 +195,15 @@ function nen_communities_no_results_show_map( $form ) {
$gmw->map_element();
}
//add_filter( "gmw_default_form_values" , "gasap_modify_gmw_form_values", 10, 1 );
function gasap_modify_gmw_form_values() {
}
//exemple https://geomywp.com/forums/search/add_filter%28+%5C%22gmw_default_form_values%5C%22/
function gmw_remove_ul_icon( $form ) {
$form['ul_icon'] = '1';
return $form;
}
add_filter( 'gmw_default_form_values', 'gmw_remove_ul_icon' );
// -----------
/**
* Posts Locator search form stylesheet "default"
*/
div.gmw-pt-default-form-wrapper {
margin:10px 0px;
}
div.gmw-pt-default-form-wrapper input[type="text"] {
margin-top:6px;
padding:8px 10px 7px;
}
div.gmw-pt-default-form-wrapper .gmw-address-field-wrapper {
display: inline-block;
}
.widget_gmw_search_form_widget .gmw-address-field-wrapper {
float:none;
}
div.gmw-pt-default-form-wrapper .gmw-single-address-field {
float:left;
}
div.gmw-pt-default-form-wrapper .gmw-unit-distance-wrapper {
margin:10px 0px;
}
div.gmw-pt-default-form-wrapper .gmw-checkbox-taxonomy-wrapper label {
display:block;
}
div.gmw-pt-default-form-wrapper .gmw-saf-wrapper label {
margin-right:5px;
}
div.gmw-pt-default-form-wrapper .gmw-checkbox-category {
margin-right:5px;
}
div.gmw-pt-default-form-wrapper .gmw-checkbox-taxonomy-wrapper label {
text-transform: capitalize;
}
div.gmw-pt-default-form-wrapper .gmw-checkbox-taxonomy-wrapper span.label {
font-weight:bold;
}
div.gmw-pt-default-form-wrapper .gmw-radius-dropdown-wrapper, div.gmw-pt-default-form-wrapper .gmw-units-dropdown-wrapper {
display:inline;
margin-right:5px;
}
div.gmw-pt-default-form-wrapper .gmw-radius-slider-wrapper {
margin-bottom:10px;
}
div.gmw-pt-default-form-wrapper .gmw-radius-slider-range-wrapper {
margin:5px 0px;
}
div.gmw-pt-default-form-wrapper .gmw-no-address-error {
border: 1px solid rgb(252, 165, 165) !important;
}
div.gmw-pt-default-form-wrapper .gmw-locator-btn-wrapper {
width: 28px;
height: 28px;
padding: 3px 0px;
display: inline-block;
}
div.gmw-pt-default-form-wrapper .gmw-locator-btn-wrapper img {
position: absolute;
width: 28px;
height: 28px;
border-radius: 0px !important;
box-shadow: none !important;
}
div.gmw-pt-default-form-wrapper .gmw-locate-btn {
cursor: pointer;
}
\ No newline at end of file
<?php
error_reporting(0);
/**
* Posts Locator "GASAP" search form template file.
*
* The function pass 1 args for you to use:
* $gmw - the form being used ( array )
*/
?>
<script>//start gasap
jQuery( document ).ready(function()
{
$.fn.extend({
equalHeights: function(){
var top=0;
var row=[];
var classname=('equalHeights'+Math.random()).replace('.','');
$(this).each(function(){
var thistop=$(this).offset().top;
if (thistop>top) {
$('.'+classname).removeClass(classname);
top=thistop;
}
$(this).addClass(classname);
$(this).height('auto');
var h=(Math.max.apply(null, $('.'+classname).map(function(){ return $(this).outerHeight(); }).get()));
$('.'+classname).height(h);
}).removeClass(classname);
}
});
$(function(){
$(window).resize(function(){
$('.excerpt.wppl-excerpt').equalHeights();
}).trigger('resize');
});
$('#mydiv<?php echo $gmw['ID']; ?>').click(function(){
$(this).siblings(".comments").toggleClass('hidden');
if($(this).hasClass('close'))
{
$(this).addClass('open').removeClass('close');
}
else
{
$(this).addClass('close').removeClass('open');
}
});
if($(".uk-tab > li").hasClass('uk-active'))
{
//$("#map1").show();
//$("#map2").hide();
}
});
</script>
<?php
if($_GET['gmw_post'] == 'gasap'){?>
<script>
jQuery( document ).ready(function()
{
$("#mydiv1").addClass('open');
//$("#map1").show();
//$("#map2").hide();
});
</script><?php
}
else if($_GET['gmw_post'] == 'producer'){?>
<script>
jQuery( document ).ready(function()
{
//$("#map2").show();
//$("#map1").hide();
$(".uk-tab > li").removeClass("uk-active");
$("#tab-content div:first-child").removeClass("uk-active");
$(".uk-tab > li").attr("aria-expanded","false");
$("#tab-content div:first-child").attr("aria-hidden","true");
$("#tab-content div:nth-child(2)").attr("aria-hidden","false");
$("#tab-content div:nth-child(2)").addClass("uk-active");
$(".uk-tab li:nth-child(2)").addClass("uk-active");
$(".uk-tab li:nth-child(2)").attr("aria-expanded","true");
$("#myDIV2").removeClass('hidden');
$("#mydiv2").removeClass('close');
$("#mydiv2").addClass('open');
});
</script><?php
} //end gasap?>
<?php do_action( 'gmw_before_search_form_template', $gmw ); ?>
<div class="gmw-form-wrapper gmw-form-wrapper-<?php echo $gmw['ID']; ?> gmw-pt-form-wrapper gmw-pt-default-form-wrapper uk-accordion" data-uk-accordion="{showfirst: false}">
<?php //start gasap ?>
<h2 class="uk-accordion-title">
<?php
if(isset($_GET['lang']) == 'nl') { ?> Zoekfilters <?php
} else if(isset($_GET['lang']) == 'en'){ ?> Search Filters <?php
} else { ?> Filtres de recherche <?php
} ?>
<i class="uk-icon-caret-down"></i>
<i class="uk-icon-caret-right"></i>
</h2>
<div class="uk-accordion-content">
<?php //end gasap ?>
<?php do_action( 'gmw_before_search_form', $gmw ); ?>
<form class="gmw-form gmw-form-<?php echo $gmw['ID']; ?>" name="gmw_form" action="<?php echo $gmw['search_results']['results_page']; ?>" method="get">
<?php do_action( 'gmw_search_form_start', $gmw ); ?>
<div class="gmw-post-types-wrapper">
<!-- post types dropdown -->
<?php gmw_pt_form_post_types_dropdown( $gmw, false, false, false ); ?>
</div>
<?php do_action( 'gmw_search_form_before_taxonomies', $gmw ); ?>
<div class="gmw-taxonomies-wrapper">
<!-- Display taxonomies/categories -->
<?php gmw_pt_form_taxonomies( $gmw, 'div', $class='' ); ?>
</div>
<?php do_action( 'gmw_search_form_before_address', $gmw ); ?>
<!-- Address Field -->
<?php gmw_search_form_address_field( $gmw, $id='', $class='' ); ?>
<?php do_action( 'gmw_search_form_before_locator', $gmw ); ?>
<!-- locator icon -->
<?php gmw_search_form_locator_icon( $gmw ); ?>
<div class="clear"></div>
<?php do_action( 'gmw_search_form_before_distance', $gmw ); ?>
<div class="gmw-unit-distance-wrapper">
<div class="gmw-radius-dropdown-wrapper">
<!--distance values -->
<?php gmw_search_form_radius_values( $gmw, $class='' ); ?>
</div>
<div class="gmw-units-dropdown-wrapper">
<!--distance units-->
<?php gmw_search_form_units( $gmw, $class='' ); ?>
</div>
</div><!-- distance unit wrapper -->
<?php gmw_form_submit_fields( $gmw, false ); ?>
<?php do_action( 'gmw_search_form_end', $gmw ); ?>
</form>
<?php do_action( 'gmw_after_search_form', $gmw ); ?>
</div>
</div><!--form wrapper -->
<?php do_action( 'gmw_after_search_form_template', $gmw ); ?>
\ No newline at end of file
/**
* Posts Locator search results stylesheet "default"
*/
.wppl-map-wrapper {
margin-bottom: 10px;
width: auto;
position: relative;
clear: both;
}
.wppl-single-result {
font-family: arial;
padding: 5px;
background: #fff;
padding:10px;
margin: 10px;
border-radius: 0px;
border-bottom: 1px solid #aaafb6;
border-right: 1px solid #aaafb6;
border-left: 1px solid #aaafb6;
border-top: 1px solid #aaafb6;
float: left;
width: 47%;
position:relative;
}
.gmw-pt-per-page-dropdown {
height:25px !important;
font-size: 12px;
border:1px solid #ccc;
margin-left: 15px
}
.wppl-single-result .wppl-title-holder {
text-shadow: 0px 0px 0px white !important;
background: #fff;
text-transform: capitalize;
padding: 5px 0px 0px 0px;
margin-bottom: 5px;
}
.wppl-single-result h2.wppl-h2 {
line-height: 25px;
margin: 0px !important;
text-align:left;
}
.wppl-title-holder .wppl-h2 {
font-size: 16px;
color:#00686b;
}
.wppl-title-holder .wppl-h2 a{
font-size: 16px;
color:#00686b;
}
.wppl-single-result .wppl-h2 span {
font-size: 12px;
color: #666;
}
.wppl-single-result .wppl-thumb {
border: 1px solid #DDD;
padding: 4px 4px 4px 4px;
float: left;
margin-right: 10px;
display: inline;
background: #EFEFEF;
}
.wppl-single-result .wppl-thumb img { //
float: left;
}
.wppl-single-result .wppl-info {
font-family: arial, sans-serif;
color: #666;
font-size: 12px;
line-height: 20px;
clear: both;
float: left;
border: 1px solid gainsboro;
width: 96.5%;
background: #EFEFEF;
margin-top: 5px;
padding: 5px 10px;
text-shadow: 1px 1px 1px white;
box-shadow: inset 0px 0px 4px white;
-webkit-box-shadow: inset 0px 0px 4px white;
-moz-box-shadow: inset 0px 0px 4px white;
border-radius: 3px;
}
.wppl-info .wppl-info-left {
float: left;
width: 36%;
border-right: 1px dashed #AAA;
margin-right: 20px;
}
.wppl-info .wppl-info-right {
float: left;
width: 58%;
}
.wppl-single-result .wppl-info div span {
color: #444;
font-size: 14px;
text-transform: capitalize;
word-spacing: -1px;
text-decoration: none;
text-shadow: 1px 1px 1px white;
font-weight: normal;
margin-right: 3px;
}
.wppl-single-result.wppl-drive-dis {
margin-right: 10px;
float: left;
}
.wppl-single-result .wppl-get-directions {
float: left;
}
.wppl-get-directions a:link,.wppl-get-directions a:visited,.wppl-website a:link,.wppl-website a:visited
{
color: #2E738F;
}
.wppl-get-directions a:hover,.wppl-get-directions a:active,.wppl-website a:hover,.wppl-website a:active
{
color: #4B90AB;
}
.gmw-results-count {
background: #fdfdfd;
padding:8px 15px;
border-bottom:1px solid #ddd;
border-top:1px solid #ddd;
}
.gmw-results-count span {
font-size:13px;
}
/* pagination */
.gmw-pt-pagination-wrapper {
font-size: 12px;
background: #F9F9F9;
padding: 8px 0px;
display: inline-block;
width:100%;
min-height: 25px;
margin: 3px 0px
}
.gmw-pt-bottom-pagination-wrapper {
border-bottom:1px solid #ddd;
border-top:1px solid #ddd;
}
ul.gmw-pagination {
float: right;
text-align: center;
margin:0px;
list-style:none;
padding:0px;
}
ul.gmw-pagination li {
text-align:center;
display: inline-block;
margin:0 0 0 2px;
}
ul.gmw-pagination li a,
ul.gmw-pagination li span {
padding: 3px 4px;
border: solid 1px #ddd;
background: white;
font-size: 12px;
text-decoration: none
}
ul.gmw-pagination li a:hover,
ul.gmw-pagination li span {
background: #eee;
}
\ No newline at end of file
<?php
/**
* Posts locator "default" search results template file.
*
* The information on this file will be displayed as the search results.
*
* The function pass 2 args for you to use:
* $gmw - the form being used ( array )
* $post - each post in the loop
*
* You could but It is not recomemnded to edit this file directly as your changes will be overridden on the next update of the plugin.
* Instead you can copy-paste this template ( the "default" folder contains this file and the "css" folder )
* into the theme's or child theme's folder of your site and apply your changes from there.
*
* The template folder will need to be placed under:
* your-theme's-or-child-theme's-folder/geo-my-wp/posts/search-results/
*
* Once the template folder is in the theme's folder you will be able to choose it when editing the posts locator form.
* It will show in the "Search results" dropdown menu as "Custom: default".
*/
?>
<!-- Main results wrapper - wraps the paginations, map and results -->
<div class="gmw-results-wrapper gmw-results-wrapper-<?php echo $gmw['ID']; ?> gmw-pt-default-results-wrapper">
<?php do_action( 'gmw_search_results_start' , $gmw, $post ); ?>
<!-- results count -->
<div class="gmw-results-count">
<span><?php //gmw_results_message( $gmw, false ); ?></span>
</div>
<?php do_action( 'gmw_search_results_before_top_pagination' , $gmw, $post ); ?>
<div class="gmw-pt-pagination-wrapper gmw-pt-top-pagination-wrapper" style="display:none;">
<!-- paginations -->
<?php gmw_per_page( $gmw, $gmw['total_results'], 'paged' ); ?><?php gmw_pagination( $gmw, 'paged', $gmw['max_pages'] ); ?>
</div>
<div class="clear"></div>
<?php do_action( 'gmw_search_results_before_loop' , $gmw, $post ); ?>
<!-- Results wrapper -->
<div class="gmw-posts-wrapper">
<h2><?php esc_html_e( 'Résultat de recherche', 'beans_gasap' ); ?></h2>
<div data-uk-grid>
<!-- this is where wp_query loop begins -->
<?php while ( $gmw_query->have_posts() ) : $gmw_query->the_post(); ?>
<!-- single results wrapper -->
<?php $featured = ( !empty( $post->feature ) ) ? 'gmw-featured-post' : ''; ?>
<div id="post-<?php the_ID(); ?>" <?php post_class( 'uk-width-1-1 uk-width-medium-1-2 '.$featured ); ?>>
<div class="uk-panel uk-panel-box">
<?php do_action( 'gmw_search_results_loop_item_start' , $gmw, $post ); ?>
<!-- Title -->
<div class="wppl-title-holder">
<h3 class="uk-panel-title">
<a href="#post_<?php echo $post->ID; ?>" data-uk-modal><?php the_title(); ?></a>
<!--<a href="<?php echo the_permalink(); ?>"><?php echo $post->post_count; ?>) <?php the_title(); ?></a>
<span class="radius-dis">(<?php gmw_distance_to_location( $post, $gmw ); ?>)</span>-->
</h3>
<!-- This is an anchor toggling the modal -->
<!-- This is the modal -->
<div id="post_<?php echo $post->ID; ?>" class="uk-modal">
<div class="uk-modal-dialog">
<a class="uk-modal-close uk-close">x</a>
<h2><?php echo get_the_title($post->ID); ?></h2>
<?php echo get_post_field('post_content', $post->ID); ?>
<?php
$email = $post->post_author;
$terms = wp_get_post_terms( $post->ID, 'gasapstatus' );
if($email != '' && ($terms[0]->slug != 'complet')){ echo do_shortcode('[contact-form-7 id="693" title="Contact producteurs fr"]'); }
?>
</div>
</div>
</div>
<?php do_action( 'gmw_posts_loop_before_taxonomies' , $gmw, $post ); ?>
<!-- taxonomies -->
<div id="wppl-taxes-wrapper" class="wppl-taxes-wrapper">
<?php gmw_pt_taxonomies( $gmw, $post ); ?>
</div>
<div class="result-button">
<button class="uk-button uk-button-success post" data-uk-modal="{target:'#post_<?php echo $post->ID; ?>'}">
<?php esc_html_e( 'Découvrir', 'beans_gasap' ); ?>
</button>
</div>
<div><?php edit_post_link( esc_html__( 'Edit gasap', 'beans_gasap' ), '<span class="edit-link">', '</span>' ); ?></div>
<?php do_action( 'gmw_search_results_loop_item_end' , $gmw, $post ); ?>
</div>
</div> <!-- single- wrapper ends -->
<?php endwhile; ?>
<!-- end of the loop -->
</div>
</div> <!-- results wrapper -->
<?php do_action( 'gmw_search_results_before_bottom_pagination' , $gmw, $post ); ?>
<div class="gmw-pt-pagination-wrapper gmw-pt-bottom-pagination-wrapper" style="display:none;">
<!-- paginations -->
<?php gmw_per_page( $gmw, $gmw['total_results'], 'paged' ); ?><?php gmw_pagination( $gmw, 'paged', $gmw['max_pages'] ); ?>
</div>
<!-- GEO my WP Map -->
</div> <!-- output wrapper -->
<?php
if ( $gmw['search_results']['display_map'] == 'results' ) {
gmw_results_map( $gmw );