diff --git a/fancypages/static/fancypages/js/libs/doT/doT.js b/fancypages/static/fancypages/js/libs/doT/doT.js deleted file mode 100644 index 9864e44..0000000 --- a/fancypages/static/fancypages/js/libs/doT/doT.js +++ /dev/null @@ -1,135 +0,0 @@ -// doT.js -// 2011, Laura Doktorova, https://github.com/olado/doT -// Licensed under the MIT license. - -(function() { - "use strict"; - - var doT = { - version: '1.0.0', - templateSettings: { - evaluate: /\{\{([\s\S]+?\}?)\}\}/g, - interpolate: /\{\{=([\s\S]+?)\}\}/g, - encode: /\{\{!([\s\S]+?)\}\}/g, - use: /\{\{#([\s\S]+?)\}\}/g, - useParams: /(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g, - define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g, - defineParams:/^\s*([\w$]+):([\s\S]+)/, - conditional: /\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g, - iterate: /\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g, - varname: 'it', - strip: true, - append: true, - selfcontained: false - }, - template: undefined, //fn, compile template - compile: undefined //fn, for express - }; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = doT; - } else if (typeof define === 'function' && define.amd) { - define(function(){return doT;}); - } else { - (function(){ return this || (0,eval)('this'); }()).doT = doT; - } - - function encodeHTMLSource() { - var encodeHTMLRules = { "&": "&", "<": "<", ">": ">", '"': '"', "'": ''', "/": '/' }, - matchHTML = /&(?!#?\w+;)|<|>|"|'|\//g; - return function() { - return this ? this.replace(matchHTML, function(m) {return encodeHTMLRules[m] || m;}) : this; - }; - } - String.prototype.encodeHTML = encodeHTMLSource(); - - var startend = { - append: { start: "'+(", end: ")+'", endencode: "||'').toString().encodeHTML()+'" }, - split: { start: "';out+=(", end: ");out+='", endencode: "||'').toString().encodeHTML();out+='"} - }, skip = /$^/; - - function resolveDefs(c, block, def) { - return ((typeof block === 'string') ? block : block.toString()) - .replace(c.define || skip, function(m, code, assign, value) { - if (code.indexOf('def.') === 0) { - code = code.substring(4); - } - if (!(code in def)) { - if (assign === ':') { - if (c.defineParams) value.replace(c.defineParams, function(m, param, v) { - def[code] = {arg: param, text: v}; - }); - if (!(code in def)) def[code]= value; - } else { - new Function("def", "def['"+code+"']=" + value)(def); - } - } - return ''; - }) - .replace(c.use || skip, function(m, code) { - if (c.useParams) code = code.replace(c.useParams, function(m, s, d, param) { - if (def[d] && def[d].arg && param) { - var rw = (d+":"+param).replace(/'|\\/g, '_'); - def.__exp = def.__exp || {}; - def.__exp[rw] = def[d].text.replace(new RegExp("(^|[^\\w$])" + def[d].arg + "([^\\w$])", "g"), "$1" + param + "$2"); - return s + "def.__exp['"+rw+"']"; - } - }); - var v = new Function("def", "return " + code)(def); - return v ? resolveDefs(c, v, def) : v; - }); - } - - function unescape(code) { - return code.replace(/\\('|\\)/g, "$1").replace(/[\r\t\n]/g, ' '); - } - - doT.template = function(tmpl, c, def) { - c = c || doT.templateSettings; - var cse = c.append ? startend.append : startend.split, needhtmlencode, sid = 0, indv, - str = (c.use || c.define) ? resolveDefs(c, tmpl, def || {}) : tmpl; - - str = ("var out='" + (c.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g,' ') - .replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,''): str) - .replace(/'|\\/g, '\\$&') - .replace(c.interpolate || skip, function(m, code) { - return cse.start + unescape(code) + cse.end; - }) - .replace(c.encode || skip, function(m, code) { - needhtmlencode = true; - return cse.start + unescape(code) + cse.endencode; - }) - .replace(c.conditional || skip, function(m, elsecase, code) { - return elsecase ? - (code ? "';}else if(" + unescape(code) + "){out+='" : "';}else{out+='") : - (code ? "';if(" + unescape(code) + "){out+='" : "';}out+='"); - }) - .replace(c.iterate || skip, function(m, iterate, vname, iname) { - if (!iterate) return "';} } out+='"; - sid+=1; indv=iname || "i"+sid; iterate=unescape(iterate); - return "';var arr"+sid+"="+iterate+";if(arr"+sid+"){var "+vname+","+indv+"=-1,l"+sid+"=arr"+sid+".length-1;while("+indv+"":">",'"':""","'":"'","/":"/"},b=/&(?!#?\w+;)|<|>|"|'|\//g;return function(){return this?this.replace(b,function(c){return a[c]||c}):this}}function p(a,b,c){return(typeof b==="string"?b:b.toString()).replace(a.define||i,function(l,e,f,g){if(e.indexOf("def.")===0)e=e.substring(4);if(!(e in c))if(f===":"){a.defineParams&&g.replace(a.defineParams,function(n,h,d){c[e]={arg:h,text:d}});e in c||(c[e]=g)}else(new Function("def","def['"+ -e+"']="+g))(c);return""}).replace(a.use||i,function(l,e){if(a.useParams)e=e.replace(a.useParams,function(g,n,h,d){if(c[h]&&c[h].arg&&d){g=(h+":"+d).replace(/'|\\/g,"_");c.__exp=c.__exp||{};c.__exp[g]=c[h].text.replace(RegExp("(^|[^\\w$])"+c[h].arg+"([^\\w$])","g"),"$1"+d+"$2");return n+"def.__exp['"+g+"']"}});var f=(new Function("def","return "+e))(c);return f?p(a,f,c):f})}function m(a){return a.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}var j={version:"1.0.0",templateSettings:{evaluate:/\{\{([\s\S]+?\}?)\}\}/g, -interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,useParams:/(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,defineParams:/^\s*([\w$]+):([\s\S]+)/,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:true,append:true,selfcontained:false},template:undefined, -compile:undefined};if(typeof module!=="undefined"&&module.exports)module.exports=j;else if(typeof define==="function"&&define.amd)define(function(){return j});else(function(){return this||(0,eval)("this")})().doT=j;String.prototype.encodeHTML=o();var q={append:{start:"'+(",end:")+'",endencode:"||'').toString().encodeHTML()+'"},split:{start:"';out+=(",end:");out+='",endencode:"||'').toString().encodeHTML();out+='"}},i=/$^/;j.template=function(a,b,c){b=b||j.templateSettings;var l=b.append?q.append: -q.split,e,f=0,g;a=b.use||b.define?p(b,a,c||{}):a;a=("var out='"+(b.strip?a.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):a).replace(/'|\\/g,"\\$&").replace(b.interpolate||i,function(h,d){return l.start+m(d)+l.end}).replace(b.encode||i,function(h,d){e=true;return l.start+m(d)+l.endencode}).replace(b.conditional||i,function(h,d,k){return d?k?"';}else if("+m(k)+"){out+='":"';}else{out+='":k?"';if("+m(k)+"){out+='":"';}out+='"}).replace(b.iterate||i,function(h, -d,k,r){if(!d)return"';} } out+='";f+=1;g=r||"i"+f;d=m(d);return"';var arr"+f+"="+d+";if(arr"+f+"){var "+k+","+g+"=-1,l"+f+"=arr"+f+".length-1;while("+g+" + {% endblock %} {% block column_left %} @@ -38,9 +38,9 @@

