diff --git a/app/Database/Models/Forum.php b/app/Database/Models/Forum.php index 0e4d929c..d25e1523 100644 --- a/app/Database/Models/Forum.php +++ b/app/Database/Models/Forum.php @@ -54,7 +54,7 @@ class Forum extends Model implements HasPresenter, InheritPermissionInterface, C * * @var array */ - protected $guarded = ['left_id', 'right_id', 'parent_id']; + protected $guarded = []; /** * @var array diff --git a/app/Database/Repositories/Decorators/Forum/CachingDecorator.php b/app/Database/Repositories/Decorators/Forum/CachingDecorator.php index 2f341b09..ff741d7f 100644 --- a/app/Database/Repositories/Decorators/Forum/CachingDecorator.php +++ b/app/Database/Repositories/Decorators/Forum/CachingDecorator.php @@ -197,4 +197,63 @@ public function moveTopicToForum(Topic $topic, Forum $forum) return $this->decoratedRepository->moveTopicToForum($topic, $forum); } + + /** + * {@inheritdoc} + */ + public function create(array $details = []) + { + $this->cache->forget('forums.index_tree'); + $this->cache->forget('forums.all'); + + return $this->decoratedRepository->create($details); + } + + /** + * {@inheritdoc} + */ + public function getForum(int $id) + { + return $this->decoratedRepository->getForum($id); + } + + /** + * {@inheritdoc} + */ + public function isEmpty() + { + return $this->decoratedRepository->isEmpty(); + } + + /** + * {@inheritdoc} + */ + public function delete(Forum $forum) + { + $this->cache->forget('forums.index_tree'); + $this->cache->forget('forums.all'); + + return $this->decoratedRepository->delete($forum); + } + + /** + * {@inheritdoc} + */ + public function update(Forum $forum, $details) + { + $this->cache->forget('forums.index_tree'); + $this->cache->forget('forums.all'); + + return $this->decoratedRepository->update($forum, $details); + } + + /** + * {@inheritdoc} + */ + public function changeParent(Forum $forum, int $newParent) + { + $this->decoratedRepository->changeParent($forum, $newParent); + $this->cache->forget('forums.index_tree'); + return $this->cache->forget('forums.all'); + } } diff --git a/app/Database/Repositories/Eloquent/ForumRepository.php b/app/Database/Repositories/Eloquent/ForumRepository.php index 57b2e7e8..1e477234 100644 --- a/app/Database/Repositories/Eloquent/ForumRepository.php +++ b/app/Database/Repositories/Eloquent/ForumRepository.php @@ -10,6 +10,7 @@ namespace MyBB\Core\Database\Repositories\Eloquent; +use Illuminate\Database\DatabaseManager; use MyBB\Core\Database\Models\Forum; use MyBB\Core\Database\Models\Post; use MyBB\Core\Database\Models\Topic; @@ -28,16 +29,24 @@ class ForumRepository implements ForumRepositoryInterface */ private $permissionChecker; + /** + * @var DatabaseManager + */ + protected $dbManager; + /** * @param Forum $forumModel The model to use for forums. * @param PermissionChecker $permissionChecker The permission class + * @param DatabaseManager $dbManager */ public function __construct( Forum $forumModel, - PermissionChecker $permissionChecker + PermissionChecker $permissionChecker, + DatabaseManager $dbManager ) { $this->forumModel = $forumModel; $this->permissionChecker = $permissionChecker; + $this->dbManager = $dbManager; } /** @@ -77,7 +86,7 @@ public function find($id = 0) ->whereBetween('left_id', [$parent->left_id, $parent->right_id]) ->get(); - return $forums->toTree(); + return $forums->toTree()->first(); } /** @@ -107,7 +116,7 @@ public function findBySlug($slug = '') ->whereBetween('left_id', [$parent->left_id, $parent->right_id]) ->get(); - return $forums->toTree(); + return $forums->toTree()->first(); } /** @@ -135,6 +144,14 @@ public function getIndexTree($checkPermissions = true) return $res->toTree(); } + /** + * {@inheritdoc} + */ + public function getForum(int $id) + { + return $this->forumModel->find($id); + } + /** * Increment the number of posts in the forum by one. * @@ -144,7 +161,7 @@ public function getIndexTree($checkPermissions = true) */ public function incrementPostCount($id = 0) { - $forum = $this->find($id); + $forum = $this->forumModel->find($id); if ($forum) { $forum->increment('num_posts'); @@ -162,7 +179,7 @@ public function incrementPostCount($id = 0) */ public function incrementTopicCount($id = 0) { - $forum = $this->find($id); + $forum = $this->forumModel->find($id); if ($forum) { $forum->increment('num_topics'); @@ -220,4 +237,49 @@ public function moveTopicToForum(Topic $topic, Forum $forum) $this->updateLastPost($forum); } + + /** + * {@inheritdoc} + */ + public function create(array $details = []) + { + return $this->dbManager->transaction(function () use ($details) { + $this->forumModel->where('left_id', '>=', $details['left_id'])->increment('left_id', 2); + $this->forumModel->where('right_id', '>=', $details['left_id'])->increment('right_id', 2); + $this->forumModel->create($details); + }, 2); + } + + /** + * {@inheritdoc} + */ + public function isEmpty() + { + $result = $this->forumModel->select('id')->first(); + return !(bool)$result; + } + + /** + * {@inheritdoc} + */ + public function update(Forum $forum, $details) + { + return $forum->update($details); + } + + /** + * {@inheritdoc} + */ + public function delete(Forum $forum) + { + //TODO implement function + } + + /** + * {@inheritdoc} + */ + public function changeParent(Forum $forum, int $newParent) + { + //TODO implement function + } } diff --git a/app/Database/Repositories/Eloquent/TopicRepository.php b/app/Database/Repositories/Eloquent/TopicRepository.php index aae4e802..6285edc7 100644 --- a/app/Database/Repositories/Eloquent/TopicRepository.php +++ b/app/Database/Repositories/Eloquent/TopicRepository.php @@ -413,4 +413,12 @@ public function movePostToTopic(Post $post, Topic $topic) 'last_post_user_id' => $post->author->id, ]); } + + /** + * {@inheritdoc} + */ + public function countTopicsForForum(int $forumId) + { + return $this->topicModel->where('forum_id', $forumId)->count(); + } } diff --git a/app/Database/Repositories/ForumRepositoryInterface.php b/app/Database/Repositories/ForumRepositoryInterface.php index 4a20acde..869b5458 100644 --- a/app/Database/Repositories/ForumRepositoryInterface.php +++ b/app/Database/Repositories/ForumRepositoryInterface.php @@ -10,6 +10,7 @@ namespace MyBB\Core\Database\Repositories; +use Doctrine\Common\Collections\Collection; use MyBB\Core\Database\Models\Forum; use MyBB\Core\Database\Models\Post; use MyBB\Core\Database\Models\Topic; @@ -83,4 +84,51 @@ public function updateLastPost(Forum $forum, Post $post = null); * @param Forum $forum */ public function moveTopicToForum(Topic $topic, Forum $forum); + + /** + * Create new forum + * + * @param array $details + * @return mixed + */ + public function create(array $details = []); + + /** + * Return single forum by id (without any relations, just forum) + * + * @param int $id Forum id + * @return Collection + */ + public function getForum(int $id); + + /** + * Check if there are already created any forums + * + * @return bool + */ + public function isEmpty(); + + /** + * Delete forum by id. Removes all related forums/subforums/topics/posts + * + * @param Forum $forum + * @return bool + */ + public function delete(Forum $forum); + + /** + * Update forum + * + * @param Forum $forum + * @param $details + * @return mixed + */ + public function update(Forum $forum, $details); + + /** + * @param Forum $forum + * @param int $newParent + * @return mixed + */ + public function changeParent(Forum $forum, int $newParent); } diff --git a/app/Database/Repositories/TopicRepositoryInterface.php b/app/Database/Repositories/TopicRepositoryInterface.php index 1814a141..1bb36c30 100644 --- a/app/Database/Repositories/TopicRepositoryInterface.php +++ b/app/Database/Repositories/TopicRepositoryInterface.php @@ -138,4 +138,12 @@ public function updateLastPost(Topic $topic, Post $post = null); * @param Topic $topic */ public function movePostToTopic(Post $post, Topic $topic); + + /** + * Count topics for forum + * + * @param int $forumId Forum id + * @return int + */ + public function countTopicsForForum(int $forumId); } diff --git a/app/Http/Controllers/Admin/Forums/ForumsController.php b/app/Http/Controllers/Admin/Forums/ForumsController.php new file mode 100644 index 00000000..95f71af2 --- /dev/null +++ b/app/Http/Controllers/Admin/Forums/ForumsController.php @@ -0,0 +1,210 @@ +forumRepository = $forumRepository; + $this->topicRepository = $topicRepository; + } + + /** + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function show() + { + $forums = $this->forumRepository->all()->toTree(); + return view('admin.forums.list', compact('forums'))->withActive('forums'); + } + + /** + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function add() + { + $forums = $this->forumRepository->all()->toTree(); + return view('admin.forums.add', compact('forums'))->withActive('forums'); + } + + /** + * @param CreateForumRequest $request + * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse + */ + public function create(CreateForumRequest $request) + { + $details = [ + 'slug' => str_slug($request->get('slug')), + 'title' => $request->get('title'), + 'description' => $request->get('description'), + ]; + + if ((bool)$request->get('type')) { + $details['parent_id'] = $request->get('parent'); + } else { + $details['parent_id'] = null; + } + + // set forum order + if ($this->forumRepository->isEmpty()) { + // There isn't any forums yet. Make this first + $details['left_id'] = 1; + $details['right_id'] = 2; + if ((bool)$request->get('type')) { + return back()->withInput()->withErrors(trans('admin::forums.error.create_category')); + } + } else { + if ((bool)$request->get('order')) { + $forumOrder = $this->forumRepository->getForum($request->get('order')); + } else { + $forumOrder = $this->forumRepository->getForum($request->get('parent')); + } + + if ((bool)$request->get('order_position') && (bool)$request->get('order')) { + // Set new forum after + $details['left_id'] = $forumOrder->right_id + 1; + $details['right_id'] = $forumOrder->right_id + 2; + } elseif ((bool)$request->get('order')) { + // Set new forum before + $details['left_id'] = $forumOrder->left_id; + $details['right_id'] = $forumOrder->left_id + 1; + } else { + // Save as first in parent + $details['left_id'] = $forumOrder->left_id + 1; + $details['right_id'] = $forumOrder->left_id + 2; + } + } + + // other options + if ((bool)$request->get('link')) { + $details['is_link'] = 1; + $details['link'] = $request->get('link'); + } else { + $details['is_link'] = 0; + } + + if (!(bool)$request->get('open')) { + $details['closed'] = 1; + } + + try { + $this->forumRepository->create($details); + } catch (\Exception $e) { + return back()->withInput()->withErrors(trans('admin::general.error.try_again')); + } + + return redirect()->route('admin.forums')->withSuccess(trans('admin::general.success_saved')); + } + + /** + * @param Request $request + * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse + */ + public function delete(Request $request) + { + dd($request->get('id')); + $forum = $this->forumRepository->getForum($request->get('id')); + if (!$forum) { + throw new ForumNotFoundException; + } + + try { + $this->forumRepository->delete($forum); + } catch (\Exception $e) { + return back()->withErrors(trans('admin::general.error.try_again')); + } + + return redirect()->route('admin.forums')->withSuccess(trans('admin::general.success_deleted')); + } + + /** + * @param $id + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function edit($id) + { + $forum = $this->forumRepository->getForum($id); + $forums = $this->forumRepository->all()->toTree(); + return view('admin.forums.edit', compact('forum', 'forums'))->withActive('forums'); + } + + /** + * @param $id + * @param CreateForumRequest $request + * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse + */ + public function update($id, CreateForumRequest $request) + { + $forum = $this->forumRepository->getForum($request->get('id')); + if (!$forum) { + throw new ForumNotFoundException; + } + + $details = [ + 'slug' => str_slug($request->get('slug')), + 'title' => $request->get('title'), + 'description' => $request->get('description'), + 'link' => $request->get('link'), + ]; + + if (!(bool)$request->get('open')) { + $details['closed'] = 1; + } + + // change forum type + if (!(bool)$request->get('type') && $forum->parent_id) { + // change from forum to category + $details['parent_id'] = null; + } elseif ((bool)$request->get('type') && !$forum->parent_id) { + // change from category to forum + $details['parent_id'] = $request->get('parent'); + } + + //todo set order + + $this->forumRepository->update($forum, $details); + + // change parent forum + if ($request->get('parent') != $forum->parent_id) { + // move node to new parent + try { + $this->forumRepository->changeParent($forum, $request->get('parent')); + } catch (\Exception $e) { + return back()->withErrors(trans('admin::general.error.try_again')); + } + } + + return redirect()->route('admin.forums')->withSuccess(trans('admin::general.success_saved')); + } +} diff --git a/app/Http/Controllers/Admin/Users/WarningsController.php b/app/Http/Controllers/Admin/Users/WarningsController.php index 936a4868..28ba03dc 100644 --- a/app/Http/Controllers/Admin/Users/WarningsController.php +++ b/app/Http/Controllers/Admin/Users/WarningsController.php @@ -119,7 +119,7 @@ public function saveWarningType($id, CreateWarningTypeRequest $request) */ public function deleteWarningType(Request $request) { - $this->warningTypesRepository->delete($request->input('warning_type_id')); + $this->warningTypesRepository->delete($request->input('id')); return redirect()->back()->withSuccess(trans('admin::general.success_deleted')); } diff --git a/app/Http/Controllers/ForumController.php b/app/Http/Controllers/ForumController.php index 354d103a..ac1bef38 100644 --- a/app/Http/Controllers/ForumController.php +++ b/app/Http/Controllers/ForumController.php @@ -110,7 +110,7 @@ public function index(Store $settings) public function show(Request $request, $id, $slug) { // Forum permissions are checked in "find" - $forum = $this->forumRepository->find($id)->first(); + $forum = $this->forumRepository->find($id); if (!$forum) { throw new ForumNotFoundException; diff --git a/app/Http/Requests/Forums/CreateForumRequest.php b/app/Http/Requests/Forums/CreateForumRequest.php new file mode 100644 index 00000000..57a75840 --- /dev/null +++ b/app/Http/Requests/Forums/CreateForumRequest.php @@ -0,0 +1,47 @@ + 'required|integer', + 'title' => 'required|string|max:255', + //'slug' => 'required|string|max:255|unique:forums,slug', + 'parent' => 'required_if:type,1|integer', + //todo add order rule + 'link' => 'url|max:255', + 'open' => 'integer', + ]; + // TODO temporary solution, probably need to create separately request for edit. + if ($this->input('id')) { + $return['slug'] = 'required|string|max:255|unique:forums,slug,'.$this->input('id'); + } else { + $return['slug'] = 'required|string|max:255|unique:forums,slug'; + } + return $return; + } + + /** + * @return bool + */ + public function authorize() + { + return true; + } +} diff --git a/app/Http/routes.php b/app/Http/routes.php index 46c76643..06b2db4a 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -179,6 +179,32 @@ 'uses' => 'Admin\Users\WarningsController@deleteWarningType', ]); }); + Route::group(['prefix' => 'forums'], function () { + Route::get('/', [ + 'as' => 'admin.forums', + 'uses' => 'Admin\Forums\ForumsController@show', + ]); + Route::get('/add', [ + 'as' => 'admin.forums.add', + 'uses' => 'Admin\Forums\ForumsController@add', + ]); + Route::post('/add', [ + 'as' => 'admin.forums.add', + 'uses' => 'Admin\Forums\ForumsController@create', + ]); + Route::post('/delete', [ + 'as' => 'admin.forums.delete', + 'uses' => 'Admin\Forums\ForumsController@delete', + ]); + Route::get('/edit/{id}', [ + 'as' => 'admin.forums.edit', + 'uses' => 'Admin\Forums\ForumsController@edit', + ]); + Route::post('/edit/{id}', [ + 'as' => 'admin.forums.edit', + 'uses' => 'Admin\Forums\ForumsController@update', + ]); + }); }); Route::get('captcha/{imagehash}', ['as' => 'captcha', 'uses' => 'CaptchaController@captcha', 'noOnline' => true]); diff --git a/app/Presenters/ForumPresenter.php b/app/Presenters/ForumPresenter.php index 41242329..3e5e1cb6 100644 --- a/app/Presenters/ForumPresenter.php +++ b/app/Presenters/ForumPresenter.php @@ -92,4 +92,20 @@ public function moderations() return $decorated; } + + /** + * @return null|string + */ + public function link() + { + return $this->wrappedObject->link; + } + + /** + * @return null|integer + */ + public function parent_id() + { + return $this->wrappedObject->parent_id; + } } diff --git a/app/Twig/Extensions/AdminDeleteButton.php b/app/Twig/Extensions/AdminDeleteButton.php new file mode 100644 index 00000000..4e8e70f3 --- /dev/null +++ b/app/Twig/Extensions/AdminDeleteButton.php @@ -0,0 +1,47 @@ + ['html']]), + ]; + } + + /** + * @param $for + * @param $id + * @return string + */ + public function deleteButton($for, $id) + { + return view('admin.partials.delete_button', compact('for', 'id'))->render(); + } +} diff --git a/app/Twig/Extensions/ListAllForums.php b/app/Twig/Extensions/ListAllForums.php new file mode 100644 index 00000000..b347edb3 --- /dev/null +++ b/app/Twig/Extensions/ListAllForums.php @@ -0,0 +1,56 @@ + ['html']]), + ]; + } + + /** + * @param $forums + * @param string $template + * @param null $options + * @param int $level + * @return string + */ + public function renderForums($forums, $template = 'admin.forums.forum-item', $options = null, $level = 1) + { + $result = ''; + foreach ($forums as $forum) { + $result .= view($template, compact('forum', 'level', 'options'))->render(); + if ($forum->children->count() > 0) { + $result .= $this->renderForums($forum->children, $template, $options, $level + 1); + } + } + return $result; + } +} diff --git a/config/twigbridge.php b/config/twigbridge.php index f6476468..6fa019ba 100644 --- a/config/twigbridge.php +++ b/config/twigbridge.php @@ -111,6 +111,8 @@ \MyBB\Core\Twig\Extensions\Navigation::class, \MyBB\Core\Twig\Extensions\Moderation::class, \MyBB\Core\Twig\Extensions\Presenter::class, + \MyBB\Core\Twig\Extensions\ListAllForums::class, + \MyBB\Core\Twig\Extensions\AdminDeleteButton::class, \MyBB\Core\Widgets\Twig\Widget::class, // 'TwigBridge\Extension\Laravel\Legacy\Facades', ], diff --git a/resources/lang/admin/en/forums.php b/resources/lang/admin/en/forums.php new file mode 100644 index 00000000..e259315e --- /dev/null +++ b/resources/lang/admin/en/forums.php @@ -0,0 +1,32 @@ + 'Forums Management', + 'add_forum' => 'Add Forum', + 'edit_forum' => 'Edit Forum', + 'category' => 'Category', + 'forum' => 'Forum', + 'forum_type' => 'Forum type', + 'forum_type.desc' => 'Select the type of forum you are creating - a Forum you can post in, or a Category, which contains other forums.', + 'title' => 'Title', + 'description' => 'Description', + 'forum_link' => 'Forum link', + 'forum_link.desc' => 'To make a forum redirect to another location, enter the URL to the destination you wish to redirect to. Entering a URL in this field will remove the forum functionality; however, permissions can still be set for it.', + 'is_open' => 'Forum is open?', + 'is_open.desc' => 'If unselected, users will not be able to post in this forum regardless of permissions.', + 'parent' => 'Parent Forum', + 'parent.desc' => 'The Forum that contains this forum.', + 'slug' => 'Forum slug', + 'slug.desc' => 'Slug desc', + 'order' => 'Display order', + 'order.desc' => 'Display this forum:', + 'after' => 'After', + 'before' => 'Before', + 'error.create_category' => 'You must create at least one category before creating forums.', +]; diff --git a/resources/lang/admin/en/general.php b/resources/lang/admin/en/general.php index 1a749b6a..5697be50 100644 --- a/resources/lang/admin/en/general.php +++ b/resources/lang/admin/en/general.php @@ -23,4 +23,5 @@ 'yes' => 'Yes', 'no' => 'No', 'actions_field' => 'Actions', + 'error.try_again' => 'Something went wrong. Try again.', ]; diff --git a/resources/views/admin/forums/add.twig b/resources/views/admin/forums/add.twig new file mode 100644 index 00000000..43cc1f91 --- /dev/null +++ b/resources/views/admin/forums/add.twig @@ -0,0 +1,12 @@ +{% extends "layouts.admin" %} +{% block title %} {{ trans('admin::forums.add_forum') }} {% endblock %} +{% block contents %} +
+

{{ trans('admin::forums.add_forum') }}

+
+
+
+ {% include "admin.partials.forums.forum_form" %} +
+
+{% endblock %} diff --git a/resources/views/admin/forums/edit.twig b/resources/views/admin/forums/edit.twig new file mode 100644 index 00000000..c4a244dd --- /dev/null +++ b/resources/views/admin/forums/edit.twig @@ -0,0 +1,12 @@ +{% extends "layouts.admin" %} +{% block title %} {{ trans('admin::forums.edit_forum') }} {% endblock %} +{% block contents %} +
+

{{ trans('admin::forums.edit_forum') }}

+
+
+
+ {% include "admin.partials.forums.forum_form" with [forum, forums] %} +
+
+{% endblock %} diff --git a/resources/views/admin/forums/forum-item-select.twig b/resources/views/admin/forums/forum-item-select.twig new file mode 100644 index 00000000..3bfaa90f --- /dev/null +++ b/resources/views/admin/forums/forum-item-select.twig @@ -0,0 +1,8 @@ + diff --git a/resources/views/admin/forums/forum-item.twig b/resources/views/admin/forums/forum-item.twig new file mode 100644 index 00000000..a0a3abc9 --- /dev/null +++ b/resources/views/admin/forums/forum-item.twig @@ -0,0 +1,10 @@ +
+ {{ forum.title }} | Level: {{ level }} + + {{ trans('admin::general.edit') }} + {{ admin_delete_button('admin.forums.delete', forum.id) }} + +
+ {{ forum.description }} +
+
diff --git a/resources/views/admin/forums/list.twig b/resources/views/admin/forums/list.twig new file mode 100644 index 00000000..4186cd22 --- /dev/null +++ b/resources/views/admin/forums/list.twig @@ -0,0 +1,11 @@ +{% extends "layouts.admin" %} +{% block title %} {{ trans('admin::forums.management') }} {% endblock %} +{% block contents %} +
+

{{ trans('admin::forums.management') }}

+
{{ trans(('admin::forums.add_forum')) }}
+
+
+ {{ list_all_forums(forums) }} +
+{% endblock %} diff --git a/resources/views/admin/partials/delete_button.twig b/resources/views/admin/partials/delete_button.twig new file mode 100644 index 00000000..3b024db9 --- /dev/null +++ b/resources/views/admin/partials/delete_button.twig @@ -0,0 +1,5 @@ +
+ {{ csrf_field() }} + + +
diff --git a/resources/views/admin/partials/forums/forum_form.twig b/resources/views/admin/partials/forums/forum_form.twig new file mode 100644 index 00000000..e840298b --- /dev/null +++ b/resources/views/admin/partials/forums/forum_form.twig @@ -0,0 +1,114 @@ +
+ {{ csrf_field() }} + {% if forum is defined %} + + {% endif %} +
+
+

{{ trans('admin::forums.forum_type') }}

+

{{ trans('admin::forums.forum_type.desc') }}

+
+ {% if forums.count > 0 %} + + + + + {% endif %} + + + + +
+
+
+

+ +

+ +
+
+ {# TODO js autogenerate slug from forum title #} +

+ +

+

{{ trans('admin::forums.slug.desc') }}

+ +
+
+

+ +

+ +
+ {% if forums.count > 0 %} +
+ {# TODO js hide if type == category #} +

+ +

+

{{ trans('admin::forums.parent.desc') }}

+ +
+
+ {# TODO js show only children of parent forum #} + {# TODO js forums order #} + {# Maybe something different than select? IMHO sortable items would be nice concept http://i.imgur.com/KyLvVIL.png #} +

+ +

+

{{ trans('admin::forums.order.desc') }}

+
+ + + + + + + + +
+ +
+ {% endif %} +
+

+ +

+

{{ trans('admin::forums.forum_link.desc') }}

+ +
+
+

+ +

+
+
+ +
+
+
diff --git a/resources/views/admin/warnings/warning_types/list.twig b/resources/views/admin/warnings/warning_types/list.twig index 3ee15999..d2230369 100644 --- a/resources/views/admin/warnings/warning_types/list.twig +++ b/resources/views/admin/warnings/warning_types/list.twig @@ -39,11 +39,7 @@ {{ trans('admin::general.edit') }} -
- {{ csrf_field() }} - - -
+ {{ admin_delete_button('admin.warnings.warning_types.delete', warningType.id) }} {% endfor %} diff --git a/resources/views/layouts/admin.twig b/resources/views/layouts/admin.twig index 5658fda0..55994e60 100644 --- a/resources/views/layouts/admin.twig +++ b/resources/views/layouts/admin.twig @@ -27,10 +27,10 @@
  • Languages
  • -
  • -

    Forums & Posts

    +
  • +

    Forums & Posts

  • -
  • +
  • {{ trans('admin::nav.users_and_roles') }}