Template: Event
(times) |
(only show icalendar link if page has ID) |
||
(64 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{#cargo_declare: | _table = events | <noinclude>{{#cargo_declare: | _table = events | ||
| start_date = Datetime | | start_date = Datetime | ||
| end_date = Datetime | | end_date = Datetime | ||
| timezone = Number | | timezone = Number | ||
| region = String | |||
| location = Wikitext | |||
| coordinates = Coordinates | |||
| short_description = Wikitext | |||
| description = Wikitext | | description = Wikitext | ||
| keywords = List (,) of String | |||
| link = URL | | link = URL | ||
| | | image = File | ||
| attendee_count = Number | |||
| wmau_cost = Number | |||
}}</noinclude><includeonly>{{#cargo_store: _table = events | }}</noinclude><includeonly>{{#cargo_store: _table = events | ||
| start_date = {{{start_date|}}} | | start_date = {{{start_date|}}} | ||
| end_date = {{{end_date|}}} | | end_date = {{{end_date|}}} | ||
| timezone = {{{timezone|}}} | | timezone = {{{timezone|}}} | ||
| region = {{{region|{{{state|}}}}}} | |||
| location = {{{location|}}} | |||
| coordinates = {{{coordinates|}}} | |||
| short_description = {{{short_description|}}} | |||
| description = {{{description|}}} | | description = {{{description|}}} | ||
| keywords = {{{keywords|}}} | |||
| link = {{{link|}}} | | link = {{{link|}}} | ||
| | | image = {{{image|}}} | ||
}}</includeonly><!-- | | attendee_count = {{{attendee_count|}}} | ||
| wmau_cost = {{{wmau_cost|}}} | |||
}}</includeonly>{{#default_form:event}}<!-- | |||
--><templatestyles src="Template:Event/style.css" /><!-- | |||
Suppress the page title so we can re-display it within the header box. | |||
-->{{DISPLAYTITLE:<span style=" | -->{{DISPLAYTITLE:<span style="display:none">{{FULLPAGENAME}}</span>}}<!-- | ||
Add page metadata (for sharing on Twitter etc.). | |||
-->{{#seo: | |||
| type = event | |||
| description = {{{short_description|{{{description|A Wikimedia Australia event.}}}}}} | |||
| keywords = {{{keywords|}}} | |||
| image = {{#if:{{{image|}}} | {{filepath:{{{image}}}|800}} }} | |||
}}<!-- | |||
Start the box. | Start the box. | ||
--><div | --><div class="tpl-event-header"><!-- | ||
<div | --><div class="tpl-event-header-left">'''Event'''</div><!-- | ||
<div | --><div class="tpl-event-header-right">[[Events|View all events]]</div> | ||
</div> | </div> | ||
<div itemscope itemtype="http://schema.org/Event | <div class="tpl-event-main" itemscope itemtype="http://schema.org/Event"><!-- | ||
--><div class="tpl-event-top"><!-- | |||
-->< | |||
--><div class="tpl-event-name-etc"><!-- | |||
Event title (page name): | |||
--><div class="tpl-event-name" itemprop="name">'''{{PAGENAME}}'''</div><!-- | |||
-->< | Start time and date: | ||
--><div class="tpl-event-dates"><!-- | |||
--><time itemprop="startDate" datetime="{{#time: c | {{{start_date|}}} }}"><!-- | |||
-->{{#time: l j F Y, g:i a | @{{#expr: {{#time:U| {{{start_date|}}} }} + (60*60*{{{timezone}}}) }} }}<!-- | |||
--></time> <!-- | |||
End time (and date if on a different day): | |||
-->{{#if: {{{end_date|}}} | <!-- | |||
-->{{#ifeq: {{#time: Y-m-d | {{{start_date}}} }} | {{#time: Y-m-d | {{{end_date}}} }} <!-- | |||
--> | <!-- | |||
If same day: | |||
--> – <time itemprop="endDate" datetime="{{#time: c | {{{end_date|}}} }}"><!-- | |||
-->{{#time: g:i a | @{{#expr: {{#time:U| {{{end_date|}}} }} + (60*60*{{{timezone}}}) }} }}<!-- | |||
--></time> <!-- | |||
--> | <!-- | |||
If different day: | |||
--><br><em>to</em> <time itemprop="endDate" datetime="{{#time: c | {{{end_date|}}} }}"><!-- | |||
-->{{#time: l j F Y, g:i a | @{{#expr: {{#time:U| {{{end_date|}}} }} + (60*60*{{{timezone}}}) }} }}<!-- | |||
--></time> <!-- | |||
-->}}<!-- end ifeq | |||
-->}}<!-- | |||
Timezone abbreviation: | |||
-->{{#if: {{{timezone|}}} |<!-- | |||
--> <abbr title="Timezone: UTC+{{{timezone}}}"><!-- | |||
-->{{#switch: {{{timezone}}} | |||
| 8 = AWST | |||
| 9.5 = ACST | |||
| 10 = AEST | |||
| 10.5 = ACST | |||
| 11 = AEDT | |||
| 12 = NZST | |||
| 13 = NZDT | |||
| UTC <!-- | |||
-->}}<!-- | |||
--></abbr><!-- | |||
-->}}<!-- | |||
--></div><!-- end .tpl-event-dates | |||
--></div><!-- end .tpl-event-name-etc | |||
--><div class="tpl-event-image">{{#if: {{{image|}}} |<!-- | |||
-->[[File:{{{image}}}|right|frameless|600x400px]]<!-- | |||
-->}}</div><!-- | |||
--></div><!-- end .tpl-event-top | |||
Short description: | |||
--><div class="tpl-event-short-description" itemprop="description"><!-- | |||
-->{{{short_description|{{{description|}}}}}}<!-- | |||
--></div><!-- | |||
Description (long; only shown if short desc is given): | |||
-->{{#if: {{{short_description|}}} | <div class="tpl-event-description">{{{description|}}}</div> }}<!-- | |||
Location and region: | |||
-->{{#if: {{{location|}}}{{{region|{{{state|}}}}}} |<!-- | |||
--><p class="event-venue" itemprop="location" itemscope itemtype="http://schema.org/Place"><!-- | |||
Region (used to be called 'state'): | |||
-->Region: {{{region|{{{state|<span class="error">Please set 'region' parameter.</span>}}}}}}<br><!-- | |||
-->{{#if: {{{location|}}} | Location: <span itemprop="name">{{{location}}}</span> }}<!-- | |||
--></p><!-- | |||
-->}}<!-- | |||
--><p><!-- | |||
-->Share link: <span itemprop="url" class="plainlinks">{{#if: {{{link|}}} | {{{link}}} | {{canonicalurl:{{FULLPAGENAMEE}} }} }}</span><!-- | |||
--> {{#if: {{PAGEID}} | – or {{#cargo_query: tables=events |where=_pageId={{PAGEID}} |format=icalendar |link text=download calendar item (.ics) |fields=_pageID,_pageName,start_date=start,end_date=end,location,CONCAT('More information: https://wikimedia.org.au/wiki/Special:Redirect/page/',_pageID)=description |icalendar name={{FULLPAGENAME}} |filename=Wikimedia Australia event.ics }} }}<!-- | |||
--></p><!-- | |||
Keywords: | |||
-->{{#if: {{{keywords|}}} | <span class="tpl-event-keywords">Keywords: {{#arraymap:{{{keywords|}}}|,|QQQ|[[QQQ]][[Category:QQQ]]| · }}</span> }}<!-- | |||
Coordinates map: | |||
-->{{#if: {{{coordinates|}}} <!-- | |||
--> | <div class="tpl-event-map">{{#cargo_display_map: | point = {{{coordinates}}} | zoom = 14 | height = 200px | width = 100% }}</div> <!-- | |||
-->}}<!-- | -->}}<!-- | ||
--></div><!-- end .tpl-event-main | |||
Report: | |||
-->{{#if: {{{report|}}} | | |||
<h2>Report</h2> | |||
{{{report}}} | |||
* Attendee count: '''{{{attendee_count|unknown}}}''' | |||
* Cost to Wikimedia Australia: '''{{{wmau_cost|no cost}}}''' | |||
}}<!-- | |||
Metrics: | |||
-->{{#if: {{{event_metrics|}}} | | |||
<h2>Event Metrics</h2> | |||
{{{event_metrics}}} | |||
}}<!-- | |||
Add region navigation bar. | |||
--> | |||
<br/> | |||
{{navigation header | title = {{{region|{{{state|}}}}}} | |||
|prev = {{#cargo_query: | |||
| tables = events | |||
| fields = CONCAT('[[',_pageName,']]<br><small>',DATE_FORMAT(start_date, '%e %M %Y'),'</small>')=prev_event | |||
| where = _pageID != '{{PAGEID}}' AND region = '{{{region|{{{state|}}}}}}' AND start_date IS NOT NULL AND start_date < '{{{start_date}}}' | |||
| order by = start_date DESC | |||
| limit = 1 | |||
| default = | |||
| more results text = | |||
}} | |||
|next = {{#cargo_query: | |||
| tables = events | |||
| fields = CONCAT('[[',_pageName,']]<br><small>',DATE_FORMAT(start_date, '%e %M %Y'),'</small>')=next_event | |||
| where = _pageID != '{{PAGEID}}' AND region = '{{{region|{{{state|}}}}}}' AND start_date IS NOT NULL AND start_date > '{{{start_date}}}' | |||
| order by = start_date ASC | |||
| limit = 1 | |||
| default = | |||
| more results text = | |||
}} | |||
}}<!-- | |||
Categories: | |||
-->[[Category:Events in {{#time: Y | {{{start_date|}}} }}]]<!-- | |||
-->[[Category:Events in {{#time: Y | {{{end_date|}}} }}]]<!-- | |||
-->[[Category:Events in {{{region|{{{state|}}}}}}]]<!-- | |||
--><noinclude>{{documentation}}</noinclude> | |||
-- |
Latest revision as of 04:51, 13 March 2023
This template defines the table "events". View table.
Event
Event
Share link: https://wikimedia.org.au/wiki/Template:Event – or download calendar item (.ics)