{% trans "Ima {% block extrascripts %} {{ block.super }} - - - + + + {% compress js %} {% endcompress %} diff --git a/fancypages/templates/fancypages/base.html b/fancypages/templates/fancypages/base.html index 7ea4703..f9da79e 100644 --- a/fancypages/templates/fancypages/base.html +++ b/fancypages/templates/fancypages/base.html @@ -20,7 +20,7 @@ {% block mainstyles %} - + {# Font awesome pulled in through CDN #} @@ -56,17 +56,14 @@ {% block cdn_scripts %} - - - {##} {% endblock %} {# Local scripts #} {% block scripts %} {% compress js %} - + {% include "fancypages/partials/extrascripts.html" %} {% endcompress %} {% endblock %} diff --git a/fancypages/templates/fancypages/dashboard/layout.html b/fancypages/templates/fancypages/dashboard/layout.html index 500cf79..d768c72 100644 --- a/fancypages/templates/fancypages/dashboard/layout.html +++ b/fancypages/templates/fancypages/dashboard/layout.html @@ -13,10 +13,11 @@ {% block extrascripts %} {{ block.super }} - - + + {% compress js %} - + + {% endcompress %} diff --git a/fancypages/templates/fancypages/dashboard/page_list.html b/fancypages/templates/fancypages/dashboard/page_list.html index 483e9ff..884ecc7 100644 --- a/fancypages/templates/fancypages/dashboard/page_list.html +++ b/fancypages/templates/fancypages/dashboard/page_list.html @@ -42,8 +42,8 @@

{% trans "Page Management" %}

{% block extrascripts %} {{ block.super }} {% compress js %} - - + + {% endcompress %} {% endblock %} diff --git a/fancypages/templates/fancypages/editor/head.html b/fancypages/templates/fancypages/editor/head.html index d6a331d..63a5a02 100644 --- a/fancypages/templates/fancypages/editor/head.html +++ b/fancypages/templates/fancypages/editor/head.html @@ -2,6 +2,8 @@ {% load compress %} {% compress css %} + + {% endcompress %} diff --git a/fancypages/templates/fancypages/editor/partials/extrascripts.html b/fancypages/templates/fancypages/editor/partials/extrascripts.html index 10c3e4a..1757c6f 100644 --- a/fancypages/templates/fancypages/editor/partials/extrascripts.html +++ b/fancypages/templates/fancypages/editor/partials/extrascripts.html @@ -1,13 +1,14 @@ {% load staticfiles %} {% load compress %} - - + + {% compress js %} - - - + + + + - + {% endcompress %} diff --git a/fancypages/templates/fancypages/pages/product_page.html b/fancypages/templates/fancypages/pages/product_page.html deleted file mode 100644 index 5767bf6..0000000 --- a/fancypages/templates/fancypages/pages/product_page.html +++ /dev/null @@ -1,249 +0,0 @@ -{% extends "fancypages/layout.html" %} -{% load currency_filters %} -{% load fp_container_tags %} -{% load history_tags %} -{% load staticfiles %} -{% load i18n %} -{% load url from future %} - -{% block body_class %}fp-page editor-hidden{% endblock %} - -{% block title %} -{{ product.title }} | {{ block.super }} -{% endblock %} - -{% block breadcrumbs %} - -{% endblock %} - -{% block header %} -{% endblock header %} - -{% block content %} -
- - {% if user.is_authenticated and user.is_staff and not edit_mode %} - - {% endif %} - -
-
- {% fp_object_container content-container %} -
-
- -
-
- {% include "catalogue/partials/gallery.html" %} -
-
-

{{ product.get_title }}

- - {% include "catalogue/partials/stock_record.html" %} - - {% if reviews %} -
    - {% for review in reviews %} -
  • {{ review.score }}
  • - {% endfor %} -
- {% else %} -

- - {% trans "Write a review" %} - -

- {% endif %} - -
- - {% include "catalogue/partials/add_to_basket_form.html" %} -
-
- -
-
- {% fp_object_container product-description-container %} -
-
- - {% block product_description %} - {% if product.description %} -
-

{% trans "Product Description" %}

-
-

{{ product.description|safe }}

- {% endif %} - {% endblock %} - -
-
- {% fp_object_container product-info-container %} -
-
- - {% block product_info %} -
-

{% trans "Product Information" %}

-
- - {% if product.upc %} - - - - {% endif %} - - - - {% if product.stockrecord %} - - - - - - - - - - - {% endif %} - {% for av in product.attribute_values.all %} - - - - - {% endfor %} - - - - - - - - -
{% trans "UPC" %}{{ product.upc }}
{% trans "Product class" %}{{ product.product_class.name }}
{% trans "Price (excl. tax)" %}{{ product.stockrecord.price_incl_tax|currency }}
{% trans "Price (incl. tax)" %}{{ product.stockrecord.price_excl_tax|currency }}
{% trans "Availability" %}{{ product.stockrecord.availability }}
{{ av.attribute.name }}{{ av.value }}
{% trans "Num reviews" %}{{ reviews.count }}
- {% endblock %} - -
-
- {% fp_object_container product-review-container %} -
-
- - {% block product_review %} -
-
-

{% trans "Customer Reviews" %}

-
- {% if reviews %} -

{% trans "Read customer reviews on this product." %}

- {% else %} -

{% trans "Be the first to review this product." %}

- {% endif %} - - - {% if reviews %} -
- {% for review in reviews|slice:":3" %} -
-
-

{{ review.title }} {{ review.score }}

-

{% trans "Reviewed by" %} {{ review.get_reviewer_name }} ({{ review.date_created }})

-
-
-
-
-

{{ review.body|linebreaks }}

-
-
-
-
- {% include 'reviews/_vote_bit.html' %} - {% if review.has_votes %} -

{{ review.num_up_votes }} customer{{ review.num_up_votes|pluralize }} found this review helpful.

- {% endif %} -
-
-
-
- {% endfor %} - -
- {% endif %} -
- {% endblock product_review %} - -
- {% if product.related_products.count %} -
-
-

{% trans "Related items" %}

-
- -
- {% endif %} - - {% if product.recommended_products.count %} -
-
-

{% trans "Recommended items" %}

-
- -
- {% endif %} - - {% recently_viewed_products %} - -
-
-{% endblock content %} - -{% block extrascripts %} - {{ block.super }} - -{% endblock %} diff --git a/fancypages/templates/fancypages/partials/extrascripts.html b/fancypages/templates/fancypages/partials/extrascripts.html index ed096af..89762d7 100644 --- a/fancypages/templates/fancypages/partials/extrascripts.html +++ b/fancypages/templates/fancypages/partials/extrascripts.html @@ -1,5 +1,5 @@ {% load staticfiles %} - - + - + + diff --git a/fancypages/templates/fancypages/partials/extrastyles.html b/fancypages/templates/fancypages/partials/extrastyles.html index 53702fc..a7409a2 100644 --- a/fancypages/templates/fancypages/partials/extrastyles.html +++ b/fancypages/templates/fancypages/partials/extrastyles.html @@ -1,5 +1,5 @@ {% load staticfiles %} + + - -