97 lines
5.6 KiB
PHP
97 lines
5.6 KiB
PHP
@extends('themes.base.layout')
|
|
@section('title', trans('admin.edit_group_title', ['group_name' => $group->name]))
|
|
|
|
@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('groups.index') }}">@lang('navigation.breadcrumb.groups')</a></li>
|
|
<li class="breadcrumb-item active">@lang('navigation.breadcrumb.edit_group')</li>
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col">
|
|
<h1>@yield('title')</h1>
|
|
<p>@lang('admin.edit_group_intro')</p>
|
|
<hr/>
|
|
|
|
<form action="{{ route('groups.update', [$group->id]) }}" method="post">
|
|
{{ csrf_field() }}
|
|
{{ method_field('PUT') }}
|
|
<div>
|
|
{{-- Nav tabs --}}
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
@include(Theme::viewName('partials.tab'), ['active_tab' => 'details', 'tab_name' => 'details', 'tab_icon' => 'info-circle', 'tab_text' => trans('admin.group_details_tab')])
|
|
@include(Theme::viewName('partials.tab'), ['active_tab' => 'details', 'tab_name' => 'users', 'tab_icon' => 'users', 'tab_text' => trans('admin.group_users_tab')])
|
|
@include(Theme::viewName('partials.tab'), ['active_tab' => 'details', 'tab_name' => 'permissions', 'tab_icon' => 'lock', 'tab_text' => trans('admin.group_permissions_tab')])
|
|
</ul>
|
|
|
|
{{-- Tab panes --}}
|
|
<div class="tab-content">
|
|
{{-- Details --}}
|
|
<div role="tabpanel" class="tab-pane active" id="details-tab">
|
|
<div class="row">
|
|
<div class="col-md-6 offset-md-3">
|
|
<div class="form-group{{ $errors->has('name') ? ' has-danger' : '' }}">
|
|
<label class="form-control-label" for="group-name">@lang('forms.name_label')</label>
|
|
<input type="text" class="form-control" id="group-name" name="name" value="{{ old('name') }}">
|
|
|
|
@if ($errors->has('name'))
|
|
<div class="form-control-feedback">
|
|
<strong>{{ $errors->first('name') }}</strong>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Users --}}
|
|
<div role="tabpanel" class="tab-pane" id="users-tab">
|
|
@if ($group->users()->count() > 0)
|
|
<p>@lang('admin.group_users_message', ['group_name' => $group->name])</p>
|
|
<ul class="nav nav-pills">
|
|
@foreach ($group->users as $user)
|
|
<li class="nav-item"><a class="nav-link" href="{{ route('users.edit', [$user->id]) }}">{{ $user->name }}</a></li>
|
|
@endforeach
|
|
</ul>
|
|
@else
|
|
<p class="text-danger">@lang('admin.group_no_users_message')</p>
|
|
<div><a class="btn btn-secondary" href="{{ route('users.index') }}">@lang('admin.users_title')</a></div>
|
|
@endif
|
|
</div>
|
|
|
|
{{-- Permissions --}}
|
|
<div role="tabpanel" class="tab-pane" id="permissions-tab">
|
|
@php
|
|
$callback = [$group, 'hasAdminPermission'];
|
|
$callback_object = $group;
|
|
$key_id = 'group_' . $group->id;
|
|
$object_id = $group->id
|
|
@endphp
|
|
|
|
@include(Theme::viewName('partials.permission_checkbox'), [
|
|
'permission' => Theme::getPermission($all_permissions, 'admin', 'access')
|
|
])
|
|
|
|
@include(Theme::viewName('partials.permission_checkbox'), [
|
|
'permission' => Theme::getPermission($all_permissions, 'admin', 'configure')
|
|
])
|
|
|
|
@include(Theme::viewName('partials.permission_checkbox'), [
|
|
'permission' => Theme::getPermission($all_permissions, 'admin', 'manage-albums')
|
|
])
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="text-right mt-3">
|
|
<a href="{{ route('groups.index') }}" class="btn btn-link">@lang('forms.cancel_action')</a>
|
|
<button class="btn btn-success" type="submit"><i class="fa fa-fw fa-check"></i> @lang('forms.save_action')</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection |