Change the way groups are written in templates

parent e270e8fa
Pipeline #1760 passed with stages
in 1 minute and 58 seconds
......@@ -41,8 +41,8 @@
<td>{{user.id}}</td>
<td>{{user.username}}</td>
<td>{{user.email}}</td>
<td>{{user.date_joined |date:'d/m/Y - H:i:s'}}</td>
<td>{{user.groups.all.0.name}}</td>
<td>{{user.date_joined | date:'d/m/Y - H:i:s'}}</td>
<td>{{user.groups.last.name}}</td>
<td></td>
</tr>
{% endfor %}
......
......@@ -57,17 +57,17 @@
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link">
Vous êtes {{user.groups.all.0.name}}
{% if user.groups.all.0.name == "padawan" %}
Vous êtes {{user.groups.last.name}}
{% if user.groups.last.name == "padawan" %}
<img class="inline-image ml-2" role="img" src="{% static 'img/padawan.svg' %}" />
{% elif user.groups.all.0.name == "Jedi" %}
{% elif user.groups.last.name == "jedi" %}
<img class="inline-image ml-2" role="img" src="{% static 'img/jedi.svg' %}" />
{% endif %}
</a>
</li>
</ul>
{% else %}
<span class="navbar-text ml-auto text-muted">For jedis by jedis</span>
<span class="navbar-text ml-auto text-muted">For jedi by jedi</span>
{% endif %}
</div>
</nav>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment