From 35a84e9e45d124b298d4298593a90fc201b0dcda Mon Sep 17 00:00:00 2001 From: Nikolai Kristiansen Date: Sun, 4 May 2014 18:00:42 +0200 Subject: [PATCH] Only display events with event_type "teater" --- wp-content/themes/tn-2014/footer.php | 2 +- wp-content/themes/tn-2014/js/app.js | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/wp-content/themes/tn-2014/footer.php b/wp-content/themes/tn-2014/footer.php index 7a43c0f..5fda299 100644 --- a/wp-content/themes/tn-2014/footer.php +++ b/wp-content/themes/tn-2014/footer.php @@ -14,7 +14,7 @@
-
Teater Neuf, en del av Det Norske Studentersamfund +
Teater Neuf er en del av Det Norske Studentersamfund
diff --git a/wp-content/themes/tn-2014/js/app.js b/wp-content/themes/tn-2014/js/app.js index c44eca7..1a4767a 100644 --- a/wp-content/themes/tn-2014/js/app.js +++ b/wp-content/themes/tn-2014/js/app.js @@ -1,15 +1,6 @@ -var program_endpoint = "https://studentersamfundet.no/api/get_type_event/"; -var custom_fields = [ - "_neuf_events_starttime", - "_neuf_events_endtime", - "_neuf_events_price_regular", - "_neuf_events_price_member"]; +var program_endpoint = "https://studentersamfundet.no/api/events/get_upcoming/"; var query_params = { - json: '1', - post_type: 'event', - type: 'teater', // TODO not implemented - order_by: '_neuf_events_starttime', - custom_fields: custom_fields.join() + event_type: 'teater' }; function format_posts(posts) { @@ -24,7 +15,7 @@ function format_posts(posts) { html += '
'; } html += ''+ moment.unix(post.custom_fields._neuf_events_starttime).utc().format("YYYY-MM-DD HH:mm") +'
'; - html += post.title +'('+ post.custom_fields._neuf_events_price_regular +')/'+ post.custom_fields._neuf_events_price_member +')
'; + html += post.title +''; } return html; } @@ -35,10 +26,10 @@ jQuery(document).ready(function() { program_endpoint+"?callback=?", query_params, function(data) { - if(data && data.posts) { + if(data && data.events) { console.log(data); // render template - var html = format_posts(data.posts.slice(0, 4)); + var html = format_posts(data.events.slice(0, 4)); $(".program-upcoming ul.program-list").html(html); } }