Files
nhgooi.nl/resources/views/newslist.blade.php
T
eric.busandClaude Opus 5.5 9d9917eea5 Tag/region/theme pages: all articles as compact rows, like /nieuws
The first 6 articles used card markup from the old Pressroom theme
(column_1_2, auto_height, read_more) whose styles no longer exist, so they
showed a tiny image and an unstyled 'Lees verder'. All articles now use
the same compact rows (partial/newslist_small) and row height as /nieuws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 12:25:25 +01:00

91 lines
2.6 KiB
PHP

@extends('layouts/sidebar')
@section('title')
@if($title)
{{$title}} - Nieuws
@endif
@endsection
@section('page_class')
news_post post_container
@endsection
@section('page_container_class')
{{-- 'news': same list rows as on /nieuws --}}
grey_background news
@endsection
@section('site_container_class')
grey_background
@endsection
@section('breadcrumb')
@if($title)
<ul class="bread_crumb" style="margin-top: -10px; margin-bottom: 4px; ">
<li><a title="Home" href="/">Home</a></li>
<li class="separator"><i class="fa-solid fa-chevron-right"></i></li>
<li><a title="Nieuws" href="{{route('nieuws')}}">Nieuws</a></li>
<li class="separator"><i class="fa-solid fa-chevron-right"></i></li>
<li>{{$title}}</li>
</ul>
@endif
@endsection
@section('content')
<div class="post_body">
{{-- All articles as compact rows, the same as on /nieuws and the homepage lists --}}
<div id="items">
@include('partial/newslist_small', ['id' => 'items-more-news', 'news' => $news])
</div>
@if(count($news) >= 15)
<div>
<a class="btn auto_width" id="meer-nieuws" href="#"
data-loadmorenews='{"container":["#items-more-news"]}'>
<span class="fas fa-spinner fa-spin" id="loading"></span>
LAAD MEER NIEUWSBERICHTEN
</a>
</div>
@endif
</div>
@endsection
@push('scripts')
<script>
var nextPage = 2;
var isLoading = 0;
var $isLoading = $('#loading').hide();
$('#meer-nieuws').click(function (e) {
e.preventDefault();
if (!isLoading) {
// Set flag and update UI
isLoading = 1;
$isLoading.show();
var $button = $(this).attr("disabled", "disabled");
// Fire request for the next page
$.ajax({url: document.location.pathname + '?pagina=' + nextPage})
.always(function () {
// Whether success or failure, update the UI again
isLoading = 0;
$isLoading.hide();
$button.removeAttr("disabled");
})
.done(function (data) {
if (!data) {
// When no data was returned, disable the button permanently
page = -1;
$('#items').append("<hr /><p>Er zijn geen nieuwsberichten (meer).</p>");
$button.remove();
return;
}
$('#items').append(data);
++nextPage;
});
}
});
</script>
@endpush