Skip to content

Commit 1a19c09

Browse files
authored
Merge pull request #440 from dbarzin/dev
Dev
2 parents 8957a08 + d2f5735 commit 1a19c09

File tree

8 files changed

+168
-132
lines changed

8 files changed

+168
-132
lines changed

app/Http/Controllers/AuditLogsController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public function index(Request $request)
3131
'audit_logs.created_at'
3232
)
3333
->join('users', 'users.id', '=', 'user_id')
34-
->orderBy('audit_logs.id', 'desc')->paginate(100);
34+
->orderBy('audit_logs.id', 'desc')
35+
->paginate(100);
3536

3637
return view('logs.index', ['logs' => $logs]);
3738
}

app/Providers/AppServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
namespace App\Providers;
43

54
use DB;

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2025.06.13",
2+
"version": "2025.06.23",
33
"license": "GPL-3.0",
44
"author": "Didier Barzin",
55
"repository": "https://www.github.com/dbarzin/deming",
Lines changed: 123 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,133 @@
11
@extends('layout')
22
@section('content')
33
<div class="table-responsive" data-role="panel" data-title-caption="{{ trans('cruds.log.title') }}" data-collapsible="false" data-title-icon="<span class='mif-log-file'></span>">
4-
<table class="table table-border cell-border">
5-
<tbody>
6-
<tr>
7-
<th style="width: 150px;">
8-
{{ trans('cruds.log.subject_id') }}
9-
</th>
10-
<td>
11-
@if ($auditLogs->first()->subject_type=='App\\Models\\Measure')
12-
<a href="/alice/show/{{ $auditLogs->first()->subject_id }} ">
13-
{{ $auditLogs->first()->subject_id }}
14-
</a>
15-
@elseif ($auditLogs->first()->subject_type=='App\\Models\\Control')
16-
<a href="/bob/show/{{ $auditLogs->first()->subject_id }} ">
17-
{{ $auditLogs->first()->subject_id }}
18-
</a>
19-
@elseif ($auditLogs->first()->subject_type=='App\\Models\\Action')
20-
<a href="/action/show/{{ $auditLogs->first()->subject_id }} ">
21-
{{ $auditLogs->first()->subject_id }}
22-
</a>
23-
@elseif ($auditLogs->first()->subject_type=='App\\Models\\User')
24-
<a href="/user/show/{{ $auditLogs->first()->subject_id }} ">
25-
{{ $auditLogs->first()->subject_id }}
26-
</a>
27-
@else
4+
<table class="table table-border cell-border">
5+
<tbody>
6+
<tr>
7+
<th style="width: 150px;">
8+
{{ trans('cruds.log.subject_id') }}
9+
</th>
10+
<td>
11+
@if ($auditLogs->first()->subject_type=='App\\Models\\Measure')
12+
<a href="/alice/show/{{ $auditLogs->first()->subject_id }} ">
13+
{{ $auditLogs->first()->subject_id }}
14+
</a>
15+
@elseif ($auditLogs->first()->subject_type=='App\\Models\\Control')
16+
<a href="/bob/show/{{ $auditLogs->first()->subject_id }} ">
17+
{{ $auditLogs->first()->subject_id }}
18+
</a>
19+
@elseif ($auditLogs->first()->subject_type=='App\\Models\\Action')
20+
<a href="/action/show/{{ $auditLogs->first()->subject_id }} ">
2821
{{ $auditLogs->first()->subject_id }}
22+
</a>
23+
@elseif ($auditLogs->first()->subject_type=='App\\Models\\User')
24+
<a href="/user/show/{{ $auditLogs->first()->subject_id }} ">
25+
{{ $auditLogs->first()->subject_id }}
26+
</a>
27+
@else
28+
{{ $auditLogs->first()->subject_id }}
29+
@endif
30+
</td>
31+
</tr>
32+
<tr>
33+
<th>
34+
id
35+
</th>
36+
@foreach($auditLogs as $auditLog)
37+
<td>
38+
<a href="/logs/show/{{ $auditLog->id }}">
39+
{{ $auditLog->id }}
40+
</a>
41+
</td>
42+
@endforeach
43+
</tr>
44+
<tr>
45+
<th>
46+
{{ trans('cruds.log.action') }}
47+
</th>
48+
@foreach($auditLogs as $auditLog)
49+
<td>
50+
{{ $auditLog->description }}
51+
</td>
52+
@endforeach
53+
</tr>
54+
<tr>
55+
<th>
56+
{{ trans('cruds.log.user') }}
57+
</th>
58+
@foreach($auditLogs as $auditLog)
59+
<td>
60+
<a href="/user/{{ $auditLog->user_id }}">
61+
{{ $auditLog->name }}
62+
</a>
63+
</td>
64+
@endforeach
65+
</tr>
66+
@foreach($auditLog->properties as $key => $value)
67+
<tr>
68+
<th>[{{ $key }}]</th>
69+
@php $previous = null; @endphp
70+
@foreach($auditLogs as $auditLog2)
71+
@php
72+
if (property_exists($auditLog2->properties,$key))
73+
$value = $auditLog2->properties->{$key};
74+
else
75+
$value = null;
76+
@endphp
77+
<td {!! (($loop->first)||($value==$previous)) ? "" : "class='info'" !!}>
78+
@if ((gettype($value)=="string")&&(strlen($value)>100))
79+
{{ substr($value,0,100) }}
80+
@elseif ((gettype($value)=="array"))
81+
@foreach($value as $v)
82+
{{ $v->name }}
83+
@endforeach
84+
@else
85+
{{ $value }}
2986
@endif
3087
</td>
31-
</tr>
32-
<tr>
33-
<th>
34-
id
35-
</th>
36-
@foreach($auditLogs as $auditLog)
37-
<td>
38-
<a href="/logs/show/{{ $auditLog->id }}">
39-
{{ $auditLog->id }}
40-
</a>
41-
</td>
88+
@php $previous = $value; @endphp
4289
@endforeach
43-
</tr>
44-
<tr>
45-
<th>
46-
{{ trans('cruds.log.action') }}
47-
</th>
48-
@foreach($auditLogs as $auditLog)
49-
<td>
50-
{{ $auditLog->description }}
51-
</td>
52-
@endforeach
53-
</tr>
54-
<tr>
55-
<th>
56-
{{ trans('cruds.log.user') }}
57-
</th>
58-
@foreach($auditLogs as $auditLog)
59-
<td>
60-
<a href="/user/{{ $auditLog->user_id }}">
61-
{{ $auditLog->name }}
62-
</a>
63-
</td>
64-
@endforeach
65-
</tr>
66-
@foreach($auditLog->properties as $key => $value)
67-
<tr>
68-
<th>[{{ $key }}]</th>
69-
@php $previous = null; @endphp
70-
@foreach($auditLogs as $auditLog2)
71-
@php
72-
if (property_exists($auditLog2->properties,$key))
73-
$value = $auditLog2->properties->{$key};
74-
else
75-
$value = null;
76-
@endphp
77-
<td {!! (($loop->first)||($value==$previous)) ? "" : "class='info'" !!}>
78-
@if ((gettype($value)=="string")&&(strlen($value)>100))
79-
{{ substr($value,0,100) }}
80-
@elseif ((gettype($value)=="array"))
81-
@foreach($value as $v)
82-
{{ $v->name }}
83-
@endforeach
84-
@else
85-
{{ $value }}
86-
@endif
87-
</td>
88-
@php $previous = $value; @endphp
89-
@endforeach
90-
</tr>
90+
</tr>
91+
@endforeach
92+
<tr>
93+
<th>
94+
{{ trans('cruds.log.host') }}
95+
</th>
96+
@foreach($auditLogs as $auditLog)
97+
<td>
98+
{{ $auditLog->host }}
99+
</td>
91100
@endforeach
92-
<tr>
93-
<th>
94-
{{ trans('cruds.log.host') }}
95-
</th>
96-
@foreach($auditLogs as $auditLog)
97-
<td>
98-
{{ $auditLog->host }}
99-
</td>
100-
@endforeach
101-
</tr>
102-
<tr>
103-
<th>
104-
{{ trans('cruds.log.timestamp') }}
105-
</th>
106-
@foreach($auditLogs as $auditLog)
107-
<td>
108-
{{ $auditLog->created_at }}
109-
</td>
110-
@endforeach
111-
</tr>
112-
</tbody>
113-
</table>
114-
</div>
115-
<div>
116-
<br>
117-
<a class="button btn-default" href="/logs">
118-
{{ trans('common.cancel') }}
119-
</a>
120-
</div>
101+
</tr>
102+
<tr>
103+
<th>
104+
{{ trans('cruds.log.timestamp') }}
105+
</th>
106+
@foreach($auditLogs as $auditLog)
107+
<td>
108+
{{ $auditLog->created_at }}
109+
</td>
110+
@endforeach
111+
</tr>
112+
</tbody>
113+
</table>
114+
</div>
115+
<div>
116+
<br>
117+
<a class="button btn-default" href="/logs">
118+
{{ trans('common.cancel') }}
119+
</a>
120+
</div>
121121
@endsection
122-
@section('style')
123-
<style>
124-
.table-responsive {
125-
overflow-x: auto !important;
126-
border: 1px solid red; /* Pour voir les limites du conteneur */
127-
}
128-
.table {
129-
min-width: max-content;
130-
}
131-
</style>
122+
@section('styles')
123+
<style>
124+
.table {
125+
min-width: max-content;
126+
}
127+
128+
.table-responsive .panel-content {
129+
overflow-x: auto !important;
130+
}
131+
132+
</style>
132133
@endsection

