Back

Template Source: bdgenerix/snippets/_angularjs_urls.html

{% load i18n %} {% load bdex_tags %} <script type="text/javascript"> // Constant pool CURRENT_COUNTRY_CODE = "{{ country_code }}"; SSL_ENABLED = {% if request.path|starts_with_any:"/campaign/list,/store/category,/store/checkout/confirmation,/store/record/favourite-list/" %}true{% else %}false{% endif %}; // API endpoints which angularJs call CAMPAIGN_LIST_ENDPOINT = "/api/v5/campaigns/category/%s/?channel=10&country_code=%s"; PRODUCT_LIST_ENDPOINT = "/api/v5/campaigns/%s/?channel=%s&country_code=%s"; MY_FAVOURITE_ENDPOINT = "/api/v5/record/favourite-product/list/" + (SSL_ENABLED?"":"no-ssl/") + "?user_id=%s&token=%s&channel=10&country_code=%s"; PRODUCT_PREVIEW_ENDPOINT = "/api/v5/products/%s/?channel=%s&country_code=%s"; CART_ENDPOINT = "/api/v5/carts/?user_id=%s&token=%s&channel=10&country_code=%s"; LUXURY_CAMPAIGN_LIST_ENDPOINT = "/api/v5/campaigns/category/%s/?channel=40"; BARGAIN_CAMPAIGN_LIST_ENDPOINT = "/api/v5/campaigns/category/%s/?channel=80"; BROWSE_HISTORY_ENDPOINT = "/api/v5/record/browse-record/list/" + (SSL_ENABLED?"secure/":"") + "?user_id=%s&token=%s&channel=10&country_code=%s"; FAVOURITE_ADD_ENDPOINT = "/api/v5/record/favourite-product/add/" + (SSL_ENABLED?"":"no-ssl/"); FAVOURITE_REMOVE_ENDPOINT = "/api/v5/record/favourite-product/remove/" + (SSL_ENABLED?"":"no-ssl/"); url_bdex_store_category_details = "{% url bdex-store-category-details '000' %}?country_code=%s".replace("000", "%s"); url_bdex_store_productspec_details = "{% url bdex-store-productspec-details '000' %}?country_code=%s".replace("000", "%s"); // url_product_list_express = "{{ SITE_HTTP_URL_LUXURY }}/campaign/%s/"; url_product_list_bargain = "{{ SITE_HTTP_URL_BARGAIN }}/campaign/%s/"; </script>