Working on display of the other pages

This commit is contained in:
tschneider 2020-01-31 11:15:25 +01:00
parent d3479e77f1
commit a6baa46ddc
12 changed files with 482 additions and 150 deletions

View file

@ -2,10 +2,16 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="eed7de89-f054-487c-bf59-36356758942b" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/resources/js/Icon.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/seeds/DatabaseSeeder.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/seeds/DatabaseSeeder.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/js/Icon.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/Icon.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/js/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/app.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/mix-manifest.json" beforeDir="false" afterPath="$PROJECT_DIR$/public/mix-manifest.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/js/store.js" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/store.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/js/views/EditPage.vue" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/views/EditPage.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/js/views/Main.vue" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/views/Main.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webpack.mix.js" beforeDir="false" afterPath="$PROJECT_DIR$/webpack.mix.js" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -137,8 +143,9 @@
</component>
<component name="PropertiesComponent">
<property name="ASKED_ADD_EXTERNAL_FILES" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/resources/js/views" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/resources/js" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
@ -148,16 +155,16 @@
<property name="nodejs_package_manager_path" value="yarn" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resources/views" />
<recent name="$PROJECT_DIR$/public" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="D:\repos\motorradig\motorradig\resources\js" />
<recent name="$PROJECT_DIR$/resources/js/views" />
<recent name="$PROJECT_DIR$/app/Http/Controllers" />
<recent name="$PROJECT_DIR$/resources/js" />
<recent name="$PROJECT_DIR$/resources/js/vue" />
<recent name="$PROJECT_DIR$/resources/js/vue/components" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resources/views" />
<recent name="$PROJECT_DIR$/public" />
</key>
</component>
<component name="RunManager" selected="Node.js.app.js">
@ -224,6 +231,7 @@
<workItem from="1579800919877" duration="5421000" />
<workItem from="1580281771610" duration="2990000" />
<workItem from="1580370378793" duration="3758000" />
<workItem from="1580461236383" duration="4110000" />
</task>
<servers />
</component>
@ -251,13 +259,15 @@
<screen x="1280" y="23" width="1920" height="1057" />
</state>
<state x="1280" y="23" width="1720" height="857" maximized="true" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.23.1280.777/1280.23.1920.1057@1280.23.1920.1057" timestamp="1580282545601" />
<state x="1903" y="197" width="673" height="708" key="find.popup" timestamp="1579597123793">
<screen x="1280" y="23" width="1920" height="1057" />
<state x="623" y="178" width="673" height="724" key="find.popup" timestamp="1580465329892">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state x="623" y="178" width="673" height="724" key="find.popup/0.0.1920.1080@0.0.1920.1080" timestamp="1580465329892" />
<state x="1903" y="197" width="673" height="708" key="find.popup/0.23.1280.777/1280.23.1920.1057@1280.23.1920.1057" timestamp="1579597123793" />
<state x="1905" y="258" width="670" height="676" key="search.everywhere.popup" timestamp="1580196905378">
<screen x="1280" y="23" width="1920" height="1057" />
<state x="625" y="240" width="672" height="691" key="search.everywhere.popup" timestamp="1580465130135">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state x="625" y="240" width="672" height="691" key="search.everywhere.popup/0.0.1920.1080@0.0.1920.1080" timestamp="1580465130135" />
<state x="1905" y="258" width="670" height="676" key="search.everywhere.popup/0.23.1280.777/1280.23.1920.1057@1280.23.1920.1057" timestamp="1580196905378" />
</component>
</project>

BIN
motorradig/composer.phar Normal file

Binary file not shown.

View file

@ -28,6 +28,12 @@ class DatabaseSeeder extends Seeder
'body' => '<h1></h1>http://www.bmw-motorrad.de<br/>http://motorrad.suzuki.de/</h1>'
]);
DB::table('main')->insert([
'page' => 'links',
'body' => '<h1>Willkommen auf der Homepage der MotorradIG.</h1>'
]);
DB::table('pagecontents')->insert([
'page' => 'impressum',
'body' => '<h1>Impressum<br/>
@ -41,5 +47,5 @@ Email: motorradig (at) aol.com<br/>
© bei Motorrad-IG 2009</h1>'
]);
}
}

