BlogCalendarViewTemplate
a topic view for a blog calendar

24 May 2024 - 09:49 | Version 1 |

%TMPL:INCLUDE{"Applications.WikiTopicView"}%

%TMPL:DEF{"body::layout"}%fullscreen%TMPL:END%
%TMPL:DEF{"topicactions"}%%TMPL:END%
%TMPL:DEF{"sidebar"}%%TMPL:END%
%TMPL:DEF{"webmenu"}%%TMPL:END%
%TMPL:DEF{"blogcalendar::initialview"}%dayGridMonth%TMPL:END%
%TMPL:DEF{"blogcalendar::mintime"}%0:00%TMPL:END%
%TMPL:DEF{"blogcalendar::maxtime"}%24:00%TMPL:END%

%TMPL:DEF{"content"}%%TMPL:P{"blogcalendar"
   initialdate="%URLPARAM{"initialdate" default="%NOW%"}%"
}%%TMPL:P{"blogcalendar::css"}%%TMPL:P{"blogcalendar::js"}%%TMPL:END%

%TMPL:DEF{"blogcalendar"}%%FULLCALENDAR{
   "mycal"
   web="%web{default="%BASEWEB%"}%"
   initial_date="%DATETIME{"%initialdate%" format="$iso"}%"
   scroll_time="%DATETIME{"%initialdate%" format="$hour:$min:00"}%"
   selectable="false"
   editable="true"
   height="100%"
   expand_rows="true"
   event_duration_editable="false"
   event_min_height="100"
   initial_view="%TMPL:P{"blogcalendar::initialview"}%"
   all_day_slot="false"
   slot_duration="00:30:00"
   snap_duration="00:30:00"
   slot_min_time="%TMPL:P{"blogcalendar::mintime"}%"
   slot_max_time="%TMPL:P{"blogcalendar::maxtime"}%"
}%%TMPL:END%

%TMPL:DEF{"blogcalendar::css"}%%ADDTOZONE{
   "head"
   id="BLOGCALENDAR::css"
   text="<link rel='stylesheet' href='%PUBURLPATH%/Applications/BlogApp/BlogCalendarViewTemplate/blogCalendar.css' media='all' />"
   requires="JQUERYPLUGIN::FULLCALENDAR"
}%%TMPL:END%

%TMPL:DEF{"blogcalendar::js"}%%JQREQUIRE{"pnotify"}%%ADDTOZONE{
   "script"
   id="BLOGCALENDAR::JS"
   text="<script src='%PUBURLPATH%/Applications/BlogApp/BlogCalendarViewTemplate/blogCalendar.js'></script>"
   requires="JQUERYPLUGIN::PNOTIFY, JQUERYPLUGIN::FULLCALENDAR"
}%%TMPL:END%

%TMPL:DEF{"blogcalendar::events"}%%DBQUERY{
   "TopicType=~'\bBlogEntry\b' AND 
   publishdate >= %DATETIME{"%URLPARAM{"start" default="0"}%" format="$epoch"}% AND 
   publishdate <= %DATETIME{"%URLPARAM{"end" default="%NOW%"}%" format="$epoch"}%"
   web="%URLPARAM{"web" default="%BASEWEB%"}%"
   exclude="WebTopicEditTemplate"
   header="["
   footer="]"
   separator=",$n"
   format="{
    \"id\": \"$web.$topic\",
    \"web\": \"$web\",
    \"topic\": \"$topic\",
    \"title\": \"$encode($expand(topictitle))\",
    \"start\": \"$formatTime(publishdate, '$iso')\",
    \"end\": \"$formatTime(publishdate, '$iso')\",
    \"allDay\": $expand(AllDay or 'false'),
    \"className\": \"$expand(qmstate.id) $percntIF{\"'$web.$topic' allows 'change'\" then=\"editable\" else=\"not-editable\"}$percnt $expand(Sticky)\",
    \"url\": \"$percntSCRIPTURLPATH{\"view\" topic=\"$web.$topic\"}$percnt\",
    \"editable\": $percntIF{\"'$web.$topic' allows 'change'\" then=\"true\" else=\"false\"}$percnt,
    \"extendedProps\": {
      \"language\": \"$expand(preferences.CONTENT_LANGUAGE)\",
      \"language_icon\": \"$percntENCODE{
                           \"$percntLANGUAGES{\"$expand(preferences.CONTENT_LANGUAGE)\" format=\"$icon\"}$percnt\"
                          }$percnt\",
      \"category\": \"$percntENCODE{
                        \"$percntCATINFO{
                           \"$web.$topic\" 
                           format=\"$title\"
                           exclude=\"TopCategory\"
                        }$percnt\" 
                        type=\"entity\"
                     }$percnt\",
      \"tag\": \"$encode($expand(Tag))\",
      \"summary\": \"$encode($expand(Summary))\",
      \"thumbnail\": \"$percntENCODE{
                        \"$percntDBCALL{\"Applications.RenderTopicThumbnail\"
                           OBJECT=\"$web.$topic\"
                           TYPE=\"plain\"
                           SIZE=\"80x80\"
                           CROP=\"on\"
                        }$percnt\"
                      }$percnt\"
    }
  }"
}%%TMPL:END%
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding arbeitsgruppe.ch? Send feedback