Add profile view
This commit is contained in:
parent
090985c3e9
commit
31d8016d7b
4 changed files with 57 additions and 3 deletions
1
src/servala/frontend/templates/frontend/index.html
Normal file
1
src/servala/frontend/templates/frontend/index.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{% extends "frontend/base.html" %}
|
43
src/servala/frontend/templates/frontend/profile.html
Normal file
43
src/servala/frontend/templates/frontend/profile.html
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
{% extends "frontend/base.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% block html_title %}
|
||||||
|
{% block page_title %}
|
||||||
|
{% translate "Profile" %}
|
||||||
|
{% endblock page_title %}
|
||||||
|
{% endblock html_title %}
|
||||||
|
{% block content %}
|
||||||
|
<section class="section">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h4 class="card-title">{% translate "Account" %}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="card-body">
|
||||||
|
<p class="card-text">
|
||||||
|
{% blocktranslate trimmed %}
|
||||||
|
You are logged in with your VSHN user account. You will be able to change your password and other settings here in the future.
|
||||||
|
{% endblocktranslate %}
|
||||||
|
</p>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-lg">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>{% translate "E-mail" %}</th>
|
||||||
|
<td>{{ request.user.email }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{% translate "First name" %}</th>
|
||||||
|
<td>{{ request.user.first_name }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{% translate "Last name" %}</th>
|
||||||
|
<td>{{ request.user.last_name }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{% endblock content %}
|
|
@ -2,4 +2,8 @@ from django.views.generic import TemplateView
|
||||||
|
|
||||||
|
|
||||||
class IndexView(TemplateView):
|
class IndexView(TemplateView):
|
||||||
template_name = "frontend/base.html"
|
template_name = "frontend/index.html"
|
||||||
|
|
||||||
|
|
||||||
|
class ProfileView(TemplateView):
|
||||||
|
template_name = "frontend/profile.html"
|
||||||
|
|
|
@ -2,17 +2,23 @@ from django.conf import settings
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
from django.urls.conf import include
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from servala.frontend.views import IndexView
|
from servala.frontend import views
|
||||||
|
|
||||||
admin.site.site_title = _("Servala Admin")
|
admin.site.site_title = _("Servala Admin")
|
||||||
admin.site.site_header = _("Servala Management")
|
admin.site.site_header = _("Servala Management")
|
||||||
admin.site.index_title = _("Dashboard")
|
admin.site.index_title = _("Dashboard")
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("", IndexView.as_view(), name="index"),
|
# This adds the allauth urls to the project:
|
||||||
|
# - accounts/keycloak/login/
|
||||||
|
# - accounts/keycloak/login/callback/
|
||||||
|
path("accounts/", include("allauth.urls")),
|
||||||
|
path("accounts/profile/", views.ProfileView.as_view(), name="profile"),
|
||||||
path("admin/", admin.site.urls),
|
path("admin/", admin.site.urls),
|
||||||
|
path("", views.IndexView.as_view(), name="index"),
|
||||||
]
|
]
|
||||||
|
|
||||||
# Serve static and media files in development
|
# Serve static and media files in development
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue