UI: Training templates fluid video layouts #104435

Merged
Márton Lente merged 13 commits from ui/training-layout-fluid into main 2024-08-23 16:50:27 +02:00
7 changed files with 47 additions and 43 deletions
Showing only changes of commit fa65203506 - Show all commits

View File

@ -72,8 +72,8 @@
</a> </a>
</li> </li>
<li> <li>
<a href="https://twitter.com/BlenderStudio_" title="Follow Blender Studio on Twitter" target="_blank" class="social-icons__twitter"> <a href="https://x.com/BlenderStudio_" title="Follow Blender Studio on X" target="_blank" class="social-icons__twitter">
<i class="i-twitter"></i>Twitter <i class="i-twitter"></i>X
</a> </a>
</li> </li>
<li> <li>

View File

@ -1,32 +1,31 @@
<nav> <nav>
<ul class="pagination"> <ul class="pagination">
{% if page_obj.has_previous %} {% if page_obj.has_previous %}
<li class="page-item page-next"> {% if not page_obj.previous_page_number == 1 %}
<a href="?page=1"> <li class="page-item page-first">
<i class="i-skip-forward d-block" style="transform: scaleX(-1)"></i> <a href="?page=1">First</a>
</a> </li>
{% endif %}
<li class="page-item page-prev">
<a href="?page={{ page_obj.previous_page_number }}"><i class="i-chevron-left"></i> Previous</a>
</li> </li>
{% endif %} {% endif %}
{% for page_num in page_range %} <li class="page-item page-current">
{% if page_num == page_obj.number %} <a href="#">Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</a>
<li class="active disabled page-item"> </li>
<a href="#">{{ page_obj.number }}</a>
</li>
{% else %}
<li class="page-item">
<a href="?page={{ page_num }}">{{page_num}}</a>
</li>
{% endif %}
{% endfor %}
{% if page_obj.has_next %} {% if page_obj.has_next %}
<li class="page-item page-prev"> <li class="page-item page-next">
<a href="?page={{ page_obj.paginator.num_pages }}"> <a href="?page={{ page_obj.next_page_number }}">Next <i class="i-chevron-right"></i></a>
<i class="i-skip-forward"></i>
</a>
</li> </li>
{% if not page_obj.next_page_number == page_obj.paginator.num_pages %}
<li class="page-item page-last">
<a href="?page={{ page_obj.paginator.num_pages }}">Last</a>
</li>
{% endif %}
{% endif %} {% endif %}
</ul> </ul>
</nav> </nav>

@ -1 +1 @@
Subproject commit 23fdb84a86ac1ada1eb06152a76f655307a9e82f Subproject commit 666ff483b500b3b417c617596ddeebe58afb718d

View File

@ -81,7 +81,6 @@ pypdf==4.2.0
pypng==0.20220715.0 pypng==0.20220715.0
python-bidi==0.4.2 python-bidi==0.4.2
python-dateutil==2.8.2 python-dateutil==2.8.2
python-dotenv==0.21.0
python-monkey-business==1.0.0 python-monkey-business==1.0.0
python-stdnum==1.18 python-stdnum==1.18
pytz==2022.7.1 pytz==2022.7.1

View File

@ -34,6 +34,7 @@ pycodestyle==2.7.0
pydocstyle==6.1.1 pydocstyle==6.1.1
pyflakes==2.3.1 pyflakes==2.3.1
Pygments==2.13.0 Pygments==2.13.0
python-dotenv==0.21.0
responses==0.25.3 responses==0.25.3
snowballstemmer==2.2.0 snowballstemmer==2.2.0
tblib==3.0.0 tblib==3.0.0

View File

@ -9,7 +9,6 @@ import os
import pathlib import pathlib
import sys import sys
from dotenv import load_dotenv
import braintree import braintree
import dj_database_url import dj_database_url
import meilisearch import meilisearch
@ -17,10 +16,14 @@ import meilisearch
import common.upload_paths import common.upload_paths
# Load variables from .env, if available try:
path = os.path.dirname(os.path.abspath(__file__)) + '/../.env' from dotenv import load_dotenv
if os.path.isfile(path): # Load variables from .env, if available
load_dotenv(path) path = os.path.dirname(os.path.abspath(__file__)) + '/../.env'
if os.path.isfile(path):
load_dotenv(path)
except ImportError: # This is expected: there should be no python-dotenv in production
pass
def _get(name: str, default=None, coerse_to=None): def _get(name: str, default=None, coerse_to=None):
@ -319,6 +322,11 @@ LOGGING = {
'formatter': 'default', # Set to 'verbose' in production 'formatter': 'default', # Set to 'verbose' in production
'stream': 'ext://sys.stderr', 'stream': 'ext://sys.stderr',
}, },
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
'include_html': True,
},
}, },
'loggers': { 'loggers': {
'asyncio': {'level': 'WARNING'}, 'asyncio': {'level': 'WARNING'},
@ -328,7 +336,7 @@ LOGGING = {
'static_assets': {'level': 'DEBUG'}, 'static_assets': {'level': 'DEBUG'},
'looper': {'level': 'DEBUG'}, 'looper': {'level': 'DEBUG'},
}, },
'root': {'level': 'WARNING', 'handlers': ['console']}, 'root': {'level': 'WARNING', 'handlers': ['console', 'mail_admins']},
} }
SITE_ID = 1 SITE_ID = 1
@ -512,8 +520,14 @@ GATEWAYS = {
}, },
} }
# Optional Sentry configuration if os.environ.get('ADMINS') is not None:
# Expects the following format:
# ADMINS='J Doe: jane@example.com, John Dee: john@example.com'
ADMINS = [[_.strip() for _ in adm.split(':')] for adm in os.environ.get('ADMINS').split(',')]
EMAIL_SUBJECT_PREFIX = f'[{ALLOWED_HOSTS[0]}]'
SERVER_EMAIL = f'django@{ALLOWED_HOSTS[0]}'
# Optional Sentry configuration
SENTRY_DSN = _get('SENTRY_DSN') SENTRY_DSN = _get('SENTRY_DSN')
if SENTRY_DSN: if SENTRY_DSN:
import sentry_sdk import sentry_sdk

View File

@ -1,5 +1,5 @@
""" """
WSGI config for training project. WSGI config for Blender Studio project.
It exposes the WSGI callable as a module-level variable named ``application``. It exposes the WSGI callable as a module-level variable named ``application``.
@ -8,18 +8,9 @@ https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
""" """
import os import os
import os.path
import pathlib
from django.core.wsgi import get_wsgi_application from django.core.wsgi import get_wsgi_application
from dotenv import load_dotenv
BASE_DIR = pathlib.Path(__file__).absolute().parent.parent
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studio.settings') os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studio.settings')
# Load variables from .env, if available
path = BASE_DIR / '.env'
if os.path.isfile(path):
load_dotenv(path)
application = get_wsgi_application() application = get_wsgi_application()