6
0
Fork 0

Allows switching between list and dashboard view

This commit is contained in:
Jasper Berghoef 2017-05-31 12:31:30 +02:00 committed by Michael van Tellingen
parent 45f2de62ea
commit 7034c09d4a
35 changed files with 67 additions and 209 deletions

View File

@ -1,2 +0,0 @@
.block_container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.block_container .block{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:calc(100% / 3 - 13.33px);padding:10px 20px;margin-bottom:20px;border:1px solid #d9d9d9;border-radius:3px;background-color:#fff;cursor:pointer;-webkit-box-shadow:0 1px 3px transparent,0 1px 2px transparent;box-shadow:0 1px 3px transparent,0 1px 2px transparent;-webkit-transition:border .3s cubic-bezier(.25,.8,.25,1),-webkit-box-shadow .3s cubic-bezier(.25,.8,.25,1);transition:border .3s cubic-bezier(.25,.8,.25,1),-webkit-box-shadow .3s cubic-bezier(.25,.8,.25,1);transition:box-shadow .3s cubic-bezier(.25,.8,.25,1),border .3s cubic-bezier(.25,.8,.25,1);transition:box-shadow .3s cubic-bezier(.25,.8,.25,1),border .3s cubic-bezier(.25,.8,.25,1),-webkit-box-shadow .3s cubic-bezier(.25,.8,.25,1)}.block_container .block:nth-child(3n+1),.block_container .block:nth-child(3n+2){margin-right:20px}.block_container .block:hover{border:1px solid #fff;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23)}.block_container .block.disabled{background-color:#eee;cursor:default}.block_container .block.disabled:hover{border:1px solid #d9d9d9;-webkit-box-shadow:0 1px 3px transparent,0 1px 2px transparent;box-shadow:0 1px 3px transparent,0 1px 2px transparent}@media (min-width:800px) and (max-width:999px){.block_container .block{width:calc(100% / 2 - 10px)}.block_container .block:nth-child(3n+1),.block_container .block:nth-child(3n+2){margin-right:0}.block_container .block:nth-child(odd){margin-right:20px}}@media (max-width:599px){.block_container .block{width:calc(100% / 2 - 10px)}.block_container .block:nth-child(3n+1),.block_container .block:nth-child(3n+2){margin-right:0}.block_container .block:nth-child(odd){margin-right:20px}}
/*# sourceMappingURL=form.css.map*/

View File

@ -1 +0,0 @@
{"version":3,"sources":["webpack:///./scss/form.scss"],"names":[],"mappings":"AAAA,iBACI,oBAAa,iCACb,8BAAmB,uEACnB,mBAAe,eAGf,wBACI,cACA,8BAAsB,sBACtB,kBACA,+BACA,kBACA,mBACA,yBACA,kBACA,sBACA,eACA,+DAAkE,uDAClE,2GAA8F,2UAGlG,gFAEI,iBAAkB,CAGtB,8BACI,sBACA,uEAAkE,+DAGtE,iCACI,sBACA,cAAe,CAGnB,uCACI,yBACA,+DAAkE,uDAG1E,+CACI,wBACI,2BAA4B,CAGhC,gFAEI,cAAe,CAGnB,uCACI,iBAAkB,CACrB,CAGL,yBACI,wBACI,2BAA4B,CAGhC,gFAEI,cAAe,CAGnB,uCACI,iBAAkB,CACrB","file":"../css/form.css","sourcesContent":[".block_container {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n}\n\n .block_container .block {\n display: block;\n box-sizing: border-box;\n position: relative;\n width: calc(100% / 3 - 13.33px);\n padding: 10px 20px;\n margin-bottom: 20px;\n border: 1px solid #d9d9d9;\n border-radius: 3px;\n background-color: #fff;\n cursor: pointer;\n box-shadow: 0 1px 3px rgba(0,0,0,0.00), 0 1px 2px rgba(0,0,0,0.00);\n transition: box-shadow 0.3s cubic-bezier(.25,.8,.25,1), border 0.3s cubic-bezier(.25,.8,.25,1);\n }\n\n .block_container .block:nth-child(3n+1),\n .block_container .block:nth-child(3n+2) {\n margin-right: 20px;\n }\n\n .block_container .block:hover {\n border: 1px solid #fff;\n box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);\n }\n\n .block_container .block.disabled {\n background-color: #eee;\n cursor: default;\n }\n\n .block_container .block.disabled:hover {\n border: 1px solid #d9d9d9;\n box-shadow: 0 1px 3px rgba(0,0,0,0.00), 0 1px 2px rgba(0,0,0,0.00);\n }\n\n@media (min-width: 800px) and (max-width: 999px) {\n .block_container .block {\n width: calc(100% / 2 - 10px);\n }\n\n .block_container .block:nth-child(3n+1),\n .block_container .block:nth-child(3n+2) {\n margin-right: 0;\n }\n\n .block_container .block:nth-child(2n+1) {\n margin-right: 20px;\n }\n}\n\n@media (max-width: 599px) {\n .block_container .block {\n width: calc(100% / 2 - 10px);\n }\n\n .block_container .block:nth-child(3n+1),\n .block_container .block:nth-child(3n+2) {\n margin-right: 0;\n }\n\n .block_container .block:nth-child(2n+1) {\n margin-right: 20px;\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./scss/form.scss"],"sourceRoot":""}

View File

@ -1,2 +0,0 @@
/*# sourceMappingURL=index.css.map*/

View File

@ -1 +0,0 @@
{"version":3,"sources":[],"names":[],"mappings":"","file":"../css/index.css","sourceRoot":""}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,155 +0,0 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ var parentJsonpFunction = window["webpackJsonp"];
/******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [], result;
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/ if(executeModules) {
/******/ for(i=0; i < executeModules.length; i++) {
/******/ result = __webpack_require__(__webpack_require__.s = executeModules[i]);
/******/ }
/******/ }
/******/ return result;
/******/ };
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // objects to store loaded and loading chunks
/******/ var installedChunks = {
/******/ 2: 0
/******/ };
/******/
/******/ var resolvedPromise = new Promise(function(resolve) { resolve(); });
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
/******/ if(installedChunks[chunkId] === 0) {
/******/ return resolvedPromise;
/******/ }
/******/
/******/ // a Promise means "currently loading".
/******/ if(installedChunks[chunkId]) {
/******/ return installedChunks[chunkId][2];
/******/ }
/******/
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise(function(resolve, reject) {
/******/ installedChunks[chunkId] = [resolve, reject];
/******/ });
/******/ installedChunks[chunkId][2] = promise;
/******/
/******/ // start chunk loading
/******/ var head = document.getElementsByTagName('head')[0];
/******/ var script = document.createElement('script');
/******/ script.type = 'text/javascript';
/******/ script.charset = 'utf-8';
/******/ script.async = true;
/******/ script.timeout = 120000;
/******/
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "" + chunkId + ".js";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var chunk = installedChunks[chunkId];
/******/ if(chunk !== 0) {
/******/ if(chunk) {
/******/ chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));
/******/ }
/******/ installedChunks[chunkId] = undefined;
/******/ }
/******/ };
/******/ head.appendChild(script);
/******/
/******/ return promise;
/******/ };
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // on error function for async loading
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
/******/ })
/************************************************************************/
/******/ ([]);
//# sourceMappingURL=commons.js.map

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"version":3,"sources":["webpack:///./scss/form.scss?4a48","webpack:///./js/form.js"],"names":[],"mappings":";;;;AAAA,yC;;;;;;;;;;ACAA,uB","file":"form.js","sourcesContent":["// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./scss/form.scss\n// module id = 0\n// module chunks = 1","import '../scss/form.scss';\n\n\n\n// WEBPACK FOOTER //\n// ./js/form.js"],"sourceRoot":""}

