Skip to content

Commit

Permalink
V2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gwin committed Apr 28, 2022
1 parent 859d937 commit b28006e
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 25 deletions.
6 changes: 5 additions & 1 deletion assets/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,17 @@
}

.wpadverts-form .wpa-form-buttons {
@apply atw-flex atw-mt-3 atw-p-3 atw-bg-gray-50 atw-rounded-md atw-justify-end md:atw-flex-none;
@apply atw-flex atw-mt-3 atw-py-3 atw-bg-gray-50 atw-rounded-md atw-justify-end md:atw-flex-none;
}

.wpadverts-form .wpa-form-buttons-list {
@apply atw-flex-none;
}

#wpadverts-block-contact-box .wpadverts-form .wpa-form-buttons {
@apply atw--mx-0
}

/* FORM STYLES */

.wpadverts-form input[type=text],
Expand Down
2 changes: 2 additions & 0 deletions assets/js/block-details.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
jQuery(function($) {

/*
$(".wpadverts-show-contact-form").on("click", function(e) {
e.preventDefault();
Expand All @@ -13,4 +14,5 @@ jQuery(function($) {
window.location.hash = "#wpadverts-block-contact-box";
}
});
*/
});
8 changes: 5 additions & 3 deletions blocks/details/templates/single.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@
<?php do_action( "adverts_tpl_single_bottom", $post_id ) ?>

<?php if( ! empty( $contact_options ) || ! empty( $options ) ): ?>
<div class="wpa-cpt-contact-details atw-my-3 atw--mx-1">
<div class="wpa-cpt-contact-details atw-my-3 atw--mx-1">

<div class="atw-relative atw-flex atw-flex-col md:atw-flex-row">
<div class="atw-relative atw-flex atw-flex-col md:atw-flex-row atw--mx-1">

<div class="atw-relative atw-flex atw-flex-1 atw-flex-col md:atw-flex-row">
<div class="atw-relative atw-flex atw-flex-1 atw-flex-col md:atw-flex-row md:atw-flex-none">
<?php foreach( $contact_options as $contact_option ): ?>
<div class="atw-flex-auto atw-mx-1 atw-mb-3">
<?php
Expand All @@ -133,6 +133,7 @@

<?php do_action( "wpadverts/block/details/tpl/contact-content", $post_id, $atts ) ?>

<?php /*
<div class="wpa-contact-more atw-inset-x-0">
<div class="atw-w-full atw-flex atw-flex-col md:atw-flex-row atw-my-3 atw-px-0 atw-mx-1 md:atw-my-0">
Expand All @@ -154,6 +155,7 @@
</div>
</div>
</div>
*/ ?>

</div>

