blue-twilight/resources/views/themes/base/admin/edit_group.blade.php

78 lines
4.1 KiB
PHP
Raw Normal View History

@extends('themes.base.layout')
@section('title', trans('admin.edit_group_title', ['group_name' => $group->name]))
@section('breadcrumb')
<div class="breadcrumb">
<div class="container">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-fw fa-home"></i></a></li>
<li><a href="{{ route('admin') }}">@lang('navigation.breadcrumb.admin')</a></li>
<li><a href="{{ route('groups.index') }}">@lang('navigation.breadcrumb.groups')</a></li>
<li class="active">@lang('navigation.breadcrumb.edit_group')</li>
</ol>
</div>
</div>
@endsection
@section('content')
<div class="container">
<div class="row">
<div class="col-xs-12">
<h1>@yield('title')</h1>
<p>@lang('admin.edit_group_intro')</p>
<hr/>
{!! Form::model($group, ['route' => ['groups.update', $group->id], 'method' => 'PUT']) !!}
<div>
{{-- Nav tabs --}}
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#details-tab" aria-controls="details-tab" role="tab" data-toggle="tab"><i class="fa fa-fw fa-info-circle"></i> @lang('admin.group_details_tab')</a></li>
<li role="presentation"><a href="#users-tab" aria-controls="groups-tab" role="tab" data-toggle="tab"><i class="fa fa-fw fa-users"></i> @lang('admin.group_users_tab')</a></li>
</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 col-md-offset-3">
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
{!! Form::label('name', trans('forms.name_label'), ['class' => 'control-label']) !!}
{!! Form::text('name', old('name'), ['class' => 'form-control']) !!}
@if ($errors->has('name'))
<span class="help-block">
<strong>{{ $errors->first('name') }}</strong>
</span>
@endif
</div>
<div class="form-actions">
<a href="{{ route('groups.index') }}" class="btn btn-default">@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>
</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><a href="{{ route('users.edit', [$user->id]) }}">{{ $user->name }}</a></li>
@endforeach
</ul>
@else
<p class="text-danger">@lang('admin.group_no_users_message')</p>
<p><a class="btn btn-default" href="{{ route('users.index') }}">@lang('admin.users_title')</a></p>
@endif
</div>
</div>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
@endsection