Profile view page refactoring

This commit is contained in:
Andrew Smirnov
2021-03-04 20:01:10 +03:00
parent 3a448a399a
commit 656081295e
2 changed files with 17 additions and 24 deletions

View File

@@ -10,17 +10,14 @@
{% block extra_css %}
<style>
.img{
<style>
.img {
width:auto;
height:auto;
max-width:100px!important;
max-height:100px!important;
}
</style>
</style>
{% endblock %}
{% block content %}
@@ -28,24 +25,24 @@
<div class="row">
<div class="col-auto">
<div class="container">
{% if image_url %}
<img src={{image_url}} class="img img-thumbnail" alt="Аватар">
{% else %}
<img src="{% static 'no_avatar.png' %}" class="img img-thumbnail" alt="Нет изображения">
{% endif %}
<img
src="{% if profile.image %}{{ profile.image }}{% else %}{% static 'no_avatar.png' %}{% endif %}"
class="img img-thumbnail"
alt="Нет изображения"
>
</div>
</div>
<div class="col">
<h5><span class="badge bg-secondary text-light">Имя пользователя</span> {{name}}</h5>
<h5><span class="badge bg-secondary text-light">Имя пользователя</span> {{ profile.name }}</h5>
<br>
<h5><span class="badge bg-secondary text-light">Электронная почта</span> {{email}}</h5>
<h5><span class="badge bg-secondary text-light">Электронная почта</span> {{ profile.user.email }}</h5>
<br>
<h5><span class="badge bg-secondary text-light">Текущая роль</span> {{role}}</h5>
<h5><span class="badge bg-secondary text-light">Текущая роль</span> {{ profile.role }}</h5>
</div>
</div>
<div align="center">
<form action="">
<a href="/work/{{ id }}" class="btn btn-primary"><big>Запросить права доступа</big></a>
<a href="{% url 'work' profile.user.id %}" class="btn btn-primary"><big>Запросить права доступа</big></a>
</form>
</div>
{% endblock %}