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
be48e342
Commit
be48e342
authored
Mar 26, 2024
by
Jenica
Browse files
Options
Browse Files
Download
Plain Diff
Fixed local merge conflict
parents
6e65f707
e9dfb33e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
8 deletions
+41
-8
views.py
redbrickboard/accounts/views.py
+6
-5
models.py
redbrickboard/event_management/models.py
+29
-1
create_event.html
...t_management/templates/event_management/create_event.html
+1
-1
index.html
redbrickboard/eventcatalog/templates/eventcatalog/index.html
+1
-0
custom.css
redbrickboard/static/css/custom.css
+1
-1
base.html
redbrickboard/templates/base.html
+3
-0
No files found.
redbrickboard/accounts/views.py
View file @
be48e342
...
...
@@ -10,7 +10,7 @@ from .forms import CustomUserCreationForm, CustomUserAuthenticationForm
from
django.contrib.auth.models
import
auth
from
django.contrib.auth
import
authenticate
,
login
,
logout
from
django
import
forms
from
.
import
models
...
...
@@ -75,16 +75,17 @@ def auth_receiver(request):
password
=
user_data
[
'sub'
]
+
'google'
+
user_data
[
'name'
]
logInUser
=
authenticate
(
request
,
email
=
email
,
password
=
password
)
if
"@ateneo.edu"
not
in
email
and
"@student.ateneo.edu"
not
in
email
and
"@alumni.ateneo.edu"
not
in
email
:
return
HttpResponse
(
"Your login must be an ateneo email address. Try again <a href='./login'>here</a>"
,
status
=
403
)
if
logInUser
is
not
None
:
pass
auth
.
login
(
request
,
logInUser
)
else
:
first_name
=
user_data
[
'given_name'
]
last_name
=
user_data
[
'family_name'
]
role
=
"STUDENT"
user
=
models
.
CustomUser
.
objects
.
create_user
(
email
=
email
,
password
=
password
,
first_name
=
first_name
,
last_name
=
last_name
,
role
=
role
)
auth
.
login
(
request
,
logInUser
)
auth
.
login
(
request
,
logInUser
)
print
(
"Login Successful"
)
return
redirect
(
"index"
)
\ No newline at end of file
redbrickboard/event_management/models.py
View file @
be48e342
from
django.db
import
models
from
django.utils
import
timezone
from
django.urls
import
reverse
from
datetime
import
timedelta
from
accounts
import
models
as
accounts
# Create your models here.
class
Event
(
models
.
Model
):
event_name
=
models
.
CharField
(
default
=
''
,
max_length
=
150
)
event_datetime_start
=
models
.
DateTimeField
(
default
=
timezone
.
now
,
null
=
False
)
event_datetime_end
=
models
.
DateTimeField
()
event_organizer
=
models
.
ForeignKey
(
accounts
.
CustomUser
,
on_delete
=
models
.
CASCADE
,
related_name
=
'events_organized'
)
# finalize arguments
event_header
=
models
.
ImageField
(
upload_to
=
'headers/'
,
height_field
=
None
,
width_field
=
None
,
max_length
=
100
,
blank
=
True
)
# research how exactly to do this
event_promos
=
models
.
FileField
(
upload_to
=
'promos/'
,
blank
=
True
,
null
=
True
)
# decide whether to have a separate model for the comments
comments
=
models
.
TextField
()
last_time_bumped
=
models
.
DateTimeField
()
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
event_name
)
def
get_absolute_url
(
self
):
return
reverse
(
'event_management:event_details'
,
kwargs
=
{
'pk'
:
self
.
pk
})
def
save
(
self
,
*
args
,
**
kwargs
):
if
self
.
event_datetime_end
is
None
:
self
.
event_datetime_end
=
self
.
event_datetime_start
+
timedelta
(
hours
=
1
)
if
self
.
last_time_bumped
is
None
:
self
.
last_time_bumped
=
self
.
event_datetime_start
super
(
Event
,
self
)
.
save
(
*
args
,
**
kwargs
)
\ No newline at end of file
redbrickboard/event_management/templates/event_management/create_event.html
View file @
be48e342
{% extends 'base.html' %}
{% load static %}
{% block title %}
Widget's Forum
{% endblock %}
{% block title %}
Event Management
{% endblock %}
{% block content %}
<div
class=
"container justify-content-md-center align-items-center"
id=
"trial"
>
<div
class=
"row"
>
...
...
redbrickboard/eventcatalog/templates/eventcatalog/index.html
View file @
be48e342
...
...
@@ -11,6 +11,7 @@ Hi {{ user.first_name }} {{ user.last_name }}!
{% else %}
<p>
You are not logged in
</p>
<a
href=
"{% url 'accounts:login' %}"
>
Log In
</a>
<a
href=
"{% url 'accounts:register' %}"
>
Register
</a>
{% endif %}
{% endblock %}
\ No newline at end of file
redbrickboard/static/css/custom.css
View file @
be48e342
...
...
@@ -11,7 +11,7 @@
body
{
font-family
:
"Inter"
;
background-color
:
var
(
--theme-dutch-white
);
background-image
:
url("/static/images/Continuous Background.png")
;
/* background-image: url("/static/images/Continuous Background.png"); */
background-position
:
left
top
;
background-repeat
:
repeat-y
;
background-size
:
80%
;
...
...
redbrickboard/templates/base.html
View file @
be48e342
...
...
@@ -32,6 +32,9 @@
<button
class=
"btn"
type=
"button"
>
Log Out
</button>
</form>
</div>
{% comment %}
<form
class=
"container-fluid justify-content-start"
>
<button
class=
"btn"
type=
"button"
>
Log Out
</button>
</form>
{% endcomment %}
</div>
</div>
</nav>
...
...
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