Expand Down
6 changes: 3 additions & 3 deletions blocks/list/src/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
"grid_img_height": {
"type": "integer",
"default": 6
"default": 8
},
"grid_img_fit": {
"type": "string",
Expand All @@ -95,8 +95,8 @@
"data": {
"type": "array",
"default": [
{ "name": "meta__adverts_location" },
{ "name": "pattern__post_date" }
{ "name": "pattern__post_date" },
{ "name": "meta__adverts_location" }
]
},
"default_image_url": {
Expand Down
16 changes: 8 additions & 8 deletions blocks/list/src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ class Edit extends Component {
<>

<InspectorControls>
<PanelBody title="Display Options">
<PanelBody title="Display Options" initialOpen={ true }>


<ToggleControl
Expand Down Expand Up @@ -529,7 +529,7 @@ class Edit extends Component {

</PanelBody>

<PanelBody title="Display Information">
<PanelBody title="Display Information" initialOpen={ false }>

<ToggleControl
label="Show image column/row."
Expand Down Expand Up @@ -568,7 +568,7 @@ class Edit extends Component {
</PanelBody>


<PanelBody title="List View Options">
<PanelBody title="List View Options" initialOpen={ false }>

<RangeControl
label="Image Width"
Expand Down Expand Up @@ -619,7 +619,7 @@ class Edit extends Component {

</PanelBody>

<PanelBody title="Grid View Options">
<PanelBody title="Grid View Options" initialOpen={ false }>

<TextControl
label="Columns in the Grid view."
Expand Down Expand Up @@ -680,7 +680,7 @@ class Edit extends Component {
/>
</PanelBody>

<PanelBody title="Featured Ads">
<PanelBody title="Featured Ads" initialOpen={ false }>

<SelectControl
label="Show on the list"
Expand All @@ -704,7 +704,7 @@ class Edit extends Component {

</PanelBody>

<PanelBody title="Filters / Basic">
<PanelBody title="Filters / Basic" initialOpen={ false }>

<SelectControl
label="Default Sorting and Order"
Expand All @@ -730,7 +730,7 @@ class Edit extends Component {
/>
</PanelBody>

<PanelBody title="Filters / Taxonomies">
<PanelBody title="Filters / Taxonomies" initialOpen={ false }>

<BaseControl label="">
<Button
Expand Down Expand Up @@ -793,7 +793,7 @@ class Edit extends Component {
</PanelBody>


<PanelBody title="Colors">
<PanelBody title="Colors" initialOpen={ false }>

<AdvertsColorPicker
label="Price Color"
Expand Down
2 changes: 1 addition & 1 deletion blocks/manage/src/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
"grid_img_height": {
"type": "integer",
"default": 6
"default": 8
},
"grid_img_fit": {
"type": "string",
Expand Down
10 changes: 5 additions & 5 deletions blocks/manage/src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class Edit extends Component {

<InspectorControls>

<PanelBody title="Display Options">
<PanelBody title="Display Options" initialOpen={ true }>

<ToggleControl
label="Show number of found results."
Expand Down Expand Up @@ -493,7 +493,7 @@ class Edit extends Component {

</PanelBody>

<PanelBody title="Display Information">
<PanelBody title="Display Information" initialOpen={ false }>

<ToggleControl
label="Show image column/row."
Expand Down Expand Up @@ -521,7 +521,7 @@ class Edit extends Component {

</PanelBody>

<PanelBody title="List View Options">
<PanelBody title="List View Options" initialOpen={ false }>

<RangeControl
label="Image Width"
Expand Down Expand Up @@ -572,7 +572,7 @@ class Edit extends Component {

</PanelBody>

<PanelBody title="Grid View Options">
<PanelBody title="Grid View Options" initialOpen={ false }>

<TextControl
label="Columns in the Grid view."
Expand Down Expand Up @@ -633,7 +633,7 @@ class Edit extends Component {
/>
</PanelBody>

<PanelBody title="Filters / Basic">
<PanelBody title="Filters / Basic" initialOpen={ false }>

<SelectControl
label="Default Sorting and Order"
Expand Down
6 changes: 4 additions & 2 deletions includes/class-block-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ public function get_default_post_template( $post_type ) {
* @param string $taxonomy Taxonomy name
* @return string block template string
*/
public function get_default_taxonomy_template() {
return '@todo: default taxonomy template';
public function get_default_taxonomy_template( $taxonomy ) {
$tpl = sprintf( '<!-- wp:wpadverts/search {"post_type":"advert"} /-->', $taxonomy );
$tpl .= sprintf( '<!-- wp:wpadverts/list { "post_type": "advert", "query":{"term_autodetect":true} } /-->', $taxonomy );
return $tpl;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions wpadverts.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
'image_sizes' => array(
// supported sizes: adverts-upload-thumbnail, adverts-list, adverts-gallery
"adverts-gallery" => array( 'enabled' => 1, 'width' => 650, 'height' => 300, 'crop' => false ),
"adverts-list" => array( 'enabled' => 1, 'width' => 310, 'height' => 190, 'crop' => true ),
"adverts-upload-thumbnail" => array( 'enabled' => 1, 'width' => 150, 'height' => 105, 'crop' => true ),
"adverts-list" => array( 'enabled' => 1, 'width' => 310, 'height' => 190, 'crop' => false ),
"adverts-upload-thumbnail" => array( 'enabled' => 1, 'width' => 150, 'height' => 105, 'crop' => false ),
//"adverts-gallery-thumbnail"
),
'image_editor' => ''
Expand Down

0 comments on commit b28006e

Please sign in to comment.