View file

@ -0,0 +1,4 @@
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'c5b9b6d368201a9db6f74e2611495f369991b72d9c8cbd3ffbc63edff210eb73d46ffbfce88669ad33695ef77dc76976') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

View file

@ -86,25 +86,312 @@
/************************************************************************/
/******/ ({
/***/ "./resources/js/views/components/Icon.js":
/*!***********************************************!*\
!*** ./resources/js/views/components/Icon.js ***!
\***********************************************/
/***/ "./resources/js/Icon.js":
/*!******************************!*\
!*** ./resources/js/Icon.js ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports) {
throw new Error("Module build failed (from ./node_modules/babel-loader/lib/index.js):\nError: ENOENT: no such file or directory, open '/Users/tschneider/dev/repo/motorradig/motorradig/resources/js/views/components/Icon.js'");
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/******/
(function (modules) {
// webpackBootstrap
/******/
// The module cache
/******/
var installedModules = {};
/******/
/******/
// 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;
/******/
}
/******/
/******/
/******/
// expose the modules object (__webpack_modules__)
/******/
__webpack_require__.m = modules;
/******/
/******/
// expose the module cache
/******/
__webpack_require__.c = installedModules;
/******/
/******/
// define getter function for harmony exports
/******/
__webpack_require__.d = function (exports, name, getter) {
/******/
if (!__webpack_require__.o(exports, name)) {
/******/
Object.defineProperty(exports, name, {
enumerable: true,
get: getter
});
/******/
}
/******/
};
/******/
/******/
// define __esModule on exports
/******/
__webpack_require__.r = function (exports) {
/******/
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/
Object.defineProperty(exports, Symbol.toStringTag, {
value: 'Module'
});
/******/
}
/******/
Object.defineProperty(exports, '__esModule', {
value: true
});
/******/
};
/******/
/******/
// create a fake namespace object
/******/
// mode & 1: value is a module id, require it
/******/
// mode & 2: merge all properties of value into the ns
/******/
// mode & 4: return value when already ns object
/******/
// mode & 8|1: behave like require
/******/
__webpack_require__.t = function (value, mode) {
/******/
if (mode & 1) value = __webpack_require__(value);
/******/
if (mode & 8) return value;
/******/
if (mode & 4 && _typeof(value) === 'object' && value && value.__esModule) return value;
/******/
var ns = Object.create(null);
/******/
__webpack_require__.r(ns);
/******/
Object.defineProperty(ns, 'default', {
enumerable: true,
value: value
});
/******/
if (mode & 2 && typeof value != 'string') for (var key in value) {
__webpack_require__.d(ns, key, function (key) {
return value[key];
}.bind(null, key));
}
/******/
return ns;
/******/
};
/******/
/******/
// 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 = "/";
/******/
/******/
/******/
// Load entry module and return exports
/******/
return __webpack_require__(__webpack_require__.s = 1);
/******/
})(
/************************************************************************/
/******/
{
/***/
"./resources/js/views/components/Icon.js":
/*!***********************************************!*\
!*** ./resources/js/views/components/Icon.js ***!
\***********************************************/
/*! no static exports found */
/***/
function resourcesJsViewsComponentsIconJs(module, exports) {
throw new Error("Module build failed (from ./node_modules/babel-loader/lib/index.js):\nError: ENOENT: no such file or directory, open '/Users/tschneider/dev/repo/motorradig/motorradig/resources/js/views/components/Icon.js'");
/***/
},
/***/
1:
/*!*****************************************************!*\
!*** multi ./resources/js/views/components/Icon.js ***!
\*****************************************************/
/*! no static exports found */
/***/
function _(module, exports, __webpack_require__) {
module.exports = __webpack_require__(
/*! /Users/tschneider/dev/repo/motorradig/motorradig/resources/js/views/components/Icon.js */
"./resources/js/views/components/Icon.js");
/***/
}
/******/
});
/***/ }),
/***/ 1:
/*!*****************************************************!*\
!*** multi ./resources/js/views/components/Icon.js ***!
\*****************************************************/
/*!************************************!*\
!*** multi ./resources/js/Icon.js ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! /Users/tschneider/dev/repo/motorradig/motorradig/resources/js/views/components/Icon.js */"./resources/js/views/components/Icon.js");
module.exports = __webpack_require__(/*! /mnt/d/repos/motorradig/motorradig/resources/js/Icon.js */"./resources/js/Icon.js");
/***/ })

