Commit 8ed38e36 authored by gab's avatar gab Committed by Ciella Francisco

added profile views with temporary views to view all users

parent 16b3ea8f
{% extends "base.html" %}
{% block content %}
{% for object in object_list %}
<a href="{{ object.get_absolute_url }}">{{ object.first_name }}</a> <br>
{% endfor %}
{% endblock %}
\ No newline at end of file
{% extends "base.html" %}
{% block content %}
<div id="rbb-container container" class="d-flex my-5">
<div id="rbb-section" class="mx-auto px-3 py-4 bg-white" style="width: 59rem;">
<div class="row mx-4 mt-4 mb-5">
<div class="col">
<img class="img-fluid img-test float-end" src="https://placehold.co/400x400"/>
</div>
<div class="col">
<p class="h1 blue-text">{{ object.first_name }} {{ object.last_name }}</p>
{% comment %} <p><span class="badge badge-pill">{{ object.role }}</span></p> {% endcomment %}
<span class="profile-pill rounded-pill">
{{ object.role.capitalize }}
</span>
<p class="my-3 body-text">{{ object.bio }}</p>
</div>
</div>
<div class="row">
<p class="h1 blue-text">UPCOMING EVENTS</h1>
{% comment %} generate list of upcoming events {% endcomment %}
</div>
<div class="row">
<p class="h1 blue-text">EVENTS ATTENDED</h1>
{% comment %} generate list of upcoming events {% endcomment %}
</div>
<div class="row">
<p class="h1 blue-text">EVENTS ORGANIZED</h1>
{% comment %} generate list of upcoming events {% endcomment %}
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
from django.urls import path
from . import views
from .views import *
app_name = "accounts"
urlpatterns = [
path('login', views.login_page, name="login"),
path('register', views.register, name="register"),
path('logout', views.user_logout, name="logout"),
path('auth-receiver', views.auth_receiver, name="auth-receiver")
path('login', login_page, name="login"),
path('register', register, name="register"),
path('logout', user_logout, name="logout"),
path('auth-receiver', auth_receiver, name="auth-receiver"),
path('list', UserList.as_view(), name="list"),
path('profile/<int:pk>', UserProfile.as_view(), name="profile")
]
\ No newline at end of file
......@@ -6,7 +6,8 @@ from google.oauth2 import id_token
from google.auth.transport import requests
from .forms import CustomUserCreationForm, CustomUserAuthenticationForm
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.contrib.auth.models import auth
from django.contrib.auth import authenticate, login, logout
......@@ -89,3 +90,11 @@ def auth_receiver(request):
print("Login Successful")
return redirect("index")
class UserProfile(DetailView):
model = models.CustomUser
template_name = 'accounts/profile.html'
class UserList(ListView):
model = models.CustomUser
template_name = 'accounts/list.html'
\ No newline at end of file
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