View File

@ -1,20 +0,0 @@
webpackJsonp([0],[
/* 0 */,
/* 1 */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/* 2 */,
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(1);
/***/ })
],[3]);
//# sourceMappingURL=index.js.map

View File

@ -1 +0,0 @@
{"version":3,"sources":["webpack:///./scss/index.scss","webpack:///./js/index.js"],"names":[],"mappings":";;;;;AAAA,yC;;;;;;;;;;ACAA,uB","file":"index.js","sourcesContent":["// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./scss/index.scss\n// module id = 1\n// module chunks = 0","import '../scss/index.scss';\n\n\n\n// WEBPACK FOOTER //\n// ./js/index.js"],"sourceRoot":""}

View File

@ -10,5 +10,7 @@ urlpatterns = [
url(r'^segment/(?P<segment_id>[0-9]+)/toggle/$',
views.toggle, name='toggle'),
url(r'^(?P<page_id>[0-9]+)/copy/(?P<segment_id>[0-9]+)$',
views.copy_page_view, name='copy_page')
views.copy_page_view, name='copy_page'),
url(r'^segment/toggle_segment_view/$',
views.toggle_segment_view, name='toggle_segment_view'),
]

View File

@ -0,0 +1,2 @@
.nice-padding{padding-left:50px;padding-right:50px}.block_container{display:block;margin-top:30px}.block_container .block{display:block;float:left;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:calc(50% - 10px);min-height:216px;padding:10px 20px;margin-bottom:20px;border:1px solid #d9d9d9;border-radius:3px;background-color:#fff;-webkit-box-shadow:0 1px 3px transparent,0 1px 2px transparent;box-shadow:0 1px 3px transparent,0 1px 2px transparent;-webkit-transition:border .3s cubic-bezier(.25,.8,.25,1),-webkit-box-shadow .3s cubic-bezier(.25,.8,.25,1);transition:border .3s cubic-bezier(.25,.8,.25,1),-webkit-box-shadow .3s cubic-bezier(.25,.8,.25,1);transition:box-shadow .3s cubic-bezier(.25,.8,.25,1),border .3s cubic-bezier(.25,.8,.25,1);transition:box-shadow .3s cubic-bezier(.25,.8,.25,1),border .3s cubic-bezier(.25,.8,.25,1),-webkit-box-shadow .3s cubic-bezier(.25,.8,.25,1);cursor:pointer}.block_container .block--disabled .inspect_container,.block_container .block--disabled h2{opacity:.5}.block_container .block h2{display:inline-block;width:auto}.block_container .block:nth-child(odd){margin-right:20px}.block_container .block .block_actions{list-style:none;margin:0;padding:0}.block_container .block .block_actions li{float:left;margin-right:10px}.block_container .block .block_actions li:last-child{margin-right:0}.block_container .block.suggestion{border:1px dashed #d9d9d9}.block_container .block:hover{border:1px solid #fff;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23)}@media (max-width:699px){.block_container .block{width:100%;margin-right:0}}.block_container .block .inspect_container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;margin-bottom:10px}.block_container .block .inspect_container .inspect{display:block;float:left;width:calc(50% - 10px);padding:0;margin:0;list-style:none}.block_container .block .inspect_container .inspect li{display:inline-block;margin-bottom:5px}.block_container .block .inspect_container .inspect li span{display:block;font-size:20px;font-weight:700;margin:5px 0;overflow-wrap:break-word}.block_container .block .inspect_container .inspect li span:before{display:inline-block;content:"";width:16px;height:16px;margin-right:5px;background-size:contain;background-image:url(../img/ruler_icon.png)}.block_container .block .inspect_container .segment_stats .visit_stat span:before{background-image:url(../img/rocket_icon.png)}.block_container .block .inspect_container .segment_stats .days_stat span:before{background-image:url(../img/calendar_icon.png)}.block_container .block .inspect_container .segment_rules .persistent_state span:before{background-image:url(../img/persistent_icon.png)}.block_container .block .inspect_container .segment_rules .persistent_state.fleeting span:before{-webkit-transform:rotate(45deg) translateY(-2px);transform:rotate(45deg) translateY(-2px)}.block_container .block .inspect_container .segment_rules .time-rule span:before{background-image:url(../img/time_icon.png)}.block_container .block .inspect_container .segment_rules .visit-count-rule span:before{background-image:url(../img/visit_count_icon.png)}.block_container .block .inspect_container .segment_rules .logged-in-rule span:before{background-image:url(../img/key_icon.png)}.block_container .block .inspect_container .segment_rules .day-rule span:before{background-image:url(../img/calendar_icon.png)}.block_container .block .inspect_container .inspect li pre{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:auto;background-color:#eee;border:1px solid #ccc;margin:5px 0 5px 21px;padding:2px 5px;word-wrap:break-word;word-break:break-all;border-radius:3px}.block_container .block .inspect_container .inspect li pre:before{display:inline-block;position:absolute;content:"";left:-21px;top:6px;width:16px;height:16px;margin-right:5px;background-size:contain;background-image:url(../img/ruler_icon.png)}.block_container .block .inspect_container .segment_rules .referral-rule pre:before{background-image:url(../img/referral_icon.png)}.block_container .block .inspect_container .segment_rules .query-rule pre:before{background-image:url(../img/referral_icon.png)}.block_container .block.suggestion .suggestive_text{display:block;position:absolute;width:calc(100% - 40px);text-align:center;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);color:#d9d9d9;font-size:20px;font-weight:100}
/*# sourceMappingURL=dashboard.css.map*/

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
.nice-padding{padding-left:50px;padding-right:50px}.block_container{display:block;margin-top:30px}.block_container .block{display:block;float:left;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:calc(50% - 10px);min-height:216px;padding:10px 20px;margin-bottom:20px;border:1px solid #d9d9d9;border-radius:3px;background-color:#fff;-webkit-box-shadow:0 1px 3px transparent,0 1px 2px transparent;box-shadow:0 1px 3px transparent,0 1px 2px transparent;-webkit-transition:border .3s cubic-bezier(.25,.8,.25,1),-webkit-box-shadow .3s cubic-bezier(.25,.8,.25,1);transition:border .3s cubic-bezier(.25,.8,.25,1),-webkit-box-shadow .3s cubic-bezier(.25,.8,.25,1);transition:box-shadow .3s cubic-bezier(.25,.8,.25,1),border .3s cubic-bezier(.25,.8,.25,1);transition:box-shadow .3s cubic-bezier(.25,.8,.25,1),border .3s cubic-bezier(.25,.8,.25,1),-webkit-box-shadow .3s cubic-bezier(.25,.8,.25,1);cursor:pointer}.block_container .block--disabled .inspect_container,.block_container .block--disabled h2{opacity:.5}.block_container .block h2{display:inline-block;width:auto}.block_container .block:nth-child(odd){margin-right:20px}.block_container .block .block_actions{list-style:none;margin:0;padding:0}.block_container .block .block_actions li{float:left;margin-right:10px}.block_container .block .block_actions li:last-child{margin-right:0}.block_container .block.suggestion{border:1px dashed #d9d9d9}.block_container .block:hover{border:1px solid #fff;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23)}@media (max-width:699px){.block_container .block{width:100%;margin-right:0}}.block_container .block .inspect_container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;margin-bottom:10px}.block_container .block .inspect_container .inspect{display:block;float:left;width:calc(50% - 10px);padding:0;margin:0;list-style:none}.block_container .block .inspect_container .inspect li{display:inline-block;margin-bottom:5px}.block_container .block .inspect_container .inspect li span{display:block;font-size:20px;font-weight:700;margin:5px 0;overflow-wrap:break-word}.block_container .block .inspect_container .inspect li span:before{display:inline-block;content:"";width:16px;height:16px;margin-right:5px;background-size:contain;background-image:url(../img/ruler_icon.png)}.block_container .block .inspect_container .segment_stats .visit_stat span:before{background-image:url(../img/rocket_icon.png)}.block_container .block .inspect_container .segment_stats .days_stat span:before{background-image:url(../img/calendar_icon.png)}.block_container .block .inspect_container .segment_rules .persistent_state span:before{background-image:url(../img/persistent_icon.png)}.block_container .block .inspect_container .segment_rules .persistent_state.fleeting span:before{-webkit-transform:rotate(45deg) translateY(-2px);transform:rotate(45deg) translateY(-2px)}.block_container .block .inspect_container .segment_rules .time-rule span:before{background-image:url(../img/time_icon.png)}.block_container .block .inspect_container .segment_rules .visit-count-rule span:before{background-image:url(../img/visit_count_icon.png)}.block_container .block .inspect_container .segment_rules .logged-in-rule span:before{background-image:url(../img/key_icon.png)}.block_container .block .inspect_container .segment_rules .day-rule span:before{background-image:url(../img/calendar_icon.png)}.block_container .block .inspect_container .inspect li pre{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:auto;background-color:#eee;border:1px solid #ccc;margin:5px 0 5px 21px;padding:2px 5px;word-wrap:break-word;word-break:break-all;border-radius:3px}.block_container .block .inspect_container .inspect li pre:before{display:inline-block;position:absolute;content:"";left:-21px;top:6px;width:16px;height:16px;margin-right:5px;background-size:contain;background-image:url(../img/ruler_icon.png)}.block_container .block .inspect_container .segment_rules .referral-rule pre:before{background-image:url(../img/referral_icon.png)}.block_container .block .inspect_container .segment_rules .query-rule pre:before{background-image:url(../img/referral_icon.png)}.block_container .block.suggestion .suggestive_text{display:block;position:absolute;width:calc(100% - 40px);text-align:center;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);color:#d9d9d9;font-size:20px;font-weight:100}
/*# sourceMappingURL=index.css.map*/

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,7 @@
/******/
/******/ // objects to store loaded and loading chunks
/******/ var installedChunks = {
/******/ 2: 0
/******/ 3: 0
/******/ };
/******/
/******/ var resolvedPromise = new Promise(function(resolve) { resolve(); });

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
webpackJsonp([1],[
webpackJsonp([2],[
/* 0 */
/***/ (function(module, exports) {
@ -6,7 +6,8 @@ webpackJsonp([1],[
/***/ }),
/* 1 */,
/* 2 */
/* 2 */,
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -15,5 +16,5 @@ webpackJsonp([1],[
__webpack_require__(0);
/***/ })
],[2]);
//# sourceMappingURL=form.js.map
],[3]);
//# sourceMappingURL=dashboard.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///./scss/dashboard.scss?d2b5","webpack:///./js/dashboard.js"],"names":[],"mappings":";;;;AAAA,yC;;;;;;;;;;;ACAA,uB","file":"dashboard.js","sourcesContent":["// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./scss/dashboard.scss\n// module id = 0\n// module chunks = 2","import '../scss/dashboard.scss';\n\n\n\n// WEBPACK FOOTER //\n// ./js/dashboard.js"],"sourceRoot":""}

View File

@ -1,19 +1,21 @@
webpackJsonp([1],[
/* 0 */
/* 0 */,
/* 1 */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/* 1 */,
/* 2 */
/* 2 */,
/* 3 */,
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(0);
__webpack_require__(1);
/***/ })
],[2]);
],[4]);
//# sourceMappingURL=form.js.map

