Skip to content

Commit d891ccc

Browse files
committed
Events: Show upcoming events close to the visitor
1 parent 9d652d2 commit d891ccc

File tree

16 files changed

+352
-16
lines changed

16 files changed

+352
-16
lines changed

public_html/wp-content/themes/wporg-events-2023/functions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
// Block files.
1111
require_once __DIR__ . '/src/event-list/index.php';
12+
require_once __DIR__ . '/src/event-list-chips/index.php';
1213

1314
add_action( 'after_setup_theme', __NAMESPACE__ . '\theme_support' );
1415
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' );
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 7 additions & 0 deletions
Loading
File renamed without changes.

public_html/wp-content/themes/wporg-events-2023/patterns/events-list-filters.php renamed to public_html/wp-content/themes/wporg-events-2023/patterns/event-list-filters-with-nearby.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Title: Events List Filters
4-
* Slug: wporg-events-2023/event-list-filters
3+
* Title: Event List Filters
4+
* Slug: wporg-events-2023/event-list-filters-with-nearby
55
* Inserter: no
66
*/
77

@@ -14,6 +14,8 @@
1414
<!-- wp:search {"showLabel":false,"placeholder":"Search events...","width":100,"widthUnit":"%","buttonText":"Search","buttonPosition":"button-inside","buttonUseIcon":true,"className":"is-style-secondary-search-control"} /-->
1515
</div> <!-- /wp:group -->
1616

17+
<!-- wp:wporg/event-list-chips /-->
18+
1719
<!-- wp:group {"style":{"spacing":{"blockGap":"0"}},"className":"wporg-query-filters","layout":{"type":"flex","flexWrap":"nowrap"}} -->
1820
<div class="wp-block-group wporg-query-filters">
1921
<!-- wp:wporg/query-filter {"key":"format_type","multiple":false} /-->

public_html/wp-content/themes/wporg-events-2023/patterns/front-events.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
<h2 class="wp-block-heading has-inter-font-family has-medium-font-size" style="font-style:normal;font-weight:700">Upcoming events</h2>
1414
<!-- /wp:heading -->
1515

16-
<!-- wp:pattern {"slug":"wporg-events-2023/event-list-filters"} /-->
16+
<!-- wp:pattern {"slug":"wporg-events-2023/event-list-filters-with-nearby"} /-->
1717

18-
<!-- wp:wporg/event-list {"limit": "10"} /-->
18+
<!-- wp:wporg/event-list {"events":"nearby","id":"event-list-nearby","limit": "10"} /-->
19+
<!-- wp:wporg/event-list {"events":"all-upcoming","id":"event-list-global","className":"wporg-events__hidden","limit": "10"} /-->
1920

2021
<!-- wp:buttons {"style":{"spacing":{"margin":{"top":"var:preset|spacing|30"}}}} -->
2122
<div class="wp-block-buttons" style="margin-top:var(--wp--preset--spacing--30)"><!-- wp:button {"className":"is-style-outline"} -->
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.wporg-events__nearby-chips {
2+
button::before {
3+
content: "";
4+
width: 24px;
5+
height: 24px;
6+
display: inline-block;
7+
}
8+
9+
#wporg-events__see-global::before {
10+
background-image: url( 'images/close.svg' );
11+
}
12+
13+
#wporg-events__see-nearby::before {
14+
background-image: url( 'images/location.svg' );
15+
}
16+
}

public_html/wp-content/themes/wporg-events-2023/postcss/style.pcss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
@import "base/layout.pcss";
1212
@import "footer/community-callout.pcss";
1313

14+
/* Patterns */
15+
@import "patterns/event-list-filters-with-nearby.pcss";
16+
1417
/* Pages */
1518
@import "page/misc.pcss";
1619
@import "page/front-page/cover.pcss";
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://schemas.wp.org/trunk/block.json",
3+
"apiVersion": 2,
4+
"name": "wporg/event-list-chips",
5+
"version": "0.1.0",
6+
"title": "WordPress Events List Chips",
7+
"category": "design",
8+
"icon": "list-view",
9+
"description": "Chips for filtering results from the wporg/event-list block",
10+
"textdomain": "wporg",
11+
"supports": {
12+
"anchor": true
13+
},
14+
"editorScript": "file:./index.js"
15+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* WordPress dependencies
3+
*/
4+
5+
import { useBlockProps } from '@wordpress/block-editor';
6+
import { Disabled } from '@wordpress/components';
7+
import ServerSideRender from '@wordpress/server-side-render';
8+
9+
export default function Edit( { attributes, name } ) {
10+
return (
11+
<div { ...useBlockProps() }>
12+
<Disabled>
13+
<ServerSideRender block={ name } attributes={ attributes } />
14+
</Disabled>
15+
</div>
16+
);
17+
}

0 commit comments

Comments
 (0)