diff --git a/allsessions.php b/allsessions.php index 5b87698..c51e731 100644 --- a/allsessions.php +++ b/allsessions.php @@ -1,5 +1,7 @@ '; +$MY_TITLE = "All Sessions"; +$MY_CRUMB = "All Sessions"; +$timeslot_config = file_exists('schedule_timeslots.json') ? json_decode(file_get_contents('schedule_timeslots.json'), true) : []; +$config_js = ''; +$CONTENT = ''; include 'layout.php'; diff --git a/index.php b/index.php index 14c1549..c59a1d0 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,7 @@ '; +$timeslot_config = file_exists('schedule_timeslots.json') ? json_decode(file_get_contents('schedule_timeslots.json'), true) : []; +$config_js = ''; +$CONTENT = $config_js . ''; include 'layout.php'; diff --git a/js/dir_app.js b/js/dir_app.js index b93c9e9..c59c7d3 100644 --- a/js/dir_app.js +++ b/js/dir_app.js @@ -855,12 +855,24 @@ const ActivityEditor = Vue.component('activityedit', { // // // +// Empty time slot card +const EmptySlotCard = Vue.component('emptyslotcard', { + props: ['label'], + template: `` +}) + + const ActivityList = Vue.component('activitylist', { props: [ 'itineraryview','static','show_all_sessions' ], data: function () { return { activities:[], mysessions:[], search:'', sortby:'starttime', reversed:false, my_ses_ids:[], my_host_ids:[], show_filters: 'all', expanded: 1, editing: -1, active:-1, hosts:{}, selectedSlotKey: null, - hosts_by_sesid: {}, options:{}, conference:{}, ay:{}, conf:-1, survey_on:0, zoom_on:1, cancelingIds:[], } }, + hosts_by_sesid: {}, options:{}, conference:{}, ay:{}, conf:-1, survey_on:0, zoom_on:1, cancelingIds:[], timeslotConfig:null, } }, mounted: function() { this.fetch_myevents() }, @@ -919,8 +931,10 @@ const ActivityList = Vue.component('activitylist', { mode_string: function(a) { if (this.$root.active) { return _.findWhere(this.$root.modes_menu, { 'id': a.mode })['string'] } return a.mode }, get_day_title: function(day) { var d = dayjs(day, 'MMM DD YYYY') - convertedDateString = d.format('YYYY-MM-DD') - return _.findWhere( this.conference, {date1:convertedDateString} ).title + var convertedDateString = d.format('YYYY-MM-DD') + var found = _.findWhere( this.conference, {date1:convertedDateString} ) + if (found && found.title) { return found.title } + return '' }, month_year: function(d) { var b = this.$root.$dj(d).format('MMM D YYYY'); return b }, setsort: function(ss) { @@ -950,6 +964,7 @@ const ActivityList = Vue.component('activitylist', { self.survey_on = parseInt( _.findWhere(self.options, { label:'survey_on' }).value ) self.zoom_on = parseInt( _.findWhere(self.options, { label:'zoom_on' }).value ) self.active = 1 + self.loadTimeslots() self.$forceUpdate(); } ) @@ -978,6 +993,7 @@ const ActivityList = Vue.component('activitylist', { }, sessionsForSlot: function(slot) { var self=this; + if (slot.presetSessions && slot.presetSessions.length) { return []; } return _.chain(this.activities_for_slots) .filter(function(item) { return self.slotKeyFromStart(item.starttime) === slot.key; }) .sortBy('starttime') @@ -990,6 +1006,23 @@ const ActivityList = Vue.component('activitylist', { } self.clearSlot(); }, + slotPresets: function(slot) { return slot.presetSessions || []; }, + slotHasPreset: function(slot) { return (slot.presetSessions && slot.presetSessions.length>0); }, + loadTimeslots: function() { + var self=this; + if (window.TIMESLOT_CONFIG) { + self.timeslotConfig = window.TIMESLOT_CONFIG; + return; + } + fetch('schedule_timeslots.json').then(function(resp) { + if (!resp.ok) { throw new Error('timeslot fetch'); } + return resp.json(); + }).then(function(json) { + self.timeslotConfig = json; + }).catch(function(e) { + console.warn('No schedule_timeslots.json found or unreadable', e); + }); + }, isCanceling: function(id) { return this.cancelingIds.includes(id) }, filtered: function(ff, opts = { applySearch: true, applySlot: false }) { var self = this @@ -1028,6 +1061,28 @@ const ActivityList = Vue.component('activitylist', { timeSlotsByDay: function() { if (this.active < 1) { return {}; } var self=this; + if (this.timeslotConfig && this.timeslotConfig.versions && this.timeslotConfig.days) { + var res = {}; + _.each(this.timeslotConfig.days, function(versionKey, dayStr) { + var version = self.timeslotConfig.versions[versionKey]; + if (!version || !version.slots) { return; } + var dayLabel = dayjs(dayStr).format('MMM D YYYY'); + res[dayLabel] = _.map(version.slots, function(slot) { + var start = dayjs(dayStr + ' ' + slot.start); + var end = dayjs(dayStr + ' ' + slot.end); + return { + key: dayStr + 'T' + slot.start, + startLabel: start.isValid() ? start.format('h:mma') : slot.start, + endLabel: end.isValid() ? end.format('h:mma') : slot.end, + dayLabel: dayLabel, + presetSessions: slot.sessions || [], + version: versionKey, + versionLabel: version.label || versionKey + }; + }); + }); + return res; + } var grouped = _.groupBy(this.activities_for_slots, function(x) { return self.month_year(x.starttime) }); return _.mapObject(grouped, function(list) { return _.chain(list) @@ -1038,7 +1093,10 @@ const ActivityList = Vue.component('activitylist', { key: self.slotKeyFromStart(item.starttime), startLabel: start.format('h:mma'), endLabel: self.addTime(item.starttime, item.length), - dayLabel: self.month_year(item.starttime) + dayLabel: self.month_year(item.starttime), + presetSessions: [], + version: null, + versionLabel: null, }; }) .uniq(false, function(slot) { return slot.key; }) @@ -1086,7 +1144,19 @@ const ActivityList = Vue.component('activitylist', {
-
+
+
+
{{ sel.title }}
+
+ {{ sel.audience }} meeting + at {{ sel.location }} + ยท {{ sel.mode }} +
+
{{ sel.notes }}
+
+
+ +
{{ sel.title }}
@@ -1099,13 +1169,11 @@ const ActivityList = Vue.component('activitylist', {
- +
-
+
Pick for {{ slot.startLabel }} - {{ slot.endLabel }}
@@ -1154,6 +1222,27 @@ const ActivityList = Vue.component('activitylist', {

+ +
+
+

{{ mmyy }} {{ get_day_title(mmyy) }}

+
+
+
+
+
{{ $root.$dj(a.starttime).format('h:mma') }} - {{ addTime(a.starttime, a.length) }}
+

{{ a.title }}

+

+

{{ mode_string(a) }}

+

Location: {{ a.location_irl }}

+

Link: {{ a.location }}

+
+
+
+
+
+
+
diff --git a/layout.php b/layout.php index b0687ae..d82dc13 100644 --- a/layout.php +++ b/layout.php @@ -13,6 +13,7 @@ require_once('semester.php'); if (!isset($MY_TITLE)) $MY_TITLE = "Untitled Page"; if (!isset($MY_CRUMB)) $MY_CRUMB = $MY_TITLE; if (!isset($CONTENT)) $CONTENT = "

No content provided.

"; +$DIR_APP_VER = file_exists('js/dir_app.js') ? filemtime('js/dir_app.js') : time(); $MY_PATH = $_SERVER['PHP_SELF']; $MOD_DATE = file_exists(__FILE__) ? date("F d Y H:i.", filemtime(__FILE__)) : "(unknown)"; @@ -25,6 +26,7 @@ $MOD_DATE = file_exists(__FILE__) ? date("F d Y H:i.", filemtime(__FILE__)) : "( + @@ -73,7 +75,7 @@ $MOD_DATE = file_exists(__FILE__) ? date("F d Y H:i.", filemtime(__FILE__)) : "(
 
  - +