Skip to content

Commit dd3a00b

Browse files
committed
fix: add missing files for course invitation join; feat: add original requirements; feat: add course visibility and invitations migration
1 parent 527726f commit dd3a00b

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Generated by Django 2.2.28 on 2024-09-09 10:07
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
import django.utils.timezone
6+
import secrets
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('app', '0009_auto_20201009_1001'),
13+
]
14+
15+
operations = [
16+
migrations.AddField(
17+
model_name='course',
18+
name='visible',
19+
field=models.BooleanField(default=True),
20+
),
21+
migrations.CreateModel(
22+
name='Invitation',
23+
fields=[
24+
('key', models.CharField(default=secrets.token_urlsafe, max_length=255, primary_key=True, serialize=False)),
25+
('role', models.CharField(choices=[('ADM', 'Admin'), ('GUE', 'Guest'), ('STU', 'Student'), ('LEC', 'Lecturer'), ('TA', 'Teaching Assistant')], default='STU', max_length=3)),
26+
('valid', models.BooleanField(default=True)),
27+
('created_at', models.DateTimeField(default=django.utils.timezone.now)),
28+
('updated_at', models.DateTimeField(auto_now=True)),
29+
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Course')),
30+
],
31+
),
32+
]

requirements-original.txt

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Django==2.2.28
2+
django-crispy-forms==1.8.1
3+
django-bootstrap-datepicker-plus==3.0.5
4+
django-bootstrap4==1.1.1
5+
django-fontawesome-5==1.0.18
6+
djangorestframework==3.10.3
7+
django-prettyjson==0.4.1
8+
cachetools
9+
git+https://github.com/rizkiarm/django-updateable.git@devel
10+
xlwt
11+
setuptools
12+
python-dotenv

templates/course_join.html

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{% extends 'base.html' %}
2+
3+
{% load crispy_forms_tags %}
4+
5+
{% block extrahead %}
6+
{{ form.media }}
7+
{% endblock %}
8+
9+
{% block title %} Join - {{ course }} - {{ block.super }} {% endblock %}
10+
11+
{% block breadcrumb %}
12+
<li class="breadcrumb-item"><a href="{% url 'courses' %}">Courses</a></li>
13+
<li class="breadcrumb-item">
14+
<a href="{% url 'course' course.pk %}"
15+
>{{ course }}</a
16+
>
17+
</li>
18+
<li class="breadcrumb-item active">Join</li>
19+
{% endblock %}
20+
21+
{% block content %}
22+
<form method="post" novalidate>
23+
{% csrf_token %} {{ form|crispy }}
24+
<button type="submit" class="btn btn-success">Submit</button>
25+
</form>
26+
{% endblock %}

0 commit comments

Comments
 (0)