Unverified Commit 11dde516 authored by Gabriel Geraldo's avatar Gabriel Geraldo Committed by GitHub

Merge pull request #4 from avraiel/event_management

merging event_management into main for iteration 1
parents c266ea8e 739be35d
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class EventManagementConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'event_management'
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
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
{% extends 'base.html' %}
{% load static %}
{% block title %}Widget's Forum{% endblock %}
{% block content %}
<div class="container justify-content-md-center align-items-center vh-80" id="trial">
<div class="row">
<div class="col-12">
<div class="main content" style="font-family:'Inter';">
<button>Upload Cover</button>
</div>
</div>
</div>
<div class="row">
<div class="col-md-auto">
<p class="display-1" style="font-family:'Inter';">Event Name</p>
</div>
</div>
<div class="row mb-3">
<label for="colFormLabel" class="col-sm-2 col-form-label">Date</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="colFormLabelDate">
</div>
</div>
<div class="row mb-3">
<label for="colFormLabel" class="col-sm-2 col-form-label">Time</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="colFormLabelTime">
</div>
</div>
<div class="row mb-3">
<label for="colFormLabel" class="col-sm-2 col-form-label">Venue</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="colFormLabelVenue">
</div>
</div>
<div class="row">
<div class="col">
<p class="display-1" style="font-family:'Inter';">Upload Images</p>
</div>
</div>
<div class="row">
<div class="col">
<div class="main content" style="font-family:'Inter';">
<button>Create Event</button>
</div>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
from django.test import TestCase
# Create your tests here.
from django.urls import path
from .views import index
urlpatterns = [path('', index, name='index')]
app_name = "event_management"
\ No newline at end of file
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse('Hello World! This came from the index view.')
\ No newline at end of file
......@@ -42,6 +42,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
'accounts',
'eventcatalog',
'event_management',
'bootstrap5',
]
......@@ -121,7 +122,8 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.2/howto/static-files/
STATIC_URL = 'static/'
STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
......
......@@ -21,5 +21,6 @@ from django.views.generic.base import TemplateView
urlpatterns = [
path('admin/', admin.site.urls),
path("accounts/", include("accounts.urls"), name="accounts"),
path("event_management/", include("event_management.urls", namespace="event_management")),
path("", include("eventcatalog.urls"), name="index"),
]
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@700&display=swap');
:root {
--theme-prusian-blue: #003049;
--theme-bright-red: #D62828;
--theme-orange: #F77F00;
--theme-yellow-red: #FCBF49;
--theme-dutch-white: #EAE2B7;
}
body {
font-family: "Inter";
background-color: var(--theme-dutch-white);
background-image: url("/static/images/Continuous Background.png");
background-position: left top;
background-repeat: repeat-y;
background-size: 80%;
}
.nav-link {
color: var(--theme-orange);
font-size: 1.5vw;
}
.col-form-label {
font-family:Verdana, sans-serif;
font-size: 2vw;
}
#trial {
align-items: center;
background-color: white;
}
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{% block title %}Red Brick Board{% endblock %}</title>
{% block head %}
{% endblock %}
{% load static %}
{% load bootstrap5 %}
{% bootstrap_css %}
{% bootstrap_javascript %}
{% bootstrap_messages %}
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="{% static '/css/custom.css' %}">
<link rel="icon" type="image/x-icon" href="static/images/Logo.png">
<title>{% block title %}Red Brick Board{% endblock %}</title>
{% block head %}
{% endblock %}
</head>
<body>
<main>
I have the base.html
<nav class="navbar navbar-expand-md navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img src="{% static '/images/Logo with Name.png' %}" alt="Red Brick Board" style="width:30%; height:auto; padding-left:10%;">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end align-center" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-link" href="#">Event Catalog</a>
</div>
<form class="container-fluid justify-content-start">
<button class="btn" type="button">Log Out</button>
</form>
</div>
</div>
</nav>
{% block content %}
{% endblock %}
</main>
......
......@@ -16,3 +16,4 @@ soupsieve==2.5
sqlparse==0.4.4
tzdata==2024.1
urllib3==2.2.1
Pillow==10.2.0
\ 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