From 0b1b3785ca57b0647fb8788425d86a3aaf5d739f Mon Sep 17 00:00:00 2001
From: Danny Gershman
Date: Sat, 7 Sep 2024 20:46:08 -0400
Subject: [PATCH 1/5] suggest change feature to link to bmlt-workflow
# Conflicts:
# crouton.php
---
crouton.php | 27 +++---
croutonjs/src/js/crouton-core.js | 104 +++++++++++++----------
croutonjs/src/js/crouton-localization.js | 51 +++++++----
croutonjs/src/templates/meetings.hbs | 5 +-
partials/_instructions.php | 11 ++-
5 files changed, 118 insertions(+), 80 deletions(-)
diff --git a/crouton.php b/crouton.php
index 139ffb64..6ac9977d 100644
--- a/crouton.php
+++ b/crouton.php
@@ -109,7 +109,8 @@ class Crouton
"hide_byday_headers" => false,
"native_lang" => '',
"has_meeting_count" => false,
- "google_api_key" => ""
+ "google_api_key" => "",
+ "suggest_change_url" => "",
);
private $hasFilters = [
"has_days",
@@ -189,7 +190,7 @@ private function hasShortcode()
if (empty($matches)) {
return false;
}
-
+
foreach ($matches as $shortcode) {
if ($shortcode[2] === 'bmlt_handlebar' ||
$shortcode[2] === 'bmlt_tabs' ||
@@ -222,7 +223,7 @@ public function enqueueBackendFiles($hook)
add_thickbox();
wp_enqueue_script('jquery-ui-accordion');
wp_enqueue_script("crouton-default-templates", plugin_dir_url(__FILE__) . "croutonjs/src/js/crouton-default-templates.js", array('jquery'), filemtime(plugin_dir_path(__FILE__) . "croutonjs/src/js/crouton-default-templates.js"), true);
-
+
wp_enqueue_style("codemirror", plugin_dir_url(__FILE__) . "css/codemirror.css", false, "5.65.15", 'all');
wp_enqueue_style("codemirror", plugin_dir_url(__FILE__) . "css/show-hint.css", false, "5.65.15", 'all');
wp_enqueue_script('codemirror', plugins_url('js/codemirror/codemirror.js', __FILE__), array('jquery'), filemtime(plugin_dir_path(__FILE__) . "js/codemirror/codemirror.js"), false);
@@ -849,7 +850,7 @@ public function adminOptionsPage()
venue_type
- venue_type_name
+ venue_type_name
formatted_address
formatted_location_info
serviceBodyUrl
@@ -865,14 +866,14 @@ public function adminOptionsPage()
parentServiceBodyType
- To include a map in the meeting details, use the "crouton_map" helper function, ie, {{{crouton_map}}}.
+
To include a map in the meeting details, use the "crouton_map" helper function, ie, {{{crouton_map}}}.
Note the triple brackets. A initial zoom factor (from 2 to 17) may be given as an option, eg, {{{crouton_map zoom=16}}}. Default zoom is 14.
Meeting Data Template
This allows a customization of the meeting data template. A list of available fields are
-
- .
+
+ .
@@ -890,8 +891,8 @@ public function adminOptionsPage()
Metadata Template
This allows a customization of the metadata template (3rd column). A list of available fields are
-
- .
+
+ .
@@ -909,8 +910,8 @@ public function adminOptionsPage()
Meeting Details Page
This allows a customization of the view of the meeting data that you get when you click on the meeting name. A list of available fields are
-
- .
+
+ .
Title
@@ -1189,14 +1190,14 @@ private function getCroutonJsConfig($atts, $croutonMap = false)
}
}
$this->options['meeting_details_href'] = $params['meeting_details_href'];
-
+
$params['force_rootserver_in_querystring'] = ($params['root_server'] !== $this->options['root_server']);
if (!function_exists('is_plugin_active')) {
include_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$params['bmlt2ics'] = (is_plugin_active('bmlt2calendar/bmlt2calendar.php')) ? get_feed_link('bmlt2ics') : "";
$params = apply_filters('crouton_configuration', $params);
-
+
return [json_encode($params), $this->meetingMapController->getMapJSConfig($params, $croutonMap)];
}
}
diff --git a/croutonjs/src/js/crouton-core.js b/croutonjs/src/js/crouton-core.js
index 14b2c4d0..ecfe72b9 100644
--- a/croutonjs/src/js/crouton-core.js
+++ b/croutonjs/src/js/crouton-core.js
@@ -89,6 +89,7 @@ function Crouton(config) {
force_timeformat_in_querystring: true, // Set to false to shorten generated meeting detail query strings
force_language_in_querystring: true, // Set to false to shorten generated meeting detail query strings
theme: "jack", // Allows for setting pre-packaged themes. Choices are listed here: https://github.com/bmlt-enabled/crouton/blob/master/croutonjs/dist/templates/themes
+ suggest_change_url: "", // URL to edit a meeting for BMLT-workflow plugin
meeting_data_template: croutonDefaultTemplates.meeting_data_template,
metadata_template: croutonDefaultTemplates.metadata_template,
observer_template: croutonDefaultTemplates.observer_template,
@@ -215,6 +216,7 @@ function Crouton(config) {
"parentServiceBodyType",
"map_word",
"share_word",
+ "suggest_change_word",
"show_qrcode",
"formatted_day",
"formatted_address",
@@ -454,7 +456,7 @@ function Crouton(config) {
jQuery('#displayTypeButton_tablePages').addClass('hide');
jQuery('#filterButton_embeddedMapPage').removeClass('hide');
} else if (self.config.show_map) croutonMap.fillMap();
- self.filtering = false;
+ self.filtering = false;
self.updateFilters();
self.updateMeetingCount();
jQuery(".filter-dropdown").val(null).trigger("change");
@@ -638,7 +640,7 @@ function Crouton(config) {
templateString = element.firstChild.textContent;
}
var handlebarResult;
- try {
+ try {
var template = crouton_Handlebars.compile(templateString);
handlebarResult = template(meetingDetailsData);
} catch (e) {
@@ -735,7 +737,7 @@ function Crouton(config) {
};
self.toFarsinNumber = function( n ) {
const farsiDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
-
+
return n.replace(/\d/g, x => farsiDigits[x]);
}
self.enrichMeetings = function (meetingData) {
@@ -771,7 +773,7 @@ function Crouton(config) {
.format(self.config['time_format']);
if (self.config.language === 'fa-IR') {
meetingData[m]['start_time_formatted'] = self.toFarsinNumber(meetingData[m]['start_time_formatted']);
- meetingData[m]['end_time_formatted'] = self.toFarsinNumber(meetingData[m]['end_time_formatted']);
+ meetingData[m]['end_time_formatted'] = self.toFarsinNumber(meetingData[m]['end_time_formatted']);
}
// back to bmlt day
@@ -816,6 +818,7 @@ function Crouton(config) {
: "";
meetingData[m]['map_word'] = self.localization.getWord('map').toUpperCase();
meetingData[m]['share_word'] = self.localization.getWord('share').toUpperCase();
+ meetingData[m]['suggest_change_word'] = self.localization.getWord('suggest change');
meetingData[m]['show_qrcode'] = self.config['show_qrcode'];
for (var k in meetingData[m]) {
if (meetingData[m].hasOwnProperty(k) && typeof meetingData[m][k] === 'string') {
@@ -852,9 +855,9 @@ function Crouton(config) {
}
meetingData[m]['meeting_details_url'] += queryStringChar + ('meeting-id=' + meetingData[m]['id_bigint']
+ '&language=' + self.config.language
- + '&time_format=' + encodeURIComponent(self.config.time_format)
+ + '&time_format=' + encodeURIComponent(self.config.time_format)
+ (self.config.force_rootserver_in_querystring ? '&root_server=' + encodeURIComponent(self.config.root_server) : '')
- );
+ );
}
meetings.push(meetingData[m])
@@ -1014,7 +1017,7 @@ Crouton.prototype.doHandlebars = function() {
Crouton.prototype.meetingModal = function(meetingId) {
let self = this;
const tabs = document.getElementById('bmlt-tabs');
-
+
let el = document.createElement('bmlt-handlebar');
tabs.appendChild(el);
let span = document.createElement('span');
@@ -1040,7 +1043,7 @@ Crouton.prototype.meetingModal = function(meetingId) {
let doSwipe = function(swipedir) {
switch(swipedir) {
case 'left':
- index = index+1;
+ index = index+1;
break;
case 'right':
index = index-1;
@@ -1227,68 +1230,68 @@ Crouton.prototype.render = function(doMeetingMap = false) {
self.dayNamesSequenced = self.config.day_sequence.map((d)=>self.localization.getDayOfTheWeekWord(d));
self.dropdownData = [];
if (self.config.has_days) self.dropdownData.push(
- {placeholder: self.localization.getWord('weekday'), pointer: 'weekdays', elementId: "filter-dropdown-weekdays",
- uniqueData: (meetings) => sortListByList(getUniqueValuesOfKey(meetings, "formatted_day"), self.dayNamesSequenced),
+ {placeholder: self.localization.getWord('weekday'), pointer: 'weekdays', elementId: "filter-dropdown-weekdays",
+ uniqueData: (meetings) => sortListByList(getUniqueValuesOfKey(meetings, "formatted_day"), self.dayNamesSequenced),
objectPointer: convertToPunyCode, optionName: (s)=>s});
if (self.config.has_states) self.dropdownData.push(
- {placeholder: self.localization.getWord('states'), pointer: 'States', elementId: "filter-dropdown-states",
- uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_province').sort(),
+ {placeholder: self.localization.getWord('states'), pointer: 'States', elementId: "filter-dropdown-states",
+ uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_province').sort(),
objectPointer: convertToPunyCode, optionName: (s)=>s});
if (self.config.has_sub_province) self.dropdownData.push(
- {placeholder: self.localization.getWord('counties'), pointer: 'Counties', elementId: "filter-dropdown-sub_province",
- uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_sub_province').sort(),
- objectPointer: convertToPunyCode, optionName: (s)=>s});
+ {placeholder: self.localization.getWord('counties'), pointer: 'Counties', elementId: "filter-dropdown-sub_province",
+ uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_sub_province').sort(),
+ objectPointer: convertToPunyCode, optionName: (s)=>s});
if (self.config.has_cities) self.dropdownData.push(
- {placeholder: self.localization.getWord('cities'), pointer: 'Cities', elementId: "filter-dropdown-cities",
- uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_municipality').sort(),
+ {placeholder: self.localization.getWord('cities'), pointer: 'Cities', elementId: "filter-dropdown-cities",
+ uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_municipality').sort(),
objectPointer: convertToPunyCode, optionName: (s)=>s});
if (self.config.has_neighborhoods) self.dropdownData.push(
- {placeholder: self.localization.getWord('neighborhood'), pointer: 'Neighborhoods', elementId: "filter-dropdown-neighborhoods",
- uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_neighborhood').sort(),
- objectPointer: convertToPunyCode, optionName: (s)=>s});
+ {placeholder: self.localization.getWord('neighborhood'), pointer: 'Neighborhoods', elementId: "filter-dropdown-neighborhoods",
+ uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_neighborhood').sort(),
+ objectPointer: convertToPunyCode, optionName: (s)=>s});
if (self.config.has_zip_codes) self.dropdownData.push(
- {placeholder: self.localization.getWord('postal_codes'), pointer: 'Zips', elementId: "filter-dropdown-zipcodes",
- uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_postal_code_1').sort(),
+ {placeholder: self.localization.getWord('postal_codes'), pointer: 'Zips', elementId: "filter-dropdown-zipcodes",
+ uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_postal_code_1').sort(),
objectPointer: convertToPunyCode, optionName: (s)=>s});
if (self.config.has_locations) self.dropdownData.push(
- {placeholder: self.localization.getWord('locations'), pointer: 'Locations', elementId: "filter-dropdown-locations",
- uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_text').map((s)=>s.replace(/(<([^>]+)>)/gi, "")).sort(),
+ {placeholder: self.localization.getWord('locations'), pointer: 'Locations', elementId: "filter-dropdown-locations",
+ uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'location_text').map((s)=>s.replace(/(<([^>]+)>)/gi, "")).sort(),
objectPointer: convertToPunyCode, optionName: (s)=>s});
if (self.config.has_regions) self.dropdownData.push(
- {placeholder: self.localization.getWord('regions'), pointer: 'Regions', elementId: "filter-dropdown-regions",
- uniqueData: (meetings) => self.all_service_bodies.filter((sb)=>getUniqueValuesOfKey(meetings,'parentServiceBodyId').includes(sb.id)).sortByKey('name'),
+ {placeholder: self.localization.getWord('regions'), pointer: 'Regions', elementId: "filter-dropdown-regions",
+ uniqueData: (meetings) => self.all_service_bodies.filter((sb)=>getUniqueValuesOfKey(meetings,'parentServiceBodyId').includes(sb.id)).sortByKey('name'),
objectPointer: (a) => convertToPunyCode(a.name), optionName: (a)=>a.name});
if (self.config.has_areas) self.dropdownData.push(
- {placeholder: self.localization.getWord('areas'), pointer: 'Areas', elementId: "filter-dropdown-areas",
- uniqueData: (meetings) => self.all_service_bodies.filter((sb)=>getUniqueValuesOfKey(meetings,'service_body_bigint').includes(sb.id)).sortByKey('name'),
+ {placeholder: self.localization.getWord('areas'), pointer: 'Areas', elementId: "filter-dropdown-areas",
+ uniqueData: (meetings) => self.all_service_bodies.filter((sb)=>getUniqueValuesOfKey(meetings,'service_body_bigint').includes(sb.id)).sortByKey('name'),
objectPointer: (a) => a.id, optionName: (a)=>a.name});
if (self.config.has_groups) self.dropdownData.push(
- {placeholder: self.localization.getWord('groups'), pointer: 'Groups', elementId: "filter-dropdown-groups",
- uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'meeting_name').sort(),
+ {placeholder: self.localization.getWord('groups'), pointer: 'Groups', elementId: "filter-dropdown-groups",
+ uniqueData: (meetings) => getUniqueValuesOfKey(meetings, 'meeting_name').sort(),
objectPointer: convertToPunyCode, optionName: (s)=>s});
if (self.config.has_venues) self.dropdownData.push(
- {placeholder: self.localization.getWord('venue_types'), pointer: 'Venues', elementId: "filter-dropdown-venues",
- uniqueData: (meetings) => self.getUsedVenueType(meetings),
+ {placeholder: self.localization.getWord('venue_types'), pointer: 'Venues', elementId: "filter-dropdown-venues",
+ uniqueData: (meetings) => self.getUsedVenueType(meetings),
objectPointer: convertToPunyCode, optionName: (s)=>s});
if (self.config.has_formats) self.dropdownData.push(
- {placeholder: self.localization.getWord('formats'), pointer: 'Formats', elementId: "filter-dropdown-formats",
- uniqueData: (meetings) => getUniqueFormats(meetings),
+ {placeholder: self.localization.getWord('formats'), pointer: 'Formats', elementId: "filter-dropdown-formats",
+ uniqueData: (meetings) => getUniqueFormats(meetings),
objectPointer: (f) => convertToPunyCode(f.name), optionName: (f)=>f.name});
if (self.config.has_languages) self.dropdownData.push(
- {placeholder: self.localization.getWord('languages'), pointer: 'Formats', elementId: "filter-dropdown-languages",
- uniqueData: (meetings) => getUniqueFormatsOfType(meetings, 'LANG').filter((f)=>f.key!==self.config.native_lang),
+ {placeholder: self.localization.getWord('languages'), pointer: 'Formats', elementId: "filter-dropdown-languages",
+ uniqueData: (meetings) => getUniqueFormatsOfType(meetings, 'LANG').filter((f)=>f.key!==self.config.native_lang),
objectPointer: (f) => convertToPunyCode(f.name), optionName: (f)=>f.name});
if (self.config.has_common_needs) self.dropdownData.push(
- {placeholder: self.localization.getWord('common_needs'), pointer: 'Formats', elementId: "filter-dropdown-commonneeds",
- uniqueData: (meetings) => getUniqueFormatsOfType(meetings, 'FC3'),
+ {placeholder: self.localization.getWord('common_needs'), pointer: 'Formats', elementId: "filter-dropdown-commonneeds",
+ uniqueData: (meetings) => getUniqueFormatsOfType(meetings, 'FC3'),
objectPointer: (f) => convertToPunyCode(f.name), optionName: (f)=>f.name});
if (doMeetingMap) self.dropdownData.push(
- {placeholder: '', pointer: 'visible', elementId: "filter-dropdown-visibile",
- uniqueData: (meetings) => self.getUsedVisibility(meetings),
+ {placeholder: '', pointer: 'visible', elementId: "filter-dropdown-visibile",
+ uniqueData: (meetings) => self.getUsedVisibility(meetings),
objectPointer: (s)=>s.value, optionName: (s)=>s.name});
if (doMeetingMap) self.dropdownData.push(
- {placeholder: '', pointer: 'next24', elementId: "filter-dropdown-next24",
- uniqueData: (meetings) => self.getUsedNext24(meetings),
+ {placeholder: '', pointer: 'next24', elementId: "filter-dropdown-next24",
+ uniqueData: (meetings) => self.getUsedNext24(meetings),
objectPointer: (s)=>s.value, optionName: (s)=>s.name});
let renderer = doMeetingMap ? self.renderStandaloneMap : self.renderView;
renderer("#" + self.config['placeholder_id'], {
@@ -1496,10 +1499,19 @@ crouton_Handlebars.registerHelper('formatDataPointer', function(str) {
crouton_Handlebars.registerHelper('call', function(fn, str) {
return fn(str);
});
+
crouton_Handlebars.registerHelper('canShare', function(data, options) {
return navigator.share ? getTrueResult(options, this) : getFalseResult(options, this);
});
+crouton_Handlebars.registerHelper('editEnabled', function(data, options) {
+ return crouton.config.suggest_change_url !== "" ? getTrueResult(options, this) : getFalseResult(options, this)
+});
+
+crouton_Handlebars.registerHelper('editUrl', function() {
+ return crouton.config.suggest_change_url;
+});
+
/**
* @deprecated Since version 3.12.2, will be removed in a future version.
*/
@@ -1843,7 +1855,7 @@ Array.prototype.sortByKey = function (key) {
return this;
};
function swipedetect(el, callback){
-
+
var touchsurface = el,
swipedir,
startX,
@@ -1853,15 +1865,15 @@ function swipedetect(el, callback){
threshold = 150, //required min distance traveled to be considered swipe
restraint = 100, // maximum distance allowed at the same time in perpendicular direction
handleswipe = callback || function(swipedir){}
-
+
touchsurface.addEventListener('touchstart', function(e){
var touchobj = e.changedTouches[0]
swipedir = 'none'
startX = touchobj.pageX
startY = touchobj.pageY
}, false)
-
-
+
+
touchsurface.addEventListener('touchend', function(e){
if (!e.cancelable) return;
var touchobj = e.changedTouches[0]
diff --git a/croutonjs/src/js/crouton-localization.js b/croutonjs/src/js/crouton-localization.js
index b1f4258b..554596c5 100644
--- a/croutonjs/src/js/crouton-localization.js
+++ b/croutonjs/src/js/crouton-localization.js
@@ -35,7 +35,7 @@ function CroutonLocalization(language) {
RS: "لجنة خدمات الإقلي.م",
ZF: "منتدى المنطقة" ,
MA: "لجنة خدمات العاصمة",
- LS: "خدمة المنتديات المحلية",
+ LS: "خدمة المنتديات المحلية",
GS: "Group Support Forum",
},
"css-direction": 'bmlt-rtl',
@@ -54,7 +54,8 @@ function CroutonLocalization(language) {
'close': "قريب",
"bmlt2ics": "Add to your calendar",
'meeting page': "صفحة الاجتماع",
- 'meeting details': "تفاصيل الاجتماع"
+ 'meeting details': "تفاصيل الاجتماع",
+ 'suggest change': "Suggest Change",
},
"da-DK": {
"days_of_the_week": ["", "Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"],
@@ -106,6 +107,7 @@ function CroutonLocalization(language) {
'visible meeting list': 'Visible meetings as list',
'enter a city or zip code': 'Enter a city or zip code',
'toggle fullscreen mode': 'Toggle fullscreen mode',
+ 'suggest change': "Suggest Change",
},
"de-DE":{
"days_of_the_week": ["", "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
@@ -159,7 +161,8 @@ function CroutonLocalization(language) {
'close': "Schliessen",
"bmlt2ics": "Zu Kalender hinzufügen",
'meeting page': "Meeting Seite",
- 'meeting details': "Genaueres zum Meeting"
+ 'meeting details': "Genaueres zum Meeting",
+ 'suggest change': "Suggest Change",
},
"en-AU": {
"days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -212,7 +215,8 @@ function CroutonLocalization(language) {
'toggle fullscreen mode': 'Toggle fullscreen mode',
'close': "Close",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
},
"en-CA": {
"days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -266,7 +270,8 @@ function CroutonLocalization(language) {
'close': "Close",
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
},
"en-NZ": {
"days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -320,7 +325,8 @@ function CroutonLocalization(language) {
'close': "Close",
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
},
"en-UK": {
"days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -374,7 +380,8 @@ function CroutonLocalization(language) {
'toggle fullscreen mode': 'Toggle fullscreen mode',
'close': "Close",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
},
"en-US": {
"days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -428,7 +435,8 @@ function CroutonLocalization(language) {
'close': "Close",
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
},
"es-US": {
"days_of_the_week" : ["", "Domingo", " Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
@@ -482,7 +490,8 @@ function CroutonLocalization(language) {
'close': "Close",
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
},
"fa-IR": {
"days_of_the_week" : ["", 'یَکشَنب', 'دوشَنبه', 'سهشنبه', 'چهار شنبه', 'پَنج شَنبه', 'جُمعه', 'شَنبه'],
@@ -535,7 +544,8 @@ function CroutonLocalization(language) {
'close': "Close",
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
},
"fr-CA": {
"days_of_the_week" : ["", "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"],
@@ -589,7 +599,8 @@ function CroutonLocalization(language) {
"close": "Fermer",
"bmlt2ics": "Ajouter au calendrier",
"meeting page": "Page de la réunion",
- "meeting details": "Détails de la réunion"
+ "meeting details": "Détails de la réunion",
+ 'suggest change': "Suggest Change",
},
"it-IT": {
"days_of_the_week" : ["", "Domenica", " Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"],
@@ -643,7 +654,8 @@ function CroutonLocalization(language) {
'close': "Close",
"bmlt2ics": "Aggiungi al tuo calendario",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
},
"nl-NL": {
"days_of_the_week" : ["", "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"],
@@ -697,7 +709,8 @@ function CroutonLocalization(language) {
'close': "Close",
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
},
"pl-PL": {
"days_of_the_week" : ["", "Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"],
@@ -751,7 +764,8 @@ function CroutonLocalization(language) {
'close': "Close",
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
},
"pt-BR": {
"days_of_the_week" : ["", "Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"],
@@ -805,7 +819,8 @@ function CroutonLocalization(language) {
'toggle fullscreen mode': 'Toggle fullscreen mode',
'close': "Close",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
},
"ru-RU": {
"days_of_the_week" : ["", "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"],
@@ -859,7 +874,8 @@ function CroutonLocalization(language) {
'toggle fullscreen mode': 'Включить полноэкранный режим',
'close': "Закрыть",
'meeting page': "Страница собрания",
- 'meeting details': "Подробности собрания"
+ 'meeting details': "Подробности собрания",
+ 'suggest change': "Suggest Change",
},
"sv-SE": {
"days_of_the_week" : ["", "Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"],
@@ -913,7 +929,8 @@ function CroutonLocalization(language) {
'close': "Close",
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
- 'meeting details': "Meeting Details"
+ 'meeting details': "Meeting Details",
+ 'suggest change': "Suggest Change",
}
};
}
diff --git a/croutonjs/src/templates/meetings.hbs b/croutonjs/src/templates/meetings.hbs
index 97575735..e8f2efa9 100644
--- a/croutonjs/src/templates/meetings.hbs
+++ b/croutonjs/src/templates/meetings.hbs
@@ -49,8 +49,11 @@
{{> metaDataTemplate }}
{{#canShare this}}
- {{this.share_word}}
+ {{this.share_word}}
{{/canShare}}
+ {{#editEnabled this}}
+ {{this.suggest_change_word}}
+ {{/editEnabled}}
{{> offerIcsButton}}
diff --git a/partials/_instructions.php b/partials/_instructions.php
index eb61e571..b178588c 100644
--- a/partials/_instructions.php
+++ b/partials/_instructions.php
@@ -164,7 +164,7 @@
Will return the number of meetings in the BMLT query.
[meeting_count]
[meeting_count live="0|1"]
- By default, [meeting_count] returns the total number of meetings in the BMLT query. By setting "live" to "1",
+
By default, [meeting_count] returns the total number of meetings in the BMLT query. By setting "live" to "1",
the number displayed will be updated to reflect the current filters selection. So, to get the number of meetings in an
area, select the area in the appropriate filter and both the table and the meeting count will be updated.
@@ -174,7 +174,7 @@
Will return the number of groups in the BMLT query.
[group_count]
[group_count live="0|1"]
- By default, [group_count] returns the total number of groups in the BMLT query. By setting "live" to "1",
+
By default, [group_count] returns the total number of groups in the BMLT query. By setting "live" to "1",
the number displayed will be updated to reflect the current filters selection. So, to get the number of groups in an
area, select the area in the appropriate filter and both the table and the group count will be updated.
@@ -268,7 +268,7 @@
Extending Crouton
-
Handlebars is the template system used by Crouton. You can add Helpers and Partials to Handlebars, and use
+
Handlebars is the template system used by Crouton. You can add Helpers and Partials to Handlebars, and use
them in your templates, or to modify meeting data. An sample for doing this is available here .
@@ -288,4 +288,9 @@
If you use the format code "TC" it will render the format description for that format above the meeting name with a flag icon. It will show in the defined language (assuming that it was set in the root server). This behavior is overridable through the meeting data template functionality.
+ Suggest Change
+
+
You can set a short setting so that a button that says "Suggest Change" appears. When the button is clicked, it links back to a BMLT workflow page with that meeting.
+
[bmlt_tabs suggest_change_url="/edit-meeting"]
+
From 70f9ff049dc0566a6b9d90c736577d998d4252e1 Mon Sep 17 00:00:00 2001
From: Danny Gershman
Date: Thu, 12 Sep 2024 09:01:26 -0400
Subject: [PATCH 2/5] changing language for suggest change to report an update
---
crouton.php | 2 +-
croutonjs/src/js/crouton-core.js | 10 +++++-----
croutonjs/src/templates/meetings.hbs | 2 +-
partials/_instructions.php | 4 ++--
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/crouton.php b/crouton.php
index 6ac9977d..8462a8a6 100644
--- a/crouton.php
+++ b/crouton.php
@@ -110,7 +110,7 @@ class Crouton
"native_lang" => '',
"has_meeting_count" => false,
"google_api_key" => "",
- "suggest_change_url" => "",
+ "report_update_url" => "",
);
private $hasFilters = [
"has_days",
diff --git a/croutonjs/src/js/crouton-core.js b/croutonjs/src/js/crouton-core.js
index ecfe72b9..21b349df 100644
--- a/croutonjs/src/js/crouton-core.js
+++ b/croutonjs/src/js/crouton-core.js
@@ -89,7 +89,7 @@ function Crouton(config) {
force_timeformat_in_querystring: true, // Set to false to shorten generated meeting detail query strings
force_language_in_querystring: true, // Set to false to shorten generated meeting detail query strings
theme: "jack", // Allows for setting pre-packaged themes. Choices are listed here: https://github.com/bmlt-enabled/crouton/blob/master/croutonjs/dist/templates/themes
- suggest_change_url: "", // URL to edit a meeting for BMLT-workflow plugin
+ report_update_url: "", // URL to edit a meeting for BMLT-workflow plugin
meeting_data_template: croutonDefaultTemplates.meeting_data_template,
metadata_template: croutonDefaultTemplates.metadata_template,
observer_template: croutonDefaultTemplates.observer_template,
@@ -216,7 +216,7 @@ function Crouton(config) {
"parentServiceBodyType",
"map_word",
"share_word",
- "suggest_change_word",
+ "report_update_word",
"show_qrcode",
"formatted_day",
"formatted_address",
@@ -818,7 +818,7 @@ function Crouton(config) {
: "";
meetingData[m]['map_word'] = self.localization.getWord('map').toUpperCase();
meetingData[m]['share_word'] = self.localization.getWord('share').toUpperCase();
- meetingData[m]['suggest_change_word'] = self.localization.getWord('suggest change');
+ meetingData[m]['report_update_word'] = self.localization.getWord('report update');
meetingData[m]['show_qrcode'] = self.config['show_qrcode'];
for (var k in meetingData[m]) {
if (meetingData[m].hasOwnProperty(k) && typeof meetingData[m][k] === 'string') {
@@ -1505,11 +1505,11 @@ crouton_Handlebars.registerHelper('canShare', function(data, options) {
});
crouton_Handlebars.registerHelper('editEnabled', function(data, options) {
- return crouton.config.suggest_change_url !== "" ? getTrueResult(options, this) : getFalseResult(options, this)
+ return crouton.config.report_update_url !== "" ? getTrueResult(options, this) : getFalseResult(options, this)
});
crouton_Handlebars.registerHelper('editUrl', function() {
- return crouton.config.suggest_change_url;
+ return crouton.config.report_update_url;
});
/**
diff --git a/croutonjs/src/templates/meetings.hbs b/croutonjs/src/templates/meetings.hbs
index e8f2efa9..e366d1ad 100644
--- a/croutonjs/src/templates/meetings.hbs
+++ b/croutonjs/src/templates/meetings.hbs
@@ -52,7 +52,7 @@
{{this.share_word}}
{{/canShare}}
{{#editEnabled this}}
- {{this.suggest_change_word}}
+ {{this.report_update_word}}
{{/editEnabled}}
{{> offerIcsButton}}
diff --git a/partials/_instructions.php b/partials/_instructions.php
index b178588c..55b0f5cb 100644
--- a/partials/_instructions.php
+++ b/partials/_instructions.php
@@ -290,7 +290,7 @@
Suggest Change
-
You can set a short setting so that a button that says "Suggest Change" appears. When the button is clicked, it links back to a BMLT workflow page with that meeting.
-
[bmlt_tabs suggest_change_url="/edit-meeting"]
+
You can set a short setting so that a button that says "Report an Update" appears. When the button is clicked, it links back to a BMLT workflow page with that meeting.
+
[bmlt_tabs report_update_url="/edit-meeting"]
From b01a98a126c3a2d1795f7653a154912c12b9cc09 Mon Sep 17 00:00:00 2001
From: Danny Gershman
Date: Thu, 12 Sep 2024 09:03:07 -0400
Subject: [PATCH 3/5] more text changes
---
croutonjs/src/js/crouton-localization.js | 34 ++++++++++++------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/croutonjs/src/js/crouton-localization.js b/croutonjs/src/js/crouton-localization.js
index 554596c5..d5d96c87 100644
--- a/croutonjs/src/js/crouton-localization.js
+++ b/croutonjs/src/js/crouton-localization.js
@@ -55,7 +55,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Add to your calendar",
'meeting page': "صفحة الاجتماع",
'meeting details': "تفاصيل الاجتماع",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"da-DK": {
"days_of_the_week": ["", "Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"],
@@ -107,7 +107,7 @@ function CroutonLocalization(language) {
'visible meeting list': 'Visible meetings as list',
'enter a city or zip code': 'Enter a city or zip code',
'toggle fullscreen mode': 'Toggle fullscreen mode',
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"de-DE":{
"days_of_the_week": ["", "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
@@ -162,7 +162,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Zu Kalender hinzufügen",
'meeting page': "Meeting Seite",
'meeting details': "Genaueres zum Meeting",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"en-AU": {
"days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -216,7 +216,7 @@ function CroutonLocalization(language) {
'close': "Close",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"en-CA": {
"days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -271,7 +271,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"en-NZ": {
"days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -326,7 +326,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"en-UK": {
"days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -381,7 +381,7 @@ function CroutonLocalization(language) {
'close': "Close",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"en-US": {
"days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -436,7 +436,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"es-US": {
"days_of_the_week" : ["", "Domingo", " Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
@@ -491,7 +491,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"fa-IR": {
"days_of_the_week" : ["", 'یَکشَنب', 'دوشَنبه', 'سهشنبه', 'چهار شنبه', 'پَنج شَنبه', 'جُمعه', 'شَنبه'],
@@ -545,7 +545,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"fr-CA": {
"days_of_the_week" : ["", "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"],
@@ -600,7 +600,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Ajouter au calendrier",
"meeting page": "Page de la réunion",
"meeting details": "Détails de la réunion",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"it-IT": {
"days_of_the_week" : ["", "Domenica", " Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"],
@@ -655,7 +655,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Aggiungi al tuo calendario",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"nl-NL": {
"days_of_the_week" : ["", "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"],
@@ -710,7 +710,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"pl-PL": {
"days_of_the_week" : ["", "Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"],
@@ -765,7 +765,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"pt-BR": {
"days_of_the_week" : ["", "Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"],
@@ -820,7 +820,7 @@ function CroutonLocalization(language) {
'close': "Close",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"ru-RU": {
"days_of_the_week" : ["", "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"],
@@ -875,7 +875,7 @@ function CroutonLocalization(language) {
'close': "Закрыть",
'meeting page': "Страница собрания",
'meeting details': "Подробности собрания",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
},
"sv-SE": {
"days_of_the_week" : ["", "Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"],
@@ -930,7 +930,7 @@ function CroutonLocalization(language) {
"bmlt2ics": "Add to your calendar",
'meeting page': "Meeting Page",
'meeting details': "Meeting Details",
- 'suggest change': "Suggest Change",
+ 'report update': "Report an Update",
}
};
}
From 8905205fcff36a20d58e71d01b69b962a04df4c9 Mon Sep 17 00:00:00 2001
From: Danny Gershman
Date: Thu, 12 Sep 2024 09:03:56 -0400
Subject: [PATCH 4/5] change helpers
---
croutonjs/src/js/crouton-core.js | 4 ++--
croutonjs/src/templates/meetings.hbs | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/croutonjs/src/js/crouton-core.js b/croutonjs/src/js/crouton-core.js
index 21b349df..ff75d0ce 100644
--- a/croutonjs/src/js/crouton-core.js
+++ b/croutonjs/src/js/crouton-core.js
@@ -1504,11 +1504,11 @@ crouton_Handlebars.registerHelper('canShare', function(data, options) {
return navigator.share ? getTrueResult(options, this) : getFalseResult(options, this);
});
-crouton_Handlebars.registerHelper('editEnabled', function(data, options) {
+crouton_Handlebars.registerHelper('reportUpdateEnabled', function(data, options) {
return crouton.config.report_update_url !== "" ? getTrueResult(options, this) : getFalseResult(options, this)
});
-crouton_Handlebars.registerHelper('editUrl', function() {
+crouton_Handlebars.registerHelper('reportUpdateUrl', function() {
return crouton.config.report_update_url;
});
diff --git a/croutonjs/src/templates/meetings.hbs b/croutonjs/src/templates/meetings.hbs
index e366d1ad..853ea128 100644
--- a/croutonjs/src/templates/meetings.hbs
+++ b/croutonjs/src/templates/meetings.hbs
@@ -51,9 +51,9 @@
{{#canShare this}}
{{this.share_word}}
{{/canShare}}
- {{#editEnabled this}}
- {{this.report_update_word}}
- {{/editEnabled}}
+ {{#reportUpdateEnabled this}}
+ {{this.report_update_word}}
+ {{/reportUpdateEnabled}}
{{> offerIcsButton}}
From e90354c4c35d9906a26a6e3bd16fa0f0588b616e Mon Sep 17 00:00:00 2001
From: Danny Gershman
Date: Thu, 12 Sep 2024 09:26:53 -0400
Subject: [PATCH 5/5] adding isset for jsInFooter
---
crouton.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crouton.php b/crouton.php
index 8462a8a6..b05854bf 100644
--- a/crouton.php
+++ b/crouton.php
@@ -312,7 +312,7 @@ private function inlineScript($s)
}
private function outputScript($s)
{
- if ($this->options['jsInFooter']) {
+ if (isset($this->options['jsInFooter'])) {
wp_add_inline_script('croutonjs', $s);
$s = "";
}