Vorlage:Event item: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(+ zu full width plus ersetzen +) |
(+Anzeige: nächstes Datum bei recurring events) |
||
Zeile 73: | Zeile 73: | ||
|#default=day | |#default=day | ||
}} | }} | ||
− | }}{{#switch: {{NAMENSRAUM}}<!-- | + | }}<!-- |
+ | |||
+ | get a handy display of the next recurring event | ||
+ | check recurring events if the actual next date is comming or has passed already | ||
+ | -->{{#vardefine: askRecurringCommingEventStart_DateTimeUnixSeconds|{{#switch: {{LC:{{{recurring type|}}}}} | ||
+ | |1|recurring|wiederkehrend={{#ask: [[Has group::wiederkehrendes Ereignis@de]] [[Has event::{{{title}}}]] [[Has event start::≥{{#time:d.m.Y H:i}}]] | ||
+ | |sort=Has date |?Has date#-F[U]= | ||
+ | |mainlabel=- |intro= |default=|searchlabel= |limit=1 | ||
+ | }} | ||
+ | }} | ||
+ | }}<!-- | ||
+ | -->{{#vardefine: askRecurringNextEventStart_DateTimeUnixSeconds|{{#switch: {{LC:{{{recurring type|}}}}} | ||
+ | |1|recurring|wiederkehrend={{#ask: [[Has group::wiederkehrendes Ereignis@de]] [[Has event::{{{title}}}]] [[Has date::≥{{#time:d.m.Y H:i}}]] | ||
+ | |sort=Has date |?Has date#-F[U]= | ||
+ | |mainlabel=- |intro= |default=|searchlabel= |limit=1 | ||
+ | }} | ||
+ | }} | ||
+ | }}<!-- | ||
+ | -->{{#vardefine: timeDiffEventEndMinusEventStart_UnixSeconds|{{#if: {{{end|}}}<!-- | ||
+ | then-->| {{#expr: {{#time: xNU | {{{end|}}} }} - {{#time: xNU | {{{start|}}} }} + 0 }}<!-- | ||
+ | else-->| 0<!-- | ||
+ | -->}}<!-- | ||
+ | -->}}<!-- | ||
+ | {{#time: xNU |2018/06/06 22:30}} - {{#time: xNU |2018/06/06 20:30}} | ||
+ | using unix time seconds | ||
+ | |||
+ | -->{{#switch: {{NAMENSRAUM}}<!-- | ||
-->|Calendar|Kalender=<!-- nichts im Haupt Namensraum --><indicator name="calendar-data-page" style="cursor:help;">{{Logo|Kalender|35px|Kurzinfo=Kalendereintrag und -datenseite für „{{SEITENNAME}}“}}</indicator> | -->|Calendar|Kalender=<!-- nichts im Haupt Namensraum --><indicator name="calendar-data-page" style="cursor:help;">{{Logo|Kalender|35px|Kurzinfo=Kalendereintrag und -datenseite für „{{SEITENNAME}}“}}</indicator> | ||
<div class="noprint floatright" style="text-align:center;">{{BrowseByAskQueryPreviousNext | [[Kalender:+]]}}<br>↗ [[Open Source Ecology Germany/Kalender|Kalender]]</div> | <div class="noprint floatright" style="text-align:center;">{{BrowseByAskQueryPreviousNext | [[Kalender:+]]}}<br>↗ [[Open Source Ecology Germany/Kalender|Kalender]]</div> | ||
Zeile 111: | Zeile 137: | ||
}}</div> | }}</div> | ||
}}<!--#switch wiederkehrend --><!-- | }}<!--#switch wiederkehrend --><!-- | ||
+ | |||
+ | add date and time (if given) | ||
no line break here | no line break here | ||
-->{{#if: {{#pos:{{{start|}}}|:}}<!-- | -->{{#if: {{#pos:{{{start|}}}|:}}<!-- | ||
− | + | THEN: has a time string | |
− | -->|{{#time: l d. F Y H:i |{{{start|}}}}} Uhr<!-- | + | -->|{{#time: l d. F Y H:i |<!-- |
− | + | -->{{#switch: {{LC:{{{recurring type|}}}}} | |
− | -->|{{#time: l d. F Y |{{{start|}}}}} | + | |1|recurring|wiederkehrend={{#if: {{#var: askRecurringCommingEventStart_DateTimeUnixSeconds}} |
− | }}{{#if: {{{end|}}}<!-- | + | |{{#var: askRecurringCommingEventStart_DateTimeUnixSeconds}} |
− | start & end | + | |{{#var: askRecurringNextEventStart_DateTimeUnixSeconds}} |
+ | }} | ||
+ | |#default={{{start|}}}<!-- | ||
+ | -->}}<!-- #switch | ||
+ | -->}} Uhr<!-- #time | ||
+ | |||
+ | ELSE: has no time, just date | ||
+ | -->|<!-- | ||
+ | -->{{#time: l d. F Y |<!-- | ||
+ | -->{{#switch: {{LC:{{{recurring type|}}}}} | ||
+ | |1|recurring|wiederkehrend={{#if: {{#var: askRecurringCommingEventStart_DateTimeUnixSeconds}} | ||
+ | |{{#var: askRecurringCommingEventStart_DateTimeUnixSeconds}} | ||
+ | |{{#var: askRecurringNextEventStart_DateTimeUnixSeconds}} | ||
+ | }} | ||
+ | |#default={{{start|}}}<!-- | ||
+ | -->}} | ||
+ | }}<!-- #time | ||
+ | -->}}<!-- no line break here | ||
+ | |||
+ | END time | ||
+ | -->{{#if: {{{end|}}}<!-- | ||
+ | start & end | ||
+ | THEN | ||
-->| ''bis:'' {{ | -->| ''bis:'' {{ | ||
#ifeq: <!-- at the same day? | #ifeq: <!-- at the same day? | ||
-->{{#explode:{{{start|}}}| }} | {{#explode:{{{end|}}}| }}<!-- | -->{{#explode:{{{start|}}}| }} | {{#explode:{{{end|}}}| }}<!-- | ||
− | + | Then | |
-->|{{#if: {{#pos:{{{end|}}}|:}}<!-- | -->|{{#if: {{#pos:{{{end|}}}|:}}<!-- | ||
− | then has | + | then has date |
-->|{{#time: H:i |{{{end|}}}}} Uhr<!-- | -->|{{#time: H:i |{{{end|}}}}} Uhr<!-- | ||
else has no time, just date | else has no time, just date | ||
-->| Ende am selben Tag | -->| Ende am selben Tag | ||
}}<!-- | }}<!-- | ||
− | + | Else end at a different day | |
-->|{{ | -->|{{ | ||
− | + | #if: {{#pos:{{{end|}}}|:}}<!-- | |
− | + | then: has a time string | |
− | + | -->|{{#time: l d. F Y H:i |<!-- | |
− | + | -->{{#switch: {{LC:{{{recurring type|}}}}} | |
− | + | |1|recurring|wiederkehrend={{#if: {{#var: askRecurringCommingEventStart_DateTimeUnixSeconds}} | |
− | }} | + | |{{#expr: {{#var: askRecurringCommingEventStart_DateTimeUnixSeconds}} + {{#var: timeDiffEventEndMinusEventStart_UnixSeconds}} + 0 }} |
− | }} | + | |{{#expr: {{#var: askRecurringNextEventStart_DateTimeUnixSeconds}} + {{#var: timeDiffEventEndMinusEventStart_UnixSeconds}} + 0 }} |
− | }} | + | }} |
+ | |#default={{{end|}}}<!-- | ||
+ | -->}}<!-- | ||
+ | -->}}<!-- #time | ||
+ | --> Uhr<!-- | ||
+ | else has no time string, just date | ||
+ | -->|{{#time: l d. F Y |<!-- | ||
+ | -->{{#switch: {{LC:{{{recurring type|}}}}} | ||
+ | |1|recurring|wiederkehrend={{#if: {{#var: askRecurringCommingEventStart_DateTimeUnixSeconds}} | ||
+ | |{{#expr: {{#var: askRecurringCommingEventStart_DateTimeUnixSeconds}} + {{#var: timeDiffEventEndMinusEventStart_UnixSeconds}} + 0 }} | ||
+ | |{{#expr: {{#var: askRecurringNextEventStart_DateTimeUnixSeconds}} + {{#var: timeDiffEventEndMinusEventStart_UnixSeconds}} + 0 }} | ||
+ | }} | ||
+ | |#default={{{end|}}}<!-- | ||
+ | -->}}<!-- | ||
+ | -->}}<!-- #time | ||
+ | -->}}<!-- if: date or datetime | ||
+ | -->}}<!-- ifeq: same day end | ||
+ | -->}}<!-- if: {{{end}}} --> | ||
</td> | </td> | ||
</tr> | </tr> |
Version vom 9. November 2018, 23:26 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
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.