Fort Worth Events


Fort Worth Events | Festivals, Music, Sporting Events highlights

    {{#items.slice(0,3)}}
  • {{:link.url}}{{/}} {{asset.alt_text}} {{title}} ]]>

{{:link.url}}{{/}} {{/}} 0) { return true; } return false; } function addToDropdown($this) { var $panel = $this.parents(“[data-sv-navDropdownWidget]”); var selectedNavItem = $panel.attr(“data-sv-nav-item”); var widgetHtml = $this.children(‘.slide-holder’).html(); var $beacon = $(“[data-nav-dropdown-widget-beacon='”+selectedNavItem+”‘]”); if ($beacon.length > 0) { $beacon.html(widgetHtml); } } }); highlights

    {{#items.slice(0,3)}}
  • {{:link.url}}{{/}} {{asset.alt_text}} {{title}} ]]>

{{:link.url}}{{/}} {{/}} 0) { return true; } return false; } function addToDropdown($this) { var $panel = $this.parents(“[data-sv-navDropdownWidget]”); var selectedNavItem = $panel.attr(“data-sv-nav-item”); var widgetHtml = $this.children(‘.slide-holder’).html(); var $beacon = $(“[data-nav-dropdown-widget-beacon='”+selectedNavItem+”‘]”); if ($beacon.length > 0) { $beacon.html(widgetHtml); } } }); highlights

    {{#items.slice(0,3)}}
  • {{:link.url}}{{/}} {{asset.alt_text}} {{title}} ]]>

{{:link.url}}{{/}} {{/}} 0) { return true; } return false; } function addToDropdown($this) { var $panel = $this.parents(“[data-sv-navDropdownWidget]”); var selectedNavItem = $panel.attr(“data-sv-nav-item”); var widgetHtml = $this.children(‘.slide-holder’).html(); var $beacon = $(“[data-nav-dropdown-widget-beacon='”+selectedNavItem+”‘]”); if ($beacon.length > 0) { $beacon.html(widgetHtml); } } }); highlights

    {{#items.slice(0,3)}}
  • {{:link.url}}{{/}} {{asset.alt_text}} {{title}} ]]>

{{:link.url}}{{/}} {{/}} 0) { return true; } return false; } function addToDropdown($this) { var $panel = $this.parents(“[data-sv-navDropdownWidget]”); var selectedNavItem = $panel.attr(“data-sv-nav-item”); var widgetHtml = $this.children(‘.slide-holder’).html(); var $beacon = $(“[data-nav-dropdown-widget-beacon='”+selectedNavItem+”‘]”); if ($beacon.length > 0) { $beacon.html(widgetHtml); } } }); {{/}} {{:*show_title}}

{{title}}

{{/}} {{/asset}} {{/items}}

Events This Week

  • placeholder

    May

    11

    ArtFlow!

    ArtFlow! ArtFlow!

    May 11, 2021 – Feb 03, 2022

  • placeholder

    May

    11

    Arts Fifth Avenue’s Spring 3rd Outdoor Walk-by Art Gallery

    Arts Fifth Avenue’s Spring 3rd… Arts Fifth Avenue’s Spring 3rd Outdoor Walk-by Art Gallery

    May 11, 2021 – May 16, 2021

  • placeholder

    May

    11

    Date Night is Back at Coyote Drive-In Theater!

    Date Night is Back at Coyote… Date Night is Back at Coyote Drive-In Theater!

    May 11, 2021 – May 11, 2021

  • placeholder

    May

    11

    Isamu Noguchi Digital Exhibit

    Isamu Noguchi Digital Exhibit Isamu Noguchi Digital Exhibit

    May 11, 2021 – May 29, 2021

  • placeholder

    May

    11

    Sean Kenney’s Nature Connects Made with LEGO® Bricks

    Sean Kenney’s Nature Connects Made… Sean Kenney’s Nature Connects Made with LEGO® Bricks

    May 11, 2021 – Aug 01, 2021

‘, nextArrow: ‘‘, slidesToScroll: 1, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 640, settings: { slidesToShow: 3, slidesToScroll: 1, vertical: true, verticalSwiping: true } } ] }); }); ]]> 1; helpers.var.nofilters = “No available filters”; helpers.var.showmore = “Show More”; helpers.var.template = “events_custom_event_list_filter”; helpers.var.today = helpers.plugins.clientMoment().format(“L”); helpers.var.weekFromToday = helpers.plugins.clientMoment().add(6, “days”).format(“L”); helpers.var.monthFromToday = helpers.plugins.clientMoment().add(1, “months”).format(“L”); helpers.var.weekendFri = helpers.plugins.clientMoment().day(5).format(“l”); helpers.var.weekendSun = helpers.plugins.clientMoment().day(7).format(“l”); })}} ]]> 1 && data.recurrence == 0) { helpers.var.formattedDate = startDate.format(‘MMM. DD’); } else if (data.recurType > 1 && data.recurrence != undefined) { helpers.var.formattedDate = data.recurrence + (endDate !== undefined ? ” until ” + endDate.format(‘MMM. DD YYYY’) : “”); } })}} {{~setVar(“placeholder”, helpers.plugins.cloudinary.createResource({ imageUrl : helpers.plugins.sv_site.siteConfig.custom.placeholderImageUrl }) )}} {{~setVar(‘image_settings’, { height : 251, width : 380, crop : ‘fill’, quality : 50 })}} {{~setVar(“template”, “events_custom_event_list_item”)}} {{:featured}}Sponsored]]>{{/featured}} {{:distance}}