View File

@ -1 +1 @@
{"version":3,"sources":["webpack:///./scss/form.scss?4a48","webpack:///./js/form.js"],"names":[],"mappings":";;;;AAAA,yC;;;;;;;;;;ACAA,uB","file":"form.js","sourcesContent":["// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./scss/form.scss\n// module id = 0\n// module chunks = 1","import '../scss/form.scss';\n\n\n\n// WEBPACK FOOTER //\n// ./js/form.js"],"sourceRoot":""}
{"version":3,"sources":["webpack:///./scss/form.scss?4a48","webpack:///./js/form.js"],"names":[],"mappings":";;;;;AAAA,yC;;;;;;;;;;;ACAA,uB","file":"form.js","sourcesContent":["// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./scss/form.scss\n// module id = 1\n// module chunks = 1","import '../scss/form.scss';\n\n\n\n// WEBPACK FOOTER //\n// ./js/form.js"],"sourceRoot":""}

View File

@ -1,20 +1,21 @@
webpackJsonp([0],[
/* 0 */,
/* 1 */
webpackJsonp([0],{
/***/ 2:
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/* 2 */,
/* 3 */
/***/ 5:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(1);
__webpack_require__(2);
/***/ })
],[3]);
},[5]);
//# sourceMappingURL=index.js.map