View file

@ -1925,14 +1925,14 @@ __webpack_require__.r(__webpack_exports__);
var _this = this;
axios.post('http://localhost:8000/api/v1/auth/save_page', {
page: 'testpage',
page: this.$store.state.page_name,
body: this.editor.view.docView.dom.innerHTML
}, {
headers: {
'Authorization': 'Bearer ' + this.$store.state.user_token
}
}).then(function (res) {
console.log("savePage: Wrote Testpage");
console.log("savePage: Wrote " + _this.$store.state.page_name);
console.log("Going back to main view");
_this.$router.push("/");
@ -2007,6 +2007,10 @@ __webpack_require__.r(__webpack_exports__);
};
},
methods: {
set_page: function set_page(pageName) {
this.$store.state.page_name = pageName;
this.loadPage();
},
logout: function logout() {
var _this = this;
@ -2034,29 +2038,17 @@ __webpack_require__.r(__webpack_exports__);
var _this2 = this;
axios.post('http://localhost:8000/api/v1/load_page', {
page: 'testpage'
page: this.$store.state.page_name
}, {
headers: {
'Authorization': 'Bearer ' + this.$store.state.user_token
}
}).then(function (res) {
console.log("savePage: Loading Testpage");
console.log("loadPage: Loading Testpage");
console.log("Body:");
console.log(res.data.body);
_this2.$store.state.page_content = res.data.body;
});
},
savePage: function savePage() {
axios.post('http://localhost:8000/api/v1/auth/save_page', {
page: 'testpage',
body: 'testbody'
}, {
headers: {
'Authorization': 'Bearer ' + this.$store.state.user_token
}
}).then(function (res) {
console.log("savePage: Wrote Testpage");
});
}
},
created: function created() {
@ -30866,40 +30858,19 @@ var render = function() {
[
_c(
"button",
{
staticClass: "button",
on: {
click: function($event) {
return _vm.changeMainText("Über uns")
}
}
},
{ staticClass: "button", on: { click: function($event) {} } },
[_vm._v("Über uns")]
),
_vm._v(" "),
_c(
"button",
{
staticClass: "button",
on: {
click: function($event) {
return _vm.changeMainText("Aktuelles")
}
}
},
{ staticClass: "button", on: { click: function($event) {} } },
[_vm._v("Aktuelles")]
),
_vm._v(" "),
_c(
"button",
{
staticClass: "button",
on: {
click: function($event) {
return _vm.changeMainText("Mitgliedsantrag")
}
}
},
{ staticClass: "button", on: { click: function($event) {} } },
[_vm._v("Mitgliedsantrag")]
),
_vm._v(" "),
@ -30907,14 +30878,7 @@ var render = function() {
? _c("span", [
_c(
"button",
{
staticClass: "button",
on: {
click: function($event) {
return _vm.changeMainText("Tourplan")
}
}
},
{ staticClass: "button", on: { click: function($event) {} } },
[_vm._v("Tourplan (Beispiel)")]
)
])
@ -30922,14 +30886,7 @@ var render = function() {
? _c("span", [
_c(
"button",
{
staticClass: "button",
on: {
click: function($event) {
return _vm.changeMainText("Tourplan")
}
}
},
{ staticClass: "button", on: { click: function($event) {} } },
[_vm._v("Tourplan (Gast)")]
)
])
@ -30937,14 +30894,7 @@ var render = function() {
? _c("span", [
_c(
"button",
{
staticClass: "button",
on: {
click: function($event) {
return _vm.changeMainText("Tourplan")
}
}
},
{ staticClass: "button", on: { click: function($event) {} } },
[_vm._v("Tourplan (komplett)")]
)
])
@ -30952,14 +30902,7 @@ var render = function() {
? _c("span", [
_c(
"button",
{
staticClass: "button",
on: {
click: function($event) {
return _vm.changeMainText("Tourplan")
}
}
},
{ staticClass: "button", on: { click: function($event) {} } },
[_vm._v("Tourplan (komplett)")]
)
])
@ -30967,40 +30910,19 @@ var render = function() {
_vm._v(" "),
_c(
"button",
{
staticClass: "button",
on: {
click: function($event) {
return _vm.changeMainText("Wetter")
}
}
},
{ staticClass: "button", on: { click: function($event) {} } },
[_vm._v("Wetter")]
),
_vm._v(" "),
_c(
"button",
{
staticClass: "button",
on: {
click: function($event) {
return _vm.changeMainText("Links")
}
}
},
{ staticClass: "button", on: { click: function($event) {} } },
[_vm._v("Links")]
),
_vm._v(" "),
_c(
"button",
{
staticClass: "button",
on: {
click: function($event) {
return _vm.changeMainText("Impressum")
}
}
},
{ staticClass: "button", on: { click: function($event) {} } },
[_vm._v("Impressum")]
),
_vm._v(" "),
@ -48057,6 +47979,7 @@ var store = new vuex__WEBPACK_IMPORTED_MODULE_1__["default"].Store({
state: {
user: {},
user_token: {},
page_name: 'main',
page_content: '<h1 style="font-align:center;">Placeholder</h1>'
}
});
@ -48357,8 +48280,8 @@ __webpack_require__.r(__webpack_exports__);
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(/*! /Users/tschneider/dev/repo/motorradig/motorradig/resources/js/app.js */"./resources/js/app.js");
module.exports = __webpack_require__(/*! /Users/tschneider/dev/repo/motorradig/motorradig/resources/sass/app.scss */"./resources/sass/app.scss");
__webpack_require__(/*! /mnt/d/repos/motorradig/motorradig/resources/js/app.js */"./resources/js/app.js");
module.exports = __webpack_require__(/*! /mnt/d/repos/motorradig/motorradig/resources/sass/app.scss */"./resources/sass/app.scss");
/***/ })

View file

@ -1,4 +1,5 @@
{
"/js/Icon.js": "/js/Icon.js",
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css"
}

112
motorradig/resources/js/Icon.js vendored Normal file
View file

@ -0,0 +1,112 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // 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;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // 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 = "/";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1);
/******/ })
/************************************************************************/
/******/ ({
/***/ "./resources/js/views/components/Icon.js":
/*!***********************************************!*\
!*** ./resources/js/views/components/Icon.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
throw new Error("Module build failed (from ./node_modules/babel-loader/lib/index.js):\nError: ENOENT: no such file or directory, open '/Users/tschneider/dev/repo/motorradig/motorradig/resources/js/views/components/Icon.js'");
/***/ }),
/***/ 1:
/*!*****************************************************!*\
!*** multi ./resources/js/views/components/Icon.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! /Users/tschneider/dev/repo/motorradig/motorradig/resources/js/views/components/Icon.js */"./resources/js/views/components/Icon.js");
/***/ })
/******/ });

