mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-04 22:28:21 +00:00
Compare commits
12 Commits
ff780f2042
...
d1069a1745
| Author | SHA1 | Date | |
|---|---|---|---|
|
d1069a1745
|
|||
|
238d53a547
|
|||
|
8756e7f880
|
|||
|
25c9cf25f7
|
|||
|
ad66f434de
|
|||
|
1aae2bff28
|
|||
|
9302cccd58
|
|||
|
123c8bfd80
|
|||
|
02af3870aa
|
|||
|
6d3a861df5
|
|||
|
0e07c50c18
|
|||
|
8505d5e93a
|
24
.github/workflows/django.yml
vendored
24
.github/workflows/django.yml
vendored
@@ -14,21 +14,12 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache Static Files
|
||||
id: static-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: 'static/'
|
||||
key: ${{ hashFiles('package-lock.json') }}-${{ hashFiles('pipeline/source_assets') }}
|
||||
- uses: bahmutov/npm-install@v1
|
||||
if: steps.static-cache.outputs.cache-hit != 'true'
|
||||
- run: node node_modules/gulp/bin/gulp build
|
||||
if: steps.static-cache.outputs.cache-hit != 'true'
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: Cache python deps
|
||||
id: pcache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.pythonLocation }}
|
||||
@@ -43,7 +34,18 @@ jobs:
|
||||
pipenv run pycodestyle . --exclude=migrations,node_modules
|
||||
pipenv run python manage.py check
|
||||
pipenv run python manage.py makemigrations --check --dry-run
|
||||
pipenv run python manage.py collectstatic --noinput
|
||||
- name: Cache Static Files
|
||||
id: static-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: 'static/'
|
||||
key: ${{ hashFiles('package-lock.json') }}-${{ hashFiles('pipeline/source_assets') }}
|
||||
- uses: bahmutov/npm-install@v1
|
||||
if: steps.static-cache.outputs.cache-hit != 'true'
|
||||
- run: node node_modules/gulp/bin/gulp build
|
||||
if: steps.static-cache.outputs.cache-hit != 'true'
|
||||
- run: pipenv run python manage.py collectstatic --noinput
|
||||
if: steps.static-cache.outputs.cache-hit != 'true'
|
||||
- name: Run Tests
|
||||
run: pipenv run pytest -n auto -vv --cov
|
||||
- uses: actions/upload-artifact@v2
|
||||
|
||||
@@ -9,23 +9,18 @@ https://docs.djangoproject.com/en/1.7/ref/settings/
|
||||
"""
|
||||
|
||||
import datetime
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
import os
|
||||
from pathlib import Path
|
||||
import secrets
|
||||
|
||||
import sentry_sdk
|
||||
from sentry_sdk.integrations.django import DjangoIntegration
|
||||
from envparse import env
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = env('SECRET_KEY', default='gxhy(a#5mhp289_=6xx$7jh=eh$ymxg^ymc+di*0c*geiu3p_e')
|
||||
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = env('DEBUG', cast=bool, default=True)
|
||||
STAGING = env('STAGING', cast=bool, default=False)
|
||||
@@ -97,7 +92,7 @@ WSGI_APPLICATION = 'PyRIGS.wsgi.application'
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||
'NAME': str(BASE_DIR / 'db.sqlite3'),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,19 +230,16 @@ DATETIME_INPUT_FORMATS = ('%Y-%m-%dT%H:%M', '%Y-%m-%dT%H:%M:%S')
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
||||
STATIC_URL = '/static/'
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
|
||||
STATIC_DIRS = [
|
||||
os.path.join(BASE_DIR, 'static/'),
|
||||
]
|
||||
STATIC_ROOT = str(BASE_DIR / 'static/')
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, 'pipeline/built_assets'),
|
||||
str(BASE_DIR / 'pipeline/built_assets'),
|
||||
]
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [
|
||||
os.path.join(BASE_DIR, 'templates')
|
||||
BASE_DIR / 'templates'
|
||||
],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
|
||||
@@ -27,13 +27,14 @@ urlpatterns = [
|
||||
path('', include('users.urls')),
|
||||
|
||||
path('admin/', admin.site.urls),
|
||||
path("robots.txt", TemplateView.as_view(template_name="robots.txt", content_type="text/plain")),
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
|
||||
import debug_toolbar
|
||||
urlpatterns = [
|
||||
urlpatterns += [
|
||||
path('__debug__/', include(debug_toolbar.urls)),
|
||||
path('bootstrap/', TemplateView.as_view(template_name="bootstrap.html")),
|
||||
] + urlpatterns
|
||||
]
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 28 KiB |
BIN
RIGS/static/imgs/logo.webp
Normal file
BIN
RIGS/static/imgs/logo.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
@@ -44,9 +44,10 @@ function scripts() {
|
||||
const base_scripts = ["src.js", "util.js", "alert.js", "collapse.js", "dropdown.js", "modal.js", "konami.js"];
|
||||
const bs_select = ["bootstrap-select.js", "ajax-bootstrap-select.js"]
|
||||
const interaction = ["html5sortable.min.js", "interaction.js"]
|
||||
return gulp.src(['node_modules/jquery/dist/jquery.js',
|
||||
const jpop = ["jquery.min.js", "popper.min.js"]
|
||||
return gulp.src(['node_modules/jquery/dist/jquery.min.js',
|
||||
/* JQuery Plugins */
|
||||
'node_modules/popper.js/dist/umd/popper.js',
|
||||
'node_modules/popper.js/dist/umd/popper.min.js',
|
||||
/* Bootstrap Plugins */
|
||||
'node_modules/bootstrap/js/dist/util.js',
|
||||
'node_modules/bootstrap/js/dist/tooltip.js',
|
||||
@@ -68,6 +69,7 @@ function scripts() {
|
||||
.pipe(gulpif(function(file) { return base_scripts.includes(file.relative);}, con('base.js')))
|
||||
.pipe(gulpif(function(file) { return bs_select.includes(file.relative);}, con('selects.js')))
|
||||
.pipe(gulpif(function(file) { return interaction.includes(file.relative);}, con('interaction.js')))
|
||||
.pipe(gulpif(function(file) { return jpop.includes(file.relative);}, con('jpop.js')))
|
||||
.pipe(flatten())
|
||||
.pipe(terser())
|
||||
.pipe(gulp.dest(dest))
|
||||
|
||||
@@ -15,14 +15,13 @@
|
||||
|
||||
<link rel="icon" type="image/png" href="{% static 'imgs/pyrigs-avatar.png' %}">
|
||||
<link rel="apple-touch-icon" href="{% static 'imgs/pyrigs-avatar.png' %}">
|
||||
<link href="{% static 'fonts/OpenSans-Regular.tff' %}">
|
||||
<link rel="preload" href="{% static 'fonts/fa-solid-900.woff2' %}" as="font" type="font/woff2" crossorigin>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'css/screen.css' %}">
|
||||
{% block css %}
|
||||
{% endblock %}
|
||||
|
||||
<script src="{% static 'js/jquery.js' %}"></script>
|
||||
<script src="{% static 'js/popper.js' %}"></script>
|
||||
<script src="{% static 'js/jpop.js' %}"></script>
|
||||
{% block preload_js %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -35,7 +34,7 @@
|
||||
{% block navbar %}
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark flex-nowrap" role="navigation">
|
||||
<a class="navbar-brand" href="{% if request.user.is_authenticated %}https://members.nottinghamtec.co.uk{%else%}https://nottinghamtec.co.uk{%endif%}">
|
||||
<img src="{% static 'imgs/logo.png' %}" width="40" height="40" alt="TEC's Logo: Serif 'TEC' vertically next to a blue box with the words 'PA and Lighting', surrounded by graduated rings">
|
||||
<img src="{% static 'imgs/logo.webp' %}" width="40" height="40" alt="TEC's Logo: Serif 'TEC' vertically next to a blue box with the words 'PA and Lighting', surrounded by graduated rings">
|
||||
</a>
|
||||
<div class="container">
|
||||
{% block titleheader %}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<a class="list-group-item list-group-item-action" href="https://forum.nottinghamtec.co.uk" target="_blank" rel="noopener noreferrer"><span class="fas fa-comment-alt text-info align-middle"></span><span class="align-middle"> TEC Forum</span></a>
|
||||
<a class="list-group-item list-group-item-action" href="//wiki.nottinghamtec.co.uk" target="_blank" rel="noopener noreferrer"><span class="fas fa-pen-square align-middle"></span><span class="align-middle"> TEC Wiki</span></a>
|
||||
{% if perms.RIGS.view_event %}
|
||||
<a class="list-group-item list-group-item-action" href="//members.nottinghamtec.co.uk/price" target="_blank"><span class="fas fa-pound-sign text-warning align-middle"></span><span class="align-middle"> Price List</span></a>
|
||||
<a class="list-group-item list-group-item-action" href="//members.nottinghamtec.co.uk/price" target="_blank" rel="noopener noreferrer"><span class="fas fa-pound-sign text-warning align-middle"></span><span class="align-middle"> Price List</span></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
2
templates/robots.txt
Normal file
2
templates/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
Reference in New Issue
Block a user