Skip to content

Commit

Permalink
Merge pull request #96 from ACMAS/login_tailwind
Browse files Browse the repository at this point in the history
Account System + Tailwind Implementation
  • Loading branch information
jaw12346 authored Oct 24, 2023
2 parents a1b524c + 7a2935e commit 7f1c151
Show file tree
Hide file tree
Showing 63 changed files with 2,863 additions and 40,613 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: github/super-linter@v4
env:
DEFAULT_BRANCH: "main"
FILTER_REGEX_EXCLUDE: (.*./ACMAS/ACMAS_Web/migrations*|.*./ACMAS/app/ACMAS_Web/static/js*|.*./ACMAS/app/ACMAS_Web/static/styles/bootstrap*)
FILTER_REGEX_EXCLUDE: (.*./ACMAS/ACMAS_Web/migrations*|.*./ACMAS/app/ACMAS_Web/static/js*)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: false
VALIDATE_DOCKERFILE_HADOLINT: false # Turns off Dockerfile linter.
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ __pycache__/
env
ACMAS/package-lock.json
ACMAS/package.json
ACMAS/app/db.sqlite3
ACMAS/app/db.sqlite3
ACMAS/node_modules
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"python.analysis.typeCheckingMode": "off",
"liveServer.settings.port": 5501
}
5 changes: 4 additions & 1 deletion ACMAS/.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# 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.60.213.127 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
Expand Down
15 changes: 14 additions & 1 deletion ACMAS/app/ACMAS/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"django.contrib.messages",
"django.contrib.staticfiles",
"ACMAS_Web",
"django_components",
]

MIDDLEWARE = [
Expand All @@ -56,14 +57,23 @@
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
"loaders": [
(
"django.template.loaders.cached.Loader",
[
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
"django_components.template_loader.Loader",
],
)
],
},
},
]
Expand Down Expand Up @@ -132,3 +142,6 @@
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

LOGIN_REDIRECT_URL = "/"
LOGOUT_REDIRECT_URL = "/"
14 changes: 12 additions & 2 deletions ACMAS/app/ACMAS_Web/admin.py
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"
7 changes: 7 additions & 0 deletions ACMAS/app/ACMAS_Web/components/button/button.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<span class="button-component pt-2">
{% 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>
{% 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>
{% endif %}
</span>
14 changes: 14 additions & 0 deletions ACMAS/app/ACMAS_Web/components/button/button.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from django_components import component


@component.register("button")
class Button(component.Component):
template_name = "button/button.html"

def get_context_data(self, text, component_type, value, name=""):
return {
"text": text,
"component_type": component_type,
"value": value,
"name": name,
}
7 changes: 7 additions & 0 deletions ACMAS/app/ACMAS_Web/components/field/field.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="field-component p-0.5">
{% 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 }}">
{% endif %}
</div>
13 changes: 13 additions & 0 deletions ACMAS/app/ACMAS_Web/components/field/field.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from django_components import component


@component.register("field")
class Field(component.Component):
template_name = "field/field.html"

def get_context_data(self, placeholder, name, component_type):
return {
"placeholder": placeholder,
"name": name,
"component_type": component_type,
}
Loading

0 comments on commit 7f1c151

Please sign in to comment.