Massivly simplify notes index controller method

This commit is contained in:
Jonny Barnes 2017-06-22 14:30:10 +01:00
parent 36cf131839
commit 0c62e558ec
5 changed files with 200 additions and 197 deletions

View file

@ -8,7 +8,7 @@
<div class="note">
<div class="e-content p-name">
{!! $note->note !!}
@foreach($note->media()->get() as $media)
@foreach($note->media as $media)
@if($media->type == 'image')<img class="u-photo" src="{{ $media->url }}" alt="">@endif
@if($media->type == 'audio')<audio class="u-audio" src="{{ $media->url }}" controls>@endif
@if($media->type == 'video')<video class="u-video" src="{{ $media->url }}" controls>@endif
@ -17,10 +17,10 @@
</div>
<div class="note-metadata">
<div>
<a class="u-url" href="/notes/{{ $note->nb60id }}"><time class="dt-published" datetime="{{ $note->iso8601_time }}">{{ $note->human_time }}</time></a>@if($note->client_name) via <a class="client" href="{{ $note->client_id }}">{{ $note->client_name }}</a>@endif
@if($note->placeLink)in <span class="p-location h-card"><a class="p-name u-url" href="{{ $note->placeLink }}">{{ $note->address }}</a><data class="p-latitude" value="{{ $note->latitude }}"></data><data class="p-longitude" value="{{ $note->longitude }}"></data></span>
<a class="u-url" href="/notes/{{ $note->nb60id }}"><time class="dt-published" datetime="{{ $note->iso8601 }}" title="{{ $note->iso8601 }}">{{ $note->humandiff }}</time></a>@if($note->client) via <a class="client" href="{{ $note->client->client_url }}">{{ $note->client->client_name }}</a>@endif
@if($note->place)in <span class="p-location h-card"><a class="p-name u-url" href="{{ $note->place->longurl }}">{{ $note->address }}</a><data class="p-latitude" value="{{ $note->place->latitude }}"></data><data class="p-longitude" value="{{ $note->place->longitude }}"></data></span>
@elseif($note->address)in <span class="p-location h-adr">{!! $note->address !!}<data class="p-latitude" value="{{ $note->latitude }}"></data><data class="p-longitude" value="{{ $note->longitude }}"></data></span>@endif
@if($note->replies > 0) @include('templates.replies-icon'): {{ $note->replies }}@endif
@if($note->replies_count > 0) @include('templates.replies-icon'): {{ $note->replies_count }}@endif
</div>
<div class="social-links">
@if(
@ -37,10 +37,10 @@
@endif
</div>
</div>
@if ($note->placeLink)
@if ($note->place)
<div class="map"
data-latitude="{{ $note->latitude }}"
data-longitude="{{ $note->longitude }}"
data-latitude="{{ $note->place->latitude }}"
data-longitude="{{ $note->place->longitude }}"
data-name="{{ $note->place->name }}"
data-marker="{{ $note->place->icon }}"></div>
@endif