[WIP] Setup of skeleton
This commit is contained in:
74
resources/views/users/teams/create.blade.php
Normal file
74
resources/views/users/teams/create.blade.php
Normal file
@@ -0,0 +1,74 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('team.title'),
|
||||
'subtitle' => __('team.create.title'),
|
||||
'breadcrumb' => [
|
||||
__('team.title') => 'boilerplate.Users.Teams.index',
|
||||
__('team.create.title')
|
||||
]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.icheck')
|
||||
|
||||
@section('content')
|
||||
{{ Form::open(['route' => 'boilerplate.Users.Teams.store', 'autocomplete' => 'off']) }}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<a href="{{ route("boilerplate.Users.Teams.index") }}" class="btn btn-default">
|
||||
{{ __('team.list.title') }}
|
||||
</a>
|
||||
<span class="btn-group pull-right">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('team.savebutton') }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-5">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{ __('team.parameters') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="form-group {{ $errors->has('display_name') ? 'has-error' : '' }}">
|
||||
{{ Form::label('display_name', __('team.label')) }}
|
||||
{{ Form::text('display_name', old('display_name'), ['class' => 'form-control', 'autofocus']) }}
|
||||
{!! $errors->first('display_name','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
<div class="form-group {{ $errors->has('description') ? 'has-error' : '' }}">
|
||||
{{ Form::label('description', __('team.description')) }}
|
||||
{{ Form::text('description', old('description'), ['class' => 'form-control']) }}
|
||||
{!! $errors->first('description','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(count($permissions) > 0)
|
||||
<div class="col-md-7">
|
||||
<div class="box box-info">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{ __('team.permissions') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table class="table table-hover table-striped table-condensed">
|
||||
<tbody>
|
||||
@foreach($permissions as $permission)
|
||||
<tr>
|
||||
<td style="width:25px;">
|
||||
{{ Form::checkbox('permission['.$permission->id.']', 1, old('permission['.$permission->id.']'), ['id' => 'permission_'.$permission->id, 'class' => 'icheck']) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::label('permission_'.$permission->id, __($permission->display_name), ['class' => 'mbn']) }}<br />
|
||||
<small>{{ __($permission->description) }}</small>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
@endsection
|
||||
52
resources/views/users/teams/edit.blade.php
Normal file
52
resources/views/users/teams/edit.blade.php
Normal file
@@ -0,0 +1,52 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('team.title'),
|
||||
'subtitle' => __('team.edit.title'),
|
||||
'breadcrumb' => [
|
||||
__('team.title') => 'boilerplate.Users.Teams.index',
|
||||
__('team.edit.title')
|
||||
]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.icheck')
|
||||
|
||||
@section('content')
|
||||
{{ Form::open(['route' => ['boilerplate.Users.Teams.update', $team->id], 'method' => 'put', 'autocomplete' => 'off']) }}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<a href="{{ route("boilerplate.Users.Teams.index") }}" class="btn btn-default">
|
||||
{{ __('team.list.title') }}
|
||||
</a>
|
||||
<span class="btn-group pull-right">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('team.savebutton') }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-5">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{ __('team.parameters') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="form-group {{ $errors->has('display_name') ? 'has-error' : '' }}">
|
||||
{{ Form::label('display_name', __('team.label')) }}
|
||||
{{ Form::text('display_name', old('display_name', $team->display_name), ['class' => 'form-control', 'autofocus']) }}
|
||||
{!! $errors->first('display_name','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
<div class="form-group {{ $errors->has('description') ? 'has-error' : '' }}">
|
||||
{{ Form::label('description', __('team.description')) }}
|
||||
{{ Form::text('description', old('description', $team->description), ['class' => 'form-control']) }}
|
||||
{!! $errors->first('description','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
<div class="form-group {{ $errors->has('name') ? 'has-error' : '' }}">
|
||||
{{ Form::label('name', __('team.name')) }}
|
||||
{{ Form::text('name', old('name', $team->name), ['class' => 'form-control']) }}
|
||||
{!! $errors->first('name','<p class="text-danger"><strong>:message</strong></p>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
@endsection
|
||||
108
resources/views/users/teams/list.blade.php
Normal file
108
resources/views/users/teams/list.blade.php
Normal file
@@ -0,0 +1,108 @@
|
||||
@extends('boilerplate::layout.index', [
|
||||
'title' => __('team.title'),
|
||||
'subtitle' => __('team.list.title'),
|
||||
'breadcrumb' => [__('team.list.title')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<table class="table table-striped table-hover va-middle" id="teams-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('team.label') }}</th>
|
||||
<th>{{ __('team.description') }}</th>
|
||||
<th>{{ __('team.list.nbusers') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@prepend('js')
|
||||
@include('components.js.ie11')
|
||||
@include('components.js', ['js' => '/js/laroute.js'])
|
||||
@include('components.js', ['js' => '/js/main.min.js'])
|
||||
@include('components.js', ['js' => '/js/datatables.min.js'])
|
||||
@endprepend
|
||||
|
||||
@push('css')
|
||||
@include('components.css', ['css' => '/css/main.min.css'])
|
||||
@include('components.css', ['css' => '/css/datatables.min.css'])
|
||||
@endpush
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$(function() {
|
||||
|
||||
var columns = [
|
||||
{
|
||||
data: 'name',
|
||||
render: function (data, type, row) {
|
||||
if (data) {
|
||||
tpl = '<strong>' + data + '</strong>';
|
||||
} else {
|
||||
tpl = "Non défini";
|
||||
}
|
||||
return tpl;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'description',
|
||||
render: function (data, type, row) {
|
||||
var tpl = '';
|
||||
if (row.societe) {
|
||||
if (row.societe.manager_prenom) {
|
||||
tpl += row.societe.manager_prenom;
|
||||
}
|
||||
if (row.societe.manager_nom) {
|
||||
tpl += ' - ' + row.societe.manager_nom;
|
||||
}
|
||||
}
|
||||
return tpl;
|
||||
}
|
||||
},
|
||||
{ data: "users_count"},
|
||||
{
|
||||
data: "id",
|
||||
name: "action",
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
render: function (data, type, row) {
|
||||
tpl = "<span class='pull-right'>";
|
||||
tpl += " <a data-id=" + data + " class='btn btn-xs btn-primary edit' href='" + laroute.route('boilerplate.Users.Teams.edit', {id: data}) + "'><i class='fa fa-pencil fa-fw'></i></a>";
|
||||
tpl += " <a data-id=" + data + " class='btn btn-xs btn-danger destroy' href='#'><i class='fa fa-trash fa-fw'></i></a>";
|
||||
tpl += "</span>";
|
||||
return tpl;
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
var options = {
|
||||
columns: columns,
|
||||
}
|
||||
|
||||
var model = "teams";
|
||||
var route = '{!! route('boilerplate.Users.Teams.getTable') !!}';
|
||||
var table = getDataTables(options,route,model);
|
||||
|
||||
tpl = '<a href="' + laroute.route('boilerplate.Users.Teams.create') + '" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> Création d\'un groupe</a>';
|
||||
$('div.col-md-4.add').html(tpl);
|
||||
|
||||
$('#teams-table').on('click', '.destroy', function (e) {
|
||||
e.preventDefault();
|
||||
var id = $(this).data('id');
|
||||
confirm_delete(id, laroute.route('boilerplate.Users.Teams.destroy'), function() {
|
||||
table.draw();
|
||||
// growl("{{ __('boilerplate::teams.list.deletesuccess') }}", 'success');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user