mirror of
https://koodu.h-i.works/projects/thebadspace
synced 2025-06-25 16:04:37 -05:00
simplified pagination, cleaned up front controller
Adding total actions count to location data has made it possible to simplify backend data queries, so the custom pagination was optimized and location repositories have been cleaned up. the front end controller has been cleaned up as well, which has resulted in the appropriate template being polished up as well.
This commit is contained in:
@ -17,12 +17,8 @@
|
||||
<article>
|
||||
<h2>Found {{count($results)}} results for {{$terms}}</h2>
|
||||
@foreach($results as $item)
|
||||
@php
|
||||
$action = $item->block_count + $item->silence_count;
|
||||
$rating = ($action / $sources)*100;
|
||||
@endphp
|
||||
<a class="list-link" role="listitem" href="/location/{{$item->uuid}}">
|
||||
<span class="item-rating">{{$rating}}%</span>
|
||||
<span class="item-rating">{{($item->actions_count / $sources)*100}}%</span>
|
||||
<label class="item-name">{{$item->name}}</label>
|
||||
<div class="item-silence">
|
||||
<img class="item-icon" src="/assets/images/global/status-silence.svg" title="silenced" />
|
||||
@ -40,24 +36,20 @@
|
||||
<section class="index-meta">
|
||||
<article>
|
||||
<h2>Recent Updates</h2>
|
||||
@for($i = 0; $i < 10; $i++)
|
||||
@php
|
||||
$action = $recent[$i]->block_count + $recent[$i]->silence_count;
|
||||
$rating = ($action / $sources)*100;
|
||||
@endphp
|
||||
<a class="list-link" role="listitem" href="/location/{{$recent[$i]->uuid}}">
|
||||
<span class="item-rating">{{$rating}}%</span>
|
||||
<label class="item-name">{{$recent[$i]->name}}</label>
|
||||
@foreach($recent as $item)
|
||||
<a class="list-link" role="listitem" href="/location/{{$item->uuid}}">
|
||||
<span class="item-rating">{{($item->actions_count / $sources)*100}}%</span>
|
||||
<label class="item-name">{{$item->name}}</label>
|
||||
<div class="item-silence">
|
||||
<img class="item-icon" src="/assets/images/global/status-silence.svg" title="silenced" />
|
||||
{{$recent[$i]->silence_count}}
|
||||
{{$item->silence_count}}
|
||||
</div>
|
||||
<div class="item-block">
|
||||
<img class="item-icon" src="/assets/images/global/status-suspend.svg" title="suspended" />
|
||||
{{$recent[$i]->block_count}}
|
||||
{{$item->block_count}}
|
||||
</div>
|
||||
</a>
|
||||
@endfor
|
||||
@endforeach
|
||||
<h2>Info</h2>
|
||||
<div class="index-meta">
|
||||
<label>Locations Tracked</label>
|
||||
@ -67,7 +59,6 @@
|
||||
<label>Latest Update</label>
|
||||
<label>{{$latest_date}}</label>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
</section>
|
||||
@endsection
|
Reference in New Issue
Block a user