resources/views/logs/index.blade.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@extends("layout")
22

33
@section("content")
4-
<div data-role="panel" data-title-caption='{{ trans("cruds.log.index")}}' data-collapsible="false" data-title-icon="<span class='mif-log-file'></span>">
4+
<div data-role="panel" data-title-caption='{{ trans("cruds.log.index")}}' data-collapsible="false" data-title-icon="<span class='mif-log-file'></span>">
55

66
<div class="grid">
77

@@ -98,8 +98,9 @@ class="table striped row-hover cell-border"
9898
@endforeach
9999
</tbody>
100100
</table>
101-
<p>
102-
{{ $logs->links() }}
103-
</p>
101+
<!------------------------------------------>
102+
{!! $logs->links('pagination.metro') !!}
103+
<!------------------------------------------>
104104
</div>
105+
</div>
105106
@endsection
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@if ($paginator->hasPages())
2+
<ul class="pagination" data-role="pagination" data-cls-active="active" data-cls-link="page-link">
3+
{{-- Page précédente --}}
4+
@if ($paginator->onFirstPage())
5+
<li class="disabled"><span>«</span></li>
6+
@else
7+
<li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
8+
@endif
9+
10+
{{-- Liens --}}
11+
@foreach ($elements as $element)
12+
@if (is_string($element))
13+
<li class="disabled"><span>{{ $element }}</span></li>
14+
@endif
15+
16+
@if (is_array($element))
17+
@foreach ($element as $page => $url)
18+
@if ($page == $paginator->currentPage())
19+
<li class="active"><span>{{ $page }}</span></li>
20+
@else
21+
<li><a href="{{ $url }}">{{ $page }}</a></li>
22+
@endif
23+
@endforeach
24+
@endif
25+
@endforeach
26+
27+
{{-- Page suivante --}}
28+
@if ($paginator->hasMorePages())
29+
<li><a href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
30+
@else
31+
<li class="disabled"><span>»</span></li>
32+
@endif
33+
</ul>
34+
@endif

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025.06.13
1+
2025.06.23

0 commit comments

Comments
 (0)