Use type_bg_class() macro in templates

This commit is contained in:
Igor Scheller 2023-12-06 21:15:54 +01:00 committed by msquare
parent f7b0ee9ebb
commit bcfcb95786
5 changed files with 8 additions and 8 deletions

View File

@ -61,7 +61,7 @@
<div class="col-md-12"> <div class="col-md-12">
<h2>{{ __('form.preview') }}</h2> <h2>{{ __('form.preview') }}</h2>
<div class="card {% if theme.type =='light' %}bg-light{% else %}bg-dark{% endif %}"> <div class="card {{ m.type_bg_class() }}">
<div class="card-header"> <div class="card-header">
{{ faq.question }} {{ faq.question }}
</div> </div>

View File

@ -35,7 +35,7 @@
{% for item in items %} {% for item in items %}
<div class="col-md-12 faq"> <div class="col-md-12 faq">
<span id="faq-{{ item.id }}" class="ref-id"></span> <span id="faq-{{ item.id }}" class="ref-id"></span>
<div class="card {% if theme.type =='light' %}bg-light{% else %}bg-dark{% endif %} mb-4"> <div class="card {{ m.type_bg_class() }} mb-4">
<h4 class="card-header"> <h4 class="card-header">
{{ item.question }} {{ item.question }}
<small class="text-muted"> <small class="text-muted">
@ -47,7 +47,7 @@
{{ item.text|markdown }} {{ item.text|markdown }}
</div> </div>
<div class="card-footer {% if theme.type =='light' %}bg-light{% else %}bg-dark{% endif %} d-flex align-items-center"> <div class="card-footer {{ m.type_bg_class() }} d-flex align-items-center">
<div class="me-3"> <div class="me-3">
{{ m.icon('clock') }} {{ item.updated_at.format(__('general.datetime')) }} {{ m.icon('clock') }} {{ item.updated_at.format(__('general.datetime')) }}
</div> </div>

View File

@ -17,7 +17,7 @@
<div class="card-body {{ m.type_bg_class() }}"> <div class="card-body {{ m.type_bg_class() }}">
{{ comment.text|nl2br }} {{ comment.text|nl2br }}
</div> </div>
<div class="card-footer {% if theme.type =='light' %}bg-light{% else %}bg-dark{% endif %} text-muted d-flex align-items-center"> <div class="card-footer {{ m.type_bg_class() }} text-muted d-flex align-items-center">
<div class="me-3"> <div class="me-3">
{{ m.icon('clock') }} {{ m.icon('clock') }}
{{ comment.created_at.format(__('general.datetime')) }} {{ comment.created_at.format(__('general.datetime')) }}

View File

@ -52,7 +52,7 @@
{% endblock %} {% endblock %}
{% macro news(news, show_comments_link, is_overview) %} {% macro news(news, show_comments_link, is_overview) %}
<div class="card {% if news.is_highlighted %}bg-warning{% elseif news.is_meeting %}bg-info{% elseif theme.type =='light' %}bg-light{% else %}bg-dark{% endif %} mb-4"> <div class="card {% if news.is_highlighted %}bg-warning{% elseif news.is_meeting %}bg-info{% else %}{{ m.type_bg_class() }}{% endif %} mb-4">
{% if is_overview|default(false) %} {% if is_overview|default(false) %}
<div class="card-header {% if news.is_meeting and theme.type == 'dark' %}text-white{% endif %}"> <div class="card-header {% if news.is_meeting and theme.type == 'dark' %}text-white{% endif %}">
<a href="{{ url('/news/' ~ news.id) }}" class="text-inherit"> <a href="{{ url('/news/' ~ news.id) }}" class="text-inherit">
@ -70,7 +70,7 @@
{% endif %} {% endif %}
</div> </div>
<div class="card-footer text-nowrap {% if theme.type =='light' %}bg-light{% else %}bg-dark{% endif %} text-muted"> <div class="card-footer text-nowrap {{ m.type_bg_class() }} text-muted">
<div class="d-flex flex-column flex-md-row align-items-md-center gap-3"> <div class="d-flex flex-column flex-md-row align-items-md-center gap-3">
{% if news.updated_at != news.created_at and not is_overview %} {% if news.updated_at != news.created_at and not is_overview %}
<div> <div>

View File

@ -33,7 +33,7 @@
{{ question.text|nl2br }} {{ question.text|nl2br }}
</div> </div>
<div class="card-footer {% if theme.type =='light' %}bg-light{% else %}bg-dark{% endif %} d-flex align-items-center"> <div class="card-footer {{ m.type_bg_class() }} d-flex align-items-center">
<div class="me-3"> <div class="me-3">
{{ m.icon('clock') }} {{ question.created_at.format(__('general.datetime')) }} {{ m.icon('clock') }} {{ question.created_at.format(__('general.datetime')) }}
</div> </div>
@ -68,7 +68,7 @@
<div class="card-body bg-body {{ m.type_text_class() }}"> <div class="card-body bg-body {{ m.type_text_class() }}">
{{ question.answer|markdown }} {{ question.answer|markdown }}
</div> </div>
<div class="card-footer bg-dark d-flex align-items-center {{ m.type_text_class() }}"> <div class="card-footer {{ m.type_bg_class() }} d-flex align-items-center {{ m.type_text_class() }}">
<div class="me-3"> <div class="me-3">
{{ m.icon('clock') }} {{ question.updated_at.format(__('general.datetime')) }} {{ m.icon('clock') }} {{ question.updated_at.format(__('general.datetime')) }}
</div> </div>