aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-06-18 11:47:26 +0200
committerMax Kostikov <max@kostikov.co>2019-06-18 11:47:26 +0200
commite2abc0b7277956651d2947c34a0522a77a59a9a5 (patch)
tree95e9c8863d20b7c91a6d07297cacd2ef8cf32818 /view
parent43cec4398d0d035dd9446988134b814513a73080 (diff)
parenta677a68ab7e1f50f5b11c02a42dbc6cad3ebb444 (diff)
downloadvolse-hubzilla-e2abc0b7277956651d2947c34a0522a77a59a9a5.tar.gz
volse-hubzilla-e2abc0b7277956651d2947c34a0522a77a59a9a5.tar.bz2
volse-hubzilla-e2abc0b7277956651d2947c34a0522a77a59a9a5.zip
Merge branch 'dev' into 'dev'
Dev See merge request kostikov/core!1
Diffstat (limited to 'view')
-rw-r--r--view/pdl/mod_events.pdl8
-rwxr-xr-xview/tpl/cal_calendar.tpl105
-rwxr-xr-xview/tpl/cal_event.tpl (renamed from view/tpl/event_cal.tpl)0
3 files changed, 105 insertions, 8 deletions
diff --git a/view/pdl/mod_events.pdl b/view/pdl/mod_events.pdl
deleted file mode 100644
index e9a91e219..000000000
--- a/view/pdl/mod_events.pdl
+++ /dev/null
@@ -1,8 +0,0 @@
-[region=aside]
-[widget=eventstools][/widget]
-[widget=tasklist][/widget]
-[/region]
-[region=right_aside]
-[widget=notifications][/widget]
-[widget=newmember][/widget]
-[/region]
diff --git a/view/tpl/cal_calendar.tpl b/view/tpl/cal_calendar.tpl
new file mode 100755
index 000000000..93ebaa235
--- /dev/null
+++ b/view/tpl/cal_calendar.tpl
@@ -0,0 +1,105 @@
+<script>
+var calendar;
+
+$(document).ready(function() {
+ var calendarEl = document.getElementById('calendar');
+ calendar = new FullCalendar.Calendar(calendarEl, {
+ plugins: [ 'dayGrid' ],
+ eventSources: [ {{$sources}} ],
+
+ timeZone: '{{$timezone}}',
+
+ locale: '{{$lang}}',
+
+ eventTextColor: 'white',
+ header: false,
+
+ height: 'auto',
+
+ firstDay: {{$first_day}},
+
+ monthNames: aStr['monthNames'],
+ monthNamesShort: aStr['monthNamesShort'],
+ dayNames: aStr['dayNames'],
+ dayNamesShort: aStr['dayNamesShort'],
+ allDayText: aStr['allday'],
+
+ eventClick: function(info) {
+ var event_id = info.event._def.extendedProps.item.id;
+ showEvent(event_id);
+ },
+
+ loading: function(isLoading, view) {
+ $('#events-spinner').show();
+ $('#today-btn > i').hide();
+ if(!isLoading) {
+ $('#events-spinner').hide();
+ $('#today-btn > i').show();
+ }
+ }
+
+ });
+
+ calendar.render();
+
+ $('#title').text(calendar.view.title);
+
+ $('#today-btn').on('click', function() {
+ calendar.today();
+ $('#title').text(calendar.view.title);
+ });
+
+ $('#prev-btn').on('click', function() {
+ calendar.prev();
+ $('#title').text(calendar.view.title);
+ });
+
+ $('#next-btn').on('click', function() {
+ calendar.next();
+ $('#title').text(calendar.view.title);
+ });
+
+ $(document).on('click','#fullscreen-btn', updateSize);
+ $(document).on('click','#inline-btn', updateSize);
+
+});
+
+function showEvent(event_id) {
+ $.get(
+ 'cal/{{$nick}}?id='+event_id,
+ function(data){
+ $.colorbox({ scrolling: false, html: data, onComplete: function() { $.colorbox.resize(); }});
+ }
+ );
+}
+
+function changeView(action, viewName) {
+ calendar.changeView(viewName);
+ $('#title').text(calendar.view.title);
+ $('#view_selector').html(views[calendar.view.type]);
+ return;
+}
+
+function updateSize() {
+ calendar.updateSize();
+}
+</script>
+
+<div class="generic-content-wrapper">
+ <div class="section-title-wrapper">
+ <div class="float-right">
+ <div class="btn-group">
+ <button id="prev-btn" class="btn btn-outline-secondary btn-sm" title="{{$prev}}"><i class="fa fa-backward"></i></button>
+ <button id="today-btn" class="btn btn-outline-secondary btn-sm" title="{{$today}}"><div id="events-spinner" class="spinner s"></div><i class="fa fa-bullseye" style="display: none; width: 1rem;"></i></button>
+ <button id="next-btn" class="btn btn-outline-secondary btn-sm" title="{{$next}}"><i class="fa fa-forward"></i></button>
+ </div>
+ <button id="fullscreen-btn" type="button" class="btn btn-outline-secondary btn-sm" onclick="makeFullScreen();"><i class="fa fa-expand"></i></button>
+ <button id="inline-btn" type="button" class="btn btn-outline-secondary btn-sm" onclick="makeFullScreen(false);"><i class="fa fa-compress"></i></button>
+ </div>
+ <h2 id="title"></h2>
+ <div class="clear"></div>
+ </div>
+ <div class="section-content-wrapper-np">
+ <div id="calendar"></div>
+ </div>
+</div>
diff --git a/view/tpl/event_cal.tpl b/view/tpl/cal_event.tpl
index d7662786b..d7662786b 100755
--- a/view/tpl/event_cal.tpl
+++ b/view/tpl/cal_event.tpl