投稿の編集・削除機能性

このコミットが含まれているのは:
テクニカル諏訪子 2020-10-07 20:56:15 +09:00
コミット 07dfaf1387
8個のファイルの変更799行の追加72行の削除

ファイルの表示

@ -102,16 +102,17 @@ class Content {
}
public function delete (Request $r) {
if (($this->valid['blg_delpost'] && $bdl['isPost'] == 1) || ($this->valid['blg_delpage'] && $bdl['isPost'] == 0)) {
$chk = DB::table('blg_content')->select('isPost')->where('slug', $r->slug)->first();
if (($this->valid['blg_delpost'] && $chk->isPost == 1) || ($this->valid['blg_delpage'] && $chk->isPost == 0)) {
return DB::table('blg_content')->where('slug', $r->slug)->delete();
}
return 0;
return '許可がありません。';
}
public function edit (Request $r) {
if ($this->user && ($this->user->perm['blg_editpost'] || $this->user->perm['blg_editpage'])) {
$frm = DB::table('blg_content')->where('slug', $r->slug)->first();////////////////////
$frm = DB::table('blg_content')->where('slug', $r->slug)->first();
$err = '';
$res = '';
@ -137,49 +138,44 @@ class Content {
$r->isMenu = (int)$r->isMenu;
// フォームの値を保存して
$frm['title'] = $r->title;
$frm['slug'] = $r->slug;
$frm['public_status'] = $r->public_status;
$frm['publish_date'] = $r->publish_date;
$frm['isMenu'] = $r->isMenu;
$frm['isPost'] = $r->isPost;
$frm['message'] = $r->message;
$frm->title = $r->title;
$frm->public_status = $r->public_status;
$frm->publish_date = $r->publish_date;
$frm->isMenu = $r->isMenu;
$frm->isPost = $r->isPost;
$frm->message = $r->message;
// 件名、文章又はスラッグがなければ、エラーを出て
$verify = array('件名' => $r->title, 'スラッグ' => $r->slug, '文章' => $r->message);
$verify = array('件名' => $r->title, '文章' => $r->message);
$incomplete = array();
foreach ($verify as $k => $v) { if (is_null($v) || empty($v) || !isset($v)) $incomplete[] = $k; }
if (count($incomplete) > 0) $err = implode('、', $incomplete).'をご入力下さい。';
// スラッグが既に存在したら、エラーを出て
$sl = DB::table('blg_content')->select('slug')->where('slug', $r->slug)->first();
if ($sl && $sl->slug == $r->slug) $err = 'このスラッグがもう存在しています。';
// エラーがあったら、フォームに戻って。なければ、データベースに保存したり、ページ又はポストへ移転して
if (!empty($err)) return view('pages.site.content.add', ['res' => $res, 'menu' => $this->menu, 'user' => $this->user, 'err' => $err, 'frm' => $frm]);
if (!empty($err)) return view('pages.site.content.edit', ['res' => $res, 'menu' => $this->menu, 'user' => $this->user, 'err' => $err, 'frm' => $frm]);
else {
// データベースに追加できるには、値を修正して
$gs = DB::table('blg_content')->select('sortorder')->orderBy('sortorder', 'desc')->first();
if (!isset($r->publish_date)) $frm['publish_date'] = ($r->isPost == 1 ? time() : 0);
if (!isset($r->public_status)) $frm['public_status'] = 0;
if (!isset($r->isPost)) $frm['isPost'] = 0;
if (!isset($r->isMenu)) $frm['isMenu'] = 0;
$frm['post_date'] = ($r->isPost == 1 ? time() : 0);
$frm['sortorder'] = ($r->isPost == 0 ? $gs->sortorder+1 : 0);
if (!isset($r->publish_date)) $frm->publish_date = ($r->isPost == 1 ? time() : 0);
if (!isset($r->public_status)) $frm->public_status = 0;
if (!isset($r->isPost)) $frm->isPost = 0;
if (!isset($r->isMenu)) $frm->isMenu = 0;
$frm->post_date = ($r->isPost == 1 ? time() : 0);
$frm->sortorder = ($r->isPost == 0 ? $gs->sortorder+1 : 0);
// できたの?
if ($res = DB::table('blg_content')->where('slug', $bdl['slug'])->update($frm)) return redirect(($r->isPost == 1 ? '/blog/' : '/').$r->slug);
if ($res = DB::table('blg_content')->where('slug', $r->slug)->update((array)$frm)) return redirect(($r->isPost == 1 ? '/blog/' : '/').$r->slug);
else {
// やれやれ…
$frm['publish_date'] = $sav;
unset($frm['post_date']);
unset($frm['sortorder']);
return view('pages.site.content.add', ['res' => $res, 'menu' => $this->menu, 'user' => $this->user, 'err' => $err, 'frm' => $res['err']]);
$frm->publish_date = $sav;
unset($frm->post_date);
unset($frm->sortorder);
return view('pages.site.content.edit', ['res' => $res, 'menu' => $this->menu, 'user' => $this->user, 'err' => $err, 'frm' => $res['err']]);
}
}
}
return view('pages.site.content.add', ['res' => $res, 'menu' => $this->menu, 'user' => $this->user, 'err' => $err, 'frm' => $frm]);
return view('pages.site.content.edit', ['res' => $res, 'menu' => $this->menu, 'user' => $this->user, 'err' => $err, 'frm' => $frm]);
}
return redirect('');

ファイルの表示

@ -20,9 +20,13 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
Vue.component('appbar', require('./components/appbar.vue').default);
Vue.component('comments', require('./components/comments.vue').default);
Vue.component('content-type', require('./components/contenttype.vue').default);
Vue.component('delete-content', require('./components/deletecontent.vue').default);
Vue.component('delete-video', require('./components/deletevideo.vue').default);
Vue.component('delete-game', require('./components/deletegame.vue').default);
Vue.component('discord', require('./components/discord.vue').default);
const app = new Vue({ el: '#app' });
const men = new Vue({ el: '#men' });
/**
* Echo exposes an expressive API for subscribing to channels and listening

230
resources/js/components/deletecontent.vue ノーマルファイル
ファイルの表示

@ -0,0 +1,230 @@
<template>
<div class="col">
<button @click="show = true" class="btn btn-block btn-danger">投稿の削除</button>
<span v-if="show">
<vue-draggable-resizable style="border: 0px solid #232629;" :drag-handle="'.drag-handle'" class-name-handle="resize-handle" class="disco" :x="-500" :y="10" :z="99999999">
<div style="width: 100%; position: relative;">
<div class="drag-handle-left"></div>
<div class="drag-handle">投稿の削除</div>
<div class="drag-handle-right" @click="show = false"></div>
</div>
<div class="konsole_left"></div>
<div style="text-align: center; font-size: 18px; padding-top: 10px;">本当に現在の投稿を削除しますか</div>
<div style="text-align:right; line-height: 15; padding: 10px;">
<button type="button" class="btn btn2 btn-popup" @click="show = false">キャンセル</button>
<button type="button" class="btn btn2 btn-popup" @click="del">削除</button>
</div>
<div class="konsole_right"></div>
<div class="konsole_bottom_left"></div>
<div class="konsole_bottom"></div>
<div class="konsole_bottom_right"></div>
</vue-draggable-resizable>
</span>
</div>
</template>
<script>
import VueDraggableResizable from 'vue-draggable-resizable';
import 'vue-draggable-resizable/dist/VueDraggableResizable.css';
Vue.component('vue-draggable-resizable', VueDraggableResizable);
export default {
props: { slug: '' },
data: function () {
return {
show: false,
width: 0,
height: 0,
x: 0,
y: 0
}
},
watch: { text (x) { localStorage.shotanote = x; } },
methods: {
del () { axios.post('/api/content/del', { slug: this.slug }).then(() => { window.location.href = '/'; }); },
onResize: function (x, y, width, height) {
this.x = x
this.y = y
this.width = width
this.height = height
},
onDrag: function (x, y) {
this.x = x
this.y = y
}
}
}
</script>
<style scoped>
.konsole {
width: 600px;
height: 358px;
margin: auto;
color: #fcfcfc;
}
::-webkit-scrollbar-thumb:hover {
background: #452886;
}
.drag-handle-left {
height: 30px;
width: 30px;
background: url('/img/bash/discord_top_left.png') no-repeat;
position: absolute;
top: 0;
left: 0;
}
.drag-handle {
cursor: default;
height: 30px;
background: url('/img/bash/top_bg.png') repeat-x;
width: auto;
margin-left: 30px;
margin-right: 28px;
padding-top: 7px;
padding-right: 0px;
text-align: center;
font-weight: bold;
}
.drag-handle-right {
height: 30px;
width: 28px;
background: url('/img/bash/top_right.png') no-repeat;
position: absolute;
top: 0;
right: 0;
}
.drag-handle-right:hover {
background: url('/img/bash/top_right_hover.png') no-repeat;
cursor: default;
}
.drag-handle-max {
height: 30px;
width: 23px;
background: url('/img/bash/top_max.png') no-repeat;
position: absolute;
top: 0;
right: 28px;
}
.drag-handle-max:hover {
background: url('/img/bash/top_max_hover.png') no-repeat;
cursor: default;
}
.drag-handle-min {
height: 30px;
width: 23px;
background: url('/img/bash/top_min.png') no-repeat;
position: absolute;
top: 0;
right: 51px;
}
.drag-handle-min:hover {
background: url('/img/bash/top_min_hover.png') no-repeat;
cursor: default;
}
.konsole_left {
width: 2px;
background: url('/img/bash/left_bg.png') repeat-y;
position: absolute;
top: 30px;
left: 0;
height: 167px;
}
.konsole_right {
width: 2px;
background: url('/img/bash/right_bg.png') repeat-y;
position: absolute;
height: 167px;
top: 30px;
right: 0;
}
.disco { background-color: #252a35; }
.noter, .noter:active, .noter:focus {
background: transparent;
border: 0;
min-height: 360px;
width: 290px;
resize: none;
}
.btn2 {
width: 120px;
border: 1px solid #4d4d4d;
}
.btn2:hover {
cursor: default;
border: 1px solid #3daee9;
}
.btn-popup {
color: #fcfcfc;
background-color: #252a35;
}
.vdr {
background-size: cover;
backdrop-filter: blur(17px);
font-family: "Lucida Console", Monospace, "DejaVu Sans Mono", "Courier New", MiscFixed;
font-size: 12px;
/* white-space: pre; */
color: #fcfcfc;
overflow: hidden;
position: absolute;
top: 30px;
left: 2px;
height: 200px !important;
width: 500px !important;
padding: 0;
}
.resize-handle-mr {
width: 2px;
background: url('/img/bash/right_bg.png') repeat-y;
position: absolute;
height: 325px;
top: 30px;
right: 0;
}
.konsole_bottom_left {
width: 3px;
height: 3px;
background: url('/img/bash/bottom_left.png') no-repeat;
position: absolute;
bottom: 0;
left: 0;
}
.konsole_bottom {
height: 2px;
background: url('/img/bash/bottom_bg.png') repeat-x;
position: absolute;
bottom: 0;
left: 2px;
width: 495px;
}
.konsole_bottom_right {
height: 3px;
width: 3px;
background: url('/img/bash/bottom_right.png') no-repeat;
position: absolute;
right: 0;
bottom: 0;
}
</style>

230
resources/js/components/deletegame.vue ノーマルファイル
ファイルの表示

@ -0,0 +1,230 @@
<template>
<div class="col">
<button @click="show = true" class="btn btn-block btn-danger">ゲームの削除</button>
<span v-if="show">
<vue-draggable-resizable style="border: 0px solid #232629;" :drag-handle="'.drag-handle'" class-name-handle="resize-handle" class="disco" :x="-500" :y="10" :z="99999999">
<div style="width: 100%; position: relative;">
<div class="drag-handle-left"></div>
<div class="drag-handle">ゲームの削除</div>
<div class="drag-handle-right" @click="show = false"></div>
</div>
<div class="konsole_left"></div>
<div style="text-align: center; font-size: 18px; padding-top: 10px;">本当に現在のゲームを削除しますか</div>
<div style="text-align:right; line-height: 15; padding: 10px;">
<button type="button" class="btn btn2 btn-popup" @click="show = false">キャンセル</button>
<button type="button" class="btn btn2 btn-popup" @click="del">削除</button>
</div>
<div class="konsole_right"></div>
<div class="konsole_bottom_left"></div>
<div class="konsole_bottom"></div>
<div class="konsole_bottom_right"></div>
</vue-draggable-resizable>
</span>
</div>
</template>
<script>
import VueDraggableResizable from 'vue-draggable-resizable';
import 'vue-draggable-resizable/dist/VueDraggableResizable.css';
Vue.component('vue-draggable-resizable', VueDraggableResizable);
export default {
props: { slug: '' },
data: function () {
return {
show: false,
width: 0,
height: 0,
x: 0,
y: 0
}
},
watch: { text (x) { localStorage.shotanote = x; } },
methods: {
del () { axios.post('/api/game/del', { slug: this.slug }).then(() => { window.location.href = '/'; }); },
onResize: function (x, y, width, height) {
this.x = x
this.y = y
this.width = width
this.height = height
},
onDrag: function (x, y) {
this.x = x
this.y = y
}
}
}
</script>
<style scoped>
.konsole {
width: 600px;
height: 358px;
margin: auto;
color: #fcfcfc;
}
::-webkit-scrollbar-thumb:hover {
background: #452886;
}
.drag-handle-left {
height: 30px;
width: 30px;
background: url('/img/bash/discord_top_left.png') no-repeat;
position: absolute;
top: 0;
left: 0;
}
.drag-handle {
cursor: default;
height: 30px;
background: url('/img/bash/top_bg.png') repeat-x;
width: auto;
margin-left: 30px;
margin-right: 28px;
padding-top: 7px;
padding-right: 0px;
text-align: center;
font-weight: bold;
}
.drag-handle-right {
height: 30px;
width: 28px;
background: url('/img/bash/top_right.png') no-repeat;
position: absolute;
top: 0;
right: 0;
}
.drag-handle-right:hover {
background: url('/img/bash/top_right_hover.png') no-repeat;
cursor: default;
}
.drag-handle-max {
height: 30px;
width: 23px;
background: url('/img/bash/top_max.png') no-repeat;
position: absolute;
top: 0;
right: 28px;
}
.drag-handle-max:hover {
background: url('/img/bash/top_max_hover.png') no-repeat;
cursor: default;
}
.drag-handle-min {
height: 30px;
width: 23px;
background: url('/img/bash/top_min.png') no-repeat;
position: absolute;
top: 0;
right: 51px;
}
.drag-handle-min:hover {
background: url('/img/bash/top_min_hover.png') no-repeat;
cursor: default;
}
.konsole_left {
width: 2px;
background: url('/img/bash/left_bg.png') repeat-y;
position: absolute;
top: 30px;
left: 0;
height: 167px;
}
.konsole_right {
width: 2px;
background: url('/img/bash/right_bg.png') repeat-y;
position: absolute;
height: 167px;
top: 30px;
right: 0;
}
.disco { background-color: #252a35; }
.noter, .noter:active, .noter:focus {
background: transparent;
border: 0;
min-height: 360px;
width: 290px;
resize: none;
}
.btn2 {
width: 120px;
border: 1px solid #4d4d4d;
}
.btn2:hover {
cursor: default;
border: 1px solid #3daee9;
}
.btn-popup {
color: #fcfcfc;
background-color: #252a35;
}
.vdr {
background-size: cover;
backdrop-filter: blur(17px);
font-family: "Lucida Console", Monospace, "DejaVu Sans Mono", "Courier New", MiscFixed;
font-size: 12px;
/* white-space: pre; */
color: #fcfcfc;
overflow: hidden;
position: absolute;
top: 30px;
left: 2px;
height: 200px !important;
width: 500px !important;
padding: 0;
}
.resize-handle-mr {
width: 2px;
background: url('/img/bash/right_bg.png') repeat-y;
position: absolute;
height: 325px;
top: 30px;
right: 0;
}
.konsole_bottom_left {
width: 3px;
height: 3px;
background: url('/img/bash/bottom_left.png') no-repeat;
position: absolute;
bottom: 0;
left: 0;
}
.konsole_bottom {
height: 2px;
background: url('/img/bash/bottom_bg.png') repeat-x;
position: absolute;
bottom: 0;
left: 2px;
width: 495px;
}
.konsole_bottom_right {
height: 3px;
width: 3px;
background: url('/img/bash/bottom_right.png') no-repeat;
position: absolute;
right: 0;
bottom: 0;
}
</style>

230
resources/js/components/deletevideo.vue ノーマルファイル
ファイルの表示

@ -0,0 +1,230 @@
<template>
<div class="col">
<button @click="show = true" class="btn btn-block btn-danger">動画の削除</button>
<span v-if="show">
<vue-draggable-resizable style="border: 0px solid #232629;" :drag-handle="'.drag-handle'" class-name-handle="resize-handle" class="disco" :x="-500" :y="10" :z="99999999">
<div style="width: 100%; position: relative;">
<div class="drag-handle-left"></div>
<div class="drag-handle">動画の削除</div>
<div class="drag-handle-right" @click="show = false"></div>
</div>
<div class="konsole_left"></div>
<div style="text-align: center; font-size: 18px; padding-top: 10px;">本当に現在の動画を削除しますか</div>
<div style="text-align:right; line-height: 15; padding: 10px;">
<button type="button" class="btn btn2 btn-popup" @click="show = false">キャンセル</button>
<button type="button" class="btn btn2 btn-popup" @click="del">削除</button>
</div>
<div class="konsole_right"></div>
<div class="konsole_bottom_left"></div>
<div class="konsole_bottom"></div>
<div class="konsole_bottom_right"></div>
</vue-draggable-resizable>
</span>
</div>
</template>
<script>
import VueDraggableResizable from 'vue-draggable-resizable';
import 'vue-draggable-resizable/dist/VueDraggableResizable.css';
Vue.component('vue-draggable-resizable', VueDraggableResizable);
export default {
props: { slug: '' },
data: function () {
return {
show: false,
width: 0,
height: 0,
x: 0,
y: 0
}
},
watch: { text (x) { localStorage.shotanote = x; } },
methods: {
del () { axios.post('/api/video/del', { slug: this.slug }).then(() => { window.location.href = '/'; }); },
onResize: function (x, y, width, height) {
this.x = x
this.y = y
this.width = width
this.height = height
},
onDrag: function (x, y) {
this.x = x
this.y = y
}
}
}
</script>
<style scoped>
.konsole {
width: 600px;
height: 358px;
margin: auto;
color: #fcfcfc;
}
::-webkit-scrollbar-thumb:hover {
background: #452886;
}
.drag-handle-left {
height: 30px;
width: 30px;
background: url('/img/bash/discord_top_left.png') no-repeat;
position: absolute;
top: 0;
left: 0;
}
.drag-handle {
cursor: default;
height: 30px;
background: url('/img/bash/top_bg.png') repeat-x;
width: auto;
margin-left: 30px;
margin-right: 28px;
padding-top: 7px;
padding-right: 0px;
text-align: center;
font-weight: bold;
}
.drag-handle-right {
height: 30px;
width: 28px;
background: url('/img/bash/top_right.png') no-repeat;
position: absolute;
top: 0;
right: 0;
}
.drag-handle-right:hover {
background: url('/img/bash/top_right_hover.png') no-repeat;
cursor: default;
}
.drag-handle-max {
height: 30px;
width: 23px;
background: url('/img/bash/top_max.png') no-repeat;
position: absolute;
top: 0;
right: 28px;
}
.drag-handle-max:hover {
background: url('/img/bash/top_max_hover.png') no-repeat;
cursor: default;
}
.drag-handle-min {
height: 30px;
width: 23px;
background: url('/img/bash/top_min.png') no-repeat;
position: absolute;
top: 0;
right: 51px;
}
.drag-handle-min:hover {
background: url('/img/bash/top_min_hover.png') no-repeat;
cursor: default;
}
.konsole_left {
width: 2px;
background: url('/img/bash/left_bg.png') repeat-y;
position: absolute;
top: 30px;
left: 0;
height: 167px;
}
.konsole_right {
width: 2px;
background: url('/img/bash/right_bg.png') repeat-y;
position: absolute;
height: 167px;
top: 30px;
right: 0;
}
.disco { background-color: #252a35; }
.noter, .noter:active, .noter:focus {
background: transparent;
border: 0;
min-height: 360px;
width: 290px;
resize: none;
}
.btn2 {
width: 120px;
border: 1px solid #4d4d4d;
}
.btn2:hover {
cursor: default;
border: 1px solid #3daee9;
}
.btn-popup {
color: #fcfcfc;
background-color: #252a35;
}
.vdr {
background-size: cover;
backdrop-filter: blur(17px);
font-family: "Lucida Console", Monospace, "DejaVu Sans Mono", "Courier New", MiscFixed;
font-size: 12px;
/* white-space: pre; */
color: #fcfcfc;
overflow: hidden;
position: absolute;
top: 30px;
left: 2px;
height: 200px !important;
width: 500px !important;
padding: 0;
}
.resize-handle-mr {
width: 2px;
background: url('/img/bash/right_bg.png') repeat-y;
position: absolute;
height: 325px;
top: 30px;
right: 0;
}
.konsole_bottom_left {
width: 3px;
height: 3px;
background: url('/img/bash/bottom_left.png') no-repeat;
position: absolute;
bottom: 0;
left: 0;
}
.konsole_bottom {
height: 2px;
background: url('/img/bash/bottom_bg.png') repeat-x;
position: absolute;
bottom: 0;
left: 2px;
width: 495px;
}
.konsole_bottom_right {
height: 3px;
width: 3px;
background: url('/img/bash/bottom_right.png') no-repeat;
position: absolute;
right: 0;
bottom: 0;
}
</style>

ファイルの表示

@ -70,52 +70,9 @@
@if ($user->perm['blg_addpost'] || $user->perm['blg_addpage'])
<a href="/content/add" class="dropdown-item">投稿の追加</a>
@endif
<?php
$current = '';
$slug = '';
$url = url()->current();
$url = explode('/', $url);
if (isset($url[3])) {
if ($url[3] == 'blog') {
$current = $res->slug;
$slug = $res->slug;
}
else {
foreach ($menu as $i) {
if ($url[3] == $i['slug']) $current = $url[3];
$slug = $url[3];
}
}
}
?>
@if ($current != '' && $slug != '' && $slug == $current && ($user->perm['blg_editpost'] || $user->perm['blg_editpage']))
<a href="/content/{{ $current }}/edit" class="dropdown-item">投稿の編集</a>
@endif
@if ($current != '' && $slug != '' && $slug == $current && ($user->perm['blg_delpost'] || $user->perm['blg_delpage']))
<a href="/content/{{ $current }}/delete" class="dropdown-item">投稿の削除</a>
@endif
<?php
if (isset($url[3]) && isset($url[4]) && isset($url[5]) && $url[3] == 'video' && $url[4] == 'play') {
$current = $url[5];
$slug = $res->vid;
}
?>
@if ($user->perm['blg_addpost'] || $user->perm['blg_editpost'] || $user->perm['blg_delpost'])
<div class="dropdown-divider"></div>
@endif
@if ($user->perm['blg_addpost'])
<a href="/video/add" class="dropdown-item">動画の追加</a>
@endif
@if (isset($url[3]) && isset($url[4]) && isset($url[5]) && $url[3] == 'video' && $url[4] == 'play')
@if ($current != '' && $slug != '' && $slug == $current && ($user->perm['blg_editpost'] || $user->perm['blg_editpage']))
<a href="/video/{{ $current }}/edit" class="dropdown-item">動画の編集</a>
@endif
@if ($current != '' && $slug != '' && $slug == $current && ($user->perm['blg_delpost'] || $user->perm['blg_delpage']))
<a href="/video/{{ $current }}/delete" class="dropdown-item">動画の削除</a>
@endif
@endif
<div class="dropdown-divider"></div>
<a href="/logout" class="dropdown-item">サインアウト</a>
@else
@ -165,6 +122,50 @@
</div>
</div>
<div class="col-md">
@if (isset($user->perm) && ($user->perm['blg_editpost'] || $user->perm['blg_editpage'] || $user->perm['blg_delpost'] || $user->perm['blg_delpage']))
<div class="row" style="margin-bottom: 15px;">
<?php
$current = '';
$slug = '';
$url = url()->current();
$url = explode('/', $url);
if (isset($url[3])) {
if ($url[3] == 'blog') {
$current = $res->slug;
$slug = $res->slug;
}
else {
foreach ($menu as $i) {
if ($url[3] == $i['slug']) $current = $url[3];
$slug = $url[3];
}
}
}
?>
@if ($current != '' && $slug != '' && $slug == $current && ($user->perm['blg_editpost'] || $user->perm['blg_editpage']))
<div class="col"><a href="/content/{{ $current }}/edit" class="btn btn-block btn-warning">投稿の編集</a></div>
@endif
@if ($current != '' && $slug != '' && $slug == $current && ($user->perm['blg_delpost'] || $user->perm['blg_delpage']))
<delete-content slug="{{ $current }}" />
@endif
<?php
if (isset($url[3]) && isset($url[4]) && isset($url[5]) && $url[3] == 'video' && $url[4] == 'play') {
$current = $url[5];
$slug = $res->vid;
}
?>
@if (isset($url[3]) && isset($url[4]) && isset($url[5]) && $url[3] == 'video' && $url[4] == 'play')
@if ($current != '' && $slug != '' && $slug == $current && ($user->perm['blg_editpost']))
<div class="col"><a href="/video/{{ $current }}/edit" class="btn btn-block btn-warning">動画の編集</a></div>
@endif
@if ($current != '' && $slug != '' && $slug == $current && ($user->perm['blg_delpost']))
<delete-video slug="$current" />
@endif
@endif
</div>
@endif
@yield('content')
</div>
</div>

ファイルの表示

@ -0,0 +1,34 @@
@extends('layouts.site')
@section('content')
<div class="within">
<div class="bar">投稿の編集</div>
<div class="back">
@if ($err)
<div class="alert alert-danger" role="alert">
{{ $err }}
</div>
@endif
<form method="POST" action="/content/{{ $frm->slug }}/edit">
@csrf
<div class="row body">
<div class="col-md-3"><b>件名</b></div>
<div class="col"><input id="title" name="title" type="text" class="form-control" value="{{ $frm->title }}" /></div>
</div>
<div class="col"><input id="slug" name="slug" type="hidden" class="form-control" value="{{ $frm->slug }}" /></div>
<div>
<content-type p="{{$frm->public_status}}" c="{{$frm->isPost}}" d="{{$frm->publish_date}}" m="{{$frm->isMenu}}" />
</div>
<b>文章</b>
<div class="row body">
<div class="col"><textarea id="message" name="message" rows="16" class="form-control">{{ $frm->message }}</textarea></div>
</div>
<div class="row body" style="margin-top: 24px;">
<div class="col"><input name="submit" type="submit" class="btn btn-success btn-block" value="編集" /></div>
</div>
</form>
</div>
</div>
@endsection

ファイルの表示

@ -1,4 +1,6 @@
<?php
Route::post('/api/comment/new', 'HomeController@newComment');
Route::post('/content/del', 'HomeController@delContent');
Route::post('/api/content/del', 'HomeController@delContent');
Route::post('/api/video/del', 'VideoController@delVideo');
Route::post('/api/game/del', 'VideoController@delGame');