Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
red_brick_board
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ciella Francisco
red_brick_board
Commits
8ed38e36
Commit
8ed38e36
authored
Mar 26, 2024
by
gab
Committed by
Ciella Francisco
Apr 12, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added profile views with temporary views to view all users
parent
16b3ea8f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
7 deletions
+59
-7
list.html
redbrickboard/accounts/templates/accounts/list.html
+7
-0
profile.html
redbrickboard/accounts/templates/accounts/profile.html
+34
-0
urls.py
redbrickboard/accounts/urls.py
+7
-5
views.py
redbrickboard/accounts/views.py
+11
-2
No files found.
redbrickboard/accounts/templates/accounts/list.html
0 → 100644
View file @
8ed38e36
{% 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
redbrickboard/accounts/templates/accounts/profile.html
0 → 100644
View file @
8ed38e36
{% 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
redbrickboard/accounts/urls.py
View file @
8ed38e36
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
redbrickboard/accounts/views.py
View file @
8ed38e36
...
...
@@ -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
...
...
@@ -88,4 +89,12 @@ def auth_receiver(request):
print
(
"Login Successful"
)
return
redirect
(
"index"
)
\ No newline at end of file
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment