Standardised view referencing to dot-notation

This commit is contained in:
Dan Brown 2019-04-07 12:00:09 +01:00
parent 4a127c29a5
commit 221a483b40
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
30 changed files with 55 additions and 55 deletions

View File

@ -128,7 +128,7 @@ class LoginController extends Controller
]);
}
return view('auth/login', ['socialDrivers' => $socialDrivers, 'authMethod' => $authMethod]);
return view('auth.login', ['socialDrivers' => $socialDrivers, 'authMethod' => $authMethod]);
}
/**

View File

@ -176,7 +176,7 @@ class RegisterController extends Controller
*/
public function getRegisterConfirmation()
{
return view('auth/register-confirm');
return view('auth.register-confirm');
}
/**
@ -204,7 +204,7 @@ class RegisterController extends Controller
*/
public function showAwaitingConfirmation()
{
return view('auth/user-unconfirmed');
return view('auth.user-unconfirmed');
}
/**

View File

@ -51,7 +51,7 @@ class BookController extends Controller
$new = $this->entityRepo->getRecentlyCreated('book', 4, 0);
$this->setPageTitle(trans('entities.books'));
return view('books/index', [
return view('books.index', [
'books' => $books,
'recents' => $recents,
'popular' => $popular,
@ -71,7 +71,7 @@ class BookController extends Controller
{
$this->checkPermission('book-create-all');
$this->setPageTitle(trans('entities.books_create'));
return view('books/create');
return view('books.create');
}
/**
@ -104,7 +104,7 @@ class BookController extends Controller
$bookChildren = $this->entityRepo->getBookChildren($book);
Views::add($book);
$this->setPageTitle($book->getShortName());
return view('books/show', [
return view('books.show', [
'book' => $book,
'current' => $book,
'bookChildren' => $bookChildren,
@ -122,7 +122,7 @@ class BookController extends Controller
$book = $this->entityRepo->getBySlug('book', $slug);
$this->checkOwnablePermission('book-update', $book);
$this->setPageTitle(trans('entities.books_edit_named', ['bookName'=>$book->getShortName()]));
return view('books/edit', ['book' => $book, 'current' => $book]);
return view('books.edit', ['book' => $book, 'current' => $book]);
}
/**
@ -154,7 +154,7 @@ class BookController extends Controller
$book = $this->entityRepo->getBySlug('book', $bookSlug);
$this->checkOwnablePermission('book-delete', $book);
$this->setPageTitle(trans('entities.books_delete_named', ['bookName'=>$book->getShortName()]));
return view('books/delete', ['book' => $book, 'current' => $book]);
return view('books.delete', ['book' => $book, 'current' => $book]);
}
/**
@ -171,7 +171,7 @@ class BookController extends Controller
$bookChildren = $this->entityRepo->getBookChildren($book, true);
$this->setPageTitle(trans('entities.books_sort_named', ['bookName'=>$book->getShortName()]));
return view('books/sort', ['book' => $book, 'current' => $book, 'bookChildren' => $bookChildren]);
return view('books.sort', ['book' => $book, 'current' => $book, 'bookChildren' => $bookChildren]);
}
/**
@ -184,7 +184,7 @@ class BookController extends Controller
{
$book = $this->entityRepo->getBySlug('book', $bookSlug);
$bookChildren = $this->entityRepo->getBookChildren($book);
return view('books/sort-box', ['book' => $book, 'bookChildren' => $bookChildren]);
return view('books.sort-box', ['book' => $book, 'bookChildren' => $bookChildren]);
}
/**

View File

@ -39,7 +39,7 @@ class ChapterController extends Controller
$book = $this->entityRepo->getBySlug('book', $bookSlug);
$this->checkOwnablePermission('chapter-create', $book);
$this->setPageTitle(trans('entities.chapters_create'));
return view('chapters/create', ['book' => $book, 'current' => $book]);
return view('chapters.create', ['book' => $book, 'current' => $book]);
}
/**
@ -78,7 +78,7 @@ class ChapterController extends Controller
Views::add($chapter);
$this->setPageTitle($chapter->getShortName());
$pages = $this->entityRepo->getChapterChildren($chapter);
return view('chapters/show', [
return view('chapters.show', [
'book' => $chapter->book,
'chapter' => $chapter,
'current' => $chapter,
@ -98,7 +98,7 @@ class ChapterController extends Controller
$chapter = $this->entityRepo->getBySlug('chapter', $chapterSlug, $bookSlug);
$this->checkOwnablePermission('chapter-update', $chapter);
$this->setPageTitle(trans('entities.chapters_edit_named', ['chapterName' => $chapter->getShortName()]));
return view('chapters/edit', ['book' => $chapter->book, 'chapter' => $chapter, 'current' => $chapter]);
return view('chapters.edit', ['book' => $chapter->book, 'chapter' => $chapter, 'current' => $chapter]);
}
/**
@ -130,7 +130,7 @@ class ChapterController extends Controller
$chapter = $this->entityRepo->getBySlug('chapter', $chapterSlug, $bookSlug);
$this->checkOwnablePermission('chapter-delete', $chapter);
$this->setPageTitle(trans('entities.chapters_delete_named', ['chapterName' => $chapter->getShortName()]));
return view('chapters/delete', ['book' => $chapter->book, 'chapter' => $chapter, 'current' => $chapter]);
return view('chapters.delete', ['book' => $chapter->book, 'chapter' => $chapter, 'current' => $chapter]);
}
/**
@ -162,7 +162,7 @@ class ChapterController extends Controller
$this->setPageTitle(trans('entities.chapters_move_named', ['chapterName' => $chapter->getShortName()]));
$this->checkOwnablePermission('chapter-update', $chapter);
$this->checkOwnablePermission('chapter-delete', $chapter);
return view('chapters/move', [
return view('chapters.move', [
'chapter' => $chapter,
'book' => $chapter->book
]);

View File

@ -54,7 +54,7 @@ class CommentController extends Controller
$this->checkPermission('comment-create-all');
$comment = $this->commentRepo->create($page, $request->only(['html', 'text', 'parent_id']));
Activity::add($page, 'commented_on', $page->book->id);
return view('comments/comment', ['comment' => $comment]);
return view('comments.comment', ['comment' => $comment]);
}
/**
@ -75,7 +75,7 @@ class CommentController extends Controller
$this->checkOwnablePermission('comment-update', $comment);
$comment = $this->commentRepo->update($comment, $request->only(['html', 'text']));
return view('comments/comment', ['comment' => $comment]);
return view('comments.comment', ['comment' => $comment]);
}
/**

View File

@ -42,7 +42,7 @@ class SearchController extends Controller
$results = $this->searchService->searchEntities($searchTerm, 'all', $page, 20);
return view('search/all', [
return view('search.all', [
'entities' => $results['results'],
'totalResults' => $results['total'],
'searchTerm' => $searchTerm,
@ -63,7 +63,7 @@ class SearchController extends Controller
{
$term = $request->get('term', '');
$results = $this->searchService->searchBook($bookId, $term);
return view('partials/entity-list', ['entities' => $results]);
return view('partials.entity-list', ['entities' => $results]);
}
/**
@ -77,7 +77,7 @@ class SearchController extends Controller
{
$term = $request->get('term', '');
$results = $this->searchService->searchChapter($chapterId, $term);
return view('partials/entity-list', ['entities' => $results]);
return view('partials.entity-list', ['entities' => $results]);
}
/**

View File

@ -13,7 +13,7 @@
{!! csrf_field() !!}
<div class="stretch-inputs">
@include('auth/forms/login/' . $authMethod)
@include('auth.forms.login.' . $authMethod)
</div>
<div class="grid half collapse-xs gap-xl v-center">

View File

@ -12,7 +12,7 @@
<div class="form-group">
<label for="email">{{ trans('auth.email') }}</label>
@include('form/text', ['name' => 'email'])
@include('form.text', ['name' => 'email'])
</div>
<div class="from-group text-right mt-m">

View File

@ -13,17 +13,17 @@
<div class="form-group">
<label for="email">{{ trans('auth.name') }}</label>
@include('form/text', ['name' => 'name'])
@include('form.text', ['name' => 'name'])
</div>
<div class="form-group">
<label for="email">{{ trans('auth.email') }}</label>
@include('form/text', ['name' => 'email'])
@include('form.text', ['name' => 'email'])
</div>
<div class="form-group">
<label for="password">{{ trans('auth.password') }}</label>
@include('form/password', ['name' => 'password', 'placeholder' => trans('auth.password_hint')])
@include('form.password', ['name' => 'password', 'placeholder' => trans('auth.password_hint')])
</div>
<div class="grid half collapse-xs gap-xl v-center mt-m">

View File

@ -18,9 +18,9 @@
<div class="form-group">
<label for="email">{{ trans('auth.email') }}</label>
@if(auth()->check())
@include('form/text', ['name' => 'email', 'model' => auth()->user()])
@include('form.text', ['name' => 'email', 'model' => auth()->user()])
@else
@include('form/text', ['name' => 'email'])
@include('form.text', ['name' => 'email'])
@endif
</div>
<div class="form-group text-right mt-m">

View File

@ -18,7 +18,7 @@
<div class="content-wrap card">
<h1 class="list-heading">{{ trans('entities.books_create') }}</h1>
<form action="{{ baseUrl("/books") }}" method="POST" enctype="multipart/form-data">
@include('books/form')
@include('books.form')
</form>
</div>
</div>

View File

@ -18,7 +18,7 @@
<h1 class="list-heading">{{ trans('entities.books_edit') }}</h1>
<form action="{{ $book->getUrl() }}" method="POST">
<input type="hidden" name="_method" value="PUT">
@include('books/form', ['model' => $book])
@include('books.form', ['model' => $book])
</form>
</div>
</div>

View File

@ -2,12 +2,12 @@
{{ csrf_field() }}
<div class="form-group title-input">
<label for="name">{{ trans('common.name') }}</label>
@include('form/text', ['name' => 'name'])
@include('form.text', ['name' => 'name'])
</div>
<div class="form-group description-input">
<label for="description">{{ trans('common.description') }}</label>
@include('form/textarea', ['name' => 'description'])
@include('form.textarea', ['name' => 'description'])
</div>
<div class="form-group" collapsible id="logo-control">

View File

@ -16,7 +16,7 @@
<div class="content-wrap card">
<h1 class="list-heading">{{ trans('entities.chapters_create') }}</h1>
<form action="{{ $book->getUrl('/create-chapter') }}" method="POST">
@include('chapters/form')
@include('chapters.form')
</form>
</div>

View File

@ -19,7 +19,7 @@
<h1 class="list-heading">{{ trans('entities.chapters_edit') }}</h1>
<form action="{{ $chapter->getUrl() }}" method="POST">
<input type="hidden" name="_method" value="PUT">
@include('chapters/form', ['model' => $chapter])
@include('chapters.form', ['model' => $chapter])
</form>
</div>

View File

@ -3,12 +3,12 @@
<div class="form-group title-input">
<label for="name">{{ trans('common.name') }}</label>
@include('form/text', ['name' => 'name'])
@include('form.text', ['name' => 'name'])
</div>
<div class="form-group description-input">
<label for="description">{{ trans('common.description') }}</label>
@include('form/textarea', ['name' => 'description'])
@include('form.textarea', ['name' => 'description'])
</div>
<div class="form-group" collapsible id="logo-control">

View File

@ -48,7 +48,7 @@
{{--TODO--}}
<h3 class="text-muted">{{ trans('entities.search_results') }} <a v-if="searching" @click="clearSearch()" class="text-small">@icon('close'){{ trans('entities.search_clear') }}</a></h3>
<div v-if="!searchResults">
@include('partials/loading-icon')
@include('partials.loading-icon')
</div>
<div v-html="searchResults"></div>
</div>
@ -151,7 +151,7 @@
</form>
</div>
@include('partials/book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
@include('partials.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
@stop

View File

@ -14,7 +14,7 @@
<div id="recent-drafts" class="card mb-xl">
<h3>{{ trans('entities.my_recent_drafts') }}</h3>
<div class="px-m">
@include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
@include('partials.entity-list', ['entities' => $draftPages, 'style' => 'compact'])
</div>
</div>
@endif
@ -22,7 +22,7 @@
<div id="{{ $signedIn ? 'recently-viewed' : 'recent-books' }}" class="card mb-xl">
<h3>{{ trans('entities.' . ($signedIn ? 'my_recently_viewed' : 'books_recent')) }}</h3>
<div class="px-m">
@include('partials/entity-list', [
@include('partials.entity-list', [
'entities' => $recents,
'style' => 'compact',
'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
@ -35,7 +35,7 @@
<div id="recent-pages" class="card mb-xl">
<h3><a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
<div id="recently-updated-pages" class="px-m">
@include('partials/entity-list', [
@include('partials.entity-list', [
'entities' => $recentlyUpdatedPages,
'style' => 'compact',
'emptyText' => trans('entities.no_pages_recently_updated')
@ -48,7 +48,7 @@
<div id="recent-activity">
<div class="card mb-xl">
<h3>{{ trans('entities.recent_activity') }}</h3>
@include('partials/activity-list', ['activity' => $activity])
@include('partials.activity-list', ['activity' => $activity])
</div>
</div>
</div>

View File

@ -25,7 +25,7 @@
<div class="form-group title-input">
<label for="name">{{ trans('common.name') }}</label>
@include('form/text', ['name' => 'name'])
@include('form.text', ['name' => 'name'])
</div>
<div class="form-group" collapsible>

View File

@ -56,7 +56,7 @@
{{--Title input--}}
<div class="title-input page-title clearfix" v-pre>
<div class="input">
@include('form/text', ['name' => 'name', 'placeholder' => trans('entities.pages_title')])
@include('form.text', ['name' => 'name', 'placeholder' => trans('entities.pages_title')])
</div>
</div>

View File

@ -12,7 +12,7 @@
<div class="form-group title-input">
<label for="name">{{ trans('entities.pages_name') }}</label>
@include('form/text', ['name' => 'name'])
@include('form.text', ['name' => 'name'])
</div>
<div class="form-group">

View File

@ -3,7 +3,7 @@
<div class="activity-list">
@foreach($activity as $activityItem)
<div class="activity-list-item">
@include('partials/activity-item', ['activity' => $activityItem])
@include('partials.activity-item', ['activity' => $activityItem])
</div>
@endforeach
</div>

View File

@ -2,7 +2,7 @@
@if(count($pages) > 0)
@foreach($pages as $pageIndex => $page)
<div class="anim searchResult" style="animation-delay: {{$pageIndex*50 . 'ms'}};">
@include('pages/list-item', ['page' => $page])
@include('pages.list-item', ['page' => $page])
<hr>
</div>
@endforeach
@ -15,7 +15,7 @@
<div class="page-list">
@foreach($chapters as $chapterIndex => $chapter)
<div class="anim searchResult" style="animation-delay: {{($chapterIndex+count($pages))*50 . 'ms'}};">
@include('chapters/list-item', ['chapter' => $chapter, 'hidePages' => true])
@include('chapters.list-item', ['chapter' => $chapter, 'hidePages' => true])
<hr>
</div>
@endforeach

View File

@ -5,7 +5,7 @@
<div class="grid left-focus v-center">
<div class="py-m">
@include('settings/navbar', ['selected' => 'maintenance'])
@include('settings.navbar', ['selected' => 'maintenance'])
</div>
<div class="text-right mb-l px-m">
<br>

View File

@ -19,7 +19,7 @@
@if($role->users->count() > 0)
<div class="form-group">
<p>{{ trans('settings.role_delete_users_assigned', ['userCount' => $role->users->count()]) }}</p>
@include('form/role-select', ['options' => $roles, 'name' => 'migration_role_id'])
@include('form.role-select', ['options' => $roles, 'name' => 'migration_role_id'])
</div>
@endif

View File

@ -5,7 +5,7 @@
<div class="container small">
<div class="py-m">
@include('settings/navbar', ['selected' => 'roles'])
@include('settings.navbar', ['selected' => 'roles'])
</div>
<div class="card content-wrap auto-height">

View File

@ -18,7 +18,7 @@
<h1 class="list-heading">{{ trans('entities.shelves_edit') }}</h1>
<form action="{{ $shelf->getUrl() }}" method="POST">
<input type="hidden" name="_method" value="PUT">
@include('shelves/form', ['model' => $shelf])
@include('shelves.form', ['model' => $shelf])
</form>
</div>
</div>

View File

@ -2,12 +2,12 @@
<div class="form-group title-input">
<label for="name">{{ trans('common.name') }}</label>
@include('form/text', ['name' => 'name'])
@include('form.text', ['name' => 'name'])
</div>
<div class="form-group description-input">
<label for="description">{{ trans('common.description') }}</label>
@include('form/textarea', ['name' => 'description'])
@include('form.textarea', ['name' => 'description'])
</div>
<div shelf-sort class="grid half gap-xl">

View File

@ -15,7 +15,7 @@
@if(count($books) > 0)
<div class="entity-list">
@foreach($books as $book)
@include('books/list-item', ['book' => $book])
@include('books.list-item', ['book' => $book])
@endforeach
</div>
@else

View File

@ -42,7 +42,7 @@
<label for="role" class="setting-list-label">{{ trans('settings.users_role') }}</label>
<p class="small">{{ trans('settings.users_role_desc') }}</p>
<div class="mt-m">
@include('form/role-checkboxes', ['name' => 'roles', 'roles' => $roles])
@include('form.role-checkboxes', ['name' => 'roles', 'roles' => $roles])
</div>
</div>
@endif