+
+ {{ record.id }} |
+ {{ record.fields[0].value.value }} |
@@ -34,6 +24,7 @@
diff --git a/assets/js/Sidebar.vue b/assets/js/Sidebar.vue
index 127616bca..3ac126e2e 100644
--- a/assets/js/Sidebar.vue
+++ b/assets/js/Sidebar.vue
@@ -3,38 +3,66 @@
-
-
-
-
-
- Dashboard
-
-
-
+
+
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/js/bolt.js b/assets/js/bolt.js
index 15ff4c3a0..232a73ca3 100644
--- a/assets/js/bolt.js
+++ b/assets/js/bolt.js
@@ -2,7 +2,6 @@
import Vue from 'vue';
import router from './router';
-import store from './store';
// import './registerServiceWorker'
// Bolt Components
@@ -11,7 +10,6 @@ import Sidebar from './Sidebar'
import Topbar from './Topbar'
import DashboardNews from './DashboardNews'
import DashboardContentList from './DashboardContentList'
-import Content from './Content';
import App from './App'
import '../scss/bolt.scss'
@@ -27,9 +25,9 @@ Vue.component('dashboardcontentlist', DashboardContentList)
const $ = require('jquery');
global.$ = global.jQuery = $;
-new Vue({ el: 'header', router, store });
-new Vue({ el: '#sidebar', router, store });
-new Vue({ el: '#vuecontent', router, store });
+new Vue({ el: 'header', router });
+new Vue({ el: '#sidebar', router });
+new Vue({ el: '#vuecontent', router });
new Vue({ el: 'dashboardnews' });
diff --git a/assets/js/service/api/content.js b/assets/js/service/api/content.js
index 170074fda..69e612ac1 100644
--- a/assets/js/service/api/content.js
+++ b/assets/js/service/api/content.js
@@ -1,9 +1,19 @@
import axios from 'axios';
export default {
- getAll (type) {
+ getRecords (type) {
// where = where || [];
// implode
- return axios.get('/api/contents.json?contentType=' + type);
+ let records = JSON.parse(localStorage.getItem('records-' + type));
+ return records;
},
+
+ fetchRecords(type) {
+ return axios.get('/api/contents.json?contentType=' + type + '&pageSize=5')
+ .then(response => {
+ // save to localstorage _and_ return data
+ localStorage.setItem('records', JSON.stringify(response.data));
+ return response.data
+ });
+ }
}
\ No newline at end of file
diff --git a/assets/js/store/content.js b/assets/js/store/content.js
deleted file mode 100644
index ca94be37e..000000000
--- a/assets/js/store/content.js
+++ /dev/null
@@ -1,57 +0,0 @@
-import ContentAPI from '../service/api/content';
-
-export default {
- namespaced: true,
- state: {
- isLoading: false,
- error: null,
- content: [],
- },
- getters: {
- isLoading (state) {
- return state.isLoading;
- },
- hasError (state) {
- return state.error !== null;
- },
- error (state) {
- return state.error;
- },
- hasContent (state) {
- return state.content.length > 0;
- },
- content (state) {
- return state.content;
- },
- },
- mutations: {
- ['FETCHING_CONTENT'](state) {
- state.isLoading = true;
- state.error = null;
- state.content = [];
- },
- ['FETCHING_CONTENT_SUCCESS'](state, content) {
- state.isLoading = false;
- state.error = null;
- state.content = content;
- },
- ['FETCHING_CONTENT_ERROR'](state, error) {
- state.isLoading = false;
- state.error = error;
- state.content = [];
- },
- },
- actions: {
- fetchContent ({commit}, type) {
- commit('FETCHING_CONTENT');
- // if exists in localStorage, serve that
- // state.content['fefef'] -> res.data
- // ?refresh=1 do real call
-
- return ContentAPI.getAll(type)
- .then(res => commit('FETCHING_CONTENT_SUCCESS', res.data))
- .catch(err => commit('FETCHING_CONTENT_ERROR', err))
- ;
- },
- },
-}
diff --git a/assets/js/store/index.js b/assets/js/store/index.js
deleted file mode 100644
index 7420e1616..000000000
--- a/assets/js/store/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import Vue from 'vue';
-import Vuex from 'vuex';
-import ContentModule from './content';
-
-Vue.use(Vuex);
-
-export default new Vuex.Store({
- modules: {
- content: ContentModule,
- }
-});
\ No newline at end of file
diff --git a/package.json b/package.json
index 7784a669b..25e75e235 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,6 @@
"vue-loader": "^14",
"vue-router": "^3.0.1",
"vue-template-compiler": "^2.5.17",
- "vuex": "^3.0.1",
"workbox-webpack-plugin": "^3.6.1"
},
"dependencies": {
diff --git a/public/assets/bolt.js b/public/assets/bolt.js
index ba947d10d..7f2b98a3b 100644
--- a/public/assets/bolt.js
+++ b/public/assets/bolt.js
@@ -1,9 +1,9 @@
-!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/assets/",t(t.s="2qrm")}({"/ocq":function(e,t,n){"use strict";function r(e,t){}function o(e){return Object.prototype.toString.call(e).indexOf("Error")>-1}function i(e,t){switch(typeof t){case"undefined":return;case"object":return t;case"function":return t(e);case"boolean":return t?e.params:void 0}}function a(e,t){for(var n in t)e[n]=t[n];return e}function s(e,t,n){void 0===t&&(t={});var r,o=n||u;try{r=o(e||"")}catch(e){r={}}for(var i in t)r[i]=t[i];return r}function u(e){var t={};return(e=e.trim().replace(/^(\?|#|&)/,""))?(e.split("&").forEach(function(e){var n=e.replace(/\+/g," ").split("="),r=He(n.shift()),o=n.length>0?He(n.join("=")):null;void 0===t[r]?t[r]=o:Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]}),t):t}function c(e){var t=e?Object.keys(e).map(function(t){var n=e[t];if(void 0===n)return"";if(null===n)return qe(t);if(Array.isArray(n)){var r=[];return n.forEach(function(e){void 0!==e&&(null===e?r.push(qe(t)):r.push(qe(t)+"="+qe(e)))}),r.join("&")}return qe(t)+"="+qe(n)}).filter(function(e){return e.length>0}).join("&"):null;return t?"?"+t:""}function l(e,t,n,r){var o=r&&r.options.stringifyQuery,i=t.query||{};try{i=f(i)}catch(e){}var a={name:t.name||e&&e.name,meta:e&&e.meta||{},path:t.path||"/",hash:t.hash||"",query:i,params:t.params||{},fullPath:d(t,o),matched:e?p(e):[]};return n&&(a.redirectedFrom=d(n,o)),Object.freeze(a)}function f(e){if(Array.isArray(e))return e.map(f);if(e&&"object"==typeof e){var t={};for(var n in e)t[n]=f(e[n]);return t}return e}function p(e){for(var t=[];e;)t.unshift(e),e=e.parent;return t}function d(e,t){var n=e.path,r=e.query;void 0===r&&(r={});var o=e.hash;void 0===o&&(o="");var i=t||c;return(n||"/")+i(r)+o}function h(e,t){return t===Be?e===t:!!t&&(e.path&&t.path?e.path.replace(Fe,"")===t.path.replace(Fe,"")&&e.hash===t.hash&&v(e.query,t.query):!(!e.name||!t.name)&&(e.name===t.name&&e.hash===t.hash&&v(e.query,t.query)&&v(e.params,t.params)))}function v(e,t){if(void 0===e&&(e={}),void 0===t&&(t={}),!e||!t)return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(n){var r=e[n],o=t[n];return"object"==typeof r&&"object"==typeof o?v(r,o):String(r)===String(o)})}function m(e,t){return 0===e.path.replace(Fe,"/").indexOf(t.path.replace(Fe,"/"))&&(!t.hash||e.hash===t.hash)&&y(e.query,t.query)}function y(e,t){for(var n in t)if(!(n in e))return!1;return!0}function g(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||e.defaultPrevented||void 0!==e.button&&0!==e.button)){if(e.currentTarget&&e.currentTarget.getAttribute){if(/\b_blank\b/i.test(e.currentTarget.getAttribute("target")))return}return e.preventDefault&&e.preventDefault(),!0}}function b(e){if(e)for(var t,n=0;n