-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c41fbe
commit 0a6380c
Showing
7 changed files
with
211 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
from django.contrib import admin | ||
from embedathon.models import EmbedathonUser | ||
from embedathon.models import Invite | ||
from embedathon.models import Team | ||
|
||
# Register your models here. | ||
|
||
admin.site.register(EmbedathonUser) | ||
admin.site.register(Team) | ||
admin.site.register(Invite) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
corpus/embedathon/migrations/0002_team_invite_embedathonuser_team.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Generated by Django 4.2.4 on 2023-12-11 13:19 | ||
import django.db.models.deletion | ||
from django.conf import settings | ||
from django.db import migrations | ||
from django.db import models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
("embedathon", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Team", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("team_name", models.CharField(max_length=200)), | ||
( | ||
"team_leader", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="leader", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name="Invite", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("invite_email", models.EmailField(max_length=254)), | ||
( | ||
"inviting_team", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="invite_to_team", | ||
to="embedathon.team", | ||
), | ||
), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name="embedathonuser", | ||
name="team", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="team", | ||
to="embedathon.team", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,65 @@ | ||
{% extends 'base.html' %} | ||
|
||
{% block title %} | ||
Embedathon | ||
Embedathon | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="prose w-2/3 mx-auto my-10"> | ||
<h1>Welcome to Embedathon!</h1> | ||
</div> | ||
{% endblock %} | ||
<div class="prose w-2/3 mx-auto my-10"> | ||
<h1>Welcome to Embedathon!</h1> | ||
<div class="grid gap-4 sm:grid-cols-1 md:grid-cols-2"> | ||
<div> | ||
<div class="card"> | ||
<div class="card-body"> | ||
{% if in_team %} | ||
<h2>You are already in a team.</h2> | ||
{% else %} | ||
<div> | ||
<h3>Current Invites</h3> | ||
{% if invites %} | ||
<ul> | ||
{% for invite in invites %} | ||
<li> | ||
<a href="#"> | ||
{{ invite.team.name }} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% else %} | ||
<p>You have no invites.</p> | ||
{% endif %} | ||
</div> | ||
<div class="flex flex-col w-full"> | ||
<div class="divider divider-primary">OR</div> | ||
</div> | ||
<div> | ||
<h3>Create a team</h3> | ||
<form method="post" action="{% url 'embedathon_create_team' %}"> | ||
{% csrf_token %} | ||
|
||
<div class="w-full my-2"> | ||
<label for="{{ team_creation_form.team_name.id_for_label }}">Team Name</label> | ||
{{ team_creation_form.team_name }} | ||
{% if team_creation_form.team_name.errors %} | ||
<div class="my-1"> | ||
<div role="alert" class="alert alert-error"> | ||
{{ team_creation_form.team_name.errors }} | ||
</div> | ||
</div> | ||
{% endif %} | ||
</div> | ||
|
||
<div class="card-actions mt-5"> | ||
<button class="btn btn-primary btn-block">Create Team</button> | ||
</div> | ||
</form> | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
<div></div> | ||
</div> | ||
</div> | ||
{% endblock %} |