{{distance.format({ unit : “miles” })}} Miles From You

{{/distance}}

{{~var.formattedDate}}

{{:%location}} {{:latitude}}

{{%location}}

{{/}} {{?}} {{/}} {{:showtickets}}{{:udfs_object.2070}}

{{udfs_object.2070.name}}

{{/}}{{/}}
Details
{{:~plugins.sv_site.siteConfig.plugins.tripbuilder.active}}{{/}}

  • Results:
  • {{startRow}} – {{currentPageLastRow}} of {{totalRows}}
  • -1)}} {{+dmLinkTracking}} data-gtm-click data-gtm-vars='{“tClient”: {}}’ {{/}} {{+nearbyTracking}} data-gtm-click data-gtm-vars='{“tClient”: {“eventAction”: “What's Nearby”, “lt”: “Map Explorer”}}’ {{/}} {{/}} {{:~equal(data.type, “Listing”)}} {{+dmBaseTracking}} data-gtm-vars='{“tClient” : { “eventCategory”: “Listings”, “eventAction”: “Link to Detail”, “eventLabel” : “{{%%title}}”, “vt”: “InfoWindow”, “recId” : “{{recid}}”, “et” : “{{%%title}}”, “dtn” : “{{:isDTN}}DTN{{/isDTN}}”, “crmc” : “{{%%catname}}”, “crmsc” : “{{%%subcatname}}”, “ua” : “Click” }}’ {{/}} {{?:~equal(data.type, “Event”)}} {{+dmBaseTracking}} data-gtm-vars='{“tClient”: { “eventCategory”: “Events”, “eventLabel”: “{{:listing}}{{%%listing.title}} | {{/listing}}{{%%title}}”, “eventAction”: “Link to Detail”, “et”: “{{%%title}}”, “ua”: “Click”, “vt”: “InfoWindow”, “lt” : “Detail” }}’ {{/}} {{?:~equal(data.type, “Offer”)}} {{+dmBaseTracking}} data-gtm-vars='{“tClient”: { “eventCategory”: “Coupons”, “eventLabel”: “{{:listings}}{{%%listings.0.title}} | {{/listings}}{{%%title}}”, “eventAction”: “Link to Detail”, “et”: “{{%%title}}”, “ua”: “Click”, “vt”: “InfoWindow”, “lt” : “Detail” }}’ {{/}} {{/}} dmBaseTracking}}>

    {{:url}}dmLinkTracking}}>{{/}} {{title}} {{:url}}{{/}}

    {{:isEvents}} {{:nextDate}} {{~plugins.clientMoment(data.nextDate).format(‘MMM’)}} {{~plugins.clientMoment(data.nextDate).format(‘DD’)}} {{?:startDate}} {{~plugins.clientMoment(data.startDate).format(‘MMM’)}} {{~plugins.clientMoment(data.startDate).format(‘DD’)}} {{/}} {{?:isOffers}} {{:redeemstart}} {{~plugins.clientMoment(data.redeemstartMoment).format(‘MMM’)}} {{~plugins.clientMoment(data.redeemstartMoment).format(‘DD’)}} {{/}} {{/}}

    {{title}} {{:distance}}

    {{distance.format({ unit : “miles” })}} Miles From You {{/distance}} {{:isOffers}} {{:listings}} {{#listings.0}}

    {{company}} {{/}} {{/}} {{?}}

    {{~var.addressLine}} {{/}} {{/}} {{/}}]]>

    Prev {{date.format(“LL”)}}{{/date}} {{~setVar(‘previousDate’, data.date)}} {{/}} {{/date}} {{!~equal(-data.sort,”name”)}} {{!~equal(data.typeName,helpers.var.previousTypeName)}}

    {{typeName}} {{~setVar(‘previousTypeName’, data.typeName)}} {{/}} {{/}} {{>event_list_item}} {{/data}} {{?}}

    No events were found. {{/data}} ]]>

    listMapItem}} {{/}} {{?}}

    There are no listings that match your query. {{/}} ]]>

    ‘, removeButtonTemplate : ‘View Trip ‘ }); tripbuilder.events.on(“updateButton”, function() { gtm.update(); }); } if (validSorts.indexOf(querySortFallback) === -1 || validSorts.indexOf(fallbackSort) === -1) { throw new Error(“defaultSort or fallbackSort is not in the validSorts array”); } var validQueryVars = [“skip”, “categoryid”, “startDate”, “endDate”, “keyword”, “sort”]; // query variables that we allow var queryFields = { categories : 1, endDate : 1, featured : 1, host_id : 1, “host.recid” : 1, “host.title” : 1, “host.detailURL” : 1, latitude : 1, listing_id : 1, “listing.recid” : 1, “listing.title” : 1, “listing.detailURL” : 1, “listing.address1” : 1, address1 : 1, location : 1, longitude : 1, media_raw : 1, nextDate : 1, rank : 1, recId : 1, recid : 1, recurType : 1, recurrence : 1, startDate : 1, title : 1, typeName : 1, loc : 1, url : 1, date : 1, zip : 1, city : 1, state : 1, “udfs_object.2070” : 1 } var today = moment().format(“L”); var weekendFri = moment().day(5).format(“l”); var weekendSun = moment().day(7).format(“l”); var weekFromToday = moment().add(6, “days”).format(“L”); var monthFromToday = moment().add(1, “months”).format(“L”); var day = { startDate : today, endDate : today }; var week = { startDate : today, endDate : weekFromToday }; var weekend = { startDate : weekendFri, endDate : weekendSun }; var month = { startDate : today, endDate : monthFromToday }; var gtmSendFieldEvent = function(filter, input) { var gtmBase = gtm.getVars({ node : root }); var val = input.val(); if (!val) { return; } var valArray = val instanceof Array ? val : [val]; var valString = valArray.join(“,”); // extract the labels from the options, if we’re using keyword just use the original value, separates with | because “,” can occur in subcat/region names var labelString = filter === “keyword” ? val : valArray.map(function(val) { return input.find(‘option[value=”‘ + val + ‘”]’).text().trim() }).join(“|”); gtm.sendEvents($.extend(true, {}, gtmBase, { tCore : { action : “events_widget_layout_list_filter_change_” + filter, label : labelString, filter : valString }, tClient : { eventAction : “Filter Change”, eventLabel : labelString + ” | ” + filter } })); } var init = function() { query = { startDate : moment().format(queryDateFormat), endDate : moment().add(1, “years”).format(queryDateFormat), categoryid : “”, keyword : “”, sort : moduleData.defaultSort } if (weekendDate) { query.startDate = weekendFri; query.endDate = weekendSun; } else if (moduleData.defaultRange == “day”) { query.endDate = today; } else if (moduleData.defaultRange == “month”) { query.endDate = monthFromToday; } else { query.endDate = weekFromToday; } if (moduleData.defaultRange == “custom”) { if (moduleData.from_date !== undefined) { query.startDate = moment(moduleData.from_date).format(“L”); } if (moduleData.to_date !== undefined) { query.endDate = moment(moduleData.to_date).format(“L”); } } root.find(‘.txt_daterange_calendar’).each(function(){ if (clientLib.inPreview() === false && !objectLib.isEmpty(urlLib.parse(window.location.toString()).get)) { query = urlLib.parse(window.location.toString()).get; } var startDate = moment(query.startDate).format(queryDateFormat); var endDate = moment(query.endDate).format(queryDateFormat); var parent = $(this).parent(); var cnt = parent.find(‘.daterange_calendar’); datepicker = $(this).dateRangePicker({ inline: true, format: queryDateFormat, alwaysOpen:true, container: cnt, startDate: today, singleMonth: true, showTopbar: false, showShortcuts: false, hoveringTooltip: false, customArrowPrevSymbol: ‘‘, customArrowNextSymbol: ‘‘ }); datepicker.data(‘dateRangePicker’).setDateRange(query.startDate, query.endDate, true); datepicker.bind(‘datepicker-first-date-selected’, function(event, obj){ query.startDate = moment(obj.date1).format(queryDateFormat); query.endDate = moment(obj.date1).format(queryDateFormat); var gtmBase = gtm.getVars({ node : root }); gtm.sendEvents($.extend(true, {}, { tCore : gtmBase.tCore }, { tCore : { action : “events_widget_layout_list_filter_change_daterangepicker”, label : “First Selection” }, tClient: {eventCategory: “Events”, eventAction: “Filter Change”, eventLabel: “First Selection | Date”}})); }); datepicker.bind(‘datepicker-change’, function(event, obj){ query = urlLib.parse(window.location.toString()).get; query.startDate = moment(obj.date1).format(queryDateFormat); query.endDate = moment(obj.date2).format(queryDateFormat); runSearchQuery({ query : query }); renderCal(query); var gtmBase = gtm.getVars({ node : root }); gtm.sendEvents($.extend(true, {}, { tCore : gtmBase.tCore }, { tCore : { action : “events_widget_layout_list_filter_change_daterangepicker”, label : “Last Selection” }, tClient: {eventCategory: “Events”, eventAction: “Filter Change”, eventLabel: “Last Selection | Date”}})); }); }); var tooltips = root.find(‘[data-tooltip]’); tooltips.removeAttr(‘data-tooltip’); var startDate = root.find(“[data-sv-startDate]”); var endDate = root.find(“[data-sv-endDate]”); startDate.datepicker({ minDate : 0, onSelect : function(dateText) { var start = moment(new Date(dateText)); var end = moment(endDate.datepicker(“getDate”)); query = urlLib.parse(window.location.toString()).get; query.startDate = start.format(“MM/DD/YYYY”); query.endDate = end.format(“MM/DD/YYYY”); if (start.isAfter(end)) { endDate.datepicker(“setDate”, start.toDate()); query.endDate = start.format(“MM/DD/YYYY”); } runSearchQuery({ query : query }); renderCal(query); root.find(“[data-sv-timeWindow] a”).removeClass(“active”); var gtmBase = gtm.getVars({ node : root }); gtm.sendEvents($.extend(true, {}, { tCore : gtmBase.tCore }, { tCore : { action : “events_widget_layout_list_filter_change_datepicker”, label : “startDate” }, tClient: {eventCategory: “Events”, eventAction: “Filter Change”, eventLabel: “Start Date | Date”}})); } }); endDate.datepicker({ minDate : 0, onSelect : function(dateText) { var start = moment(startDate.datepicker(“getDate”)); var end = moment(new Date(dateText)); query = urlLib.parse(window.location.toString()).get; query.startDate = start.format(“MM/DD/YYYY”); query.endDate = end.format(“MM/DD/YYYY”); if (end.isBefore(start)) { startDate.datepicker(“setDate”, end.toDate()); query.startDate = end.format(“MM/DD/YYYY”); } runSearchQuery({ query : query }); renderCal(query); root.find(“[data-sv-timeWindow] a”).removeClass(“active”); var gtmBase = gtm.getVars({ node : root }); gtm.sendEvents($.extend(true, {}, { tCore : gtmBase.tCore }, { tCore : { action : “events_widget_layout_list_filter_change_datepicker”, label : “endDate” }, tClient: {eventCategory: “Events”, eventAction: “Filter Change”, eventLabel: “End Date | Date”}})); } }); // begin: Google Maps logic mapObj.init({ node : root, scrollSpeed: scrollSpeed, listingsPro : true, hasQV : true, map : { markerIcon : ‘/includes/public/assets/shared/map_point.png’, gestureHandling: ‘cooperative’, scrollwheel: false, mapOptions: { mapTypeControl: false } } }); mapObj.initListInterface(“events”); mapObj.renderMap(); // end: Google Maps logic // begin: GTM tracking var gtmBase = gtm.getVars({ node : root }); var scrollFn = lodash.debounce(function() { var top = root.find(“[data-sv-items]”).offset().top; var inRange = $(window).scrollTop() + $(window).height() > top; if (inRange) { $(window).off(“scroll”, scrollFn); gtm.sendEvents($.extend(true, {}, gtmBase, { tCore : { action : “events_widget_layout_list_scroll_into_view”, value : top, nonInteractiveHit : true }, tClient: { eventAction : “Scroll Into View”, eventLabel : “Widget – Events”, nonInteraction : true, eventValue : top } })); } }, 250); $(window).on(“scroll”, scrollFn); [“categoryid”, “keyword”].forEach(function(filter, i) { root.find(“[name=” + filter + “]”).change(function() { var input = $(this); var val = input.val(); if (!val) { return; } // catches undefined, null or “” since that applies to most field types (select, multieselect, text) var valArray = val instanceof Array ? val : [val]; var valString = valArray.join(“,”); // extract the labels from the options, if we’re using keyword just use the original value, separates with | because “,” can occur in subcat/region names var labelString = filter === “keyword” ? val : valArray.map(function(val) { return input.find(‘option[value=”‘ + val + ‘”]’).text().trim() }).join(“|”); gtm.sendEvents($.extend(true, {}, gtmBase, { tCore : { action : “events_widget_layout_list_filter_change_” + filter, label : labelString, filter : valString }, tClient : { eventCategory: “Events”, eventAction : “Filter Change”, eventLabel : labelString + ” | ” + filter } })); }); }); root.on(“submit”, “[data-sv-filters] form”, function(e) { e.preventDefault(); var query = clientLib.formToObject($(this)); if(query.startDate != undefined){ query.startDate.splice(1,1); } if(query.endDate != undefined){ query.endDate.splice(1,1); } // certain form inputs like select and multi-select and checkbox pass as an array // so we want to convert those to comma separated lists for shorter query strings and easy of use downstream Object.keys(query).forEach(function(val, i) { if (query[val] instanceof Array) { query[val] = query[val].join(“,”) } }); runSearchQuery({ query : query }); $(‘html, body’).animate({ scrollTop: $(root).offset().top }, 300); }) root.on(“click”, “[data-query-link]”, function(e) { e.preventDefault(); if ($(this).hasClass(“disabled”)) { return; } var query = urlLib.parse($(this).attr(“href”)).get; runSearchQuery({ query : query }); renderCal(query); }); root.on(“click”, “.pagingContainerFooter [data-query-link]”, function() { // enable scroll to top for the bottom pager only $(“html, body”).animate({ scrollTop: root.offset().top }, scrollSpeed); }); if (window.location.search.length > 0 && clientLib.inPreview() === false) { query = $.extend(query, urlLib.parse(window.location.toString()).get); } if (history.pushState) { history.replaceState(query, “”, window.location.href); window.onpopstate = function(e) { // older safari and iOS browsers call window.onpopstate on page load without a state, even though it’s declared the line above due to bugs so we bail if that happens if (e.state === null) { return; } runSearchQuery({ query : e.state, push : false }); } } setLayoutByView(defaultLayout); runSearchQuery({ query : query, push : false }); geolocationLib.getGeolocationPosition({ checkRange : { latitude : geoSettings.clientLat, longitude : geoSettings.clientLong, maxRangeMiles : geoSettings.maxRangeMiles } }, function(err, result) { if (err) { throw err; } if (result.inRange === false) { return; } root.find(“.distanceSort”).css({“visibility” : “visible”}); root.find(‘[data-sv-distanceSort]’).css({“opacity” : 1, “pointer-events”: “all”}); // user is in range, set the geoResult and re-search. // TODO: move the sort template out of the result set template this way we don’t have to re-perform the search to re-render the sorting template // that action should only take place if the defaultSort was distance geoResult = result; // if the original sort was meant to be distance, then lets re-run the search if (query.sort !== “distance”) { return; } runSearchQuery({ query : query, push : false }); }); } var renderCal = function(query){ root.find(‘.txt_daterange_calendar’).each(function(){ $(this).data(‘dateRangePicker’).setDateRange(query.startDate, query.endDate, true); }); } var buildUrl = function(state, delta) { var queryVars = $.extend({}, state, delta); queryVars = lodash.pick(queryVars, validQueryVars); $.each(queryVars, function(i, val) { if (val === “”) { delete queryVars[i]; } }); return urlLib.build({ get : queryVars }); } // defines a getter to ease translating comma separated strings to integer arrays since they are used in multiple places var define_stringToNumberArray = function(state, prop) { Object.defineProperty(state, prop + “_array”, { get : function() { return this[prop] !== undefined ? this[prop].split(“,”).map(function(val) { return parseInt(val) }) : [] } }); } // defines a getter to ease translating comma separated string to array of strings var define_stringToArray = function(state, prop) { Object.defineProperty(state, prop + “_array”, { get : function() { return this[prop] !== undefined ? this[prop].split(“,”) : [] } }); } var runSearchQuery = function(args) { args.query = args.query || {}; args.push = args.push !== undefined ? args.push : true; $.each(args.query, function(i, val) { if (val !== undefined && typeof val !== “string”) { // URL variables inherently only support strings, so we enforce that args.query is the same structure is only strings using comma separated instead of array // If you are hitting this thrown error it means you are likely calling this function improperly, or passing something bogus to it console.log(“query”, args.query); // intentional console.log, left to help debug when you hit this throw due to developer error throw new Error(“Invalid data type, runSearchQuery only accepts an object of key value strings, or arrays of strings, as that’s all URLs support”) } if (val === “”) { delete args.query[i]; } }); var flow = new asyncLib.Flow(); flow.series({ state : function(cb) { var state = $.extend(true, {}, args.query); state = lodash.pick(state, validQueryVars); // whitelist args if (history.pushState && args.push) { history.pushState(state, “”, urlLib.build({ get : state })) } state.limit = limit; state.skip = parseInt(state.skip) || 0; state.sort = state.sort || querySortFallback; if (state.sort === “distance” && geoResult === undefined) { state.sort = fallbackSort; } state.sort = validSorts.indexOf(state.sort) > -1 ? state.sort : defaultSort; define_stringToArray(state, “categoryid”); cb(null, state); }, filter : function(cb) { var filter = { solrOptions : {} }; if (flow.data.state.keyword !== undefined) { filter.solrOptions.keyword = flow.data.state.keyword; } var cats = flow.data.state.categoryid_array.length === 0 ? validCats.map(function(val) { return val.value; }) : flow.data.state.categoryid_array; filter[“categories.catId”] = { $in : [].concat(cats) } cb(null, filter); }, data : function(cb) { // declare query options var options = { skip : flow.data.state.skip, limit : flow.data.state.limit, hooks : [“afterFind_listing”, “afterFind_host”], sort : {}, fields : queryFields, count : true, }; var method = “/includes/rest_v2/plugins_events_events/find/” var sdate = clientMoment(moment(flow.data.state.startDate + ” UTC”)); sdate.add(sdate.utcOffset()*-1,”m”); var edate = clientMoment(moment(flow.data.state.endDate + ” UTC”)).add(1,”d”).subtract(1,”s”); edate.add(edate.utcOffset()*-1,”m”); // handle sorting behaviors if (flow.data.state.sort === “distance”) { flow.data.filter.solrOptions.sort = “distance”; flow.data.filter.solrOptions.point = [geoResult.latitude, geoResult.longitude].join(“,”); flow.data.filter.solrOptions.radius = site.siteConfig.maxRangeMiles.toString(); flow.data.filter[“dates.eventDate”] = { $gte : {“$date” : sdate.format()}, $lte : {“$date” : edate.format()}}; } else if (flow.data.state.sort === “date”) { options.sort.date = 1; options.sort.rank = 1; options.sort.title = 1; flow.data.filter[“dates.eventDate”] = { $gte : {“$date” : sdate.format()}, $lte : {“$date” : edate.format()}}; method = “/includes/rest_v2/plugins_events_events_by_date/find/” } else if (flow.data.state.sort === “title”) { options.sort.rank = 1; options.sort.title = 1; flow.data.filter.dates = { $elemMatch : { eventDate : { $gte : { $date : clientMoment(flow.data.state.startDate, queryDateFormat).toISOString() }, $lte : { $date : clientMoment(flow.data.state.endDate, queryDateFormat).add(1, “day”).subtract(1, “second”).toISOString() } } } } } if (xhr) { xhr.abort(); } xhr = $.get(method, { json : JSON.stringify({ filter : flow.data.filter, options : options }), token : core.simpleToken }); xhr.done(function(res) { var count = res.docs.count; var data = res.docs.docs; cb(null, { data : data, count : count }); }).fail(function(err, type, message) { if (type === “abort”) { return flow.halt(cb); } // another request has aborted this one, so halt this flow return cb(new Error(message)); }); }, keywordRecids : function(cb) { if (flow.data.state.keyword === undefined) { return cb(null); } var filter = { solrOptions : flow.data.filter.solrOptions }; var options = { fields : { recid : 1, _id : 0 }, count : false }; xhr = $.get(“/includes/rest_v2/plugins_events_events/find/”, { json : JSON.stringify({ filter : filter, options : options }), token : core.simpleToken }); xhr.done(function(res) { var recids = res.docs.map(function(val) { return val.recid; }); cb(null, recids); }).fail(function(err, type, message) { if (type === “abort”) { return flow.halt(cb); } // another request has aborted this one, so halt this flow return cb(new Error(message)); }); }, filterCount : function(cb) { var filter; var filterOriginal = $.extend({}, flow.data.filter); delete filterOriginal[“solrOptions”]; // solrOptions doesn’t work w/ aggregates // pull in location matches into faceted aggregates if (flow.data.state.sort === “distance”) { filterOriginal[“loc”] = { $exists : true }; } // Pull in keyword matches into faceted aggregates if (flow.data.keywordRecids !== undefined) { filterOriginal[“recid”] = { $in : flow.data.keywordRecids }; } // Regions // var facetRegions = [ // { $group : { _id : “$udfs_object.10.value_raw.listid”, count : { $sum : 1 } } } // ]; // filter = $.extend({}, filterOriginal); // delete filter[“udfs_object.10.value_raw.listid”]; // facetRegions.unshift({ $match : filter }) // Subcats var facetSubcats = [ { $project : { categories : 1 } }, { $unwind : “$categories” }, { $group : { _id : “$categories.catId”, count : { $sum : 1 } } } ]; filter = $.extend({}, filterOriginal); delete filter[“categories.catId”] facetSubcats.unshift({ $match : filter }) var filterFlow = new asyncLib.Flow(); filterFlow.series({ // regionCount : function(cb) { // xhr = $.get(“/includes/rest_v2/plugins_events_events/aggregate/”, { json : JSON.stringify({ pipeline : facetRegions }), token : core.simpleToken }); // xhr.done(function(res) { // cb(null, arrayLib.index(res.docs, “_id”)); // }).fail(function(err, type, message) { // return cb(new Error(message)); // }); // }, subcatsCount : function(cb) { xhr = $.get(“/includes/rest_v2/plugins_events_events/aggregate/”, { json : JSON.stringify({ pipeline : facetSubcats }), token : core.simpleToken }); xhr.done(function(res) { cb(null, arrayLib.index(res.docs, “_id”)); }).fail(function(err, type, message) { return cb(new Error(message)); }); } }, cb); }, render : function(cb) { var data = flow.data.data.data; // using flow.data.data, render pager, items, update map var pager = new Pager({ totalRows : flow.data.data.count, perPage : flow.data.state.limit, startIndex : flow.data.state.skip }); var placemarks = []; var eventIds = []; data.forEach(function(val, i) { val.globalRow = flow.data.state.skip + i + 1; //strip HTML from descriptions val.description = stringLib.stripHtml(val.description); val.showtickets = showtickets; // Set date values val.startDate = clientMoment(val.startDate); if (val.endDate) val.endDate = clientMoment(val.endDate); if (val.date) val.date = clientMoment(val.date); if (val.nextDate) val.nextDate = clientMoment(val.nextDate); // Create image resources var raw = val._media || val.media_raw; if (raw) { val.media = raw.map(function(media) { return cloudinaryLib.default.createResource({ imageUrl : media.mediaurl }); }); } if (val.nextDate !== undefined) { val.nextDate = moment(val.nextDate); } if (flow.data.state.sort === “distance” && val.loc !== undefined) { val.distance = new geodist({ start : { lat : val.latitude, lon : val.longitude }, end : { lat : geoResult.latitude, lon : geoResult.longitude } }); } }); var filterCount = flow.data.filterCount; var filterSortCount = function(parent, args) { // parent [DOM Element] // args.countObj [Object] // args.count [bool] // args.sort [bool] var items = parent.find(“li”); var hasCount = 0; if (args.count === true) { items.each(function(i, val) { var input = $(val).find(“input”); var countIndex = args.countObj[input.val()]; if (countIndex !== undefined) { input.removeClass(“disabled”); input.data(“count”, countIndex.count); input.next(“label”).find(“.filter-count”).text(“(“+countIndex.count+”)”); hasCount++; } else{ input.addClass(“disabled”); input.data(“count”, 0); input.next(“label”).find(“.filter-count”).text(“(“+0+”)”); } }) } if (args.sort === true) { items.sort(function(a, b) { if ($(b).hasClass(“showmore”) || $(b).hasClass(“nofilters”)) { // ensures showmore and nofilters at end return -1; } var count_a = $(a).find(“input”).data(“count”); var count_b = $(b).find(“input”).data(“count”); if (count_a === count_b) { var alpha_a = $(a).find(“label”).text().toLowerCase(); var alpha_b = $(b).find(“label”).text().toLowerCase(); return alpha_a === alpha_b ? 0 : alpha_a count_b ? -1 : 1 } }); } parent.html(items); if (hasCount > 5) { parent.find(“.showmore”).show(); parent.find(“.nofilters”).hide(); } else if (hasCount === 0) { parent.find(“.showmore”).hide(); parent.find(“.nofilters”).show(); } else { parent.find(“.showmore”).hide(); parent.find(“.nofilters”).hide(); } } // There are 2 filterContainers (1 for desktop + 1 for mobile) – loop over both and apply sort/count filterContainer.each(function(i, val) { // Regions // filterSortCount($(filterContainer[i]).find(“input[type=checkbox][name=regionids]”).parent().parent(), { countObj : filterCount.regionCount, count : true, sort : true }); // Subcats filterSortCount($(filterContainer[i]).find(“input[type=checkbox][name=categoryid]”).parent().parent(), { countObj : filterCount.subcatsCount, count : true, sort : true }); }); var formData = { startDate : flow.data.state.startDate, endDate : flow.data.state.endDate, keyword : flow.data.state.keyword, categories : validCats } var html = goatee.fill(mainTemplate, { data : data, formData : formData, pager : pager }, { event_list_item : eventItemTemplate }); var mapListHTML = goatee.fill(mapMainTemplate, { data : data }, { listMapItem : listMapItem }); var pagerHtml = goatee.fill(pagerTemplate, {pager : pager }); var pageMapHTML = goatee.fill(pagerMapTemplate, { pager : pager }); var pageMapCounterHtml = goatee.fill(pagerMapCounterTemplate, { pager : pager }); root.find(“[data-sv-items]”).html(html); root.find(“[data-sv-pager]”).html(pagerHtml); root.find(“[data-sv-map-items]”).html(mapListHTML); root.find(“[data-sv-map-pager]”).html(pageMapHTML); root.find(“[data-sv-map-items-counter]”).html(pageMapCounterHtml); [“categoryid”].forEach(function(val, i) { root.find(“[name='” + val + “‘]”).prop(“checked”, function() { return flow.data.state[val + “_array”].indexOf($(this).attr(“value”)) > -1; }); }); [“sort”, “keyword”, “startDate”, “endDate”].forEach(function(val, i) { filterContainer.find(“[name=” + val + “]”).val(flow.data.state[val]); }); if(root.find(“[data-sv-eventPrint]”).attr(“href”) == undefined) { handlePrint({ query : query }); } // update the query-links with new hrefs and selected class root.find(“[data-query-link]”).each(function(i, val) { var settingString = $(this).attr(“data-query-link”); try { var args = JSON.parse(settingString); } catch (e) { console.log(“Unable to parse”, settingString); return; } args.delta = args.delta || {}; args.selectedIgnore = args.selectedIgnore || []; var deltaUrl = buildUrl(flow.data.state, args.delta); var skipUrl = urlLib.blacklistQuery(deltaUrl, args.selectedIgnore); var currentUrl = urlLib.blacklistQuery(buildUrl(flow.data.state, {}), args.selectedIgnore); $(this).attr(“href”, deltaUrl); $(this).toggleClass(“selected”, skipUrl === currentUrl); }); $.each(flow.data.data.data, function(i,v) { if (v.latitude && v.longitude && eventIds.indexOf(v.recId) === -1) { eventIds.push(v.recId); placemarks.push({ id : “event_” + v.recId, recid : v.recId, type : ‘event’, marker : { position : [v.latitude, v.longitude] }, infoWindow : { content : goatee.fill(infoWindowTmpl, { type: “Event”, title : v.title, url : v.url, location : v.location || miscLib.varLookup(event, “listing.title”), locationUrl : miscLib.varLookup(event, “listing.url”), address1 : v.address1 || miscLib.varLookup(event, “listing.address1”), listing: v.listing }) }, maxWidth : 300 }); } }); mapObj.setPlacemarks(placemarks); // tripbuilder if (tripbuilder !== undefined) { tripbuilder.updateButtons(root); } gtm.trackMapMarkers(root.find(“.gMapContainer”), function(gtmVars){ gtmVars.tClient[‘eventCategory’] = “Events”; gtm.sendEvents(gtmVars); }); // process gtmLib tagged items that may have been added to the DOM gtm.update(); cb(null); }, renderfilterHeight : function(cb) { filterHeight = root.find(‘[data-sv-content-height]’).innerHeight(); setFilterHeight(filterHeight); cb(null); } }, function(err) { if (err) { throw err; } }); } root.find(‘a[data-sv-viewby]’).click(function(e) { e.preventDefault(); setLayoutByView($(this).attr(‘data-sv-viewby’)); }); function setLayoutByView(viewby) { var layout = $(‘[data-sv-layout]’); $(‘a[data-sv-viewby].active’).removeClass(‘active’); $(‘a[data-sv-viewby=”‘ + viewby + ‘”]’).toggleClass(‘active’); layout.removeClass(‘layout-grid’) .removeClass(‘layout-list’) .removeClass(‘layout-map’); layout.addClass(‘layout-‘ + viewby); // specific display settings for list view if (viewby === “list”) { root.find(‘[data-sv-items-wrapper]’).removeClass(‘hide’); root.find(‘[data-sv-pager]’).removeClass(‘hide’); root.find(‘[data-sv-desktop-pager]’).css({‘width’ : ‘auto’ }); filterHeight = root.find(‘[data-sv-content-height]’).innerHeight(); setFilterHeight(filterHeight); } // specific display settings for grid view if (viewby === “grid”) { root.find(‘[data-sv-items-wrapper]’).removeClass(‘hide’); root.find(‘[data-sv-pager]’).removeClass(‘hide’); root.find(‘[data-sv-desktop-pager]’).css({‘width’ : ‘auto’ }); filterHeight = root.find(‘[data-sv-content-height]’).innerHeight(); setFilterHeight(filterHeight); } // specific display settings for map view if (viewby === “map”) { mapObj.setState({ open : true }); root.find(‘[data-sv-desktop-pager]’).css({‘width’ : 280 + ‘px’ }); root.find(‘[data-sv-items-wrapper]’).addClass(‘hide’); root.find(‘[data-sv-pager]’).addClass(‘hide’); } filterHeight = root.find(‘[data-sv-content-height]’).innerHeight(); setFilterHeight(filterHeight); } root.on(‘click’, ‘[data-sv-open-map]’, function(e) { e.preventDefault(); var layout = $(‘[data-sv-layout]’); $(‘a[data-sv-viewby].active’).removeClass(‘active’); $(‘a[data-sv-viewby=”map”]’).toggleClass(‘active’); layout.removeClass(‘layout-grid’) .removeClass(‘layout-list’) .removeClass(‘layout-map’); layout.addClass(‘layout-map’); root.find(‘[data-sv-items-wrapper]’).addClass(‘hide’); root.find(‘[data-sv-pager]’).addClass(‘hide’); }); var setFilterHeight = function(filterHeight){ if(filterHeight 768){ filterContainer.css({“height” : 840 + ‘px’}); } else { filterContainer.css({“height” : filterHeight}); } } var toggleOverlay = function() { var overylay = $(‘[data-sv-listings-overlay]’); if (overylay.hasClass(‘active’)) { overylay.removeClass(‘active’); $(‘[data-sv-mobile-options]’).find(‘li.active’).removeClass(‘active’); } else { overylay.addClass(‘active’); } }; var closeMobileMenus = function() { var w_width = $(window).width(); $(‘[data-sv-mobile-options]’).find(‘li.active’).siblings().removeClass(‘active’); if (w_width 1) { responsive.push({ breakpoint: 641, settings: { slidesToShow: 1, slidesToScroll: 1 } }); } if (slidesToShow > 2) { responsive.push({ breakpoint: 1024, settings: { slidesToShow: 2, slidesToScroll: 2, } }); } root.find(“.slides”).slick({ prevArrow : root.find(“.prevSlide”), nextArrow : root.find(“.nextSlide”), slide : “.slide”, draggable : false, slidesToShow : slidesToShow, slidesToScroll : slidesToShow, responsive: responsive }); }); ]]> 1) { responsive.push({ breakpoint: 641, settings: { slidesToShow: 1, slidesToScroll: 1 } }); } if (slidesToShow > 2) { responsive.push({ breakpoint: 1024, settings: { slidesToShow: 2, slidesToScroll: 2, } }); } root.find(“.slides”).slick({ prevArrow : root.find(“.prevSlide”), nextArrow : root.find(“.nextSlide”), slide : “.slide”, draggable : false, slidesToShow : slidesToShow, slidesToScroll : slidesToShow, responsive: responsive }); }); ]]>

    Source

    Leave a Reply

    Your email address will not be published. Required fields are marked *