* @param int $page
* @return array
*/
- public function entityActivity($entity, $count = 20, $page = 0)
+ public function entityActivity($entity, $count = 20, $page = 1)
{
if ($entity->isA('book')) {
$query = $this->activity->where('book_id', '=', $entity->id);
$activity = $this->permissionService
->filterRestrictedEntityRelations($query, 'activities', 'entity_id', 'entity_type')
- ->orderBy('created_at', 'desc')->with(['entity', 'user.avatar'])->skip($count * $page)->take($count)->get();
+ ->orderBy('created_at', 'desc')->with(['entity', 'user.avatar'])->skip($count * ($page - 1))->take($count)->get();
return $this->filterSimilar($activity);
}
*/
public function getAllRoles()
{
- return $this->role->all();
+ return $this->role->newQuery()->orderBy('name', 'asc')->get();
}
/**
*/
public function getBookCover($width = 440, $height = 250)
{
+ // TODO - Make generic, focused on books right now, Perhaps set-up a better image
$default = baseUrl('/book_default_cover.png');
if (!$this->image_id) {
return $default;
}
/**
- * Get the cover image of the book
+ * Get the cover image of the shelf
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function cover()
'book' => $book,
'current' => $book,
'bookChildren' => $bookChildren,
- 'activity' => Activity::entityActivity($book, 20, 0)
+ 'activity' => Activity::entityActivity($book, 20, 1)
]);
}
*/
public function index()
{
- $shelves = $this->entityRepo->getAllPaginated('bookshelf', 18);
+
+ $view = setting()->getUser($this->currentUser, 'bookshelves_view_type', config('app.views.bookshelves', 'grid'));
+
+ $sort = setting()->getUser($this->currentUser, 'bookshelves_sort', 'name');
+ $order = setting()->getUser($this->currentUser, 'bookshelves_sort_order', 'asc');
+ $sortOptions = [
+ 'name' => trans('common.sort_name'),
+ 'created_at' => trans('common.sort_created_at'),
+ 'updated_at' => trans('common.sort_updated_at'),
+ ];
+
+ $shelves = $this->entityRepo->getAllPaginated('bookshelf', 18, $sort, $order);
$recents = $this->signedIn ? $this->entityRepo->getRecentlyViewed('bookshelf', 4, 0) : false;
$popular = $this->entityRepo->getPopular('bookshelf', 4, 0);
$new = $this->entityRepo->getRecentlyCreated('bookshelf', 4, 0);
- $view = setting()->getUser($this->currentUser, 'bookshelves_view_type', config('app.views.bookshelves', 'grid'));
+
$this->setPageTitle(trans('entities.shelves'));
return view('shelves.index', [
'recents' => $recents,
'popular' => $popular,
'new' => $new,
- 'view' => $view
+ 'view' => $view,
+ 'sort' => $sort,
+ 'order' => $order,
+ 'sortOptions' => $sortOptions,
]);
}
return view('shelves.show', [
'shelf' => $bookshelf,
'books' => $books,
- 'activity' => Activity::entityActivity($bookshelf, 20, 0)
+ 'activity' => Activity::entityActivity($bookshelf, 20, 1)
]);
}
}
/**
- * Show the Restrictions view.
- * @param $slug
+ * Show the permissions view.
+ * @param string $slug
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @throws \BookStack\Exceptions\NotFoundException
*/
- public function showRestrict(string $slug)
+ public function showPermissions(string $slug)
{
$bookshelf = $this->entityRepo->getBySlug('bookshelf', $slug);
$this->checkOwnablePermission('restrictions-manage', $bookshelf);
$roles = $this->userRepo->getRestrictableRoles();
- return view('shelves.restrictions', [
+ return view('shelves.permissions', [
'shelf' => $bookshelf,
'roles' => $roles
]);
}
/**
- * Set the restrictions for this bookshelf.
- * @param $slug
+ * Set the permissions for this bookshelf.
+ * @param string $slug
* @param Request $request
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \BookStack\Exceptions\NotFoundException
+ * @throws \Throwable
*/
- public function restrict(string $slug, Request $request)
+ public function permissions(string $slug, Request $request)
{
$bookshelf = $this->entityRepo->getBySlug('bookshelf', $slug);
$this->checkOwnablePermission('restrictions-manage', $bookshelf);
return $this->downloadResponse($pageText, $pageSlug . '.txt');
}
- /**
- * Show a listing of recently created pages
- * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
- */
- public function showRecentlyCreated()
- {
- // TODO - Still exist?
- $pages = $this->pageRepo->getRecentlyCreatedPaginated('page', 20)->setPath(baseUrl('/pages/recently-created'));
- return view('pages.detailed-listing', [
- 'title' => trans('entities.recently_created_pages'),
- 'pages' => $pages
- ]);
- }
-
/**
* Show a listing of recently created pages
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
}
/**
- * Change the stored sort type for the books view.
- * @param $id
+ * Change the stored sort type for a particular view.
+ * @param string $id
+ * @param string $type
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
- public function changeBooksSort($id, Request $request)
+ public function changeSort(string $id, string $type, Request $request)
{
// TODO - Test this endpoint
- return $this->changeListSort($id, $request, 'books');
+ $validSortTypes = ['books', 'bookshelves'];
+ if (!in_array($type, $validSortTypes)) {
+ return redirect()->back(500);
+ }
+ return $this->changeListSort($id, $request, $type);
}
/**
@mixin spacing($prop, $propLetter) {
@each $sizeLetter, $size in $spacing {
.#{$propLetter}-#{$sizeLetter} {
- #{$prop}: $size;
+ #{$prop}: $size !important;
}
.#{$propLetter}x-#{$sizeLetter} {
- #{$prop}-left: $size;
- #{$prop}-right: $size;
+ #{$prop}-left: $size !important;
+ #{$prop}-right: $size !important;
}
.#{$propLetter}y-#{$sizeLetter} {
- #{$prop}-top: $size;
- #{$prop}-bottom: $size;
+ #{$prop}-top: $size !important;
+ #{$prop}-bottom: $size !important;
}
.#{$propLetter}t-#{$sizeLetter} {
- #{$prop}-top: $size;
+ #{$prop}-top: $size !important;
}
.#{$propLetter}r-#{$sizeLetter} {
- #{$prop}-right: $size;
+ #{$prop}-right: $size !important;
}
.#{$propLetter}b-#{$sizeLetter} {
- #{$prop}-bottom: $size;
+ #{$prop}-bottom: $size !important;
}
.#{$propLetter}l-#{$sizeLetter} {
- #{$prop}-left: $size;
+ #{$prop}-left: $size !important;
}
}
.button-base {
text-decoration: none;
- font-size: $fs-m;
+ font-size: 0.85rem;
line-height: 1.4em;
padding: $-xs*1.3 $-m;
margin-top: $-xs;
margin-left: $-s;
}
+.button.small {
+ font-size: 0.75rem;
+ padding: $-xs*1.2 $-s;
+}
+
.button.outline {
background-color: transparent;
color: #888;
margin: 0;
border: none;
user-select: none;
+ font-size: 0.75rem;
&:focus, &:active {
outline: 0;
}
&.neg {
color: $negative;
}
+ &.muted {
+ color: #666;
+ }
}
.button-group {
.bg-book {
background-color: $color-book;
+}
+.bg-shelf {
+ background-color: $color-bookshelf;
}
\ No newline at end of file
line-height: 1.4em;
font-size: 0.94em;
font-weight: 400;
- color: #999;
+ color: #666;
padding-bottom: 2px;
margin-bottom: 0.2em;
&.inline {
height: 16px;
border-radius: 2px;
display: inline-block;
- border: 2px solid #999;
+ border: 2px solid currentColor;
+ opacity: 0.6;
overflow: hidden;
- fill: #888;
+ fill: currentColor;
.svg-icon {
width: 100%;
height: 100%;
}
.custom-checkbox:hover {
background-color: rgba(0, 0, 0, 0.05);
+ opacity: 0.8;
}
}
+.toggle-switch-list .toggle-switch {
+ margin: $-xs 0;
+}
.form-group {
margin-bottom: $-s;
.setting-list-label + p.small {
margin-bottom: 0;
}
+.setting-list-label + .grid {
+ margin-top: $-m;
+}
+.setting-list .grid {
+ input[type=text], input[type=email], input[type=password], select {
+ width: 100%;
+ }
+}
.simple-code-input {
background-color: #F8F8F8;
flex: 1;
}
+.dual-column-content {
+ columns: 2;
+}
+
+@include smaller-than($m) {
+ .dual-column-content {
+ columns: 1;
+ }
+}
+
.content-wrap.card {
padding: $-l $-xxl;
margin-left: auto;
}
}
+@include smaller-than($m) {
+ .content-wrap.card {
+ padding: $-m $-l;
+ }
+}
+
.tri-layout-container {
display: grid;
grid-template-columns: 1fr minmax(auto, 940px) 1fr;
.grid.third {
grid-template-columns: 1fr 1fr;
}
- .grid.left-focus, .grid.right-focus {
+ .grid.half, .grid.left-focus, .grid.right-focus {
grid-template-columns: 1fr;
}
+ .grid.large-gap {
+ grid-column-gap: $-m;
+ grid-row-gap: $-m;
+ }
.grid.right-focus.reverse-collapse > *:nth-child(2) {
order: 0;
}
}
small, p.small, span.small, .text-small {
- font-size: 0.8em;
- color: lighten($text-dark, 20%);
+ font-size: 0.85em;
+ color: lighten($text-dark, 10%);
small, p.small, span.small, .text-small {
font-size: 1em;
}
'user_profile' => 'User Profile',
'users_add_new' => 'Add New User',
'users_search' => 'Search Users',
+ 'users_details' => 'User Details',
+ 'users_details_desc' => 'Set a display name and an email address for this user. The email address will be used for logging into the application.',
'users_role' => 'User Roles',
+ 'users_role_desc' => 'Select which roles this user will be assigned to. If a user is assigned to multiple roles the permissions from those roles will stack and they will receive all abilities of the assigned roles.',
+ 'users_password' => 'User Password',
+ 'users_password_desc' => 'Set a password used to log-in to the application. This must be at least 5 characters long.',
'users_external_auth_id' => 'External Authentication ID',
- 'users_password_warning' => 'Only fill the below if you would like to change your password:',
+ 'users_password_warning' => 'Only fill the below if you would like to change your password.',
'users_system_public' => 'This user represents any guest users that visit your instance. It cannot be used to log in but is assigned automatically.',
'users_delete' => 'Delete User',
'users_delete_named' => 'Delete user :userName',
<div class="my-l">
@include('partials.breadcrumbs', ['crumbs' => [
$book,
- $book->getUrl() => trans('entities.books_edit')
+ $book->getUrl('/edit') => trans('entities.books_edit')
]])
</div>
<div class="content-wrap card">
- <div class="grid halves v-center">
+ <div class="grid half v-center">
<h1 class="list-heading">{{ trans('entities.books') }}</h1>
<div class="text-right">
- @include('partials.sort', ['options' => $sortOptions, 'order' => $order, 'sort' => $sort])
+ @include('partials.sort', ['options' => $sortOptions, 'order' => $order, 'sort' => $sort, 'type' => 'books'])
</div>
</div>
@if(count($activity) > 0)
<div class="mb-xl">
<h5>{{ trans('entities.recent_activity') }}</h5>
- @include('partials/activity-list', ['activity' => $activity])
+ @include('partials.activity-list', ['activity' => $activity])
</div>
@endif
@stop
--- /dev/null
+{{--
+$name
+$value
+$checked
+$label
+--}}
+<label class="toggle-switch @if($errors->has($name)) neg @endif">
+ <input type="checkbox" name="{{$name}}" value="{{ $value }}" @if($checked) checked="checked" @endif>
+ <span class="custom-checkbox text-primary">@icon('check')</span>
+ <span class="label">{{$label}}</span>
+</label>
\ No newline at end of file
<div class="image-picker" image-picker="{{$name}}" data-default-image="{{ $defaultImage }}" data-resize-height="{{ $resizeHeight }}" data-resize-width="{{ $resizeWidth }}" data-current-id="{{ $currentId or '' }}" data-resize-crop="{{ $resizeCrop or '' }}">
- <div>
- <img @if($currentImage && $currentImage !== 'none') src="{{$currentImage}}" @else src="{{$defaultImage}}" @endif class="{{$imageClass}} @if($currentImage=== 'none') none @endif" alt="{{ trans('components.image_preview') }}">
- </div>
-
- <button class="button" type="button" data-action="show-image-manager">{{ trans('components.image_select_image') }}</button>
- <br>
- <button class="text-button" data-action="reset-image" type="button">{{ trans('common.reset') }}</button>
+ <div class="grid half">
+ <div class="text-center">
+ <img @if($currentImage && $currentImage !== 'none') src="{{$currentImage}}" @else src="{{$defaultImage}}" @endif class="{{$imageClass}} @if($currentImage=== 'none') none @endif" alt="{{ trans('components.image_preview') }}">
+ </div>
+ <div class="text-center">
+ <button class="button outline small" type="button" data-action="show-image-manager">{{ trans('components.image_select_image') }}</button>
+ <br>
+ <button class="text-button muted" data-action="reset-image" type="button">{{ trans('common.reset') }}</button>
- @if ($showRemove)
- <span class="sep">|</span>
- <button class="text-button neg" data-action="remove-image" type="button">{{ trans('common.remove') }}</button>
- @endif
+ @if ($showRemove)
+ <span class="sep">|</span>
+ <button class="text-button muted" data-action="remove-image" type="button">{{ trans('common.remove') }}</button>
+ @endif
+ </div>
+ </div>
<input type="hidden" name="{{$name}}" id="{{$name}}" value="{{ isset($currentId) && ($currentId !== 0 && $currentId !== false) ? $currentId : $currentImage}}">
</div>
\ No newline at end of file
<label toggle-switch="{{$name}}" class="toggle-switch">
<input type="hidden" name="{{$name}}" value="{{$value?'true':'false'}}"/>
<input type="checkbox" @if($value) checked="checked" @endif>
- <span class="custom-checkbox ">@icon('check')</span>
+ <span class="custom-checkbox text-primary">@icon('check')</span>
<span class="label">{{ $label ?? '' }}</span> {{-- TODO - remove default operataor backup --}}
</label>
\ No newline at end of file
-
-<label>
- <input value="true" id="{{$name}}" type="checkbox" name="{{$name}}"
- @if($errors->has($name)) class="neg" @endif
- @if(old($name) || (!old() && isset($model) && $model->$name)) checked="checked" @endif
- >
- {{ $label }}
-</label>
+{{--
+$name
+$label
+$errors?
+$model?
+--}}
+@include('components.custom-checkbox', [
+ 'name' => $name,
+ 'label' => $label,
+ 'value' => 'true',
+ 'checked' => old($name) || (!old() && isset($model) && $model->$name)
+])
@if($errors->has($name))
<div class="text-neg text-small">{{ $errors->first($name) }}</div>
{!! csrf_field() !!}
<input type="hidden" name="_method" value="PUT">
- <p>{{ trans('entities.permissions_intro') }}</p>
+ <p class="mb-none">{{ trans('entities.permissions_intro') }}</p>
<div class="form-group">
- @include('form/checkbox', ['name' => 'restricted', 'label' => trans('entities.permissions_enable')])
+ @include('form.checkbox', [
+ 'name' => 'restricted',
+ 'label' => trans('entities.permissions_enable'),
+ ])
</div>
{{--TODO - Add global and role "Select All" options--}}
- <table class="table">
+ <table class="table toggle-switch-list">
<tr>
<th>{{ trans('common.role') }}</th>
<th @if($model->isA('page')) colspan="3" @else colspan="4" @endif>{{ trans('common.actions') }}</th>
@foreach($roles as $role)
<tr>
<td>{{ $role->display_name }}</td>
- <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.view'), 'action' => 'view'])</td>
+ <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.view'), 'action' => 'view'])</td>
@if(!$model->isA('page'))
- <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.create'), 'action' => 'create'])</td>
+ <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.create'), 'action' => 'create'])</td>
@endif
- <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.update'), 'action' => 'update'])</td>
- <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.delete'), 'action' => 'delete'])</td>
+ <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.update'), 'action' => 'update'])</td>
+ <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.delete'), 'action' => 'delete'])</td>
</tr>
@endforeach
</table>
-{{--TODO - Make custom--}}
-<label>
- <input value="true" id="{{$name}}[{{$role->id}}][{{$action}}]" type="checkbox" name="{{$name}}[{{$role->id}}][{{$action}}]"
- @if(isset($model) && $model->hasRestriction($role->id, $action)) checked="checked" @endif>
- {{ $label }}
-</label>
\ No newline at end of file
+{{--
+$name
+$label
+$role
+$action
+$model?
+--}}
+@include('components.custom-checkbox', [
+ 'name' => $name . '[' . $role->id . '][' . $action . ']',
+ 'label' => $label,
+ 'value' => 'true',
+ 'checked' => isset($model) && $model->hasRestriction($role->id, $action)
+])
\ No newline at end of file
-@foreach($roles as $role)
- <label>
- <input value="{{ $role->id }}" id="{{$name}}-{{$role->name}}" type="checkbox" name="{{$name}}[{{$role->name}}]"
- @if($errors->has($name)) class="neg" @endif
- @if(old($name . '.' . $role->name) || (!old('name') && isset($model) && $model->hasRole($role->name))) checked="checked" @endif
- >
- {{ $role->display_name }}
- </label>
-@endforeach
+<div class="toggle-switch-list dual-column-content">
+ @foreach($roles as $role)
+ <div>
+ @include('components.custom-checkbox', [
+ 'name' => $name . '[' . $role->name . ']',
+ 'label' => $role->display_name,
+ 'value' => $role->id,
+ 'checked' => old($name . '.' . $role->name) || (!old('name') && isset($model) && $model->hasRole($role->name))
+ ])
+ </div>
+ @endforeach
+</div>
@if($errors->has($name))
<div class="text-neg text-small">{{ $errors->first($name) }}</div>
@extends('simple-layout')
@section('body')
- <div class="container small">
- <p> </p>
- <div class="card">
- <h3>{{ $title }}</h3>
- @include('partials/entity-list', ['entities' => $pages, 'style' => 'detailed'])
- <div class="body text-center">
+ <div class="container small pt-xl">
+ <div class="card content-wrap">
+ <h1 class="list-heading">{{ $title }}</h1>
+
+ <div class="book-contents">
+ @include('partials.entity-list', ['entities' => $pages, 'style' => 'detailed'])
+ </div>
+
+ <div class="text-center">
{!! $pages->links() !!}
</div>
</div>
-
</div>
@stop
\ No newline at end of file
?>
<div class="list-sort-container" list-sort-control>
<div class="list-sort-label">{{ trans('common.sort') }}</div>
- <form action="{{ baseUrl("/settings/users/{$currentUser->id}/change-books-sort") }}" method="post">
+ <form action="{{ baseUrl("/settings/users/{$currentUser->id}/change-sort/{$type}") }}" method="post">
{!! csrf_field() !!}
{!! method_field('PATCH') !!}
-@extends('sidebar-layout')
+@extends('simple-layout')
-@section('toolbar')
- <div class="col-sm-12 faded">
- <div class="breadcrumbs">
- <a href="{{ baseUrl("/search?term=" . urlencode($searchTerm)) }}" class="text-button">@icon('search'){{ trans('entities.search_for_term', ['term' => $searchTerm]) }}</a>
- </div>
- </div>
-@stop
-
-@section('container-attrs')
- id="search-system"
-@stop
+@section('body')
+ <input type="hidden" name="searchTerm" value="{{$searchTerm}}">
-@section('sidebar')
- <div class="card">
- <h3>{{ trans('entities.search_filters') }}</h3>
-
- <div class="body">
- <form v-on:submit="updateSearch" v-cloak class="v-cloak anim fadeIn">
- <h6 class="text-muted">{{ trans('entities.search_content_type') }}</h6>
- <div class="form-group">
- <label class="inline checkbox text-page"><input type="checkbox" v-on:change="typeChange" v-model="search.type.page" value="page">{{ trans('entities.page') }}</label>
- <label class="inline checkbox text-chapter"><input type="checkbox" v-on:change="typeChange" v-model="search.type.chapter" value="chapter">{{ trans('entities.chapter') }}</label>
- <br>
- <label class="inline checkbox text-book"><input type="checkbox" v-on:change="typeChange" v-model="search.type.book" value="book">{{ trans('entities.book') }}</label>
- <label class="inline checkbox text-bookshelf"><input type="checkbox" v-on:change="typeChange" v-model="search.type.bookshelf" value="bookshelf">{{ trans('entities.shelf') }}</label>
- </div>
+ <div class="container" id="search-system">
- <h6 class="text-muted">{{ trans('entities.search_exact_matches') }}</h6>
- <table cellpadding="0" cellspacing="0" border="0" class="no-style">
- <tr v-for="(term, i) in search.exactTerms">
- <td style="padding: 0 12px 6px 0;">
- <input class="exact-input outline" v-on:input="exactChange" type="text" v-model="search.exactTerms[i]"></td>
- <td>
- <button type="button" class="text-neg text-button" v-on:click="removeExact(i)">
- @icon('close')
- </button>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <button type="button" class="text-button" v-on:click="addExact">
- @icon('add-circle'){{ trans('common.add') }}
- </button>
- </td>
- </tr>
- </table>
-
- <h6 class="text-muted">{{ trans('entities.search_tags') }}</h6>
- <table cellpadding="0" cellspacing="0" border="0" class="no-style">
- <tr v-for="(term, i) in search.tagTerms">
- <td style="padding: 0 12px 6px 0;">
- <input class="tag-input outline" v-on:input="tagChange" type="text" v-model="search.tagTerms[i]"></td>
- <td>
- <button type="button" class="text-neg text-button" v-on:click="removeTag(i)">
- @icon('close')
- </button>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <button type="button" class="text-button" v-on:click="addTag">
- @icon('add-circle'){{ trans('common.add') }}
- </button>
- </td>
- </tr>
- </table>
-
- @if(signedInUser())
- <h6 class="text-muted">{{ trans('entities.search_options') }}</h6>
- <label class="checkbox">
- <input type="checkbox" v-on:change="optionChange('viewed_by_me')"
- v-model="search.option.viewed_by_me" value="page">
- {{ trans('entities.search_viewed_by_me') }}
- </label>
- <label class="checkbox">
- <input type="checkbox" v-on:change="optionChange('not_viewed_by_me')"
- v-model="search.option.not_viewed_by_me" value="page">
- {{ trans('entities.search_not_viewed_by_me') }}
- </label>
- <label class="checkbox">
- <input type="checkbox" v-on:change="optionChange('is_restricted')"
- v-model="search.option.is_restricted" value="page">
- {{ trans('entities.search_permissions_set') }}
- </label>
- <label class="checkbox">
- <input type="checkbox" v-on:change="optionChange('created_by:me')"
- v-model="search.option['created_by:me']" value="page">
- {{ trans('entities.search_created_by_me') }}
- </label>
- <label class="checkbox">
- <input type="checkbox" v-on:change="optionChange('updated_by:me')"
- v-model="search.option['updated_by:me']" value="page">
- {{ trans('entities.search_updated_by_me') }}
- </label>
- @endif
-
- <h6 class="text-muted">{{ trans('entities.search_date_options') }}</h6>
- <table cellpadding="0" cellspacing="0" border="0" class="no-style form-table">
- <tr>
- <td width="200">{{ trans('entities.search_updated_after') }}</td>
- <td width="80">
- <button type="button" class="text-button" v-if="!search.dates.updated_after"
- v-on:click="enableDate('updated_after')">{{ trans('entities.search_set_date') }}</button>
-
- </td>
- </tr>
- <tr v-if="search.dates.updated_after">
- <td>
- <input v-if="search.dates.updated_after" class="tag-input"
- v-on:input="dateChange('updated_after')" type="date" v-model="search.dates.updated_after"
- pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
- </td>
- <td>
- <button v-if="search.dates.updated_after" type="button" class="text-neg text-button"
- v-on:click="dateRemove('updated_after')">
- @icon('close')
- </button>
- </td>
- </tr>
- <tr>
- <td>{{ trans('entities.search_updated_before') }}</td>
- <td>
- <button type="button" class="text-button" v-if="!search.dates.updated_before"
- v-on:click="enableDate('updated_before')">{{ trans('entities.search_set_date') }}</button>
-
- </td>
- </tr>
- <tr v-if="search.dates.updated_before">
- <td>
- <input v-if="search.dates.updated_before" class="tag-input"
- v-on:input="dateChange('updated_before')" type="date" v-model="search.dates.updated_before"
- pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
- </td>
- <td>
- <button v-if="search.dates.updated_before" type="button" class="text-neg text-button"
- v-on:click="dateRemove('updated_before')">
- @icon('close')
- </button>
- </td>
- </tr>
- <tr>
- <td>{{ trans('entities.search_created_after') }}</td>
- <td>
- <button type="button" class="text-button" v-if="!search.dates.created_after"
- v-on:click="enableDate('created_after')">{{ trans('entities.search_set_date') }}</button>
-
- </td>
- </tr>
- <tr v-if="search.dates.created_after">
- <td>
- <input v-if="search.dates.created_after" class="tag-input"
- v-on:input="dateChange('created_after')" type="date" v-model="search.dates.created_after"
- pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
- </td>
- <td>
- <button v-if="search.dates.created_after" type="button" class="text-neg text-button"
- v-on:click="dateRemove('created_after')">
- @icon('close')
- </button>
- </td>
- </tr>
- <tr>
- <td>{{ trans('entities.search_created_before') }}</td>
- <td>
- <button type="button" class="text-button" v-if="!search.dates.created_before"
- v-on:click="enableDate('created_before')">{{ trans('entities.search_set_date') }}</button>
-
- </td>
- </tr>
- <tr v-if="search.dates.created_before">
- <td>
- <input v-if="search.dates.created_before" class="tag-input"
- v-on:input="dateChange('created_before')" type="date" v-model="search.dates.created_before"
- pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
- </td>
- <td>
- <button v-if="search.dates.created_before" type="button" class="text-neg text-button"
- v-on:click="dateRemove('created_before')">
- @icon('close')
- </button>
- </td>
- </tr>
- </table>
-
-
- <button type="submit" class="button primary">{{ trans('entities.search_update') }}</button>
- </form>
+ <div class="my-s">
+
</div>
- </div>
-@stop
-
-@section('body')
+ <div class="grid right-focus reverse-collapse large-gap">
+ <div>
+ <div>
+ <h5>{{ trans('entities.search_filters') }}</h5>
+
+ <form v-on:submit="updateSearch" v-cloak class="v-cloak anim fadeIn">
+ <h6 class="text-muted">{{ trans('entities.search_content_type') }}</h6>
+ <div class="form-group">
+ <label class="inline checkbox text-page"><input type="checkbox" v-on:change="typeChange" v-model="search.type.page" value="page">{{ trans('entities.page') }}</label>
+ <label class="inline checkbox text-chapter"><input type="checkbox" v-on:change="typeChange" v-model="search.type.chapter" value="chapter">{{ trans('entities.chapter') }}</label>
+ <br>
+ <label class="inline checkbox text-book"><input type="checkbox" v-on:change="typeChange" v-model="search.type.book" value="book">{{ trans('entities.book') }}</label>
+ <label class="inline checkbox text-bookshelf"><input type="checkbox" v-on:change="typeChange" v-model="search.type.bookshelf" value="bookshelf">{{ trans('entities.shelf') }}</label>
+ </div>
+
+ <h6 class="text-muted">{{ trans('entities.search_exact_matches') }}</h6>
+ <table cellpadding="0" cellspacing="0" border="0" class="no-style">
+ <tr v-for="(term, i) in search.exactTerms">
+ <td style="padding: 0 12px 6px 0;">
+ <input class="exact-input outline" v-on:input="exactChange" type="text" v-model="search.exactTerms[i]"></td>
+ <td>
+ <button type="button" class="text-neg text-button" v-on:click="removeExact(i)">
+ @icon('close')
+ </button>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button type="button" class="text-button" v-on:click="addExact">
+ @icon('add-circle'){{ trans('common.add') }}
+ </button>
+ </td>
+ </tr>
+ </table>
+
+ <h6 class="text-muted">{{ trans('entities.search_tags') }}</h6>
+ <table cellpadding="0" cellspacing="0" border="0" class="no-style">
+ <tr v-for="(term, i) in search.tagTerms">
+ <td style="padding: 0 12px 6px 0;">
+ <input class="tag-input outline" v-on:input="tagChange" type="text" v-model="search.tagTerms[i]"></td>
+ <td>
+ <button type="button" class="text-neg text-button" v-on:click="removeTag(i)">
+ @icon('close')
+ </button>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button type="button" class="text-button" v-on:click="addTag">
+ @icon('add-circle'){{ trans('common.add') }}
+ </button>
+ </td>
+ </tr>
+ </table>
+
+ @if(signedInUser())
+ <h6 class="text-muted">{{ trans('entities.search_options') }}</h6>
+ <label class="checkbox">
+ <input type="checkbox" v-on:change="optionChange('viewed_by_me')"
+ v-model="search.option.viewed_by_me" value="page">
+ {{ trans('entities.search_viewed_by_me') }}
+ </label>
+ <label class="checkbox">
+ <input type="checkbox" v-on:change="optionChange('not_viewed_by_me')"
+ v-model="search.option.not_viewed_by_me" value="page">
+ {{ trans('entities.search_not_viewed_by_me') }}
+ </label>
+ <label class="checkbox">
+ <input type="checkbox" v-on:change="optionChange('is_restricted')"
+ v-model="search.option.is_restricted" value="page">
+ {{ trans('entities.search_permissions_set') }}
+ </label>
+ <label class="checkbox">
+ <input type="checkbox" v-on:change="optionChange('created_by:me')"
+ v-model="search.option['created_by:me']" value="page">
+ {{ trans('entities.search_created_by_me') }}
+ </label>
+ <label class="checkbox">
+ <input type="checkbox" v-on:change="optionChange('updated_by:me')"
+ v-model="search.option['updated_by:me']" value="page">
+ {{ trans('entities.search_updated_by_me') }}
+ </label>
+ @endif
+
+ <h6 class="text-muted">{{ trans('entities.search_date_options') }}</h6>
+ <table cellpadding="0" cellspacing="0" border="0" class="no-style form-table">
+ <tr>
+ <td width="200">{{ trans('entities.search_updated_after') }}</td>
+ <td width="80">
+ <button type="button" class="text-button" v-if="!search.dates.updated_after"
+ v-on:click="enableDate('updated_after')">{{ trans('entities.search_set_date') }}</button>
+
+ </td>
+ </tr>
+ <tr v-if="search.dates.updated_after">
+ <td>
+ <input v-if="search.dates.updated_after" class="tag-input"
+ v-on:input="dateChange('updated_after')" type="date" v-model="search.dates.updated_after"
+ pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
+ </td>
+ <td>
+ <button v-if="search.dates.updated_after" type="button" class="text-neg text-button"
+ v-on:click="dateRemove('updated_after')">
+ @icon('close')
+ </button>
+ </td>
+ </tr>
+ <tr>
+ <td>{{ trans('entities.search_updated_before') }}</td>
+ <td>
+ <button type="button" class="text-button" v-if="!search.dates.updated_before"
+ v-on:click="enableDate('updated_before')">{{ trans('entities.search_set_date') }}</button>
+
+ </td>
+ </tr>
+ <tr v-if="search.dates.updated_before">
+ <td>
+ <input v-if="search.dates.updated_before" class="tag-input"
+ v-on:input="dateChange('updated_before')" type="date" v-model="search.dates.updated_before"
+ pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
+ </td>
+ <td>
+ <button v-if="search.dates.updated_before" type="button" class="text-neg text-button"
+ v-on:click="dateRemove('updated_before')">
+ @icon('close')
+ </button>
+ </td>
+ </tr>
+ <tr>
+ <td>{{ trans('entities.search_created_after') }}</td>
+ <td>
+ <button type="button" class="text-button" v-if="!search.dates.created_after"
+ v-on:click="enableDate('created_after')">{{ trans('entities.search_set_date') }}</button>
+
+ </td>
+ </tr>
+ <tr v-if="search.dates.created_after">
+ <td>
+ <input v-if="search.dates.created_after" class="tag-input"
+ v-on:input="dateChange('created_after')" type="date" v-model="search.dates.created_after"
+ pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
+ </td>
+ <td>
+ <button v-if="search.dates.created_after" type="button" class="text-neg text-button"
+ v-on:click="dateRemove('created_after')">
+ @icon('close')
+ </button>
+ </td>
+ </tr>
+ <tr>
+ <td>{{ trans('entities.search_created_before') }}</td>
+ <td>
+ <button type="button" class="text-button" v-if="!search.dates.created_before"
+ v-on:click="enableDate('created_before')">{{ trans('entities.search_set_date') }}</button>
+
+ </td>
+ </tr>
+ <tr v-if="search.dates.created_before">
+ <td>
+ <input v-if="search.dates.created_before" class="tag-input"
+ v-on:input="dateChange('created_before')" type="date" v-model="search.dates.created_before"
+ pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
+ </td>
+ <td>
+ <button v-if="search.dates.created_before" type="button" class="text-neg text-button"
+ v-on:click="dateRemove('created_before')">
+ @icon('close')
+ </button>
+ </td>
+ </tr>
+ </table>
+
+
+ <button type="submit" class="button primary">{{ trans('entities.search_update') }}</button>
+ </form>
- <div class="container small" v-pre>
- <input type="hidden" name="searchTerm" value="{{$searchTerm}}">
+ </div>
+ </div>
+ <div>
+ <div v-pre class="card content-wrap">
+ <h1 class="list-heading">{{ trans('entities.search_results') }}</h1>
+ <h6 class="text-muted">{{ trans_choice('entities.search_total_results_found', $totalResults, ['count' => $totalResults]) }}</h6>
+ <div class="book-contents">
+ @include('partials.entity-list', ['entities' => $entities])
+ </div>
+ @if($hasNextPage)
+ <div class="text-right mt-m">
+ <a href="{{ $nextPageLink }}" class="button outline">{{ trans('entities.search_more') }}</a>
+ </div>
+ @endif
+ </div>
+ </div>
+ </div>
- <h1>{{ trans('entities.search_results') }}</h1>
- <h6 class="text-muted">{{ trans_choice('entities.search_total_results_found', $totalResults, ['count' => $totalResults]) }}</h6>
- @include('partials/entity-list', ['entities' => $entities])
- @if ($hasNextPage)
- <a href="{{ $nextPageLink }}" class="button">{{ trans('entities.search_more') }}</a>
- @endif
</div>
@stop
@extends('simple-layout')
-@section('toolbar')
- <div class="col-sm-12 faded">
- @include('shelves._breadcrumbs', ['shelf' => $shelf])
- </div>
-@stop
-
@section('body')
<div class="container small">
- <p> </p>
- <div class="card">
- <h3>@icon('delete') {{ trans('entities.shelves_delete') }}</h3>
- <div class="body">
- <p>{{ trans('entities.shelves_delete_explain', ['name' => $shelf->name]) }}</p>
- <p class="text-neg">{{ trans('entities.shelves_delete_confirmation') }}</p>
-
- <form action="{{ $shelf->getUrl() }}" method="POST">
+
+ <div class="my-l">
+ @include('partials.breadcrumbs', ['crumbs' => [
+ $shelf,
+ $shelf->getUrl('/delete') => trans('entities.shelves_delete')
+ ]])
+ </div>
+
+ <div class="card content-wrap auto-height">
+ <h1 class="list-heading">{{ trans('entities.shelves_delete') }}</h1>
+ <p>{{ trans('entities.shelves_delete_explain', ['name' => $shelf->name]) }}</p>
+
+ <div class="grid half">
+ <p class="text-neg">
+ <strong>{{ trans('entities.shelves_delete_confirmation') }}</strong>
+ </p>
+
+ <form action="{{ $shelf->getUrl() }}" method="POST" class="text-right">
{!! csrf_field() !!}
<input type="hidden" name="_method" value="DELETE">
<button type="submit" class="button">{{ trans('common.confirm') }}</button>
</form>
</div>
+
+
</div>
</div>
@extends('simple-layout')
-@section('toolbar')
- <div class="col-sm-12 faded">
- @include('shelves._breadcrumbs', ['shelf' => $shelf])
- </div>
-@stop
-
@section('body')
<div class="container small">
- <p> </p>
- <div class="card">
- <h3>@icon('edit') {{ trans('entities.shelves_edit') }}</h3>
- <div class="body">
- <form action="{{ $shelf->getUrl() }}" method="POST">
- <input type="hidden" name="_method" value="PUT">
- @include('shelves/form', ['model' => $shelf])
- </form>
- </div>
+
+ <div class="my-l">
+ @include('partials.breadcrumbs', ['crumbs' => [
+ $shelf,
+ $shelf->getUrl('/edit') => trans('entities.shelves_edit')
+ ]])
+ </div>
+
+ <div class="card content-wrap">
+ <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])
+ </form>
</div>
</div>
-@include('components.image-manager', ['imageType' => 'cover'])
+
+ @include('components.image-manager', ['imageType' => 'cover'])
@stop
\ No newline at end of file
-<div class="bookshelf-grid-item grid-card" data-entity-type="bookshelf" data-entity-id="{{$bookshelf->id}}">
- <div class="featured-image-container">
- <a href="{{$bookshelf->getUrl()}}" title="{{$bookshelf->name}}">
- <img src="{{$bookshelf->getBookCover()}}" alt="{{$bookshelf->name}}">
- </a>
+<a href="{{$shelf->getUrl()}}" class="bookshelf-grid-item grid-card"
+ data-entity-type="bookshelf" data-entity-id="{{$shelf->id}}">
+ <div class="featured-image-container bg-shelf">
+ <img src="{{$shelf->getBookCover()}}" alt="{{$shelf->name}}">
</div>
<div class="grid-card-content">
- <h2><a class="break-text" href="{{$bookshelf->getUrl()}}" title="{{$bookshelf->name}}">{{$bookshelf->getShortName(35)}}</a></h2>
- @if(isset($bookshelf->searchSnippet))
- <p >{!! $bookshelf->searchSnippet !!}</p>
+ <h2>{{$shelf->getShortName(35)}}</h2>
+ @if(isset($shelf->searchSnippet))
+ <p class="text-muted">{!! $shelf->searchSnippet !!}</p>
@else
- <p >{{ $bookshelf->getExcerpt(130) }}</p>
+ <p class="text-muted">{{ $shelf->getExcerpt(130) }}</p>
@endif
</div>
<div class="grid-card-footer text-muted text-small">
- <span>@include('partials.entity-meta', ['entity' => $bookshelf])</span>
+ @icon('star')<span title="{{$shelf->created_at->toDayDateTimeString()}}">{{ trans('entities.meta_created', ['timeLength' => $shelf->created_at->diffForHumans()]) }}</span>
+ <br>
+ @icon('edit')<span title="{{ $shelf->updated_at->toDayDateTimeString() }}">{{ trans('entities.meta_updated', ['timeLength' => $shelf->updated_at->diffForHumans()]) }}</span>
</div>
-</div>
\ No newline at end of file
+</a>
\ No newline at end of file
@extends('tri-layout')
@section('body')
- <div class="content-wrap card">
- @include('shelves.list', ['shelves' => $shelves, 'view' => $view])
- </div>
+ @include('shelves.list', ['shelves' => $shelves, 'view' => $view])
@stop
@section('right')
@section('left')
@if($recents)
- <div id="recents-shelves">
+ <div id="recents" class="mb-xl">
<h5>{{ trans('entities.recently_viewed') }}</h5>
@include('partials.entity-list', ['entities' => $recents, 'style' => 'compact'])
</div>
@endif
- <div id="popular-shelves">
+ <div id="popular" class="mb-xl">
<h5>{{ trans('entities.shelves_popular') }}</h5>
@if(count($popular) > 0)
@include('partials.entity-list', ['entities' => $popular, 'style' => 'compact'])
@endif
</div>
- <div id="new-shelves">
+ <div id="new" class="mb-xl">
<h5>{{ trans('entities.shelves_new') }}</h5>
@if(count($new) > 0)
@include('partials.entity-list', ['entities' => $new, 'style' => 'compact'])
-<div class="shelf entity-list-item" data-entity-type="bookshelf" data-entity-id="{{$bookshelf->id}}">
- <h4 class="text-shelf"><a class="text-bookshelf entity-list-item-link" href="{{$bookshelf->getUrl()}}">@icon('bookshelf')<span class="entity-list-item-name break-text">{{$bookshelf->name}}</span></a></h4>
- <div class="entity-item-snippet">
- @if(isset($bookshelf->searchSnippet))
- <p class="text-muted break-text">{!! $bookshelf->searchSnippet !!}</p>
- @else
- <p class="text-muted break-text">{{ $bookshelf->getExcerpt() }}</p>
- @endif
+<a href="{{ $shelf->getUrl() }}" class="shelf entity-list-item" data-entity-type="bookshelf" data-entity-id="{{$shelf->id}}">
+ <div class="entity-list-item-image bg-shelf" style="background-image: url('{{ $shelf->getBookCover() }}')">
</div>
-</div>
\ No newline at end of file
+ <div class="content">
+ <h4 class="entity-list-item-name break-text">{{ $shelf->name }}</h4>
+ <div class="entity-item-snippet">
+ <p class="text-muted break-text mb-s">{{ $shelf->getExcerpt() }}</p>
+ </div>
+ </div>
+</a>
\ No newline at end of file
-<div class="container{{ $view === 'list' ? ' small' : '' }}">
- {{--TODO - Align with books page, Have sorting operations--}}
+<div class="content-wrap card">
{{--TODO - Create unique list item--}}
- <h1>{{ trans('entities.shelves') }}</h1>
+
+ <div class="grid half v-center">
+ <h1 class="list-heading">{{ trans('entities.shelves') }}</h1>
+ <div class="text-right">
+ @include('partials.sort', ['options' => $sortOptions, 'order' => $order, 'sort' => $sort, 'type' => 'bookshelves'])
+ </div>
+ </div>
+
@if(count($shelves) > 0)
- @if($view === 'grid')
+ @if($view === 'list')
+ <div class="entity-list">
+ @foreach($shelves as $shelf)
+ @include('shelves.list-item', ['shelf' => $shelf])
+ @endforeach
+ </div>
+ @else
<div class="grid third">
@foreach($shelves as $key => $shelf)
- @include('shelves/grid-item', ['bookshelf' => $shelf])
+ @include('shelves.grid-item', ['shelf' => $shelf])
@endforeach
</div>
- @else
- @foreach($shelves as $shelf)
- @include('shelves/list-item', ['bookshelf' => $shelf])
- <hr>
- @endforeach
@endif
<div>
{!! $shelves->render() !!}
<a href="{{ baseUrl("/create-shelf") }}" class="button outline">@icon('edit'){{ trans('entities.create_now') }}</a>
@endif
@endif
-</div>
\ No newline at end of file
+
+</div>
--- /dev/null
+@extends('simple-layout')
+
+@section('body')
+
+ <div class="container small">
+
+ <div class="my-l">
+ @include('partials.breadcrumbs', ['crumbs' => [
+ $shelf,
+ $shelf->getUrl('/permissions') => trans('entities.shelves_permissions')
+ ]])
+ </div>
+
+ <div class="card content-wrap">
+ <h1 class="list-heading">{{ trans('entities.shelves_permissions') }}</h1>
+ @include('form.entity-permissions', ['model' => $shelf])
+ </div>
+
+ <div class="card content-wrap auto-height">
+ <h2 class="list-heading">{{ trans('entities.shelves_copy_permissions_to_books') }}</h2>
+ <p>{{ trans('entities.shelves_copy_permissions_explain') }}</p>
+ <form action="{{ $shelf->getUrl('/copy-permissions') }}" method="post" class="text-right">
+ {{ csrf_field() }}
+ <button class="button">{{ trans('entities.shelves_copy_permissions') }}</button>
+ </form>
+ </div>
+ </div>
+
+@stop
+++ /dev/null
-@extends('simple-layout')
-
-@section('toolbar')
- <div class="col-sm-12 faded">
- @include('shelves._breadcrumbs', ['shelf' => $shelf])
- </div>
-@stop
-
-@section('body')
-
- <div class="container small">
- <p> </p>
- <div class="card">
- <h3>@icon('lock') {{ trans('entities.shelves_permissions') }}</h3>
- <div class="body">
- @include('form.entity-permissions', ['model' => $shelf])
- </div>
- </div>
-
- <p> </p>
-
- <div class="card">
- <h3>@icon('copy') {{ trans('entities.shelves_copy_permissions_to_books') }}</h3>
- <div class="body">
- <p>{{ trans('entities.shelves_copy_permissions_explain') }}</p>
- <form action="{{ $shelf->getUrl('/copy-permissions') }}" method="post" class="text-right">
- {{ csrf_field() }}
- <button class="button">{{ trans('entities.shelves_copy_permissions') }}</button>
- </form>
- </div>
- </div>
- </div>
-
-@stop
-@extends('sidebar-layout')
+@extends('tri-layout')
-@section('toolbar')
- <div class="col-sm-6 col-xs-1 faded">
- @include('shelves._breadcrumbs', ['shelf' => $shelf])
- </div>
- <div class="col-sm-6 col-xs-11">
- <div class="action-buttons faded">
- @if(userCan('bookshelf-update', $shelf))
- <a href="{{ $shelf->getUrl('/edit') }}" class="text-button text-primary">@icon('edit'){{ trans('common.edit') }}</a>
- @endif
- @if(userCan('restrictions-manage', $shelf) || userCan('bookshelf-delete', $shelf))
- <div dropdown class="dropdown-container">
- <a dropdown-toggle class="text-primary text-button">@icon('more'){{ trans('common.more') }}</a>
- <ul>
- @if(userCan('restrictions-manage', $shelf))
- <li><a href="{{ $shelf->getUrl('/permissions') }}" class="text-primary">@icon('lock'){{ trans('entities.permissions') }}</a></li>
- @endif
- @if(userCan('bookshelf-delete', $shelf))
- <li><a href="{{ $shelf->getUrl('/delete') }}" class="text-neg">@icon('delete'){{ trans('common.delete') }}</a></li>
- @endif
- </ul>
+@section('body')
+
+ <div class="card content-wrap">
+ <h1 class="break-text">{{$shelf->name}}</h1>
+ <div class="book-content">
+ <p class="text-muted">{!! nl2br(e($shelf->description)) !!}</p>
+ @if(count($books) > 0)
+ <div class="entity-list">
+ @foreach($books as $book)
+ @include('books/list-item', ['book' => $book])
+ @endforeach
</div>
+ @else
+ <p>
+ <hr>
+ <span class="text-muted italic">{{ trans('entities.shelves_empty_contents') }}</span>
+ @if(userCan('bookshelf-create', $shelf))
+ <br/>
+ <a href="{{ $shelf->getUrl('/edit') }}" class="button outline bookshelf">{{ trans('entities.shelves_edit_and_assign') }}</a>
+ @endif
+ </p>
@endif
</div>
</div>
+
@stop
-@section('sidebar')
+@section('left')
@if($shelf->tags->count() > 0)
- <section>
+ <div id="tags" class="mb-xl">
@include('components.tag-list', ['entity' => $shelf])
- </section>
+ </div>
@endif
- <div class="card entity-details">
- <h3>@icon('info') {{ trans('common.details') }}</h3>
- <div class="body text-small text-muted blended-links">
+ <div id="details" class="mb-xl">
+ <h5>{{ trans('common.details') }}</h5>
+ <div class="text-small text-muted blended-links">
@include('partials.entity-meta', ['entity' => $shelf])
@if($shelf->restricted)
<div class="active-restriction">
</div>
@if(count($activity) > 0)
- <div class="activity card">
- <h3>@icon('time') {{ trans('entities.recent_activity') }}</h3>
- @include('partials/activity-list', ['activity' => $activity])
+ <div class="mb-xl">
+ <h5>{{ trans('entities.recent_activity') }}</h5>
+ @include('partials.activity-list', ['activity' => $activity])
</div>
@endif
@stop
-@section('body')
+@section('right')
+ <div class="actions mb-xl">
+ <h5>{{ trans('common.actions') }}</h5>
+ <div class="icon-list text-primary">
- <div class="container small nopad">
- <h1 class="break-text">{{$shelf->name}}</h1>
- <div class="book-content">
- <p class="text-muted">{!! nl2br(e($shelf->description)) !!}</p>
- @if(count($books) > 0)
- <div class="page-list">
- <hr>
- @foreach($books as $book)
- @include('books/list-item', ['book' => $book])
- <hr>
- @endforeach
- </div>
- @else
- <p>
- <hr>
- <span class="text-muted italic">{{ trans('entities.shelves_empty_contents') }}</span>
- @if(userCan('bookshelf-create', $shelf))
- <br>
- <a href="{{ $shelf->getUrl('/edit') }}" class="button outline bookshelf">{{ trans('entities.shelves_edit_and_assign') }}</a>
- @endif
- </p>
+ @if(userCan('bookshelf-update', $shelf))
+ <a href="{{ $shelf->getUrl('/edit') }}" class="icon-list-item">
+ <span class="icon">@icon('edit')</span>
+ <span>{{ trans('common.edit') }}</span>
+ </a>
@endif
- </div>
+ @if(userCan('restrictions-manage', $shelf))
+ <a href="{{ $shelf->getUrl('/permissions') }}" class="icon-list-item">
+ <span class="icon">@icon('lock')</span>
+ <span>{{ trans('entities.permissions') }}</span>
+ </a>
+ @endif
+ @if(userCan('bookshelf-delete', $shelf))
+ <a href="{{ $shelf->getUrl('/delete') }}" class="icon-list-item">
+ <span class="icon">@icon('delete')</span>
+ <span>{{ trans('common.delete') }}</span>
+ </a>
+ @endif
+
+ </div>
+ </div>
@stop
+
+
+
+
@extends('simple-layout')
-{{--TODO--}}
-
-@section('toolbar')
- @include('settings/navbar', ['selected' => 'users'])
-@stop
-
@section('body')
<div class="container small">
- <p> </p>
- <div class="card">
- <h3>@icon('users-add') {{ trans('settings.users_add_new') }}</h3>
- <div class="body">
- <form action="{{ baseUrl("/settings/users/create") }}" method="post">
- {!! csrf_field() !!}
- @include('users/forms/' . $authMethod)
- <div class="form-group text-right">
- <a href="{{ baseUrl($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button outline">{{ trans('common.cancel') }}</a>
- <button class="button pos" type="submit">{{ trans('common.save') }}</button>
- </div>
- </form>
- </div>
+
+ <div class="py-m">
+ @include('settings.navbar', ['selected' => 'users'])
+ </div>
+
+ <div class="card content-wrap">
+ <h1 class="list-heading">{{ trans('settings.users_add_new') }}</h1>
+
+ <form action="{{ baseUrl("/settings/users/create") }}" method="post">
+ {!! csrf_field() !!}
+
+ <div class="setting-list">
+ @include('users.forms.' . $authMethod)
+ </div>
+
+ <div class="form-group text-right">
+ <a href="{{ baseUrl($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button outline">{{ trans('common.cancel') }}</a>
+ <button class="button primary" type="submit">{{ trans('common.save') }}</button>
+ </div>
+
+ </form>
+
</div>
</div>
@extends('simple-layout')
-@section('toolbar')
- @include('settings/navbar', ['selected' => 'users'])
-@stop
-
@section('body')
-
<div class="container small">
- <p> </p>
- <div class="card">
- <h3>@icon('delete') {{ trans('settings.users_delete') }}</h3>
- <div class="body">
- <p>{{ trans('settings.users_delete_warning', ['userName' => $user->name]) }}</p>
- <p class="text-neg">{{ trans('settings.users_delete_confirm') }}</p>
- <form action="{{ baseUrl("/settings/users/{$user->id}") }}" method="POST">
- {!! csrf_field() !!}
- <input type="hidden" name="_method" value="DELETE">
- <a href="{{ baseUrl("/settings/users/{$user->id}") }}" class="button outline">{{ trans('common.cancel') }}</a>
- <button type="submit" class="button neg">{{ trans('common.confirm') }}</button>
- </form>
+ <div class="py-m">
+ @include('settings.navbar', ['selected' => 'users'])
+ </div>
+
+ <div class="card content-wrap auto-height">
+ <h1 class="list-heading">{{ trans('settings.users_delete') }}</h1>
+
+ <p>{{ trans('settings.users_delete_warning', ['userName' => $user->name]) }}</p>
+
+ <div class="grid half">
+ <p class="text-neg"><strong>{{ trans('settings.users_delete_confirm') }}</strong></p>
+ <div>
+ <form action="{{ baseUrl("/settings/users/{$user->id}") }}" method="POST" class="text-right">
+ {!! csrf_field() !!}
+
+ <input type="hidden" name="_method" value="DELETE">
+ <a href="{{ baseUrl("/settings/users/{$user->id}") }}" class="button outline">{{ trans('common.cancel') }}</a>
+ <button type="submit" class="button primary">{{ trans('common.confirm') }}</button>
+ </form>
+ </div>
</div>
+
</div>
</div>
-
@stop
@extends('simple-layout')
-{{--TODO--}}
+@section('body')
+ <div class="container small">
-@section('toolbar')
- @include('settings/navbar', ['selected' => 'users'])
-@stop
+ <div class="py-m">
+ @include('settings.navbar', ['selected' => 'users'])
+ </div>
-@section('body')
+ <div class="card content-wrap">
+ <h1 class="list-heading">{{ $user->id === $currentUser->id ? trans('settings.users_edit_profile') : trans('settings.users_edit') }}</h1>
+ <form action="{{ baseUrl("/settings/users/{$user->id}") }}" method="post">
+ {!! csrf_field() !!}
+ <input type="hidden" name="_method" value="PUT">
- <div class="container small">
- <p> </p>
- <div class="card">
- <h3>@icon('edit') {{ $user->id === $currentUser->id ? trans('settings.users_edit_profile') : trans('settings.users_edit') }}</h3>
- <div class="body">
- <form action="{{ baseUrl("/settings/users/{$user->id}") }}" method="post">
- <div class="row">
- <div class="col-sm-6">
- {!! csrf_field() !!}
- <input type="hidden" name="_method" value="put">
- @include('users.forms.' . $authMethod, ['model' => $user])
+ <div class="setting-list">
+ @include('users.forms.' . $authMethod, ['model' => $user])
+ <div class="grid half large-gap">
+ <div>
+ <label for="user-avatar" class="setting-list-label">{{ trans('settings.users_avatar') }}</label>
+ <p class="small">{{ trans('settings.users_avatar_desc') }}</p>
</div>
- <div class="col-sm-6">
- <div class="form-group" id="logo-control">
- <label for="user-avatar">{{ trans('settings.users_avatar') }}</label>
- <p class="small">{{ trans('settings.users_avatar_desc') }}</p>
-
- @include('components.image-picker', [
- 'resizeHeight' => '512',
- 'resizeWidth' => '512',
- 'showRemove' => false,
- 'defaultImage' => baseUrl('/user_avatar.png'),
- 'currentImage' => $user->getAvatar(80),
- 'currentId' => $user->image_id,
- 'name' => 'image_id',
- 'imageClass' => 'avatar large'
- ])
- </div>
- <div class="form-group">
- <label for="user-language">{{ trans('settings.users_preferred_language') }}</label>
- <select name="setting[language]" id="user-language">
- @foreach(trans('settings.language_select') as $lang => $label)
- <option @if(setting()->getUser($user, 'language') === $lang) selected @endif value="{{ $lang }}">{{ $label }}</option>
- @endforeach
- </select>
- </div>
+ <div>
+ @include('components.image-picker', [
+ 'resizeHeight' => '512',
+ 'resizeWidth' => '512',
+ 'showRemove' => false,
+ 'defaultImage' => baseUrl('/user_avatar.png'),
+ 'currentImage' => $user->getAvatar(80),
+ 'currentId' => $user->image_id,
+ 'name' => 'image_id',
+ 'imageClass' => 'avatar large'
+ ])
</div>
</div>
- <div class="form-group text-right">
- <a href="{{ baseUrl($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button outline">{{ trans('common.cancel') }}</a>
- @if($authMethod !== 'system')
- <a href="{{ baseUrl("/settings/users/{$user->id}/delete") }}" class="neg button">{{ trans('settings.users_delete') }}</a>
- @endif
- <button class="button pos" type="submit">{{ trans('common.save') }}</button>
+
+ <div class="grid half large-gap">
+ <div>
+ <label for="user-language" class="setting-list-label">{{ trans('settings.users_preferred_language') }}</label>
+ </div>
+ <div>
+ <select name="setting[language]" id="user-language">
+ @foreach(trans('settings.language_select') as $lang => $label)
+ <option @if(setting()->getUser($user, 'language') === $lang) selected @endif value="{{ $lang }}">{{ $label }}</option>
+ @endforeach
+ </select>
+ </div>
</div>
- </form>
- </div>
+
+ </div>
+
+ <div class="text-right">
+ <a href="{{ baseUrl($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button outline">{{ trans('common.cancel') }}</a>
+ @if($authMethod !== 'system')
+ <a href="{{ baseUrl("/settings/users/{$user->id}/delete") }}" class="button outline">{{ trans('settings.users_delete') }}</a>
+ @endif
+ <button class="button primary" type="submit">{{ trans('common.save') }}</button>
+ </div>
+ </form>
</div>
@if($currentUser->id === $user->id && count($activeSocialDrivers) > 0)
- <div class="card">
- <h3>@icon('login') {{ trans('settings.users_social_accounts') }}</h3>
- <div class="body">
- <p class="text-muted">{{ trans('settings.users_social_accounts_info') }}</p>
- <div class="container">
- <div class="row">
- @foreach($activeSocialDrivers as $driver => $enabled)
- <div class="col-sm-4 col-xs-6 text-center">
- <div>@icon('auth/'. $driver, ['style' => 'width: 56px;height: 56px;'])</div>
- <div>
- @if($user->hasSocialAccount($driver))
- <a href="{{ baseUrl("/login/service/{$driver}/detach") }}" class="button neg">{{ trans('settings.users_social_disconnect') }}</a>
- @else
- <a href="{{ baseUrl("/login/service/{$driver}") }}" class="button pos">{{ trans('settings.users_social_connect') }}</a>
- @endif
- </div>
- <div> </div>
+ <div class="card content-wrap auto-height">
+ <h2 class="list-heading">{{ trans('settings.users_social_accounts') }}</h2>
+ <p class="text-muted">{{ trans('settings.users_social_accounts_info') }}</p>
+ <div class="container">
+ <div class="grid third">
+ @foreach($activeSocialDrivers as $driver => $enabled)
+ <div class="text-center mb-m">
+ <div>@icon('auth/'. $driver, ['style' => 'width: 56px;height: 56px;'])</div>
+ <div>
+ @if($user->hasSocialAccount($driver))
+ <a href="{{ baseUrl("/login/service/{$driver}/detach") }}" class="button small outline">{{ trans('settings.users_social_disconnect') }}</a>
+ @else
+ <a href="{{ baseUrl("/login/service/{$driver}") }}" class="button small outline">{{ trans('settings.users_social_connect') }}</a>
+ @endif
</div>
- @endforeach
- </div>
+ </div>
+ @endforeach
</div>
</div>
</div>
@endif
-
-
</div>
- <p class="margin-top large"><br></p>
@include('components.image-manager', ['imageType' => 'user'])
@stop
\ No newline at end of file
+{{--TODO--}}
+
<div class="form-group">
<label for="name">{{ trans('auth.name') }}</label>
@include('form.text', ['name' => 'name'])
-<div class="form-group">
- <label for="name">{{ trans('auth.name') }}</label>
- @include('form.text', ['name' => 'name'])
-</div>
-<div class="form-group">
- <label for="email">{{ trans('auth.email') }}</label>
- @include('form.text', ['name' => 'email'])
+<div class="pt-m">
+ <label class="setting-list-label">{{ trans('settings.users_details') }}</label>
+ <p class="small">{{ trans('settings.users_details_desc') }}</p>
+ <div class="grid half mt-m large-gap">
+ <div>
+ <label for="name">{{ trans('auth.name') }}</label>
+ @include('form.text', ['name' => 'name'])
+ </div>
+ <div>
+ <label for="email">{{ trans('auth.email') }}</label>
+ @include('form.text', ['name' => 'email'])
+ </div>
+ </div>
</div>
+
@if(userCan('users-manage'))
- <div class="form-group">
- <label for="role">{{ trans('settings.users_role') }}</label>
- @include('form/role-checkboxes', ['name' => 'roles', 'roles' => $roles])
+ <div>
+ <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])
+ </div>
</div>
@endif
-@if(isset($model))
- <div class="form-group">
- <span class="text-muted">
+
+<div>
+ <label class="setting-list-label">{{ trans('settings.users_password') }}</label>
+ <p class="small">{{ trans('settings.users_password_desc') }}</p>
+ @if(isset($model))
+ <p class="small">
{{ trans('settings.users_password_warning') }}
- </span>
+ </p>
+ @endif
+ <div class="grid half mt-m large-gap">
+ <div>
+ <label for="password">{{ trans('auth.password') }}</label>
+ @include('form.password', ['name' => 'password'])
+ </div>
+ <div>
+ <label for="password-confirm">{{ trans('auth.password_confirm') }}</label>
+ @include('form.password', ['name' => 'password-confirm'])
+ </div>
</div>
-@endif
-
-<div class="form-group">
- <label for="password">{{ trans('auth.password') }}</label>
- @include('form.password', ['name' => 'password'])
-</div>
-
-<div class="form-group">
- <label for="password-confirm">{{ trans('auth.password_confirm') }}</label>
- @include('form.password', ['name' => 'password-confirm'])
</div>
\ No newline at end of file
+{{--TODO--}}
+
@if($user->system_name == 'public')
<p>{{ trans('settings.users_system_public') }}</p>
@endif
<div class="container small">
<div class="py-m">
- @include('settings/navbar', ['selected' => 'users'])
+ @include('settings.navbar', ['selected' => 'users'])
</div>
<div class="card content-wrap">
->where('path', '.*$');
Route::group(['prefix' => 'pages'], function() {
- Route::get('/recently-created', 'PageController@showRecentlyCreated');
Route::get('/recently-updated', 'PageController@showRecentlyUpdated');
});
Route::get('/{slug}', 'BookshelfController@show');
Route::put('/{slug}', 'BookshelfController@update');
Route::delete('/{slug}', 'BookshelfController@destroy');
- Route::get('/{slug}/permissions', 'BookshelfController@showRestrict');
- Route::put('/{slug}/permissions', 'BookshelfController@restrict');
+ Route::get('/{slug}/permissions', 'BookshelfController@showPermissions');
+ Route::put('/{slug}/permissions', 'BookshelfController@permissions');
Route::post('/{slug}/copy-permissions', 'BookshelfController@copyPermissions');
});
Route::get('/users/{id}/delete', 'UserController@delete');
Route::patch('/users/{id}/switch-book-view', 'UserController@switchBookView');
Route::patch('/users/{id}/switch-shelf-view', 'UserController@switchShelfView');
- Route::patch('/users/{id}/change-books-sort', 'UserController@changeBooksSort');
+ Route::patch('/users/{id}/change-sort/{type}', 'UserController@changeSort');
Route::post('/users/create', 'UserController@store');
Route::get('/users/{id}', 'UserController@edit');
Route::put('/users/{id}', 'UserController@update');