80 lines
3.0 KiB
PHP
80 lines
3.0 KiB
PHP
<div id="accordion" class="card">
|
|
@foreach($posts as $date => $postsForDate)
|
|
<div class="card-header" id="heading{{ $loop->index }}">
|
|
<h4 class="mb-0">
|
|
<a class="btn" data-toggle="collapse" data-target="#collapse{{ $loop->index }}" aria-expanded="true" aria-controls="collapse{{ $loop->index }}">
|
|
@if($date >= Carbon::now())
|
|
{{ Date::diffInDaysString($postsForDate[0]->date) }}
|
|
@else
|
|
{{ Date::diffInDaysString($postsForDate[0]->date) }}
|
|
@endif
|
|
</a>
|
|
<span class="badge badge-primary badge-pill badge-danger pull-right">{{ count($postsForDate) }}</span>
|
|
</h4>
|
|
</div>
|
|
|
|
<div id="collapse{{ $loop->index }}" class="collapse @if($loop->index == $page) show @endif" aria-labelledby="headingOne" data-parent="#accordion" data-page="{{ ($loop->index + 1) }}">
|
|
<div class="card-body">
|
|
<table class="w-100">
|
|
<tbody>
|
|
@foreach($postsForDate as $post)
|
|
@php
|
|
if(isset($post->state))
|
|
{
|
|
$platforms = $post->platforms;
|
|
$date = $post->date;
|
|
$post = $post->post;
|
|
$post->date = $date;
|
|
$post->platforms = $platforms;
|
|
}
|
|
@endphp
|
|
<tr>
|
|
<td>
|
|
<a href="#" title="@lang("admin.details")"><i class="fa fa-info show-modal" data-id="{{ $post->id }}" data-type="{{ $post->type }}"></i></a>
|
|
@if(Access::hasAnyEditPermission($post->type, $post->user_id))
|
|
<a href="#" title="@lang("admin.edit")"><i class="fa fa-edit edit-modal" data-id="{{ $post->id }}" data-type="{{ $post->type }}"></i></a>
|
|
@endif
|
|
<h5 class="d-inline">
|
|
@if(count($post->tag('abteilung')))
|
|
{{ $post->tag('abteilung')[0]->name }}
|
|
@endif
|
|
: {{ ucfirst($post->type) }}
|
|
</h5>
|
|
</td>
|
|
<td class="pull-right">
|
|
@php
|
|
$platforms = explode(",", $post->platforms);
|
|
@endphp
|
|
@foreach($platforms as $platform)
|
|
@if($platform == 'facebook')
|
|
<a href="{{ URL::Facebook($post) }}" target="_blank" title="Facebook">
|
|
<i class="fab fa-facebook" title="Veröffentlichung auf Facebook"></i>
|
|
</a>
|
|
@elseif($platform == 'twitter')
|
|
<a href="{{ URL::Twitter($post) }}" target="_blank" title="Twitter">
|
|
<i class="fab fa-twitter" title="Veröffentlichung auf Twitter"></i>
|
|
</a>
|
|
@elseif($platform == 'stadtanzeiger')
|
|
<i class="fa fa-book" title="@lang("messages.publication in news")"></i>
|
|
@endif
|
|
@endforeach
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
<strong>{{ Post::getSocialMediaTitle($post) }}</strong>
|
|
<p>
|
|
@if(isset($post->previewDocument->filename))
|
|
<img class="img-fluid float-left mr-2 mb-2" width="200px" src="{{ Post::getPreviewThumbWebPath($post) }}" alt="">
|
|
@endif
|
|
{!! Post::getSocialMediaDescription($post) !!}
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div> |