View File

@ -1 +1 @@
{"version":3,"sources":["webpack:///./scss/index.scss?e221","webpack:///./js/index.js"],"names":[],"mappings":";;;;;AAAA,yC;;;;;;;;;;ACAA,uB","file":"index.js","sourcesContent":["// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./scss/index.scss\n// module id = 1\n// module chunks = 0","import '../scss/index.scss';\n\n\n\n// WEBPACK FOOTER //\n// ./js/index.js"],"sourceRoot":""}
{"version":3,"sources":["webpack:///./scss/index.scss","webpack:///./js/index.js"],"names":[],"mappings":";;;;;AAAA,yC;;;;;;;;;;ACAA,uB","file":"index.js","sourcesContent":["// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./scss/index.scss\n// module id = 2\n// module chunks = 0","import '../scss/index.scss';\n\n\n\n// WEBPACK FOOTER //\n// ./js/index.js"],"sourceRoot":""}

View File

@ -25,6 +25,7 @@
{% if user_can_create %}
<div class="right">
<div class="addbutton">
<a href="{% url 'segment:toggle_segment_view' %}" class="button" title="{% trans "Switch view" %}">Switch {% block toggle_view %}{% endblock%}view</a>
{% include 'modeladmin/includes/button.html' with button=view.button_helper.add_button %}
</div>
</div>

