Start reworking user page

This commit is contained in:
Anna Sidwell 2019-03-04 23:17:12 +11:00
parent 179ff9d7d4
commit 2e4b09fecd
4 changed files with 29 additions and 20 deletions

View File

@ -28,6 +28,8 @@ h1 {
.ojuso-yellow { color: #f9db3c; } .ojuso-yellow { color: #f9db3c; }
.ojuso-blue { color: #008ad5; } .ojuso-blue { color: #008ad5; }
.mx-1 { margin-left: 10px; }
/* /*
* LAYOUT * LAYOUT

View File

@ -1,4 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load avatar_tags %}
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
@ -10,10 +11,12 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<h2>{{ object.username }}</h2> <img src="{% avatar_url user %}">
{% if object.name %}
<p>{{ object.name }}</p> {% if object.first_name and object.last_name %}
<h2>{{ object.first_name }} {{ object.last_name }} <i>({{ object.username }})</i></h2>
{% endif %} {% endif %}
</div> </div>
</div> </div>
@ -22,13 +25,11 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<a class="btn btn-primary" href="{% url 'profile:update' %}" role="button">{% trans 'Change Name' %}</a> <a class="btn btn-primary" href="{% url 'profile:update' %}">{% trans 'Change Name' %}</a>
<a class="btn btn-primary" href="" role="button">E-Mail</a> <a class="btn btn-primary mx-1" href="{% url 'avatar_change' %}">Change Avatar</a>
<!-- Your Stuff: Custom user template urls -->
</div> </div>
</div> </div>
<!-- End Action buttons -->
{% endif %} {% endif %}

View File

@ -4,6 +4,10 @@
{% block title %}{{ user.username }}{% endblock %} {% block title %}{{ user.username }}{% endblock %}
{% block content %} {% block content %}
<div class="container">
<div class="row">
<div class="col-sm-12">
<h1>{{ user.username }}</h1> <h1>{{ user.username }}</h1>
<form class="form-horizontal" method="post" action="{% url 'profile:update' %}"> <form class="form-horizontal" method="post" action="{% url 'profile:update' %}">
{% csrf_token %} {% csrf_token %}
@ -14,4 +18,8 @@
</div> </div>
</div> </div>
</form> </form>
</div>
</div>
</div>
{% endblock %} {% endblock %}

View File

@ -75,10 +75,8 @@
<img src="{% avatar_url user %}" class="img-circle" width="40" height="40" style="position:relative;margin-right:5px"/><span>{{user}}</span> <img src="{% avatar_url user %}" class="img-circle" width="40" height="40" style="position:relative;margin-right:5px"/><span>{{user}}</span>
</a> </a>
<ul class="dropdown-menu dropdown-menu-right" style="padding-bottom:0px" aria-labelledby="navbarDropdown"> <ul class="dropdown-menu dropdown-menu-right" style="padding-bottom:0px" aria-labelledby="navbarDropdown">
<li><a href="{% url 'avatar_change' %}"><i class="fa fa-cog" aria-hidden="true"></i> Change Avatar</a></li> <li><a href="{% url 'profile:detail' %}"><i class="fa fa-cog" aria-hidden="true"></i> {%trans 'Profile' %}</a></li>
<li><a href="{% url 'profile:detail' %}"><i class="fa fa-cog" aria-hidden="true"></i> Profile</a></li> <li><a href="{% url 'auth_logout' %}"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> {% trans 'Logout' %}</a></li>
<li role="separator" style="margin-bottom:0px"></li>
<li><a class="dropdown-item no-hover" style="background-color:red;color:white;padding:0.5rem 1.5rem" href="{% url 'auth_logout' %}"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> {% trans 'Logout' %}</a></li>
</ul> </ul>
</li> </li>