View file

@ -6,6 +6,7 @@ export const store = new Vuex.Store({
state:{
user:{},
user_token:{},
page_name: 'main',
page_content:'<h1 style="font-align:center;">Placeholder</h1>'
}
});

View file

@ -6,19 +6,19 @@
<div class="has-text-centered">
<button class="button" @click="changeMainText('Über uns')" >Über uns</button>
<button class="button" @click="changeMainText('Aktuelles')" >Aktuelles</button>
<button class="button" @click="changeMainText('Mitgliedsantrag')">Mitgliedsantrag</button>
<button class="button" @click="" >Über uns</button>
<button class="button" @click="" >Aktuelles</button>
<button class="button" @click="">Mitgliedsantrag</button>
<span v-if="!this.$store.state.user.hasOwnProperty('role')"><button class="button" @click="changeMainText('Tourplan')" >Tourplan (Beispiel)</button></span>
<span v-else-if="this.$store.state.user.role==='GUEST'"><button class="button" @click="changeMainText('Tourplan')" >Tourplan (Gast)</button></span>
<span v-else-if="this.$store.state.user.role==='MEMBER'"><button class="button" @click="changeMainText('Tourplan')" >Tourplan (komplett)</button></span>
<span v-else-if="this.$store.state.user.role==='ADMIN'"><button class="button" @click="changeMainText('Tourplan')" >Tourplan (komplett)</button></span>
<span v-if="!this.$store.state.user.hasOwnProperty('role')"><button class="button" @click="" >Tourplan (Beispiel)</button></span>
<span v-else-if="this.$store.state.user.role==='GUEST'"><button class="button" @click="" >Tourplan (Gast)</button></span>
<span v-else-if="this.$store.state.user.role==='MEMBER'"><button class="button" @click="" >Tourplan (komplett)</button></span>
<span v-else-if="this.$store.state.user.role==='ADMIN'"><button class="button" @click="" >Tourplan (komplett)</button></span>
<button class="button" @click="changeMainText('Wetter')" >Wetter</button>
<button class="button" @click="changeMainText('Links')" >Links</button>
<button class="button" @click="changeMainText('Impressum')" >Impressum</button>
<button class="button" @click="" >Wetter</button>
<button class="button" @click="" >Links</button>
<button class="button" @click="" >Impressum</button>
<button class="button" @click="showContent()" >Show content</button>
@ -109,6 +109,7 @@
this.editor.destroy()
},
methods: {
showContent() {
console.log(">>");
//console.log(this.editor.view.dom.innerText);
@ -117,16 +118,15 @@
},
savePage() {
axios.post('http://localhost:8000/api/v1/auth/save_page',{
page: 'testpage',
page: this.$store.state.page_name,
body: this.editor.view.docView.dom.innerHTML
}, {
headers: {
'Authorization': 'Bearer ' + this.$store.state.user_token
}
})
.then(res => {
console.log("savePage: Wrote Testpage");
console.log("savePage: Wrote "+this.$store.state.page_name);
console.log("Going back to main view");
this.$router.push("/");
}

View file

@ -54,7 +54,10 @@
}
},
methods: {
set_page(pageName) {
this.$store.state.page_name=pageName;
this.loadPage();
},
logout() {
console.log("logging out with token "+this.$store.state.user_token);
@ -80,7 +83,7 @@
},
loadPage() {
axios.post('http://localhost:8000/api/v1/load_page',{
page: 'testpage'
page: this.$store.state.page_name
}, {
headers: {
@ -88,7 +91,7 @@
}
})
.then(res => {
console.log("savePage: Loading Testpage");
console.log("loadPage: Loading Testpage");
console.log("Body:");
console.log(res.data.body);
@ -96,22 +99,6 @@
}
)
}
,
savePage() {
axios.post('http://localhost:8000/api/v1/auth/save_page',{
page: 'testpage',
body: 'testbody'
}, {
headers: {
'Authorization': 'Bearer ' + this.$store.state.user_token
}
})
.then(res => {
console.log("savePage: Wrote Testpage");
}
)
}
}
,
created() {

View file

@ -12,4 +12,5 @@ const mix = require('laravel-mix');
*/
mix.js('resources/js/app.js', 'public/js')
.js('resources/js/Icon.js','public/js')
.sass('resources/sass/app.scss', 'public/css');