From 4cf03981b72409eb8c3bf9370dd42989fa0be0aa Mon Sep 17 00:00:00 2001 From: re0ne Date: Wed, 2 Sep 2015 14:31:31 +0300 Subject: [PATCH] Minor changes in file structure --- templates/client/blank.html | 2 +- templates/client/includes/banners/tops.html | 12 ++---------- templates/client/popups/cemat_modal.html | 2 +- .../client/static_client/js/{ => rejs}/banners.js | 13 +++++++++---- templates/client/static_client/js/rejs/tops.js | 8 ++++++++ 5 files changed, 21 insertions(+), 16 deletions(-) rename templates/client/static_client/js/{ => rejs}/banners.js (89%) create mode 100644 templates/client/static_client/js/rejs/tops.js diff --git a/templates/client/blank.html b/templates/client/blank.html index 00219448..1be9b75a 100644 --- a/templates/client/blank.html +++ b/templates/client/blank.html @@ -87,7 +87,7 @@ This template include basic anf main styles and js files, "tag": "{{ tag }}" }; - + diff --git a/templates/client/includes/banners/tops.html b/templates/client/includes/banners/tops.html index 142e63a4..d421696d 100644 --- a/templates/client/includes/banners/tops.html +++ b/templates/client/includes/banners/tops.html @@ -1,13 +1,5 @@
- \ No newline at end of file + + \ No newline at end of file diff --git a/templates/client/popups/cemat_modal.html b/templates/client/popups/cemat_modal.html index fb497d72..d6c437d9 100644 --- a/templates/client/popups/cemat_modal.html +++ b/templates/client/popups/cemat_modal.html @@ -16,7 +16,7 @@ - + diff --git a/templates/client/static_client/js/banners.js b/templates/client/static_client/js/rejs/banners.js similarity index 89% rename from templates/client/static_client/js/banners.js rename to templates/client/static_client/js/rejs/banners.js index 1f6126ca..df86bbb0 100644 --- a/templates/client/static_client/js/banners.js +++ b/templates/client/static_client/js/rejs/banners.js @@ -4,10 +4,17 @@ var API_URL_ROOT = "/expo-b/get-banners/"; var getUrl = function () { + var catalog = ""; + + var parts = /^\/([^\/]+)(?:\/|$)/i.exec(location.pathname); + if (parts) { + catalog = parts[1]; + } + var data = window.sendData; if (data instanceof Object) { - var search = []; + var search = ["catalog=" + catalog]; for (var key in data) { if (data.hasOwnProperty(key)) { @@ -23,9 +30,7 @@ } } - if (search.length) { - return API_URL_ROOT + "?" + search.join("&"); - } + return API_URL_ROOT + "?" + search.join("&"); } return API_URL_ROOT; diff --git a/templates/client/static_client/js/rejs/tops.js b/templates/client/static_client/js/rejs/tops.js new file mode 100644 index 00000000..b3fbd8a5 --- /dev/null +++ b/templates/client/static_client/js/rejs/tops.js @@ -0,0 +1,8 @@ +(function () { + "use strict"; + + var API_URL_ROOT = "/expo-b/get-tops/"; + var PARENT_ID = "expo_top_events"; + + console.log("TOPS"); +})();