core: fix application overview
This commit is contained in:
parent
e5165abf04
commit
26613b6ea9
|
@ -3,12 +3,13 @@ from django import forms
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from passbook.core.models import Application, Provider
|
from passbook.core.models import Application, Provider
|
||||||
|
from passbook.lib.widgets import GroupedModelChoiceField
|
||||||
|
|
||||||
|
|
||||||
class ApplicationForm(forms.ModelForm):
|
class ApplicationForm(forms.ModelForm):
|
||||||
"""Application Form"""
|
"""Application Form"""
|
||||||
|
|
||||||
provider = forms.ModelChoiceField(
|
provider = GroupedModelChoiceField(
|
||||||
queryset=Provider.objects.all().order_by("pk").select_subclasses(),
|
queryset=Provider.objects.all().order_by("pk").select_subclasses(),
|
||||||
required=False,
|
required=False,
|
||||||
)
|
)
|
||||||
|
|
|
@ -24,21 +24,23 @@
|
||||||
{% if applications %}
|
{% if applications %}
|
||||||
<div class="pf-l-gallery pf-m-gutter">
|
<div class="pf-l-gallery pf-m-gutter">
|
||||||
{% for app in applications %}
|
{% for app in applications %}
|
||||||
<a href="{{ app.meta_launch_url }}" class="pf-c-card pf-m-hoverable pf-m-compact" id="card-1">
|
<a href="{{ app.meta_launch_url }}" class="pf-c-card pf-m-hoverable pf-m-compact">
|
||||||
<div class="pf-c-card__head">
|
<div class="pf-c-card__header">
|
||||||
{% if not app.meta_icon_url %}
|
{% if not app.meta_icon_url %}
|
||||||
<i class="pf-icon pf-icon-arrow"></i>
|
<i class="pf-icon pf-icon-arrow"></i>
|
||||||
{% else %}
|
{% else %}
|
||||||
<img class="app-icon pf-c-avatar" src="{{ app.meta_icon_url }}" alt="{% trans 'Application Icon' %}">
|
<img class="app-icon pf-c-avatar" src="{{ app.meta_icon_url }}" alt="{% trans 'Application Icon' %}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="pf-c-card__header pf-c-title pf-m-md">
|
<div class="pf-c-card__title">
|
||||||
<p id="card-1-check-label">{{ app.name }}</p>
|
<p id="card-1-check-label">{{ app.name }}</p>
|
||||||
<div class="pf-c-content">
|
<div class="pf-c-content">
|
||||||
<small>{{ app.meta_publisher }}</small>
|
<small>{{ app.meta_publisher }}</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pf-c-card__body">{% trans app.meta_description %}</div>
|
<div class="pf-c-card__body">
|
||||||
|
{% trans app.meta_description|truncatewords:35 %}
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in New Issue