Fixed Logo do not show correctly when it's empty

Clean query when submit filters
This commit is contained in:
BrettonYe
2024-07-15 20:52:03 +08:00
parent 31b2b91b49
commit c461700589
4 changed files with 20 additions and 7 deletions

View File

@@ -76,7 +76,7 @@
{{ Str::limit($article->category, 30) }}
</td>
<td class="text-left">
@if (! empty($article->logo))
@if ($article->logo)
<img class="mr-5" src="{{ asset($article->logo) }}" alt="logo" style="height: 32px" loading="lazy" />
@endif
{{ Str::limit($article->title, 50) }}

View File

@@ -11,8 +11,13 @@
<div class="panel">
<div class="panel-heading">
<h3 class="panel-title">
<img class="mr-10" src="{{ asset($article->logo) }}" alt="logo" style="height: 32px" />{{ $article->title }}
{!! $article->category ? '<sub class="ml-20">' . $article->category . '</sub>' : '' !!}
@if ($article->logo)
<img class="mr-10" src="{{ asset($article->logo) }}" alt="logo" style="height: 32px" />
@endif
{{ $article->title }}
@if ($article->category)
<sub class="ml-20">{{ $article->category }}</sub>
@endif
</h3>
<div class="panel-actions"><code>{{ $article->created_at }}</code></div>
</div>

View File

@@ -10,9 +10,17 @@
<script src="/assets/global/vendor/bootstrap-select/bootstrap-select.min.js"></script>
<script src="/assets/global/js/Plugin/bootstrap-select.js"></script>
<script>
$('form').on('submit', function() {
$(this).find('input, select').each(function() {
if (!$(this).val()) {
$(this).remove();
}
});
});
$('select').on('change', function() {
this.form.submit()
})
$(this).closest('form').trigger('submit');
});
</script>
@stack('javascript')
@endsection

View File

@@ -99,10 +99,10 @@
<a class="panel-title collapsed" data-toggle="collapse" href="#article_A{{ $article->id }}"
role="tab" aria-controls="article_A{{ $article->id }}" aria-expanded="false"
style="display: flex;" onclick="getArticle('{{ $article->id }}')">
@isset($article->logo)
@if ($article->logo)
<img class="mr-5" src="{{ asset($article->logo) }}" alt=""
style="height: 36px; align-self: center" loading="lazy" />
@endisset
@endif
<h4 style="margin-top: 11px">{{ $article->title }}</h4>
</a>
<div class="panel-collapse collapse" id="article_A{{ $article->id }}" role="tabpanel"