Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Start exchanging the icons with a more modern and flat version

Roland Geider31f74346bd96
diff --git a/wger/core/templates/tags/render_day.html b/wger/core/templates/tags/render_day.html
index c9047ec2e..486b2b72f 100644
--- a/wger/core/templates/tags/render_day.html
+++ b/wger/core/templates/tags/render_day.html
@@ -23,23 +23,14 @@ $(document).ready(function() {
<span class="editoptions" style="float: right;">
<a href="{% url 'manager:day:delete' day.obj.id %}"
title="{% trans 'Delete' %}">
- <img src="{% static 'images/icons/trash.svg' %}"
- width="22"
- height="22"
- alt="{% trans 'Delete' %}"></a>
+ <span class="{% fa_class 'trash' %}"></span></a>
<a href="{% url 'manager:day:edit' day.obj.id %}"
title="{% trans 'Edit' %}"
class="wger-modal-dialog">
- <img src="{% static 'images/icons/edit.svg' %}"
- width="22"
- height="22"
- alt="{% trans 'Edit' %}"></a>
+ <span class="{% fa_class 'pencil-square-o' %}"></span></a>
<a href="{% url 'manager:day:log' day.obj.id %}"
title="{% trans 'Add weight log to this day' %}">
- <img src="{% static 'images/icons/statistics.svg' %}"
- width="22"
- height="22"
- alt="{% trans 'Add weight log to this day' %}"></a>
+ <span class="{% fa_class 'line-chart' %}"></span></a>
</span>
{% endif %}
</th>
@@ -54,30 +45,17 @@ $(document).ready(function() {
{% if editable %}
<span class="editoptions">
{% if day.set_list|length > 1 %}
- <img src="{% static 'images/icons/move.svg' %}"
- width="22"
- height="22"
- alt="{% trans 'Move me' %}"
- title="{% trans 'Move me' %}"
- class="dragndrop-handle">
+ <span class="fa fa-bars fa-lg fa-fw dragndrop-handle"></span>
<br>
{% endif %}
<a href="{% url 'manager:set:edit' set.obj.id %}"
title="{% trans 'Edit' %}"
class="wger-modal-dialog">
- <img src="{% static 'images/icons/edit.svg' %}"
- width="22"
- height="22"
- alt="{% trans 'Edit' %}">
- </a>
+ <span class="{% fa_class 'pencil-square-o' %}"></span></a>
<br>
<a href="{% url 'manager:set:delete' set.obj.id %}"
title="{% trans 'Delete' %}">
- <img src="{% static 'images/icons/trash.svg' %}"
- width="16"
- height="16"
- alt="{% trans 'Delete' %}">
- </a>
+ <span class="{% fa_class 'trash' %}"></span></a>
</span>
{% endif %}
</td>
diff --git a/wger/core/templatetags/wger_extras.py b/wger/core/templatetags/wger_extras.py
index 4cdbc1982..39d7d09f8 100644
--- a/wger/core/templatetags/wger_extras.py
+++ b/wger/core/templatetags/wger_extras.py
@@ -145,6 +145,29 @@ def auto_link_css(flavour='full', css=''):
return mark_safe('class="{0}"'.format(css))
+def fa_class(class_name='', size='lg', fixed_width=True):
+ '''
+ Helper function to help add font awesome classes to elements
+
+ :param class_name: the CSS class name, without the "fa-" prefix
+ :param size: the size of the icon
+ :param fixed_width: toggle for fixed icon width
+ :return: the complete CSS classes
+ '''
+ css = ''
+ if not class_name:
+ return css
+
+ css += 'fa fa-{}'.format(class_name)
+ if size:
+ css += ' fa-{}'.format(size)
+
+ if fixed_width:
+ css += ' fa-fw'
+ return mark_safe(css)
+
+
@register.simple_tag
def trans_weight_unit(unit, user=None):
'''
diff --git a/wger/manager/templates/workout/view.html b/wger/manager/templates/workout/view.html
index a13a1fc5d..6bed988b8 100644
--- a/wger/manager/templates/workout/view.html
+++ b/wger/manager/templates/workout/view.html
@@ -122,35 +122,22 @@ $(document).ready(function() {
<h4>{% trans "Options" %}</h4>
<p>
<a data-toggle="modal" data-target="#download-pdf-popup">
- <img src="{% static 'images/icons/save.svg' %}"
- width="32"
- height="32"
- alt="{% trans 'Download as PDF' %}"
- title="{% trans 'Download as PDF' %}">
- {% trans "Download as PDF" %}
+ <span class="{% fa_class 'download' %}"></span>
+ {% trans "Download as PDF" %}
</a>
</p>
<p>
-<a href="{% url 'manager:log:log' workout.id %}">
- <img src="{% static 'images/icons/statistics.svg' %}"
- width="32"
- height="32"
- alt="{% trans 'View weight log' %}"
- title="{% trans 'View weight log' %}">
- {% trans "View weight log" %}
-</a>
+ <a href="{% url 'manager:log:log' workout.id %}">
+ <span class="{% fa_class 'line-chart' %}"></span>
+ {% trans "View weight log" %}
+ </a>
</p>
{% if is_owner %}
<p>
-<a href="{% url 'manager:workout:edit' workout.id %}"
- class="wger-modal-dialog">
- <img src="{% static 'images/icons/edit.svg' %}"
- width="32"
- height="32"
- alt="{% trans 'Edit workout' %}"
- title="{% trans 'Edit workout' %}">
+<a href="{% url 'manager:workout:edit' workout.id %}" class="wger-modal-dialog">
+ <span class="{% fa_class 'pencil-square-o' %}"></span>
{% trans "Edit workout" %}
</a>
</p>
@@ -158,35 +145,22 @@ $(document).ready(function() {
<p>
<a data-toggle="modal" data-target="#export-ical-popup">
- <img src="{% static 'images/icons/calendar.svg' %}"
- width="32"
- height="32"
- alt="{% trans 'Export calendar file' %}"
- title="{% trans 'Export calendar file' %}">
+ <span class="{% fa_class 'calendar' %}"></span>
{% trans "Export calendar file" %}
</a>
</p>
<p>
-<a href="{% url 'manager:workout:copy' workout.id %}"
- class="wger-modal-dialog">
- <img src="{% static 'images/icons/copy.svg' %}"
- width="32"
- height="32"
- alt="{% trans 'Make a copy of this workout' %}"
- title="{% trans 'Make a copy of this workout' %}">
+<a href="{% url 'manager:workout:copy' workout.id %}" class="wger-modal-dialog">
+ <span class="{% fa_class 'clone' %}"></span>
{% trans "Make a copy of this workout" %}
</a>
</p>
{% if is_owner %}
<p>
-<a href="{% url 'manager:workout:delete' workout.id %}"
- class="wger-modal-dialog">
- <img src="{% static 'images/icons/trash.svg' %}"
- width="32"
- height="32"
- alt="{% trans 'Delete this workout' %}">
+<a href="{% url 'manager:workout:delete' workout.id %}" class="wger-modal-dialog">
+ <span class="{% fa_class 'trash' %}"></span>
{% trans "Delete this workout" %}
</a>
</p>