Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
pad-upe
Commits
39c527a2
Commit
39c527a2
authored
Mar 20, 2022
by
alissonalbuquerque
Browse files
atualização de dashboard
parent
738ddd4b
Changes
7
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/DashboardController.php
0 → 100644
View file @
39c527a2
<?php
namespace
App\Http\Controllers
;
use
App\Queries\UnidadeQuery
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
class
DashboardController
extends
Controller
{
public
function
index
()
{
$user
=
Auth
::
user
();
if
(
$user
->
isTypeAdmin
())
{
return
view
(
'dashboard'
,
[
'unidades'
=>
UnidadeQuery
::
all
(),
'unidade_index'
=>
1
]);
}
}
}
app/Http/Controllers/UnidadeController.php
View file @
39c527a2
...
...
@@ -36,7 +36,9 @@ class UnidadeController extends Controller
*/
public
function
store
(
Request
$request
)
{
// dd($request);
return
redirect
(
'/dashboard'
);
}
/**
...
...
resources/views/components/buttons/btn-create.blade.php
View file @
39c527a2
<a
class=
"{{$css}}"
href=
"{{$route}}"
>
<a
class=
"{{$css}}"
href=
"{{$route}}"
id=
"{{$id}}"
>
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"36"
height=
"36"
fill=
"currentColor"
class=
"bi bi-plus-circle"
viewBox=
"0 0 16 16"
>
<path
d=
"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"
/>
<path
d=
"M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"
/>
</svg>
{{$text}}
</a>
</a>
\ No newline at end of file
resources/views/layouts/user-dashboard/dashboard_admin.blade.php
View file @
39c527a2
...
...
@@ -89,11 +89,36 @@
<h1
class=
"h2"
>
Gestão de Unidades
</h1>
</div>
@include('components.buttons.btn-create', ['route' => '', 'css' => 'btn btn-primary', 'text' => 'Cadastrar Nova Unidade'])
@include('components.buttons.btn-create', ['route' => route('unidade_create'), 'id' => 'btn-create-unidade', 'css' => 'btn btn-primary', 'text' => 'Cadastrar Nova Unidade'])
@section('form-unidade-create')
@show
<div
class=
"mt-4"
>
@include('components.tables.table', ['id' => 'table_unidades', 'css' => 'table'])
<table
class=
"table table-hover"
>
<thead>
<tr>
<th
scope=
"col"
>
#
</th>
<th
scope=
"col"
>
Nome
</th>
<th
scope=
"col"
>
Opções
</th>
</tr>
</thead>
<tbody>
@foreach($unidades as $unidade)
<tr>
<td
scope=
"row"
>
{{ $unidade_index++ }}
</td>
<td>
{{ $unidade->name }}
</td>
<td>
@include('components.buttons.btn-edit', ['route' => route('unidade_edit', ['id' => $unidade->id])])
@include('components.buttons.btn-delete', ['route' => route('unidade_delete', ['id' => $unidade->id])])
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div
class=
"tab-pane"
id=
"diretoria"
role=
"tabpanel"
aria-labelledby=
"diretoria-tab"
>
<div
...
...
resources/views/layouts/user-jquery/jquery_admin.blade.php
View file @
39c527a2
...
...
@@ -68,4 +68,7 @@ $("#btn-update-perfil").on('click', () => {
$
(
"
#update-perfil-tab
"
).
click
()
})
// $('#')
</script>
resources/views/unidade/create.blade.php
View file @
39c527a2
@
extends
(
'
layouts.main
'
)
@
extends
(
'
dashboard
'
)
@
section
(
'title'
,
'Unidade - Create'
)
@
section
(
'body'
)
@
section
(
'form-unidade-create'
)
<
div
class
=
"mt-4"
>
<
form
action
=
"{{ route('unidade_store') }}"
method
=
"post"
>
@
method
(
'POST'
)
@
csrf
...
...
@@ -14,4 +13,5 @@
<
button
type
=
"submit"
class
=
"btn btn-primary"
>
Create
</
button
>
</
form
>
</
div
>
@
endsection
routes/web.php
View file @
39c527a2
...
...
@@ -2,6 +2,7 @@
use
App\Http\Controllers\CampusController
;
use
App\Http\Controllers\CursoController
;
use
App\Http\Controllers\DashboardController
;
use
App\Http\Controllers\UnidadeController
;
use
Illuminate\Support\Facades\Route
;
...
...
@@ -22,9 +23,7 @@ Route::get('/', function () {
return
redirect
()
->
route
(
'login'
);
});
Route
::
get
(
'/dashboard'
,
function
()
{
return
view
(
'dashboard'
);
})
->
middleware
([
'auth'
])
->
name
(
'dashboard'
);
Route
::
get
(
'/dashboard'
,
[
DashboardController
::
class
,
'index'
])
->
middleware
([
'auth'
])
->
name
(
'dashboard'
);
Route
::
get
(
'/campus/index'
,
[
CampusController
::
class
,
'index'
])
->
name
(
'campus_index'
);
Route
::
get
(
'/campus/create'
,
[
CampusController
::
class
,
'create'
])
->
name
(
'campus_create'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment