-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
33 changed files
with
671 additions
and
498 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
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,15 +1,18 @@ | ||
# DO NOT UPLOAD ANY CHANGES TO GITHUB! | ||
DATABASE=postgres | ||
DEBUG=1 | ||
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] 52.60.213.127 www.acmas.systems acmas.systems | ||
DJANGO_ALLOWED_HOSTS='localhost 127.0.0.1 [::1] 52.55.52.58 www.acmas.systems acmas.systems' | ||
DJANGO_EMAIL=[email protected] | ||
DJANGO_PASS=password | ||
DJANGO_USER=acmas_admin | ||
GOOGLE_ADSENSE_ID=INSERT_ID_HERE | ||
GOOGLE_ADSENSE_URL=https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client= | ||
GOOGLE_ANALYTICS_ID=INSERT_ID_HERE | ||
GOOGLE_ANALYTICS_URL=https://www.googletagmanager.com/gtag/js?id= | ||
POSTGRES_DB=acmas_db | ||
POSTGRES_PASSWORD=PASSWORD | ||
POSTGRES_USER=acmas_admin | ||
SECRET_KEY=SECRET_KEY | ||
SQL_DATABASE=acmas_db | ||
SQL_ENGINE=django.db.backends.postgresql | ||
SQL_HOST=db | ||
SQL_PASSWORD=PASSWORD | ||
SQL_PORT=5432 | ||
SQL_USER=acmas_admin |
This file was deleted.
Oops, something went wrong.
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,3 +1,13 @@ | ||
# from django.contrib import admin | ||
from django.contrib import admin | ||
|
||
# Register your models here. | ||
from .models import Course, Question, University, UploadedFile, User | ||
|
||
admin.site.register(Question) | ||
admin.site.register(University) | ||
admin.site.register(Course) | ||
admin.site.register(UploadedFile) | ||
admin.site.register(User) | ||
|
||
admin.site.site_header = "ACMAS Admin" | ||
admin.site.site_title = "ACMAS Admin Portal" | ||
admin.site.index_title = "Welcome to the ACMAS Administration Portal" |
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,7 +1,7 @@ | ||
<span class="button-component pt-2"> | ||
<span class="button-component"> | ||
{% if component_type == "primary" %} | ||
<button type="submit" class="px-4 py-2 rounded-xl text-white text-semibold text-lg bg-blue-600 hover:bg-blue-700 transition ease-in duration-200" value="{{ value }}" name="{{ name }}">{{ text }}</button> | ||
<button type="submit" class="px-5 py-3 rounded-xl text-white font-semibold text-lg bg-blue-600 hover:bg-blue-700 transition ease-in duration-200" value="{{ value }}" name="{{ name }}">{{ text }}</button> | ||
{% elif component_type == "secondary" %} | ||
<button type="submit" class="px-4 py-2 rounded-xl text-gray-700 text-semibold border border-gray-300 text-lg bg-white hover:bg-gray-100 transition ease-in duration-200" value="{{ value }}" name="{{ name }}">{{ text }}</button> | ||
<button type="submit" class="px-5 py-3 rounded-xl text-gray-700 font-semibold border border-gray-300 text-lg bg-white hover:bg-gray-100 transition ease-in duration-200" value="{{ value }}" name="{{ name }}">{{ text }}</button> | ||
{% endif %} | ||
</span> |
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,7 +1,47 @@ | ||
<div class="field-component p-0.5"> | ||
{% load component_tags %} | ||
|
||
<div class="field-component relative flex bg-gray-100 p-4 h-14 space-x-4 rounded-lg w-full items-center"> | ||
{% if component_type == "input" %} | ||
<input type="file" class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400" name="{{ name }}"> | ||
{% else %} | ||
<input type="text" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" name="{{ name }}" placeholder="{{ placeholder }}"> | ||
<input type="file" class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 focus:outline-none" name="{{ name }}"> | ||
{% else %} | ||
{% if icon_name != "" %} | ||
{% component "icon" icon=icon_name icon_type="mini" icon_class="w-6 h-6 flex-shrink-0 text-gray-400" %} | ||
{% endif %} | ||
<input type="{{ component_type }}" class="peer bg-gray-100 outline-none border-0 w-full ring-0 focus:ring-0" name="{{ name }}" placeholder="{{ placeholder }}" /> | ||
{% endif %} | ||
{% if name == "password1" and placeholder == "Create password..." %} | ||
<div class="-left-48 absolute invisible peer-focus:visible"> | ||
<div class="w-40 h-40 flex flex-col bg-white text-gray-600 text-xs rounded-xl text-left p-4 border border-light-gray z-50 justify-items-center"> | ||
<p class="text-center">Password can't be:</p> | ||
<ul class="list-disc pl-2 gap-y-2"> | ||
<li>too similar to other personal information</li> | ||
<li>less than 8 characters </li> | ||
<li>be a commonly used password</li> | ||
<li>entirely numeric</li> | ||
</ul> | ||
</div> | ||
<div class="relative z-30"> | ||
<div class="flex left-full -ml-3 bottom-20 absolute z-0"> | ||
<div class="h-4 w-4 origin-bottom-left rotate-45 transform border border-light-gray bg-white border-b-white border-l-white"></div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% if name == "username" and placeholder == "Create username..." %} | ||
<div class="absolute -left-48 invisible peer-focus:visible"> | ||
<div class="w-40 h-40 flex-col flex bg-white text-gray-600 text-xs rounded-xl text-left p-4 border border-light-gray z-50 justify-items-center"> | ||
<p class="text-center">Required</p> | ||
<ul class="pl-2 list-disc gap-y-2"> | ||
<li>150 characters or fewer</li> | ||
<li>Letters, digits and @/./+/-/_ only</li> | ||
<li>Must not be fully numeric</li> | ||
</ul> | ||
</div> | ||
<div class="z-30 relative"> | ||
<div class="flex -ml-3 left-full bottom-20 absolute z-0"> | ||
<div class="w-4 h-4 origin-bottom-left rotate-45 transform border border-light-gray bg-white border-b-white border-l-white"></div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endif %} | ||
</div> |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django import forms | ||
from django.contrib.auth.forms import UserCreationForm | ||
from django.contrib.auth.models import User | ||
|
||
|
||
class RegisterForm(UserCreationForm): | ||
email = forms.EmailField() | ||
|
||
class Meta: | ||
model = User | ||
fields = ["username", "email", "password1", "password2"] |
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,31 @@ | ||
import os | ||
|
||
from django.contrib.auth import get_user_model | ||
from django.core.management.base import BaseCommand | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "Creates an admin user non-interactively if it doesn't exist" | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument("--username", help="Admin's username") | ||
parser.add_argument("--email", help="Admin's email") | ||
parser.add_argument("--password", help="Admin's password") | ||
parser.add_argument( | ||
"--no-input", help="Read options from the environment", action="store_true" | ||
) | ||
|
||
def handle(self, *args, **options): | ||
User = get_user_model() | ||
|
||
if options["no_input"]: | ||
options["username"] = os.environ["$DJANGO_USER"] | ||
options["email"] = os.environ["DJANGO_SUPERUSER_EMAIL"] | ||
options["password"] = os.environ["DJANGO_SUPERUSER_PASSWORD"] | ||
|
||
if not User.objects.filter(username=options["username"]).exists(): | ||
User.objects.create_superuser( | ||
username=options["username"], | ||
email=options["email"], | ||
password=options["password"], | ||
) |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.