Generification of page edit
This commit is contained in:
parent
a6baa46ddc
commit
c4ab608d76
5 changed files with 42 additions and 41 deletions
22
motorradig/.idea/workspace.xml
generated
22
motorradig/.idea/workspace.xml
generated
|
|
@ -2,16 +2,11 @@
|
|||
<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$/database/migrations/2020_01_28_072844_create_pagecontents_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2020_01_28_072844_create_pagecontents_table.php" 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" />
|
||||
|
|
@ -153,6 +148,7 @@
|
|||
<property name="node.js.selected.package.eslint" value="(autodetect)" />
|
||||
<property name="node.js.selected.package.tslint" value="(autodetect)" />
|
||||
<property name="nodejs_package_manager_path" value="yarn" />
|
||||
<property name="settings.editor.selected.configurable" value="terminal" />
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
|
|
@ -232,6 +228,8 @@
|
|||
<workItem from="1580281771610" duration="2990000" />
|
||||
<workItem from="1580370378793" duration="3758000" />
|
||||
<workItem from="1580461236383" duration="4110000" />
|
||||
<workItem from="1580563491409" duration="793000" />
|
||||
<workItem from="1580564326421" duration="2122000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
|
@ -255,10 +253,22 @@
|
|||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||
</component>
|
||||
<component name="WindowStateProjectService">
|
||||
<state x="629" y="273" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog" timestamp="1580564280549">
|
||||
<screen x="0" y="0" width="1920" height="1080" />
|
||||
</state>
|
||||
<state x="629" y="273" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.1920.1080@0.0.1920.1080" timestamp="1580564280549" />
|
||||
<state x="450" y="179" key="SettingsEditor" timestamp="1580565058667">
|
||||
<screen x="0" y="0" width="1920" height="1080" />
|
||||
</state>
|
||||
<state x="450" y="179" key="SettingsEditor/0.0.1920.1080@0.0.1920.1080" timestamp="1580565058667" />
|
||||
<state x="1280" y="23" width="1720" height="857" maximized="true" key="com.intellij.history.integration.ui.views.FileHistoryDialog" timestamp="1580282545601">
|
||||
<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="655" y="365" key="com.intellij.ide.util.TipDialog" timestamp="1580564338333">
|
||||
<screen x="0" y="0" width="1920" height="1080" />
|
||||
</state>
|
||||
<state x="655" y="365" key="com.intellij.ide.util.TipDialog/0.0.1920.1080@0.0.1920.1080" timestamp="1580564338333" />
|
||||
<state x="623" y="178" width="673" height="724" key="find.popup" timestamp="1580465329892">
|
||||
<screen x="0" y="0" width="1920" height="1080" />
|
||||
</state>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class CreatePagecontentsTable extends Migration
|
|||
Schema::create('pagecontents', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('page')->default('');
|
||||
$table->string('body')->default('');
|
||||
$table->text('body')->default('');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
54
motorradig/public/js/app.js
vendored
54
motorradig/public/js/app.js
vendored
|
|
@ -1924,6 +1924,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
savePage: function savePage() {
|
||||
var _this = this;
|
||||
|
||||
console.log('Saving to page:' + this.$store.state.page_name);
|
||||
axios.post('http://localhost:8000/api/v1/auth/save_page', {
|
||||
page: this.$store.state.page_name,
|
||||
body: this.editor.view.docView.dom.innerHTML
|
||||
|
|
@ -1932,7 +1933,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
}).then(function (res) {
|
||||
console.log("savePage: Wrote " + _this.$store.state.page_name);
|
||||
console.log("savePage success: Wrote " + _this.$store.state.page_name);
|
||||
console.log("Going back to main view");
|
||||
|
||||
_this.$router.push("/");
|
||||
|
|
@ -2034,17 +2035,18 @@ __webpack_require__.r(__webpack_exports__);
|
|||
editPage: function editPage() {
|
||||
this.$router.push('/edit_page');
|
||||
},
|
||||
loadPage: function loadPage() {
|
||||
loadPage: function loadPage(page_name) {
|
||||
var _this2 = this;
|
||||
|
||||
console.log("loadPage: " + page_name);
|
||||
this.$store.state.page_name = page_name;
|
||||
axios.post('http://localhost:8000/api/v1/load_page', {
|
||||
page: this.$store.state.page_name
|
||||
page: page_name
|
||||
}, {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + this.$store.state.user_token
|
||||
}
|
||||
}).then(function (res) {
|
||||
console.log("loadPage: Loading Testpage");
|
||||
console.log("Body:");
|
||||
console.log(res.data.body);
|
||||
_this2.$store.state.page_content = res.data.body;
|
||||
|
|
@ -2053,15 +2055,17 @@ __webpack_require__.r(__webpack_exports__);
|
|||
},
|
||||
created: function created() {
|
||||
console.log("Main component created");
|
||||
this.loadPage(this.$store.state.page_name); // Store default is 'main'
|
||||
|
||||
if (!this.$store.state.user_token) {
|
||||
console.log("No token on user detected. Waiting for user login.");
|
||||
console.log("store.state.user:");
|
||||
console.log(this.$store.state.user);
|
||||
} else {
|
||||
//this.$router.push("/main");
|
||||
this.loadPage();
|
||||
}
|
||||
/*
|
||||
if (!this.$store.state.user_token) {
|
||||
console.log("No token on user detected. Waiting for user login.");
|
||||
console.log("store.state.user:");
|
||||
console.log(this.$store.state.user);
|
||||
} else {
|
||||
this.loadPage('main');
|
||||
}
|
||||
*/
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -31050,7 +31054,7 @@ var render = function() {
|
|||
staticClass: "button",
|
||||
on: {
|
||||
click: function($event) {
|
||||
return _vm.changeMainText("Über uns")
|
||||
return _vm.loadPage("ueber_uns")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -31063,7 +31067,7 @@ var render = function() {
|
|||
staticClass: "button",
|
||||
on: {
|
||||
click: function($event) {
|
||||
return _vm.changeMainText("Aktuelles")
|
||||
return _vm.loadPage("aktuelles")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -31072,14 +31076,7 @@ var render = function() {
|
|||
_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(" "),
|
||||
|
|
@ -31129,14 +31126,7 @@ 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(" "),
|
||||
|
|
@ -31146,7 +31136,7 @@ var render = function() {
|
|||
staticClass: "button",
|
||||
on: {
|
||||
click: function($event) {
|
||||
return _vm.changeMainText("Links")
|
||||
return _vm.loadPage("links")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -31159,7 +31149,7 @@ var render = function() {
|
|||
staticClass: "button",
|
||||
on: {
|
||||
click: function($event) {
|
||||
return _vm.changeMainText("Impressum")
|
||||
return _vm.loadPage("Impressum")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -111,12 +111,13 @@
|
|||
methods: {
|
||||
|
||||
showContent() {
|
||||
console.log(">>");
|
||||
console.log(">>" );
|
||||
//console.log(this.editor.view.dom.innerText);
|
||||
//console.log(this.editor.docView.dom.innerHTML);
|
||||
console.log(this.editor.view.docView.dom.innerHTML);
|
||||
},
|
||||
savePage() {
|
||||
console.log('Saving to page:'+this.$store.state.page_name);
|
||||
axios.post('http://localhost:8000/api/v1/auth/save_page',{
|
||||
page: this.$store.state.page_name,
|
||||
body: this.editor.view.docView.dom.innerHTML
|
||||
|
|
@ -126,7 +127,7 @@
|
|||
}
|
||||
})
|
||||
.then(res => {
|
||||
console.log("savePage: Wrote "+this.$store.state.page_name);
|
||||
console.log("savePage success: Wrote "+this.$store.state.page_name);
|
||||
console.log("Going back to main view");
|
||||
this.$router.push("/");
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue