From 389dc243e1ca95c34b1f92d5143db4a39ffba84f Mon Sep 17 00:00:00 2001 From: Jasper Berghoef Date: Sat, 3 Jun 2017 10:35:34 +0200 Subject: [PATCH] More styling improvements --- frontend/scss/dashboard.scss | 106 +++++++++++++++++- .../static/css/dashboard.css | 2 +- .../static/css/dashboard.css.map | 2 +- .../static/js/commons.js.map | 2 +- .../segment/dashboard.html | 19 ++-- 5 files changed, 117 insertions(+), 14 deletions(-) diff --git a/frontend/scss/dashboard.scss b/frontend/scss/dashboard.scss index 8a3c6dd..709ebff 100644 --- a/frontend/scss/dashboard.scss +++ b/frontend/scss/dashboard.scss @@ -1,4 +1,5 @@ $color-gray: #D0D2D3; +$color-lighest-gray: #EBEBEB; $color-light-gray: #F6F6F6; $color-dark-gray: #727272; $block-spacing: 20px; @@ -12,12 +13,17 @@ $block-spacing: 20px; display: block; box-sizing: border-box; width: 22%; + max-width: 320px; min-width: 280px; + min-height: 260px; margin: 1.5%; border: 1px solid $color-gray; border-radius: 3px; + padding-bottom: 62px; &__segment { + position: relative; + .block-header, .block-rules, .block-footer { @@ -39,12 +45,18 @@ $block-spacing: 20px; } .block-footer { + position: absolute; + width: 100%; + bottom: 0; padding: $block-spacing / 2 $block-spacing; border-top: 1px solid $color-gray; background-color: $color-light-gray; } .block-data { + overflow: hidden; + margin-bottom: $block-spacing; + &__description { margin-bottom: 3px; font-size: 14px; @@ -54,12 +66,46 @@ $block-spacing: 20px; &__content { margin-bottom: 0; font-size: 18px; + + &--code { + display: inline-block; + width: auto; + padding-left: 3px !important; + padding-right: 3px; + padding-top: 1px; + padding-bottom: 1px; + margin-left: $block-spacing + 10px; + margin-right: $block-spacing / 2; + margin-top: 0; + border: 1px solid $color-gray; + border-radius: 3px; + font-size: 14px; + background-color: $color-light-gray; + } } &--icon { - .block-data__description { - padding-left: 1.5em; + position: relative; + + &:before { + display: block; + position: absolute; + top: 50%; + left: 0; + transform: translate(-20%, -50%); + margin-right: 0; + font-size: 32px; + color: $color-lighest-gray; } + + .block-data__description, + .block-data__content { + padding-left: 30px; + } + } + + &:last-child { + margin-bottom: 0; } } @@ -85,5 +131,61 @@ $block-spacing: 20px; } } + + &-suggestion { + position: relative; + border: 1px dashed $color-gray; + + &__text { + position: absolute; + top: 50%; + transform: translateY(-50%); + width: 100%; + text-align: center; + font-size: 16px; + color: $color-gray; + } + + &:hover { + .block-suggestion { + &__text { + color: $color-dark-gray; + } + } + } + } + } + + .segment { + &--match-all, + &--match-any { + .block-data--icon { + &:after { + position: absolute; + left: 5px; + padding-left: 5px; + border-left: $color-lighest-gray; + color: $color-lighest-gray; + text-align: left; + font-family: 'wagtail'; + } + } + } + + &--match-all { + .block-data--icon { + &:after { + content: "&"; + } + } + } + + &--match-any { + .block-data--icon { + &:after { + content: "//"; + } + } + } } } diff --git a/src/wagtail_personalisation/static/css/dashboard.css b/src/wagtail_personalisation/static/css/dashboard.css index 83d5be2..e9c81cb 100644 --- a/src/wagtail_personalisation/static/css/dashboard.css +++ b/src/wagtail_personalisation/static/css/dashboard.css @@ -1,2 +1,2 @@ -.block-container{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.block-container .block{width:22%;min-width:280px;margin:1.5%;border:1px solid #d0d2d3;border-radius:3px}.block-container .block,.block-container .block__segment .block-footer,.block-container .block__segment .block-header,.block-container .block__segment .block-rules{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}.block-container .block__segment .block-header{padding:20px;border-bottom:1px solid #d0d2d3}.block-container .block__segment .block-header h2{margin-top:0}.block-container .block__segment .block-rules{padding:20px 0}.block-container .block__segment .block-footer{padding:10px 20px;border-top:1px solid #d0d2d3;background-color:#f6f6f6}.block-container .block__segment .block-data__description{margin-bottom:3px;font-size:14px;color:#727272}.block-container .block__segment .block-data__content{margin-bottom:0;font-size:18px}.block-container .block__segment .block-data--icon .block-data__description{padding-left:1.5em}.block-container .block__segment .block-stats__content{margin-bottom:3px}.block-container .block__segment .block-actions{margin:0;padding:0;list-style:none}.block-container .block__segment .block-actions__action{display:inline-block;margin-right:5px}.block-container .block__segment .block-actions__action:last-child{margin-right:0} +.block-container{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.block-container .block{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;width:22%;max-width:320px;min-width:280px;min-height:260px;margin:1.5%;border:1px solid #d0d2d3;border-radius:3px;padding-bottom:62px}.block-container .block__segment{position:relative}.block-container .block__segment .block-footer,.block-container .block__segment .block-header,.block-container .block__segment .block-rules{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}.block-container .block__segment .block-header{padding:20px;border-bottom:1px solid #d0d2d3}.block-container .block__segment .block-header h2{margin-top:0}.block-container .block__segment .block-rules{padding:20px 0}.block-container .block__segment .block-footer{position:absolute;width:100%;bottom:0;padding:10px 20px;border-top:1px solid #d0d2d3;background-color:#f6f6f6}.block-container .block__segment .block-data{overflow:hidden;margin-bottom:20px}.block-container .block__segment .block-data__description{margin-bottom:3px;font-size:14px;color:#727272}.block-container .block__segment .block-data__content{margin-bottom:0;font-size:18px}.block-container .block__segment .block-data__content--code{display:inline-block;width:auto;padding-left:3px!important;padding-right:3px;padding-top:1px;padding-bottom:1px;margin-left:30px;margin-right:10px;margin-top:0;border:1px solid #d0d2d3;border-radius:3px;font-size:14px;background-color:#f6f6f6}.block-container .block__segment .block-data--icon{position:relative}.block-container .block__segment .block-data--icon:before{display:block;position:absolute;top:50%;left:0;-webkit-transform:translate(-20%,-50%);transform:translate(-20%,-50%);margin-right:0;font-size:32px;color:#ebebeb}.block-container .block__segment .block-data--icon .block-data__content,.block-container .block__segment .block-data--icon .block-data__description{padding-left:30px}.block-container .block__segment .block-data:last-child{margin-bottom:0}.block-container .block__segment .block-stats__content{margin-bottom:3px}.block-container .block__segment .block-actions{margin:0;padding:0;list-style:none}.block-container .block__segment .block-actions__action{display:inline-block;margin-right:5px}.block-container .block__segment .block-actions__action:last-child{margin-right:0}.block-container .block-suggestion{position:relative;border:1px dashed #d0d2d3}.block-container .block-suggestion__text{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);width:100%;text-align:center;font-size:16px;color:#d0d2d3}.block-container .block-suggestion:hover .block-suggestion__text{color:#727272}.block-container .segment--match-all .block-data--icon:after,.block-container .segment--match-any .block-data--icon:after{position:absolute;left:5px;padding-left:5px;border-left:#ebebeb;color:#ebebeb;text-align:left;font-family:wagtail}.block-container .segment--match-all .block-data--icon:after{content:"&"}.block-container .segment--match-any .block-data--icon:after{content:"//"} /*# sourceMappingURL=dashboard.css.map*/ \ No newline at end of file diff --git a/src/wagtail_personalisation/static/css/dashboard.css.map b/src/wagtail_personalisation/static/css/dashboard.css.map index 81dc666..7a1e5f1 100644 --- a/src/wagtail_personalisation/static/css/dashboard.css.map +++ b/src/wagtail_personalisation/static/css/dashboard.css.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./scss/dashboard.scss"],"names":[],"mappings":"AAKA,iBACI,oBAAa,iCACb,mBAAe,eACf,uBAA2B,+CAgF9B,wBA3EO,UACA,gBACA,YACA,yBACA,iBAAkB,CAsErB,oKA5EG,cACA,8BAAsB,sBAajB,+CAGG,aACA,+BA7BI,CAkCP,kDAFO,YAAa,CAChB,8CAID,cAAyB,CAC5B,+CAGG,kBACA,6BACA,wBA1CU,CA2Cb,0DAIO,kBACA,eACA,aAhDK,CAiDR,sDAGG,gBACA,cAAe,CAClB,4EAIO,kBAAmB,CACtB,uDAMD,iBAAkB,CACrB,gDAID,SACA,UACA,eAAgB,CAWnB,wDARO,qBACA,gBAAiB,CAKpB,mEAFO,cAAe","file":"../css/dashboard.css","sourcesContent":["$color-gray: #D0D2D3;\n$color-light-gray: #F6F6F6;\n$color-dark-gray: #727272;\n$block-spacing: 20px;\n\n.block-container {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n\n .block {\n display: block;\n box-sizing: border-box;\n width: 22%;\n min-width: 280px;\n margin: 1.5%;\n border: 1px solid $color-gray;\n border-radius: 3px;\n\n &__segment {\n .block-header,\n .block-rules,\n .block-footer {\n display: block;\n box-sizing: border-box;\n }\n\n .block-header {\n padding: $block-spacing;\n border-bottom: 1px solid $color-gray;\n\n h2 {\n margin-top: 0;\n }\n }\n\n .block-rules {\n padding: $block-spacing 0;\n }\n\n .block-footer {\n padding: $block-spacing / 2 $block-spacing;\n border-top: 1px solid $color-gray;\n background-color: $color-light-gray;\n }\n\n .block-data {\n &__description {\n margin-bottom: 3px;\n font-size: 14px;\n color: $color-dark-gray;\n }\n\n &__content {\n margin-bottom: 0;\n font-size: 18px;\n }\n\n &--icon {\n .block-data__description {\n padding-left: 1.5em;\n }\n }\n }\n\n .block-stats {\n &__content {\n margin-bottom: 3px;\n }\n }\n\n .block-actions {\n margin: 0;\n padding: 0;\n list-style: none;\n\n &__action {\n display: inline-block;\n margin-right: 5px;\n\n &:last-child {\n margin-right: 0;\n }\n }\n\n }\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./scss/dashboard.scss"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./scss/dashboard.scss"],"names":[],"mappings":"AAMA,iBACI,oBAAa,iCACb,mBAAe,eACf,uBAA2B,+CAqL9B,wBAlLO,cACA,8BAAsB,sBACtB,UACA,gBACA,gBACA,iBACA,YACA,yBACA,kBACA,mBAAoB,CAuIvB,iCApIO,iBAAkB,CA4GrB,4IAvGO,cACA,8BAAsB,sBACzB,+CAGG,aACA,+BAnCI,CAwCP,kDAFO,YAAa,CAChB,8CAID,cAAyB,CAC5B,+CAGG,kBACA,WACA,SACA,kBACA,6BACA,wBAlDU,CAmDb,6CAGG,gBACA,kBArDI,CAyGP,0DAjDO,kBACA,eACA,aA3DK,CA4DR,sDAGG,gBACA,cAAe,CAiBlB,4DAdO,qBACA,WACA,2BACA,kBACA,gBACA,mBACA,iBACA,kBACA,aACA,yBACA,kBACA,eACA,wBAhFE,CAiFL,mDAID,iBAAkB,CAiBrB,0DAdO,cACA,kBACA,QACA,OACA,uCAAgC,+BAChC,eACA,eACA,aAhGI,CAiGP,oJAIG,iBAAkB,CACrB,wDAID,eAAgB,CACnB,uDAKG,iBAAkB,CACrB,gDAID,SACA,UACA,eAAgB,CAWnB,wDARO,qBACA,gBAAiB,CAKpB,mEAFO,cAAe,CAClB,mCAOT,kBACA,yBAxIQ,CA2JX,yCAhBO,kBACA,QACA,mCAA2B,2BAC3B,WACA,kBACA,eACA,aAjJI,CAkJP,iEAKW,aApJC,CAqJJ,0HAWD,kBACA,SACA,iBACA,oBACA,cACA,gBACA,mBAAsB,CACzB,6DAOG,WAAY,CACf,6DAOG,YAAa","file":"../css/dashboard.css","sourcesContent":["$color-gray: #D0D2D3;\n$color-lighest-gray: #EBEBEB;\n$color-light-gray: #F6F6F6;\n$color-dark-gray: #727272;\n$block-spacing: 20px;\n\n.block-container {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n\n .block {\n display: block;\n box-sizing: border-box;\n width: 22%;\n max-width: 320px;\n min-width: 280px;\n min-height: 260px;\n margin: 1.5%;\n border: 1px solid $color-gray;\n border-radius: 3px;\n padding-bottom: 62px;\n\n &__segment {\n position: relative;\n\n .block-header,\n .block-rules,\n .block-footer {\n display: block;\n box-sizing: border-box;\n }\n\n .block-header {\n padding: $block-spacing;\n border-bottom: 1px solid $color-gray;\n\n h2 {\n margin-top: 0;\n }\n }\n\n .block-rules {\n padding: $block-spacing 0;\n }\n\n .block-footer {\n position: absolute;\n width: 100%;\n bottom: 0;\n padding: $block-spacing / 2 $block-spacing;\n border-top: 1px solid $color-gray;\n background-color: $color-light-gray;\n }\n\n .block-data {\n overflow: hidden;\n margin-bottom: $block-spacing;\n\n &__description {\n margin-bottom: 3px;\n font-size: 14px;\n color: $color-dark-gray;\n }\n\n &__content {\n margin-bottom: 0;\n font-size: 18px;\n\n &--code {\n display: inline-block;\n width: auto;\n padding-left: 3px !important;\n padding-right: 3px;\n padding-top: 1px;\n padding-bottom: 1px;\n margin-left: $block-spacing + 10px;\n margin-right: $block-spacing / 2;\n margin-top: 0;\n border: 1px solid $color-gray;\n border-radius: 3px;\n font-size: 14px;\n background-color: $color-light-gray;\n }\n }\n\n &--icon {\n position: relative;\n\n &:before {\n display: block;\n position: absolute;\n top: 50%;\n left: 0;\n transform: translate(-20%, -50%);\n margin-right: 0;\n font-size: 32px;\n color: $color-lighest-gray;\n }\n\n .block-data__description,\n .block-data__content {\n padding-left: 30px;\n }\n }\n\n &:last-child {\n margin-bottom: 0;\n }\n }\n\n .block-stats {\n &__content {\n margin-bottom: 3px;\n }\n }\n\n .block-actions {\n margin: 0;\n padding: 0;\n list-style: none;\n\n &__action {\n display: inline-block;\n margin-right: 5px;\n\n &:last-child {\n margin-right: 0;\n }\n }\n\n }\n }\n\n &-suggestion {\n position: relative;\n border: 1px dashed $color-gray;\n\n &__text {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 100%;\n text-align: center;\n font-size: 16px;\n color: $color-gray;\n }\n\n &:hover {\n .block-suggestion {\n &__text {\n color: $color-dark-gray;\n }\n }\n }\n }\n }\n\n .segment {\n &--match-all,\n &--match-any {\n .block-data--icon {\n &:after {\n position: absolute;\n left: 5px;\n padding-left: 5px;\n border-left: $color-lighest-gray;\n color: $color-lighest-gray;\n text-align: left;\n font-family: 'wagtail';\n }\n }\n }\n\n &--match-all {\n .block-data--icon {\n &:after {\n content: \"&\";\n }\n }\n }\n\n &--match-any {\n .block-data--icon {\n &:after {\n content: \"//\";\n }\n }\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./scss/dashboard.scss"],"sourceRoot":""} \ No newline at end of file diff --git a/src/wagtail_personalisation/static/js/commons.js.map b/src/wagtail_personalisation/static/js/commons.js.map index ed8e859..1461de2 100644 --- a/src/wagtail_personalisation/static/js/commons.js.map +++ b/src/wagtail_personalisation/static/js/commons.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 65a2835660cf4cccac40"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,+DAAuD,WAAW,EAAE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"commons.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t3: 0\n \t};\n\n \tvar resolvedPromise = new Promise(function(resolve) { resolve(); });\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tif(installedChunks[chunkId] === 0) {\n \t\t\treturn resolvedPromise;\n \t\t}\n\n \t\t// a Promise means \"currently loading\".\n \t\tif(installedChunks[chunkId]) {\n \t\t\treturn installedChunks[chunkId][2];\n \t\t}\n\n \t\t// setup Promise in chunk cache\n \t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\tinstalledChunks[chunkId] = [resolve, reject];\n \t\t});\n \t\tinstalledChunks[chunkId][2] = promise;\n\n \t\t// start chunk loading\n \t\tvar head = document.getElementsByTagName('head')[0];\n \t\tvar script = document.createElement('script');\n \t\tscript.type = 'text/javascript';\n \t\tscript.charset = 'utf-8';\n \t\tscript.async = true;\n \t\tscript.timeout = 120000;\n\n \t\tif (__webpack_require__.nc) {\n \t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t}\n \t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".js\";\n \t\tvar timeout = setTimeout(onScriptComplete, 120000);\n \t\tscript.onerror = script.onload = onScriptComplete;\n \t\tfunction onScriptComplete() {\n \t\t\t// avoid mem leaks in IE.\n \t\t\tscript.onerror = script.onload = null;\n \t\t\tclearTimeout(timeout);\n \t\t\tvar chunk = installedChunks[chunkId];\n \t\t\tif(chunk !== 0) {\n \t\t\t\tif(chunk) {\n \t\t\t\t\tchunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));\n \t\t\t\t}\n \t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t}\n \t\t};\n \t\thead.appendChild(script);\n\n \t\treturn promise;\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 65a2835660cf4cccac40"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap bc9aa1a0f65713e278f5"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,+DAAuD,WAAW,EAAE;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"commons.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t3: 0\n \t};\n\n \tvar resolvedPromise = new Promise(function(resolve) { resolve(); });\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tif(installedChunks[chunkId] === 0) {\n \t\t\treturn resolvedPromise;\n \t\t}\n\n \t\t// a Promise means \"currently loading\".\n \t\tif(installedChunks[chunkId]) {\n \t\t\treturn installedChunks[chunkId][2];\n \t\t}\n\n \t\t// setup Promise in chunk cache\n \t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\tinstalledChunks[chunkId] = [resolve, reject];\n \t\t});\n \t\tinstalledChunks[chunkId][2] = promise;\n\n \t\t// start chunk loading\n \t\tvar head = document.getElementsByTagName('head')[0];\n \t\tvar script = document.createElement('script');\n \t\tscript.type = 'text/javascript';\n \t\tscript.charset = 'utf-8';\n \t\tscript.async = true;\n \t\tscript.timeout = 120000;\n\n \t\tif (__webpack_require__.nc) {\n \t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t}\n \t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".js\";\n \t\tvar timeout = setTimeout(onScriptComplete, 120000);\n \t\tscript.onerror = script.onload = onScriptComplete;\n \t\tfunction onScriptComplete() {\n \t\t\t// avoid mem leaks in IE.\n \t\t\tscript.onerror = script.onload = null;\n \t\t\tclearTimeout(timeout);\n \t\t\tvar chunk = installedChunks[chunkId];\n \t\t\tif(chunk !== 0) {\n \t\t\t\tif(chunk) {\n \t\t\t\t\tchunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));\n \t\t\t\t}\n \t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t}\n \t\t};\n \t\thead.appendChild(script);\n\n \t\treturn promise;\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap bc9aa1a0f65713e278f5"],"sourceRoot":""} \ No newline at end of file diff --git a/src/wagtail_personalisation/templates/modeladmin/wagtail_personalisation/segment/dashboard.html b/src/wagtail_personalisation/templates/modeladmin/wagtail_personalisation/segment/dashboard.html index 218d702..99a5533 100644 --- a/src/wagtail_personalisation/templates/modeladmin/wagtail_personalisation/segment/dashboard.html +++ b/src/wagtail_personalisation/templates/modeladmin/wagtail_personalisation/segment/dashboard.html @@ -26,13 +26,14 @@ {% for rule in segment.get_rules %}

{{ rule.description.title }}

-

- {% if rule.description.code %} -

{{ rule.description.value }}
- {% else %} - {{ rule.description.value }} - {% endif %} -

+ {% if rule.description.code %} +
{{ rule.description.value }}
+ {% else %} +

+ {{ rule.description.value }} +

+ {% endif %} +
{% endfor %} @@ -85,8 +86,8 @@ {% if user_can_create %} {% blocktrans with url=view.create_url name=view.verbose_name %} - - Add a new {{ name }} + + Add a new {{ name }} {% endblocktrans %} {% endif %}