Skip to content

Commit ee7e44b

Browse files
authored
Merge pull request #738 from Thoth2023/main-develop-outubro
Main develop outubro
2 parents d766906 + 66a1c7f commit ee7e44b

File tree

11 files changed

+168
-112
lines changed

11 files changed

+168
-112
lines changed

app/Livewire/Conducting/StudySelection/PaperModal.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,16 @@ public function showPaper($paper, $criterias)
5858
->values()
5959
->toArray();
6060

61-
$this->paper = $paper;
61+
// Se showPaper for chamado com o ID do paper, carrega o objeto e converte para array
62+
// Se o paper for passado como um array de dados, usa o id_paper
63+
$paperId = is_array($paper) ? $paper['id_paper'] : $paper;
64+
65+
if (!$paperId) {
66+
Log::error('showPaper called without a valid paper ID or data.');
67+
return;
68+
}
69+
$this->paper = Papers::where('id_paper', $paperId)->first()->toArray();
70+
6271

6372
$databaseName = DB::table('data_base')
6473
->where('id_database', $this->paper['data_base'])
@@ -289,7 +298,6 @@ private function updatePaperStatus($type)
289298
}
290299
}
291300

292-
293301
private function checkCriteriaRules($criterias, $criterias_ev)
294302
{
295303
foreach ($criterias->pluck('rule')->unique() as $rule) {

lang/en/auth/login.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@
1717
'failed' => 'The credentials do not match our records.',
1818
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
1919
'inactive' => 'User is inactive in the system',
20-
2120
'error' => 'The provided credentials do not match our records.'
2221
];

lang/en/pages/user-manager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
'deactivated' => 'User deactivated successfully',
2222
'updated' => 'User updated successfully',
2323
'created' => 'User created successfully',
24+
2425
];

lang/en/project/conducting.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@
102102
'conflicts-members' => 'Member Evaluation',
103103
'conflicts-criteria' => 'Selected I/E Criteria',
104104
'conflicts-status' => 'Evaluation Status',
105-
106105
],
107106
'option' => [
108107
'select' => 'Select an option',

lang/pt_BR/auth/login.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@
1717
'failed' => 'As credenciais não correspondem aos nossos registros.',
1818
'throttle' => 'Muitas tentativas de login. Tente novamente em :seconds segundos.',
1919
'inactive'=>'Usuário está Inativo no sistema',
20-
21-
'error' => 'As credenciais fornecidas não correspondem aos nossos registros.'
20+
'error' => 'As credenciais fornecidas não correspondem aos nossos registros.'
2221
];

lang/pt_BR/pages/user-manager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
'deactivated' => 'Usuário desativado com sucesso',
2222
'updated' => 'Usuário atualizado com sucesso',
2323
'created' => 'Usuário criado com sucesso',
24+
2425
];

