Vorlage:Event item: Unterschied zwischen den Versionen

Aus Open Source Ecology - Germany
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>↗&nbsp;[[Open Source Ecology Germany/Kalender|Kalender]]</div>
 
<div class="noprint floatright" style="text-align:center;">{{BrowseByAskQueryPreviousNext | [[Kalender:+]]}}<br>↗&nbsp;[[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|}}}|:}}<!--  
  has time
+
THEN: has a time string
-->|{{#time: l d. F Y H:i |{{{start|}}}}}&#8239;Uhr<!--  
+
  -->|{{#time: l d. F Y H:i |<!--
  has no time, just date
+
    -->{{#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
 +
  -->}}&#8239;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
 
-->| &nbsp;''bis:''&nbsp; {{
 
-->| &nbsp;''bis:''&nbsp; {{
 
     #ifeq: <!-- at the same day?
 
     #ifeq: <!-- at the same day?
 
   -->{{#explode:{{{start|}}}| }} | {{#explode:{{{end|}}}| }}<!--  
 
   -->{{#explode:{{{start|}}}| }} | {{#explode:{{{end|}}}| }}<!--  
   then
+
   Then
 
   -->|{{#if: {{#pos:{{{end|}}}|:}}<!--  
 
   -->|{{#if: {{#pos:{{{end|}}}|:}}<!--  
     then has time
+
     then has date
 
     -->|{{#time: H:i |{{{end|}}}}}&#8239;Uhr<!--  
 
     -->|{{#time: H:i |{{{end|}}}}}&#8239;Uhr<!--  
 
     else has no time, just date
 
     else has no time, just date
 
     -->| Ende am selben Tag
 
     -->| Ende am selben Tag
 
     }}<!--  
 
     }}<!--  
   else not at the same day
+
   Else end at a different day
 
   -->|{{
 
   -->|{{
    #if: {{#pos:{{{end|}}}|:}}<!--  
+
      #if: {{#pos:{{{end|}}}|:}}<!--  
    then has time
+
      then: has a time string
    -->|{{#time: l d. F Y H:i |{{{end|}}}}}&#8239;Uhr<!--  
+
      -->|{{#time: l d. F Y H:i |<!--
    else has no time, just date
+
        -->{{#switch: {{LC:{{{recurring type|}}}}}
    -->|{{#time: l d. F Y |{{{end|}}}}}
+
            |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
 +
    -->&#8239;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

Attribute

Vorlagen/Formulare:

Dateien:

Layout:

  • CSS-Klassen booktable, vertical-align-top

Klick auf „Bearbeiten“, um den Quelltext der Vorlage anzusehen.