View File

@ -1,6 +1,8 @@
{% extends "modeladmin/wagtail_personalisation/segment/base.html" %}
{% load i18n l10n staticfiles modeladmin_tags wagtail_personalisation_filters %}
{% block toggle_view %}to List {% endblock%}
{% block content_main %}
<div>
<div class="row">

View File

@ -1,6 +1,8 @@
{% extends "modeladmin/wagtail_personalisation/segment/base.html" %}
{% load i18n l10n staticfiles modeladmin_tags wagtail_personalisation_filters %}
{% block toggle_view %}to Dashboard {% endblock%}
{% block content_main %}
<div>
<div class="row">

View File

@ -12,12 +12,12 @@ from wagtail_personalisation.models import PersonalisablePage, Segment
class SegmentModelIndexView(IndexView):
"""Placeholder for additional dashboard functionality."""
"""Placeholder for additional list functionality."""
pass
class SegmentModelDashboardView(IndexView):
"""Placeholder for additional dashboard functionality."""
"""Additional dashboard functionality."""
def media(self):
return forms.Media(
css={'all': ['css/dashboard.css']},
@ -48,6 +48,11 @@ class SegmentModelAdmin(ModelAdmin):
def index_view(self, request):
kwargs = {'model_admin': self}
view_class = self.index_view_class
request.session.setdefault('segment_view', 'list')
if request.session['segment_view'] != 'list':
view_class = self.dashboard_view_class
return view_class.as_view(**kwargs)(request)
def visits(self, obj):
@ -59,6 +64,27 @@ class SegmentModelAdmin(ModelAdmin):
days=obj.get_active_days())
def toggle_segment_view(request):
"""Toggle between the list view and dashboard view.
:param request: The http request
:type request: django.http.HttpRequest
:returns: A redirect to the original page
:rtype: django.http.HttpResponseRedirect
"""
if request.user.has_perm('wagtailadmin.access_admin'):
if request.session['segment_view'] == 'list':
request.session['segment_view'] = 'dashboard'
elif request.session['segment_view'] != 'list':
request.session['segment_view'] = 'list'
return HttpResponseRedirect(request.META.get('HTTP_REFERER', '/'))
return HttpResponseForbidden()
def toggle(request, segment_id):
"""Toggle the status of the selected segment.

View File

@ -10,6 +10,7 @@ module.exports = {
context: path.resolve(__dirname, './frontend'),
entry: {
index: './js/index.js',
dashboard: './js/dashboard.js',
form: './js/form.js'
},
output: {