lang/pt_BR/project/conducting.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@
151151
'table-duplicate' => 'Duplicado',
152152
'table-duplicate-yes' => 'SIM',
153153
'table-duplicate-no' => 'NÃO',
154-
155154
],
156155
'messages' => [
157156
'criteria_updated' => 'Critério atualizado com sucesso. Novo status: :status',

resources/views/livewire/conducting/study-selection/paper-modal.blade.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
</div>
150150
</div>
151151
</div>
152-
153152
<div wire:ignore.self class="modal fade" id="successModal" tabindex="-1" role="dialog"
154153
aria-labelledby="successModalLabel" aria-hidden="true">
155154
<div class="modal-dialog modal-dialog-centered" role="document">

resources/views/pages/database-manager.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class="row justify-content-center rounded-3 py-4 bg-gradient-faded-dark opacity-
1616
<p class="text-lead text-white">
1717
{{ __("project/planning.databases.database-manager.description") }}
1818
</p>
19+
1920
</div>
2021
</div>
2122
</div>
Lines changed: 154 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,158 @@
11
@extends('layouts.app')
22

33
@section('content')
4-
<!-- Displays the user management table with options to add, edit, activate or deactivate users -->
5-
@include('layouts.navbars.auth.topnav', ['title' => __("nav/side.user_manager")])
6-
<div class="row mt-4 mx-4">
7-
<div class="col-12">
8-
<div class="card mb-4">
9-
<div class="card-header pb-0">
10-
<div class="d-flex justify-content-between align-items-center">
11-
<h6>{{ __("pages/user-manager.Users") }}</h6>
12-
<a href="{{ route('user.create') }}" class="btn btn-primary btn-sm"
13-
style="background-color:black;">{{ __("pages/user-manager.Add_User") }}</a>
14-
</div>
15-
</div>
16-
<div class="card-body px-0 pt-0 pb-2">
17-
<div class="table-responsive p-0">
18-
<table class="table align-items-center mb-0">
19-
<thead>
20-
<tr>
21-
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">
22-
{{ __("pages/user-manager.Name") }}
23-
</th>
24-
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7 ps-2">
25-
{{ __("pages/user-manager.Role") }}
26-
</th>
27-
<th
28-
class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">
29-
{{ __("pages/user-manager.Institution") }}
30-
</th>
31-
<th
32-
class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">
33-
{{ __("pages/user-manager.Country") }}
34-
</th>
35-
<th
36-
class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">
37-
{{ __("pages/user-manager.Status") }}
38-
</th>
39-
<th
40-
class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">
41-
{{ __("pages/user-manager.Actions") }}
42-
</th>
43-
</tr>
44-
</thead>
45-
<tbody>
46-
@foreach ($users as $user)
47-
<tr>
48-
<td>
49-
<div class="d-flex px-3 py-1">
50-
<div class="d-flex flex-column justify-content-center">
51-
<h6 class="mb-0 text-sm">{{ $user->firstname }} {{ $user->lastname }}</h6>
52-
</div>
53-
</div>
54-
</td>
55-
<td>
56-
@if($user->role == 'SUPER_USER')
57-
<p class="text-sm font-weight-bold mb-0">{{ __('pages/user-manager.super_user') }}
58-
</p>
59-
@elseif($user->role == 'USER')
60-
<p class="text-sm font-weight-bold mb-0">{{ __('pages/user-manager.user') }}</p>
61-
@else
62-
<p class="text-sm font-weight-bold mb-0">{{ $user->role }}</p>
63-
@endif
64-
</td>
65-
<td class="align-middle text-center text-sm">
66-
<p class="text-sm font-weight-bold mb-0">{{ $user->institution }}</p>
67-
</td>
68-
<td class="align-middle text-center text-sm">
69-
<p class="text-sm font-weight-bold mb-0">{{ $user->country }}</p>
70-
</td>
71-
<td class="align-middle text-center text-sm">
72-
<p class="text-sm font-weight-bold mb-0">
73-
{{ $user->active ? __("pages/user-manager.Yes") : __("pages/user-manager.No") }}
74-
</td>
75-
</p>
76-
</td>
77-
<td class="align-middle text-end">
78-
<div class="d-flex px-3 py-1 justify-content-center align-items-center">
79-
<a href="{{ route('user.edit', ['user' => $user]) }}"
80-
class="btn btn-sm btn-primary me-2">
81-
{{ __("pages/user-manager.Edit") }}
82-
</a>
83-
@if ($user->active)
84-
<a href="{{ route('user.deactivate', ['user' => $user]) }}"
85-
class="btn btn-sm btn-danger">
86-
{{ __('pages/user-manager.Deactivate') }}
87-
</a>
88-
@else
89-
<a href="{{ route('user.deactivate', ['user' => $user]) }}"
90-
class="btn btn-sm btn-success">
91-
{{ __('pages/user-manager.Activate') }}
92-
</a>
93-
@endif
944

95-
</div>
96-
</td>
97-
</tr>
98-
@endforeach
99-
</tbody>
100-
</table>
101-
</div>
102-
</div>
103-
</div>
104-
</div>
105-
</div>
106-
@endsection
5+
@include('layouts.navbars.auth.topnav', ['title' => __("nav/side.user_manager")])
6+
<style>
7+
/* ---------- Estilos de melhoria visual ---------- */
8+
.table-wrapper {
9+
border-radius: 12px;
10+
overflow: hidden;
11+
background-color: #fff;
12+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
13+
}
14+
15+
.table thead th {
16+
background-color: #f8f9fa;
17+
color: #6c757d;
18+
font-size: 0.75rem;
19+
text-transform: uppercase;
20+
letter-spacing: 0.05em;
21+
border-bottom: 2px solid #dee2e6;
22+
}
23+
24+
.table tbody tr:hover {
25+
background-color: #f1f5f9;
26+
transition: background-color 0.2s ease;
27+
}
28+
29+
.table td, .table th {
30+
vertical-align: middle;
31+
padding: 0.9rem 1rem;
32+
}
33+
34+
.table td h6 {
35+
font-weight: 600;
36+
margin-bottom: 0;
37+
}
38+
39+
.btn-action {
40+
min-width: 90px;
41+
border-radius: 6px;
42+
}
43+
44+
.table-responsive {
45+
max-height: 70vh;
46+
overflow-y: auto;
47+
}
48+
49+
/* Scroll suave dentro da div */
50+
.table-responsive::-webkit-scrollbar {
51+
width: 6px;
52+
}
53+
54+
.table-responsive::-webkit-scrollbar-thumb {
55+
background: #ccc;
56+
border-radius: 3px;
57+
}
58+
59+
.card-header h6 {
60+
font-weight: 700;
61+
margin-bottom: 0;
62+
}
63+
</style>
64+
<div class="container mt-4 mb-3">
65+
<div class="page-header d-flex flex-column pt-4 pb-2 border-radius-lg">
66+
<div
67+
class="row justify-content-center rounded-3 py-4 bg-gradient-faded-dark opacity-8 "
68+
style="width: 100%"
69+
>
70+
<div class="col-lg-6 text-center mx-auto">
71+
<h1 class="text-white" style="font-size: 2rem">
72+
{{ __("pages/user-manager.Users") }}
73+
</h1>
74+
75+
<p class="text-lead text-white">
76+
{{ __("pages/user-manager.description") }}
77+
</p>
78+
</div>
79+
</div>
80+
</div>
81+
</div>
82+
<div class="row mt-1 mx-4">
83+
<div class="col-12">
84+
<div class="card mb-4 table-wrapper">
85+
<div class="card-header d-flex justify-content-between align-items-center pb-3">
86+
<h5>{{ __("pages/user-manager.Users") }}</h5>
87+
<a href="{{ route('user.create') }}" class="btn btn-dark btn-sm">
88+
<i class="fas fa-user-plus me-1"></i> {{ __("pages/user-manager.Add_User") }}
89+
</a>
90+
</div>
91+
92+
<div class="card-body px-0 pt-0 pb-3">
93+
<div class="table-responsive">
94+
<table class="table table-hover align-items-center mb-0">
95+
<thead >
96+
<tr>
97+
<th>{{ __("pages/user-manager.Name") }}</th>
98+
<th>{{ __("pages/user-manager.Role") }}</th>
99+
<th>{{ __("pages/user-manager.Institution") }}</th>
100+
<th>{{ __("pages/user-manager.Country") }}</th>
101+
<th>{{ __("pages/user-manager.Status") }}</th>
102+
<th class="text-center">{{ __("pages/user-manager.Actions") }}</th>
103+
</tr>
104+
</thead>
105+
<tbody>
106+
@foreach ($users as $user)
107+
<tr>
108+
<td>
109+
<h6>{{ $user->firstname }} {{ $user->lastname }}</h6>
110+
</td>
111+
<td>
112+
@if($user->role == 'SUPER_USER')
113+
<span class="badge bg-dark">{{ __('pages/user-manager.super_user') }}</span>
114+
@elseif($user->role == 'USER')
115+
<span class="badge bg-secondary">{{ __('pages/user-manager.user') }}</span>
116+
@else
117+
<span class="badge bg-info text-dark">{{ $user->role }}</span>
118+
@endif
119+
</td>
120+
<td class="text-center">
121+
<span>{{ $user->institution }}</span>
122+
</td>
123+
<td class="text-center">
124+
<span>{{ $user->country }}</span>
125+
</td>
126+
<td class="text-center">
127+
@if($user->active)
128+
<span class="badge bg-success">{{ __("pages/user-manager.Yes") }}</span>
129+
@else
130+
<span class="badge bg-danger">{{ __("pages/user-manager.No") }}</span>
131+
@endif
132+
</td>
133+
<td class="text-center">
134+
<div class="d-flex justify-content-center gap-2">
135+
<a href="{{ route('user.edit', ['user' => $user]) }}" class="btn btn-sm btn-outline-primary btn-action">
136+
<i class="fas fa-edit me-1"></i> {{ __("pages/user-manager.Edit") }}
137+
</a>
138+
@if ($user->active)
139+
<a href="{{ route('user.deactivate', ['user' => $user]) }}" class="btn btn-sm btn-outline-danger btn-action">
140+
<i class="fas fa-user-slash me-1"></i> {{ __('pages/user-manager.Deactivate') }}
141+
</a>
142+
@else
143+
<a href="{{ route('user.deactivate', ['user' => $user]) }}" class="btn btn-sm btn-outline-success btn-action">
144+
<i class="fas fa-user-check me-1"></i> {{ __('pages/user-manager.Activate') }}
145+
</a>
146+
@endif
147+
</div>
148+
</td>
149+
</tr>
150+
@endforeach
151+
</tbody>
152+
</table>
153+
</div>
154+
</div>
155+
</div>
156+
</div>
157+
</div>
158+
@endsection

0 commit comments

Comments
 (0)