Display icons on quick actions

This commit is contained in:
Gabriel Augendre 2018-04-03 18:29:37 +02:00
parent b318270fb0
commit 9d887dea9d
No known key found for this signature in database
GPG key ID: F360212F958357D4
2 changed files with 15 additions and 3 deletions

View file

@ -8,6 +8,11 @@
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="{% static 'gym/style.css' %}">
<script defer src="https://use.fontawesome.com/releases/v5.0.9/js/all.js"
integrity="sha384-8iPTk2s/jMVj81dnzb/iFR2sdA7u06vHJyyLlAd4snFpCl/SnyUjRrbdJsw1pGIl"
crossorigin="anonymous"></script>
{% block add-head %}
{% endblock %}
@ -36,12 +41,18 @@
<div class="row">
<div class="col-12 d-none d-md-block"> {# Visible only on large screens #}
{% for qa in quick_actions %}
<a href="{{ qa.url }}" class="btn btn-{{ qa.category }}">{{ qa.display }}</a>
<a href="{{ qa.url }}" class="btn btn-{{ qa.category }}">
{% if qa.icon %}<i class="{{ qa.icon }}"></i>{% endif %}
{{ qa.display }}
</a>
{% endfor %}
</div>
<div class="col-12 d-md-none"> {# Visible only on small screens #}
{% for qa in quick_actions %}
<a href="{{ qa.url }}" class="btn btn-{{ qa.category }} btn-block">{{ qa.display }}</a>
<a href="{{ qa.url }}" class="btn btn-{{ qa.category }} btn-block">
{% if qa.icon %}<i class="{{ qa.icon }}"></i>{% endif %}
{{ qa.display }}
</a>
{% endfor %}
</div>
</div>

View file

@ -56,7 +56,8 @@ class RoomDetailView(LoginRequiredMixin, QuickActionsMixin, SessionResetMixin, g
quick_actions.append({
'url': url,
'category': 'info',
'display': name
'display': name,
'icon': 'fas fa-location-arrow',
})
return quick_actions