105 lines
5.5 KiB
PHP
105 lines
5.5 KiB
PHP
@extends(Theme::viewName('layout'))
|
|
@section('title', 'Gallery Admin')
|
|
|
|
@section('breadcrumb')
|
|
<li class="breadcrumb-item"><a href="{{ route('home') }}"><i class="fa fa-fw fa-home"></i></a></li>
|
|
<li class="breadcrumb-item"><a href="{{ route('admin') }}">@lang('navigation.breadcrumb.admin')</a></li>
|
|
<li class="breadcrumb-item"><a href="{{ route('admin.settings') }}">@lang('navigation.breadcrumb.settings')</a></li>
|
|
<li class="breadcrumb-item active">@lang('navigation.breadcrumb.default_album_permissions')</li>
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col">
|
|
<h1>@lang('admin.default_album_permissions.title')</h1>
|
|
<div class="alert alert-info mb-4">
|
|
<p><i class="fa fa-fw fa-info"></i>@lang('admin.default_album_permissions.intro')</p>
|
|
<p class="mb-0">@lang('admin.default_album_permissions.intro_2')</p>
|
|
</div>
|
|
|
|
<form action="{{ route('albums.set_default_group_permissions') }}" method="post">
|
|
{{ csrf_field() }}
|
|
|
|
@if (count($existing_groups) > 0)
|
|
<div id="groups-accordion" role="tablist" aria-multiselectable="true">
|
|
@foreach ($existing_groups as $group)
|
|
@include(Theme::viewName('partials.album_permissions'), [
|
|
'key_id' => 'group_' . $group->id,
|
|
'object_id' => $group->id,
|
|
'title' => $group->name,
|
|
'callback' => [$album, 'doesGroupHavePermission'],
|
|
'callback_object' => $group,
|
|
'parent_id' => 'groups-accordion'
|
|
])
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
|
|
<div class="row mt-3">
|
|
<div class="col-md-4">
|
|
<select class="form-control" name="group_id" style="margin-bottom: 2px;"@if (count($add_new_groups) == 0) disabled="disabled"@endif>
|
|
@foreach ($add_new_groups as $group)
|
|
<option value="{{ $group->id }}">{{ $group->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<button type="submit" name="action" value="add_group" class="btn btn-primary">Assign Permissions</button>
|
|
</div>
|
|
<div class="col-md-6 text-right">
|
|
<button type="submit" name="action" value="update_group_permissions" class="btn btn-success">
|
|
<i class="fa fa-fw fa-check"></i> @lang('forms.save_action')
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<hr/>
|
|
|
|
<h5 style="font-weight: bold;">@lang('admin.security_users_heading')</h5>
|
|
|
|
<form action="{{ route('albums.set_default_user_permissions') }}" method="post">
|
|
{{ csrf_field() }}
|
|
|
|
<div id="users-accordion" role="tablist" aria-multiselectable="true">
|
|
{{-- Anonymous users --}}
|
|
@include(Theme::viewName('partials.album_permissions'), [
|
|
'key_id' => 'anonymous',
|
|
'object_id' => 'anonymous',
|
|
'title' => trans('admin.anonymous_users'),
|
|
'callback' => [$album, 'doesUserHavePermission'],
|
|
'callback_object' => null,
|
|
'parent_id' => 'users-accordion'
|
|
])
|
|
|
|
@foreach ($existing_users as $user)
|
|
@include(Theme::viewName('partials.album_permissions'), [
|
|
'key_id' => 'user_' . $user->id,
|
|
'object_id' => $user->id,
|
|
'title' => $user->name,
|
|
'callback' => [$album, 'doesUserHavePermission'],
|
|
'callback_object' => $user,
|
|
'parent_id' => 'users-accordion'
|
|
])
|
|
@endforeach
|
|
</div>
|
|
|
|
<div class="row mt-3">
|
|
<div class="col-md-4">
|
|
<input class="form-control" name="user_name" id="user-search-textbox" size="20" style="margin-bottom: 2px;" />
|
|
<input type="hidden" name="user_id" id="user-id-field" />
|
|
</div>
|
|
<div class="col-md-2">
|
|
<button type="submit" name="action" value="add_user" class="btn btn-primary">Assign Permissions</button>
|
|
</div>
|
|
<div class="col-md-6 text-right">
|
|
<button type="submit" name="action" value="update_user_permissions" class="btn btn-success">
|
|
<i class="fa fa-fw fa-check"></i> @lang('forms.save_action')
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection |