core: show applications on overview page

This commit is contained in:
Jens Langhammer 2018-12-10 10:50:19 +01:00
parent 1a8f3fb18a
commit 19a8ecb55a
4 changed files with 24 additions and 51 deletions

View File

@ -36,4 +36,4 @@
</tbody> </tbody>
</table> </table>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -2,11 +2,6 @@
{% csrf_token %} {% csrf_token %}
{% for field in form %} {% for field in form %}
{% if field.help_text %}
<span>
{{ field.help_text }}
</span>
{% endif %}
<div class="form-group"> <div class="form-group">
{% if field.field.widget|fieldtype == 'RadioSelect' %} {% if field.field.widget|fieldtype == 'RadioSelect' %}
<label class="col-sm-2 control-label" {% if field.field.required %}class="required"{% endif %} for="{{ field.name }}-{{ forloop.counter0 }}"> <label class="col-sm-2 control-label" {% if field.field.required %}class="required"{% endif %} for="{{ field.name }}-{{ forloop.counter0 }}">
@ -39,9 +34,15 @@
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
{{ field|css_class:'form-control' }} {{ field|css_class:'form-control' }}
{% if field.help_text %}
<span>
{{ field.help_text }}
</span>
{% endif %}
</div> </div>
{% endif %} {% endif %}
{% for error in field.errors %} {% for error in field.errors %}
{{error }}
<div class="alert alert-danger"> <div class="alert alert-danger">
<div class="alert-items"> <div class="alert-items">
<div class="alert-item"> <div class="alert-item">

View File

@ -1,63 +1,33 @@
{% extends "overview/base.html" %} {% extends "overview/base.html" %}
{% load i18n %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<div class="row row-cards-pf"> <div class="row row-cards-pf">
{% for app in applications %}
<!-- Important: if you need to nest additional .row within a .row.row-cards-pf, do *not* use .row-cards-pf on the nested .row --> <!-- Important: if you need to nest additional .row within a .row.row-cards-pf, do *not* use .row-cards-pf on the nested .row -->
<div class="col-xs-12 col-sm-6 col-md-3"> <div class="col-xs-12 col-sm-6 col-md-3">
<div class="card-pf card-pf-accented card-pf-aggregate-status"> <div class="card-pf card-pf-accented card-pf-aggregate-status">
<h2 class="card-pf-title"> <h2 class="card-pf-title">
<span class="fa fa-shield"></span><span class="card-pf-aggregate-status-count">0</span> Ipsum <span class="fa fa-shield"></span> {{ app.name }}
</h2> </h2>
<div class="card-pf-body"> <div class="card-pf-body">
<p class="card-pf-aggregate-status-notifications"> <p class="card-pf-aggregate-status-notifications">
<span class="card-pf-aggregate-status-notification"><a href="#" class="add" data-toggle="tooltip" <span class="card-pf-aggregate-status-notification">
data-placement="top" title="Add Ipsum"><span class="pficon pficon-add-circle-o"></span></a></span> <a href="{{ app.launch_url }}" class="add" data-toggle="tooltip" data-placement="top" title="{% trans 'Open App...' %}">
</p> {% if not app.icon_url %}
</div> <span class="pficon pficon-arrow"></span>
</div> {% else %}
<img src="{{ app.icon_url }}" alt="{% trans 'Application Icon' %}">
</div> {% endif %}
<div class="col-xs-12 col-sm-6 col-md-3"> </a>
<div class="card-pf card-pf-accented card-pf-aggregate-status"> </span>
<h2 class="card-pf-title">
<a href="#"><span class="fa fa-shield"></span><span class="card-pf-aggregate-status-count">20</span> Amet</a>
</h2>
<div class="card-pf-body">
<p class="card-pf-aggregate-status-notifications">
<span class="card-pf-aggregate-status-notification"><a href="#"><span class="pficon pficon-error-circle-o"></span>4</a></span>
<span class="card-pf-aggregate-status-notification"><a href="#"><span class="pficon pficon-warning-triangle-o"></span>1</a></span>
</p>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3">
<div class="card-pf card-pf-accented card-pf-aggregate-status">
<h2 class="card-pf-title">
<a href="#"><span class="fa fa-shield"></span><span class="card-pf-aggregate-status-count">9</span>
Adipiscing</a>
</h2>
<div class="card-pf-body">
<p class="card-pf-aggregate-status-notifications">
<span class="card-pf-aggregate-status-notification"><span class="pficon pficon-ok"></span></span>
</p>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3">
<div class="card-pf card-pf-accented card-pf-aggregate-status">
<h2 class="card-pf-title">
<a href="#"><span class="fa fa-shield"></span><span class="card-pf-aggregate-status-count">12</span> Lorem</a>
</h2>
<div class="card-pf-body">
<p class="card-pf-aggregate-status-notifications">
<a href="#"><span class="card-pf-aggregate-status-notification"><span class="pficon pficon-error-circle-o"></span>1</span></a>
</p> </p>
</div> </div>
</div> </div>
</div> </div>
{% endfor %}
</div><!-- /row --> </div><!-- /row -->
</div> </div>
{% endblock %} {% endblock %}

View File

@ -2,8 +2,10 @@
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import TemplateView from django.views.generic import TemplateView
from passbook.core.models import Application from passbook.core.models import Application
class OverviewView(LoginRequiredMixin, TemplateView): class OverviewView(LoginRequiredMixin, TemplateView):
"""Overview for logged in user, incase user opens passbook directly """Overview for logged in user, incase user opens passbook directly
and is not being forwarded""" and is not being forwarded"""