Vorlage:Event item: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Versuch Fehlerbehebung: Abfrage Unix-Zeitstempel liefert 2 Stunden falsch verschoben) |
|||
(10 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 32: | Zeile 32: | ||
* [[mediawikiwiki:extension:Page Forms|extension:Page Forms]] | * [[mediawikiwiki:extension:Page Forms|extension:Page Forms]] | ||
* [[mediawikiwiki:extension:Variables|extension:Variables]] | * [[mediawikiwiki:extension:Variables|extension:Variables]] | ||
+ | * [[mediawikiwiki:extension:Arrays|extension:Arrays]] | ||
Attribute | Attribute | ||
Zeile 78: | Zeile 79: | ||
check recurring events if the actual next date is comming or has passed already | check recurring events if the actual next date is comming or has passed already | ||
-->{{#vardefine: askRecurringCommingEventStart_DateTimeUnixSeconds|{{#switch: {{LC:{{{recurring type|}}}}} | -->{{#vardefine: askRecurringCommingEventStart_DateTimeUnixSeconds|{{#switch: {{LC:{{{recurring type|}}}}} | ||
− | |1|recurring|wiederkehrend={{#time: U| | + | |1|recurring|wiederkehrend={{#time: U|{{#ask: [[Has group::wiederkehrendes Ereignis@de]] [[Has event::{{{title}}}]] [[Has date::≥{{#time:d.m.Y H:i}}]] |
− | + | |sort=Has date |?Has date#ISO= | |
− | + | |mainlabel=- |intro= |default=|searchlabel= |limit=1 | |
− | + | }}}} | |
− | |||
− | |||
− | |||
}} | }} | ||
}}<!-- | }}<!-- | ||
Zeile 97: | Zeile 95: | ||
}} | }} | ||
}}<!-- | }}<!-- | ||
+ | work around week input: “1,3” if present | ||
+ | -->{{#if: {{#pos: {{{recurring week number|}}}|,}}| {{#arraydefine: week-number-array|{{{recurring week number|}}}|,}} }}<!-- | ||
+ | |||
-->{{#vardefine: timeDiffEventEndMinusEventStart_UnixSeconds|{{#if: {{{end|}}}<!-- | -->{{#vardefine: timeDiffEventEndMinusEventStart_UnixSeconds|{{#if: {{{end|}}}<!-- | ||
then-->| {{#expr: {{#time: xNU | {{{end|}}} }} - {{#time: xNU | {{{start|}}} }} + 0 }}<!-- | then-->| {{#expr: {{#time: xNU | {{{end|}}} }} - {{#time: xNU | {{{start|}}} }} + 0 }}<!-- | ||
Zeile 127: | Zeile 128: | ||
|week={{PLURAL:{{{recurring period|1}}}|jede Woche|alle {{{recurring period|1}}} Wochen}} | |week={{PLURAL:{{{recurring period|1}}}|jede Woche|alle {{{recurring period|1}}} Wochen}} | ||
|month={{ | |month={{ | ||
− | #ifexpr: {{{recurring week number|}}} + 0 > 0<!-- | + | #ifexpr: <!-- check weeknumbers, work around week input: “1,3” if present |
+ | -->{{#if: {{#pos: {{{recurring week number|}}}|,}}<!-- | ||
+ | then | ||
+ | -->|{{#arrayprint: week-number-array ||@ | abs @ +}}<!-- cumulate week numbers | ||
+ | else | ||
+ | -->|{{{recurring week number|}}} }} | ||
+ | + 0 > 0<!-- | ||
then positive week number within week | then positive week number within week | ||
− | -->|an jedem {{{recurring week number|}}}. {{#time: l|{{{start|}}}}} im Monat<!-- | + | -->|an jedem <!-- 1. oder 1. und 3. etc. |
+ | -->{{#if: {{#pos: {{{recurring week number|}}}|,}}<!-- | ||
+ | then | ||
+ | -->|{{ | ||
+ | #arrayprint: week-number-array | ||
+ | | | ||
+ | |@ | ||
+ | |{{#switch: @|-1=letzten|-2=vor–letzten|-3=vor-vor–letzten|#default=@.}} | ||
+ | |print=pretty | ||
+ | }}<!-- | ||
+ | -->|{{{recurring week number|}}}. | ||
+ | }} <!-- | ||
+ | Wochentag | ||
+ | -->{{#time: l|{{{start|}}}}} im Monat<!-- | ||
else 0==0 or < 0 | else 0==0 or < 0 | ||
-->|{{ | -->|{{ | ||
− | #ifexpr: {{{recurring week number|}}} + 0 < 0<!-- | + | #ifexpr: {{{recurring week number|}}} + 0 < 0<!-- TODO week input: “1,-1” |
then negative week number within week | then negative week number within week | ||
-->|an jedem {{#switch:{{{recurring week number|}}}|-1=letzten|#default={{{recurring week number|}}}.–letzten}} {{#time: l|{{{start|}}}}} im Monat<!-- | -->|an jedem {{#switch:{{{recurring week number|}}}|-1=letzten|#default={{{recurring week number|}}}.–letzten}} {{#time: l|{{{start|}}}}} im Monat<!-- | ||
Zeile 138: | Zeile 158: | ||
-->|{{PLURAL:{{{recurring period|1}}}|jeden Monat|alle {{{recurring period|1}}} Monate}} | -->|{{PLURAL:{{{recurring period|1}}}|jeden Monat|alle {{{recurring period|1}}} Monate}} | ||
}} | }} | ||
− | }} | + | }}<!-- if: recurring week number --> |
|year={{PLURAL:{{{recurring period|1}}}|jedes Jahr|alle {{{recurring period|1}}} Jahre}} | |year={{PLURAL:{{{recurring period|1}}}|jedes Jahr|alle {{{recurring period|1}}} Jahre}} | ||
|#default= | |#default= | ||
Zeile 151: | Zeile 171: | ||
-->{{#switch: {{LC:{{{recurring type|}}}}} | -->{{#switch: {{LC:{{{recurring type|}}}}} | ||
|1|recurring|wiederkehrend={{#if: {{#var: askRecurringCommingEventStart_DateTimeUnixSeconds}} | |1|recurring|wiederkehrend={{#if: {{#var: askRecurringCommingEventStart_DateTimeUnixSeconds}} | ||
− | + | | ''Nächster:'' <!-- {{{start}}} date(time) has past already, is a recurring date(time) future event --> | |
− | | ''Nächster | + | | |
}} | }} | ||
|#default={{{start|}}}<!-- | |#default={{{start|}}}<!-- | ||
Zeile 185: | Zeile 205: | ||
-->| ''bis:'' {{ | -->| ''bis:'' {{ | ||
#ifeq: <!-- at the same day? | #ifeq: <!-- at the same day? | ||
− | -->{{#explode:{{{start|}}}| }} | {{#explode:{{{end|}}}| }}<!-- | + | -->{{#explode:{{#time: Y/m/d H:i |{{{start|}}}}}| }} | {{#explode:{{#time: Y/m/d H:i |{{{end|}}}}}| }}<!-- |
Then | Then | ||
-->|{{#if: {{#pos:{{{end|}}}|:}}<!-- | -->|{{#if: {{#pos:{{{end|}}}|:}}<!-- | ||
Zeile 264: | Zeile 284: | ||
|<!-- {{#switch: {{{type|}}} | |<!-- {{#switch: {{{type|}}} | ||
|Besprechung =File:Event-meeting-icon.png | |Besprechung =File:Event-meeting-icon.png | ||
− | | | + | |Präsentation=File:Event-presentation-icon.png |
|Talk=File:Event-talk-icon.png }} --> | |Talk=File:Event-talk-icon.png }} --> | ||
}} | }} | ||
Zeile 276: | Zeile 296: | ||
-->{{#switch: {{LC:{{{recurring type|}}}}} | -->{{#switch: {{LC:{{{recurring type|}}}}} | ||
− | |1|recurring|wiederkehrend={{#set_recurring_event:Wiederkehrend: {{#replace:{{{title|}}}|+|+}}<!-- Kommentar: + zu full width plus ersetzen + --> | + | |1|recurring|wiederkehrend={{#if: {{#pos: {{{recurring week number}}}|,}}<!-- |
− | |property=Has date | + | THEN-->|{{#arraymap: {{{recurring week number}}}<!-- |
+ | -->|,<!-- sep , | ||
+ | -->|ω<!-- assign ω as temporary var | ||
+ | -->|{{#set_recurring_event: Wiederkehrend: {{#replace:{{{title|}}}|+|+}}<!-- Kommentar: + zu full width plus ersetzen + | ||
+ | -->|property=Has date | ||
+ | |Has event={{{title|}}} | ||
+ | |Has group=wiederkehrendes Ereignis@de | ||
+ | |Has event type={{{type|}}} | ||
+ | |Has event start={{{start|}}} | ||
+ | |Has event end={{{end|}}} | ||
+ | |Has event location={{{location|}}} | ||
+ | |Has event icon={{#if: {{{icon|}}} | ||
+ | |File:{{#explode:{{{icon|}}}|:|-1}} | ||
+ | |<!-- {{#switch: {{{type|}}} | ||
+ | |Besprechung =File:Event-meeting-icon.png | ||
+ | |Präsentation=File:Event-presentation-icon.png | ||
+ | |Talk=File:Event-talk-icon.png }} --> | ||
+ | }} | ||
+ | |Has event color={{Event item/color by type|{{{type|}}}}} | ||
+ | |Has event description={{{description|}}} | ||
+ | |Has event geocoordinates={{{coordinates|}}} | ||
+ | |Has monolingual keyword list={{#if: {{{keywords|}}}|{{{keywords|}}}@de}} | ||
+ | |Has keyword list={{{keywords|}}} | ||
+ | |start={{{recurring start|}}} | ||
+ | |end={{{recurring end|}}} | ||
+ | |unit={{#var: recurringUnitStandardized}} | ||
+ | |period={{{recurring period|1}}} | ||
+ | |week number=ω<!-- single week number --> | ||
+ | |limit={{{recurring limit|}}}<!-- end: supersedes this limit --> | ||
+ | |include={{{recurring include datetimes|}}} | ||
+ | |exclude={{{recurring exclude datetimes|}}} | ||
+ | }}<!--output | ||
+ | -->|<!--arraymap output sep | ||
+ | -->}}<!-- end arraymap | ||
+ | |||
+ | ELSE-->|<!-- | ||
+ | -->{{#set_recurring_event: Wiederkehrend: {{#replace:{{{title|}}}|+|+}}<!-- Kommentar: + zu full width plus ersetzen + | ||
+ | -->|property=Has date | ||
|Has event={{{title|}}} | |Has event={{{title|}}} | ||
|Has group=wiederkehrendes Ereignis@de | |Has group=wiederkehrendes Ereignis@de | ||
Zeile 288: | Zeile 345: | ||
|<!-- {{#switch: {{{type|}}} | |<!-- {{#switch: {{{type|}}} | ||
|Besprechung =File:Event-meeting-icon.png | |Besprechung =File:Event-meeting-icon.png | ||
− | | | + | |Präsentation=File:Event-presentation-icon.png |
|Talk=File:Event-talk-icon.png }} --> | |Talk=File:Event-talk-icon.png }} --> | ||
}} | }} | ||
Zeile 304: | Zeile 361: | ||
|include={{{recurring include datetimes|}}} | |include={{{recurring include datetimes|}}} | ||
|exclude={{{recurring exclude datetimes|}}} | |exclude={{{recurring exclude datetimes|}}} | ||
− | }}<!-- | + | }} |
+ | }}<!-- if pos , recurring week number | ||
+ | |||
+ | --><!-- | ||
<div class="debug" style="display:none"> | <div class="debug" style="display:none"> | ||
wiederkehrend-{{{title|}}} | wiederkehrend-{{{title|}}} |
Aktuelle Version vom 20. März 2021, 20:56 Uhr
Dies ist die Vorlage „Event item“. Sie hat folgende Vorlagenparameter (Pflichtparameter in fett und optionale normal):
{{Event item |title= |start= |end= |type= |description= |color= |icon= |coordinates= |location= |keywords= |recurring type= |recurring unit= |recurring period= |recurring week number= |recurring start= |recurring end= |recurring limit= |recurring include datetimes= |recurring exclude datetimes= }}
Technische Abhängigkeiten
Erweiterungen
- extension:SemanticMediaWiki
- extension:SemanticResultFormats
- extension:Maps
- extension:Page Forms
- extension:Variables
- extension:Arrays
Attribute
- Attribut: Has date
- Attribut: Has group
- Attribut: Has monolingual keyword
- Attribut: Has keyword
- Attribut: Has monolingual keyword list
- Attribut: Has keyword list
- Attribut: Has event
- Attribut: Has event description
- Attribut: Has event type
- Attribut: Has event location
- Attribut: Has event geocoordinates
- Attribut: Has event start
- Attribut: Has event end
- Attribut: Has event icon
- Attribut: Has event color
Vorlagen/Formulare:
- Vorlage: Event item/color by type
- Vorlage: Logo
- Vorlage: Stichwörter
- Vorlage: BrowseByAskQueryPreviousNext
- Formular: Event item
Dateien:
Layout:
- CSS-Klassen booktable, vertical-align-top
Klick auf „Bearbeiten“, um den Quelltext der Vorlage anzusehen.