Merge remote-tracking branch 'origin/master' into app-integration

This commit is contained in:
Paul Konstantin Gerke 2022-10-17 07:11:58 +02:00
commit 5e2b847ed8
158 changed files with 17609 additions and 16765 deletions

1
.buildpacks Normal file
View File

@ -0,0 +1 @@
https://github.com/heroku/heroku-buildpack-python.git

View File

@ -1,6 +1,57 @@
# Changelog # Changelog
## [v1.12.2](https://github.com/babybuddy/babybuddy/tree/v1.12.2) ## [v1.13.2](https://github.com/babybuddy/babybuddy/tree/v1.13.2) (2022-10-15)
[Full Changelog](https://github.com/babybuddy/babybuddy/compare/v1.13.1...v1.13.2)
**Implemented enhancements:**
- Staff users added via CLI should also be superuser [\#543](https://github.com/babybuddy/babybuddy/issues/543)
## [v1.13.1](https://github.com/babybuddy/babybuddy/tree/v1.13.1) (2022-10-13)
[Full Changelog](https://github.com/babybuddy/babybuddy/compare/v1.13.0...v1.13.1)
**Fixed bugs:**
- Database Admin: 500 Error v1.13.0 [\#540](https://github.com/babybuddy/babybuddy/issues/540)
## [v1.13.0](https://github.com/babybuddy/babybuddy/tree/v1.13.0) (2022-10-12)
[Full Changelog](https://github.com/babybuddy/babybuddy/compare/v1.12.2...v1.13.0)
**Implemented enhancements:**
- Dutch Translations updated on POEditor [\#535](https://github.com/babybuddy/babybuddy/issues/535)
- Delete Inactive Timers shouldn't appear if there are no timer entries [\#533](https://github.com/babybuddy/babybuddy/issues/533)
- Create a user add management command [\#528](https://github.com/babybuddy/babybuddy/issues/528)
- French translations updated on POEditor [\#521](https://github.com/babybuddy/babybuddy/issues/521)
- Allow REMOTE\_USER authentication [\#517](https://github.com/babybuddy/babybuddy/issues/517)
- "Recently used" shouldn't appear if no tags were recently used [\#470](https://github.com/babybuddy/babybuddy/issues/470)
- Minutes instead of minutos in Spanish [\#468](https://github.com/babybuddy/babybuddy/issues/468)
- Delete \(instead of deactivate\) completed timers [\#109](https://github.com/babybuddy/babybuddy/issues/109)
- \#468 Minutes instead of minutos in Spanish [\#538](https://github.com/babybuddy/babybuddy/pull/538) ([jmunoz94](https://github.com/jmunoz94))
- 533 - Delete Inactive Timers shouldn't appear if there are no timer entries [\#537](https://github.com/babybuddy/babybuddy/pull/537) ([earthcomfy](https://github.com/earthcomfy))
- 470 - "Recently used" shouldn't appear if no tags were recently used [\#536](https://github.com/babybuddy/babybuddy/pull/536) ([earthcomfy](https://github.com/earthcomfy))
- 528 - Create a user add management command [\#534](https://github.com/babybuddy/babybuddy/pull/534) ([earthcomfy](https://github.com/earthcomfy))
- Add forward auth by way of remote user [\#531](https://github.com/babybuddy/babybuddy/pull/531) ([EnsuingRequiem](https://github.com/EnsuingRequiem))
- Install GNU gettext at gitpod startup [\#519](https://github.com/babybuddy/babybuddy/pull/519) ([amorphobia](https://github.com/amorphobia))
- Update Chinese translations [\#518](https://github.com/babybuddy/babybuddy/pull/518) ([amorphobia](https://github.com/amorphobia))
**Fixed bugs:**
- Data mismatch [\#520](https://github.com/babybuddy/babybuddy/issues/520)
- Data mismatch - Issue \#520 [\#527](https://github.com/babybuddy/babybuddy/pull/527) ([matthieu-kr](https://github.com/matthieu-kr))
**Closed issues:**
- Feeding via API returns 400 [\#522](https://github.com/babybuddy/babybuddy/issues/522)
**Merged pull requests:**
- Dokku [\#526](https://github.com/babybuddy/babybuddy/pull/526) ([cdubz](https://github.com/cdubz))
## [v1.12.2](https://github.com/babybuddy/babybuddy/tree/v1.12.2) (2022-08-04)
[Full Changelog](https://github.com/babybuddy/babybuddy/compare/v1.12.1...v1.12.2) [Full Changelog](https://github.com/babybuddy/babybuddy/compare/v1.12.1...v1.12.2)
@ -26,7 +77,6 @@
**Fixed bugs:** **Fixed bugs:**
- Bug - DateTime fields don't load the current values when the language is Portuguese [\#498](https://github.com/babybuddy/babybuddy/issues/498)
- Set default date during picker initialization [\#505](https://github.com/babybuddy/babybuddy/pull/505) ([cdubz](https://github.com/cdubz)) - Set default date during picker initialization [\#505](https://github.com/babybuddy/babybuddy/pull/505) ([cdubz](https://github.com/cdubz))
**Closed issues:** **Closed issues:**

View File

@ -1,6 +1,7 @@
[[source]] [[source]]
verify_ssl = true verify_ssl = true
url = "https://pypi.python.org/simple" url = "https://pypi.python.org/simple"
name = "pypi"
[packages] [packages]
boto3 = "*" boto3 = "*"

View File

@ -86,6 +86,7 @@ adding it here or reach out via GitHub Issues or Discussions or on Gitter!
- [Sandstorm app](https://github.com/babybuddy/babybuddy-sandstorm) - [Sandstorm app](https://github.com/babybuddy/babybuddy-sandstorm)
- [iOS shortcuts](https://github.com/babybuddy/babybuddy/discussions/300) - [iOS shortcuts](https://github.com/babybuddy/babybuddy/discussions/300)
- Newborn parenting software - [part 1](https://lutzky.net/2021/10/03/software-parenting-1/), [part 2](https://lutzky.net/2021/10/05/software-parenting-2/), [part 3](https://lutzky.net/2021/10/10/software-parenting-3/) (API, buttons, LCD information screen!) - Newborn parenting software - [part 1](https://lutzky.net/2021/10/03/software-parenting-1/), [part 2](https://lutzky.net/2021/10/05/software-parenting-2/), [part 3](https://lutzky.net/2021/10/10/software-parenting-3/) (API, buttons, LCD information screen!)
- [Quick Entry Keypad for BabyBuddy and Home Assistant with ESPHome](https://github.com/sfgabe/OITProjects/tree/master/Baby_Buddy_Keypad)
## Reporting Vulnerabilities ## Reporting Vulnerabilities

View File

@ -46,7 +46,7 @@
""" # noqa """ # noqa
__title__ = "Baby Buddy" __title__ = "Baby Buddy"
__version__ = "1.12.2" __version__ = "1.13.2"
__license__ = "BSD 2-Clause" __license__ = "BSD 2-Clause"
VERSION = __version__ VERSION = __version__

View File

@ -20,6 +20,7 @@ class UserAddForm(UserCreationForm):
def save(self, commit=True): def save(self, commit=True):
user = super(UserAddForm, self).save(commit=False) user = super(UserAddForm, self).save(commit=False)
# All Baby Buddy users are superusers.
user.is_superuser = True user.is_superuser = True
if commit: if commit:
user.save() user.save()

View File

@ -0,0 +1,166 @@
# -*- coding: utf-8 -*-
"""
Management utility to create users
Example usage:
manage.py createuser \
--username test \
--email test@test.test \
--is-staff
"""
import sys
import getpass
from django.contrib.auth import get_user_model
from django.contrib.auth.password_validation import validate_password
from django.core import exceptions
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
from django.utils.functional import cached_property
from django.utils.text import capfirst
class NotRunningInTTYException(Exception):
pass
class Command(BaseCommand):
help = "Used to create a user"
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.UserModel = get_user_model()
self.username_field = self.UserModel._meta.get_field(
self.UserModel.USERNAME_FIELD
)
def add_arguments(self, parser):
parser.add_argument(
f"--{self.UserModel.USERNAME_FIELD}",
help="Specifies the login for a user.",
)
parser.add_argument(
"--email",
dest="email",
default="",
help="Specifies the email for the user. Optional.",
)
parser.add_argument(
"--password",
dest="password",
help="Specifies the password for the user. Optional.",
)
parser.add_argument(
"--is-staff",
dest="is_staff",
action="store_true",
default=False,
help="Specifies the staff status for the user. Default is False.",
)
def handle(self, *args, **options):
username = options.get(self.UserModel.USERNAME_FIELD)
password = options.get("password")
user_data = {}
user_password = ""
verbose_field_name = self.username_field.verbose_name
try:
error_msg = self._validate_username(
username, verbose_field_name, DEFAULT_DB_ALIAS
)
if error_msg:
raise CommandError(error_msg)
user_data[self.UserModel.USERNAME_FIELD] = username
# Prompt for a password interactively (if password not set via arg)
while password is None:
password = getpass.getpass()
password2 = getpass.getpass("Password (again): ")
if password.strip() == "":
self.stderr.write("Error: Blank passwords aren't allowed.")
password = None
# Don't validate blank passwords.
continue
if password != password2:
self.stderr.write("Error: Your passwords didn't match.")
password = None
password2 = None
# Don't validate passwords that don't match.
continue
try:
validate_password(password2, self.UserModel(**user_data))
except exceptions.ValidationError as err:
self.stderr.write("\n".join(err.messages))
response = input(
"Bypass password validation and create user anyway? [y/N]: "
)
if response.lower() != "y":
password = None
password2 = None
continue
user_password = password
user = self.UserModel._default_manager.db_manager(
DEFAULT_DB_ALIAS
).create_user(**user_data, password=user_password)
user.email = options.get("email")
user.is_staff = options.get("is_staff")
# All Baby Buddy users are superusers.
user.is_superuser = True
user.save()
if options.get("verbosity") > 0:
self.stdout.write(f"User {username} created successfully.")
except KeyboardInterrupt:
self.stderr.write("\nOperation cancelled.")
sys.exit(1)
except exceptions.ValidationError as e:
raise CommandError("; ".join(e.messages))
except NotRunningInTTYException:
self.stdout.write(
"User creation skipped due to not running in a TTY. "
"You can run `manage.py createuser` in your project "
"to create one manually."
)
@cached_property
def username_is_unique(self):
"""
Check if username is unique.
"""
if self.username_field.unique:
return True
return any(
len(unique_constraint.fields) == 1
and unique_constraint.fields[0] == self.username_field.name
for unique_constraint in self.UserModel._meta.total_unique_constraints
)
def _validate_username(self, username, verbose_field_name, database):
"""
Validate username. If invalid, return a string error message.
"""
if self.username_is_unique:
try:
self.UserModel._default_manager.db_manager(database).get_by_natural_key(
username
)
except self.UserModel.DoesNotExist:
pass
else:
return f"Error: The {verbose_field_name} is already taken."
if not username:
return f"{capfirst(verbose_field_name)} cannot be blank."
try:
self.username_field.clean(username, None)
except exceptions.ValidationError as e:
return "; ".join(e.messages)

View File

@ -1,4 +1,5 @@
import time from os import getenv
from time import time
import pytz import pytz
@ -6,6 +7,7 @@ from django.conf import settings
from django.utils import timezone, translation from django.utils import timezone, translation
from django.conf.locale.en import formats as formats_en_us from django.conf.locale.en import formats as formats_en_us
from django.conf.locale.en_GB import formats as formats_en_gb from django.conf.locale.en_GB import formats as formats_en_gb
from django.contrib.auth.middleware import RemoteUserMiddleware
def update_en_us_date_formats(): def update_en_us_date_formats():
@ -134,12 +136,20 @@ class RollingSessionMiddleware:
session_refresh = request.session.get("session_refresh") session_refresh = request.session.get("session_refresh")
if session_refresh: if session_refresh:
try: try:
delta = int(time.time()) - session_refresh delta = int(time()) - session_refresh
except (ValueError, TypeError): except (ValueError, TypeError):
delta = settings.ROLLING_SESSION_REFRESH + 1 delta = settings.ROLLING_SESSION_REFRESH + 1
if delta > settings.ROLLING_SESSION_REFRESH: if delta > settings.ROLLING_SESSION_REFRESH:
request.session["session_refresh"] = int(time.time()) request.session["session_refresh"] = int(time())
request.session.set_expiry(settings.SESSION_COOKIE_AGE) request.session.set_expiry(settings.SESSION_COOKIE_AGE)
else: else:
request.session["session_refresh"] = int(time.time()) request.session["session_refresh"] = int(time())
return self.get_response(request) return self.get_response(request)
class CustomRemoteUser(RemoteUserMiddleware):
"""
Middleware used for remote authentication when `REVERSE_PROXY_AUTH` is True.
"""
header = getenv("PROXY_HEADER", "HTTP_REMOTE_USER")

View File

@ -0,0 +1,470 @@
# Generated by Django 4.1.2 on 2022-10-12 02:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("babybuddy", "0022_alter_settings_language"),
]
operations = [
migrations.AlterField(
model_name="settings",
name="timezone",
field=models.CharField(
choices=[
("Africa/Abidjan", "Africa/Abidjan"),
("Africa/Accra", "Africa/Accra"),
("Africa/Addis_Ababa", "Africa/Addis_Ababa"),
("Africa/Algiers", "Africa/Algiers"),
("Africa/Asmara", "Africa/Asmara"),
("Africa/Bamako", "Africa/Bamako"),
("Africa/Bangui", "Africa/Bangui"),
("Africa/Banjul", "Africa/Banjul"),
("Africa/Bissau", "Africa/Bissau"),
("Africa/Blantyre", "Africa/Blantyre"),
("Africa/Brazzaville", "Africa/Brazzaville"),
("Africa/Bujumbura", "Africa/Bujumbura"),
("Africa/Cairo", "Africa/Cairo"),
("Africa/Casablanca", "Africa/Casablanca"),
("Africa/Ceuta", "Africa/Ceuta"),
("Africa/Conakry", "Africa/Conakry"),
("Africa/Dakar", "Africa/Dakar"),
("Africa/Dar_es_Salaam", "Africa/Dar_es_Salaam"),
("Africa/Djibouti", "Africa/Djibouti"),
("Africa/Douala", "Africa/Douala"),
("Africa/El_Aaiun", "Africa/El_Aaiun"),
("Africa/Freetown", "Africa/Freetown"),
("Africa/Gaborone", "Africa/Gaborone"),
("Africa/Harare", "Africa/Harare"),
("Africa/Johannesburg", "Africa/Johannesburg"),
("Africa/Juba", "Africa/Juba"),
("Africa/Kampala", "Africa/Kampala"),
("Africa/Khartoum", "Africa/Khartoum"),
("Africa/Kigali", "Africa/Kigali"),
("Africa/Kinshasa", "Africa/Kinshasa"),
("Africa/Lagos", "Africa/Lagos"),
("Africa/Libreville", "Africa/Libreville"),
("Africa/Lome", "Africa/Lome"),
("Africa/Luanda", "Africa/Luanda"),
("Africa/Lubumbashi", "Africa/Lubumbashi"),
("Africa/Lusaka", "Africa/Lusaka"),
("Africa/Malabo", "Africa/Malabo"),
("Africa/Maputo", "Africa/Maputo"),
("Africa/Maseru", "Africa/Maseru"),
("Africa/Mbabane", "Africa/Mbabane"),
("Africa/Mogadishu", "Africa/Mogadishu"),
("Africa/Monrovia", "Africa/Monrovia"),
("Africa/Nairobi", "Africa/Nairobi"),
("Africa/Ndjamena", "Africa/Ndjamena"),
("Africa/Niamey", "Africa/Niamey"),
("Africa/Nouakchott", "Africa/Nouakchott"),
("Africa/Ouagadougou", "Africa/Ouagadougou"),
("Africa/Porto-Novo", "Africa/Porto-Novo"),
("Africa/Sao_Tome", "Africa/Sao_Tome"),
("Africa/Tripoli", "Africa/Tripoli"),
("Africa/Tunis", "Africa/Tunis"),
("Africa/Windhoek", "Africa/Windhoek"),
("America/Adak", "America/Adak"),
("America/Anchorage", "America/Anchorage"),
("America/Anguilla", "America/Anguilla"),
("America/Antigua", "America/Antigua"),
("America/Araguaina", "America/Araguaina"),
(
"America/Argentina/Buenos_Aires",
"America/Argentina/Buenos_Aires",
),
("America/Argentina/Catamarca", "America/Argentina/Catamarca"),
("America/Argentina/Cordoba", "America/Argentina/Cordoba"),
("America/Argentina/Jujuy", "America/Argentina/Jujuy"),
("America/Argentina/La_Rioja", "America/Argentina/La_Rioja"),
("America/Argentina/Mendoza", "America/Argentina/Mendoza"),
(
"America/Argentina/Rio_Gallegos",
"America/Argentina/Rio_Gallegos",
),
("America/Argentina/Salta", "America/Argentina/Salta"),
("America/Argentina/San_Juan", "America/Argentina/San_Juan"),
("America/Argentina/San_Luis", "America/Argentina/San_Luis"),
("America/Argentina/Tucuman", "America/Argentina/Tucuman"),
("America/Argentina/Ushuaia", "America/Argentina/Ushuaia"),
("America/Aruba", "America/Aruba"),
("America/Asuncion", "America/Asuncion"),
("America/Atikokan", "America/Atikokan"),
("America/Bahia", "America/Bahia"),
("America/Bahia_Banderas", "America/Bahia_Banderas"),
("America/Barbados", "America/Barbados"),
("America/Belem", "America/Belem"),
("America/Belize", "America/Belize"),
("America/Blanc-Sablon", "America/Blanc-Sablon"),
("America/Boa_Vista", "America/Boa_Vista"),
("America/Bogota", "America/Bogota"),
("America/Boise", "America/Boise"),
("America/Cambridge_Bay", "America/Cambridge_Bay"),
("America/Campo_Grande", "America/Campo_Grande"),
("America/Cancun", "America/Cancun"),
("America/Caracas", "America/Caracas"),
("America/Cayenne", "America/Cayenne"),
("America/Cayman", "America/Cayman"),
("America/Chicago", "America/Chicago"),
("America/Chihuahua", "America/Chihuahua"),
("America/Costa_Rica", "America/Costa_Rica"),
("America/Creston", "America/Creston"),
("America/Cuiaba", "America/Cuiaba"),
("America/Curacao", "America/Curacao"),
("America/Danmarkshavn", "America/Danmarkshavn"),
("America/Dawson", "America/Dawson"),
("America/Dawson_Creek", "America/Dawson_Creek"),
("America/Denver", "America/Denver"),
("America/Detroit", "America/Detroit"),
("America/Dominica", "America/Dominica"),
("America/Edmonton", "America/Edmonton"),
("America/Eirunepe", "America/Eirunepe"),
("America/El_Salvador", "America/El_Salvador"),
("America/Fort_Nelson", "America/Fort_Nelson"),
("America/Fortaleza", "America/Fortaleza"),
("America/Glace_Bay", "America/Glace_Bay"),
("America/Goose_Bay", "America/Goose_Bay"),
("America/Grand_Turk", "America/Grand_Turk"),
("America/Grenada", "America/Grenada"),
("America/Guadeloupe", "America/Guadeloupe"),
("America/Guatemala", "America/Guatemala"),
("America/Guayaquil", "America/Guayaquil"),
("America/Guyana", "America/Guyana"),
("America/Halifax", "America/Halifax"),
("America/Havana", "America/Havana"),
("America/Hermosillo", "America/Hermosillo"),
("America/Indiana/Indianapolis", "America/Indiana/Indianapolis"),
("America/Indiana/Knox", "America/Indiana/Knox"),
("America/Indiana/Marengo", "America/Indiana/Marengo"),
("America/Indiana/Petersburg", "America/Indiana/Petersburg"),
("America/Indiana/Tell_City", "America/Indiana/Tell_City"),
("America/Indiana/Vevay", "America/Indiana/Vevay"),
("America/Indiana/Vincennes", "America/Indiana/Vincennes"),
("America/Indiana/Winamac", "America/Indiana/Winamac"),
("America/Inuvik", "America/Inuvik"),
("America/Iqaluit", "America/Iqaluit"),
("America/Jamaica", "America/Jamaica"),
("America/Juneau", "America/Juneau"),
("America/Kentucky/Louisville", "America/Kentucky/Louisville"),
("America/Kentucky/Monticello", "America/Kentucky/Monticello"),
("America/Kralendijk", "America/Kralendijk"),
("America/La_Paz", "America/La_Paz"),
("America/Lima", "America/Lima"),
("America/Los_Angeles", "America/Los_Angeles"),
("America/Lower_Princes", "America/Lower_Princes"),
("America/Maceio", "America/Maceio"),
("America/Managua", "America/Managua"),
("America/Manaus", "America/Manaus"),
("America/Marigot", "America/Marigot"),
("America/Martinique", "America/Martinique"),
("America/Matamoros", "America/Matamoros"),
("America/Mazatlan", "America/Mazatlan"),
("America/Menominee", "America/Menominee"),
("America/Merida", "America/Merida"),
("America/Metlakatla", "America/Metlakatla"),
("America/Mexico_City", "America/Mexico_City"),
("America/Miquelon", "America/Miquelon"),
("America/Moncton", "America/Moncton"),
("America/Monterrey", "America/Monterrey"),
("America/Montevideo", "America/Montevideo"),
("America/Montserrat", "America/Montserrat"),
("America/Nassau", "America/Nassau"),
("America/New_York", "America/New_York"),
("America/Nipigon", "America/Nipigon"),
("America/Nome", "America/Nome"),
("America/Noronha", "America/Noronha"),
("America/North_Dakota/Beulah", "America/North_Dakota/Beulah"),
("America/North_Dakota/Center", "America/North_Dakota/Center"),
(
"America/North_Dakota/New_Salem",
"America/North_Dakota/New_Salem",
),
("America/Nuuk", "America/Nuuk"),
("America/Ojinaga", "America/Ojinaga"),
("America/Panama", "America/Panama"),
("America/Pangnirtung", "America/Pangnirtung"),
("America/Paramaribo", "America/Paramaribo"),
("America/Phoenix", "America/Phoenix"),
("America/Port-au-Prince", "America/Port-au-Prince"),
("America/Port_of_Spain", "America/Port_of_Spain"),
("America/Porto_Velho", "America/Porto_Velho"),
("America/Puerto_Rico", "America/Puerto_Rico"),
("America/Punta_Arenas", "America/Punta_Arenas"),
("America/Rainy_River", "America/Rainy_River"),
("America/Rankin_Inlet", "America/Rankin_Inlet"),
("America/Recife", "America/Recife"),
("America/Regina", "America/Regina"),
("America/Resolute", "America/Resolute"),
("America/Rio_Branco", "America/Rio_Branco"),
("America/Santarem", "America/Santarem"),
("America/Santiago", "America/Santiago"),
("America/Santo_Domingo", "America/Santo_Domingo"),
("America/Sao_Paulo", "America/Sao_Paulo"),
("America/Scoresbysund", "America/Scoresbysund"),
("America/Sitka", "America/Sitka"),
("America/St_Barthelemy", "America/St_Barthelemy"),
("America/St_Johns", "America/St_Johns"),
("America/St_Kitts", "America/St_Kitts"),
("America/St_Lucia", "America/St_Lucia"),
("America/St_Thomas", "America/St_Thomas"),
("America/St_Vincent", "America/St_Vincent"),
("America/Swift_Current", "America/Swift_Current"),
("America/Tegucigalpa", "America/Tegucigalpa"),
("America/Thule", "America/Thule"),
("America/Thunder_Bay", "America/Thunder_Bay"),
("America/Tijuana", "America/Tijuana"),
("America/Toronto", "America/Toronto"),
("America/Tortola", "America/Tortola"),
("America/Vancouver", "America/Vancouver"),
("America/Whitehorse", "America/Whitehorse"),
("America/Winnipeg", "America/Winnipeg"),
("America/Yakutat", "America/Yakutat"),
("America/Yellowknife", "America/Yellowknife"),
("Antarctica/Casey", "Antarctica/Casey"),
("Antarctica/Davis", "Antarctica/Davis"),
("Antarctica/DumontDUrville", "Antarctica/DumontDUrville"),
("Antarctica/Macquarie", "Antarctica/Macquarie"),
("Antarctica/Mawson", "Antarctica/Mawson"),
("Antarctica/McMurdo", "Antarctica/McMurdo"),
("Antarctica/Palmer", "Antarctica/Palmer"),
("Antarctica/Rothera", "Antarctica/Rothera"),
("Antarctica/Syowa", "Antarctica/Syowa"),
("Antarctica/Troll", "Antarctica/Troll"),
("Antarctica/Vostok", "Antarctica/Vostok"),
("Arctic/Longyearbyen", "Arctic/Longyearbyen"),
("Asia/Aden", "Asia/Aden"),
("Asia/Almaty", "Asia/Almaty"),
("Asia/Amman", "Asia/Amman"),
("Asia/Anadyr", "Asia/Anadyr"),
("Asia/Aqtau", "Asia/Aqtau"),
("Asia/Aqtobe", "Asia/Aqtobe"),
("Asia/Ashgabat", "Asia/Ashgabat"),
("Asia/Atyrau", "Asia/Atyrau"),
("Asia/Baghdad", "Asia/Baghdad"),
("Asia/Bahrain", "Asia/Bahrain"),
("Asia/Baku", "Asia/Baku"),
("Asia/Bangkok", "Asia/Bangkok"),
("Asia/Barnaul", "Asia/Barnaul"),
("Asia/Beirut", "Asia/Beirut"),
("Asia/Bishkek", "Asia/Bishkek"),
("Asia/Brunei", "Asia/Brunei"),
("Asia/Chita", "Asia/Chita"),
("Asia/Choibalsan", "Asia/Choibalsan"),
("Asia/Colombo", "Asia/Colombo"),
("Asia/Damascus", "Asia/Damascus"),
("Asia/Dhaka", "Asia/Dhaka"),
("Asia/Dili", "Asia/Dili"),
("Asia/Dubai", "Asia/Dubai"),
("Asia/Dushanbe", "Asia/Dushanbe"),
("Asia/Famagusta", "Asia/Famagusta"),
("Asia/Gaza", "Asia/Gaza"),
("Asia/Hebron", "Asia/Hebron"),
("Asia/Ho_Chi_Minh", "Asia/Ho_Chi_Minh"),
("Asia/Hong_Kong", "Asia/Hong_Kong"),
("Asia/Hovd", "Asia/Hovd"),
("Asia/Irkutsk", "Asia/Irkutsk"),
("Asia/Jakarta", "Asia/Jakarta"),
("Asia/Jayapura", "Asia/Jayapura"),
("Asia/Jerusalem", "Asia/Jerusalem"),
("Asia/Kabul", "Asia/Kabul"),
("Asia/Kamchatka", "Asia/Kamchatka"),
("Asia/Karachi", "Asia/Karachi"),
("Asia/Kathmandu", "Asia/Kathmandu"),
("Asia/Khandyga", "Asia/Khandyga"),
("Asia/Kolkata", "Asia/Kolkata"),
("Asia/Krasnoyarsk", "Asia/Krasnoyarsk"),
("Asia/Kuala_Lumpur", "Asia/Kuala_Lumpur"),
("Asia/Kuching", "Asia/Kuching"),
("Asia/Kuwait", "Asia/Kuwait"),
("Asia/Macau", "Asia/Macau"),
("Asia/Magadan", "Asia/Magadan"),
("Asia/Makassar", "Asia/Makassar"),
("Asia/Manila", "Asia/Manila"),
("Asia/Muscat", "Asia/Muscat"),
("Asia/Nicosia", "Asia/Nicosia"),
("Asia/Novokuznetsk", "Asia/Novokuznetsk"),
("Asia/Novosibirsk", "Asia/Novosibirsk"),
("Asia/Omsk", "Asia/Omsk"),
("Asia/Oral", "Asia/Oral"),
("Asia/Phnom_Penh", "Asia/Phnom_Penh"),
("Asia/Pontianak", "Asia/Pontianak"),
("Asia/Pyongyang", "Asia/Pyongyang"),
("Asia/Qatar", "Asia/Qatar"),
("Asia/Qostanay", "Asia/Qostanay"),
("Asia/Qyzylorda", "Asia/Qyzylorda"),
("Asia/Riyadh", "Asia/Riyadh"),
("Asia/Sakhalin", "Asia/Sakhalin"),
("Asia/Samarkand", "Asia/Samarkand"),
("Asia/Seoul", "Asia/Seoul"),
("Asia/Shanghai", "Asia/Shanghai"),
("Asia/Singapore", "Asia/Singapore"),
("Asia/Srednekolymsk", "Asia/Srednekolymsk"),
("Asia/Taipei", "Asia/Taipei"),
("Asia/Tashkent", "Asia/Tashkent"),
("Asia/Tbilisi", "Asia/Tbilisi"),
("Asia/Tehran", "Asia/Tehran"),
("Asia/Thimphu", "Asia/Thimphu"),
("Asia/Tokyo", "Asia/Tokyo"),
("Asia/Tomsk", "Asia/Tomsk"),
("Asia/Ulaanbaatar", "Asia/Ulaanbaatar"),
("Asia/Urumqi", "Asia/Urumqi"),
("Asia/Ust-Nera", "Asia/Ust-Nera"),
("Asia/Vientiane", "Asia/Vientiane"),
("Asia/Vladivostok", "Asia/Vladivostok"),
("Asia/Yakutsk", "Asia/Yakutsk"),
("Asia/Yangon", "Asia/Yangon"),
("Asia/Yekaterinburg", "Asia/Yekaterinburg"),
("Asia/Yerevan", "Asia/Yerevan"),
("Atlantic/Azores", "Atlantic/Azores"),
("Atlantic/Bermuda", "Atlantic/Bermuda"),
("Atlantic/Canary", "Atlantic/Canary"),
("Atlantic/Cape_Verde", "Atlantic/Cape_Verde"),
("Atlantic/Faroe", "Atlantic/Faroe"),
("Atlantic/Madeira", "Atlantic/Madeira"),
("Atlantic/Reykjavik", "Atlantic/Reykjavik"),
("Atlantic/South_Georgia", "Atlantic/South_Georgia"),
("Atlantic/St_Helena", "Atlantic/St_Helena"),
("Atlantic/Stanley", "Atlantic/Stanley"),
("Australia/Adelaide", "Australia/Adelaide"),
("Australia/Brisbane", "Australia/Brisbane"),
("Australia/Broken_Hill", "Australia/Broken_Hill"),
("Australia/Darwin", "Australia/Darwin"),
("Australia/Eucla", "Australia/Eucla"),
("Australia/Hobart", "Australia/Hobart"),
("Australia/Lindeman", "Australia/Lindeman"),
("Australia/Lord_Howe", "Australia/Lord_Howe"),
("Australia/Melbourne", "Australia/Melbourne"),
("Australia/Perth", "Australia/Perth"),
("Australia/Sydney", "Australia/Sydney"),
("Canada/Atlantic", "Canada/Atlantic"),
("Canada/Central", "Canada/Central"),
("Canada/Eastern", "Canada/Eastern"),
("Canada/Mountain", "Canada/Mountain"),
("Canada/Newfoundland", "Canada/Newfoundland"),
("Canada/Pacific", "Canada/Pacific"),
("Europe/Amsterdam", "Europe/Amsterdam"),
("Europe/Andorra", "Europe/Andorra"),
("Europe/Astrakhan", "Europe/Astrakhan"),
("Europe/Athens", "Europe/Athens"),
("Europe/Belgrade", "Europe/Belgrade"),
("Europe/Berlin", "Europe/Berlin"),
("Europe/Bratislava", "Europe/Bratislava"),
("Europe/Brussels", "Europe/Brussels"),
("Europe/Bucharest", "Europe/Bucharest"),
("Europe/Budapest", "Europe/Budapest"),
("Europe/Busingen", "Europe/Busingen"),
("Europe/Chisinau", "Europe/Chisinau"),
("Europe/Copenhagen", "Europe/Copenhagen"),
("Europe/Dublin", "Europe/Dublin"),
("Europe/Gibraltar", "Europe/Gibraltar"),
("Europe/Guernsey", "Europe/Guernsey"),
("Europe/Helsinki", "Europe/Helsinki"),
("Europe/Isle_of_Man", "Europe/Isle_of_Man"),
("Europe/Istanbul", "Europe/Istanbul"),
("Europe/Jersey", "Europe/Jersey"),
("Europe/Kaliningrad", "Europe/Kaliningrad"),
("Europe/Kirov", "Europe/Kirov"),
("Europe/Kyiv", "Europe/Kyiv"),
("Europe/Lisbon", "Europe/Lisbon"),
("Europe/Ljubljana", "Europe/Ljubljana"),
("Europe/London", "Europe/London"),
("Europe/Luxembourg", "Europe/Luxembourg"),
("Europe/Madrid", "Europe/Madrid"),
("Europe/Malta", "Europe/Malta"),
("Europe/Mariehamn", "Europe/Mariehamn"),
("Europe/Minsk", "Europe/Minsk"),
("Europe/Monaco", "Europe/Monaco"),
("Europe/Moscow", "Europe/Moscow"),
("Europe/Oslo", "Europe/Oslo"),
("Europe/Paris", "Europe/Paris"),
("Europe/Podgorica", "Europe/Podgorica"),
("Europe/Prague", "Europe/Prague"),
("Europe/Riga", "Europe/Riga"),
("Europe/Rome", "Europe/Rome"),
("Europe/Samara", "Europe/Samara"),
("Europe/San_Marino", "Europe/San_Marino"),
("Europe/Sarajevo", "Europe/Sarajevo"),
("Europe/Saratov", "Europe/Saratov"),
("Europe/Simferopol", "Europe/Simferopol"),
("Europe/Skopje", "Europe/Skopje"),
("Europe/Sofia", "Europe/Sofia"),
("Europe/Stockholm", "Europe/Stockholm"),
("Europe/Tallinn", "Europe/Tallinn"),
("Europe/Tirane", "Europe/Tirane"),
("Europe/Ulyanovsk", "Europe/Ulyanovsk"),
("Europe/Vaduz", "Europe/Vaduz"),
("Europe/Vatican", "Europe/Vatican"),
("Europe/Vienna", "Europe/Vienna"),
("Europe/Vilnius", "Europe/Vilnius"),
("Europe/Volgograd", "Europe/Volgograd"),
("Europe/Warsaw", "Europe/Warsaw"),
("Europe/Zagreb", "Europe/Zagreb"),
("Europe/Zurich", "Europe/Zurich"),
("GMT", "GMT"),
("Indian/Antananarivo", "Indian/Antananarivo"),
("Indian/Chagos", "Indian/Chagos"),
("Indian/Christmas", "Indian/Christmas"),
("Indian/Cocos", "Indian/Cocos"),
("Indian/Comoro", "Indian/Comoro"),
("Indian/Kerguelen", "Indian/Kerguelen"),
("Indian/Mahe", "Indian/Mahe"),
("Indian/Maldives", "Indian/Maldives"),
("Indian/Mauritius", "Indian/Mauritius"),
("Indian/Mayotte", "Indian/Mayotte"),
("Indian/Reunion", "Indian/Reunion"),
("Pacific/Apia", "Pacific/Apia"),
("Pacific/Auckland", "Pacific/Auckland"),
("Pacific/Bougainville", "Pacific/Bougainville"),
("Pacific/Chatham", "Pacific/Chatham"),
("Pacific/Chuuk", "Pacific/Chuuk"),
("Pacific/Easter", "Pacific/Easter"),
("Pacific/Efate", "Pacific/Efate"),
("Pacific/Fakaofo", "Pacific/Fakaofo"),
("Pacific/Fiji", "Pacific/Fiji"),
("Pacific/Funafuti", "Pacific/Funafuti"),
("Pacific/Galapagos", "Pacific/Galapagos"),
("Pacific/Gambier", "Pacific/Gambier"),
("Pacific/Guadalcanal", "Pacific/Guadalcanal"),
("Pacific/Guam", "Pacific/Guam"),
("Pacific/Honolulu", "Pacific/Honolulu"),
("Pacific/Kanton", "Pacific/Kanton"),
("Pacific/Kiritimati", "Pacific/Kiritimati"),
("Pacific/Kosrae", "Pacific/Kosrae"),
("Pacific/Kwajalein", "Pacific/Kwajalein"),
("Pacific/Majuro", "Pacific/Majuro"),
("Pacific/Marquesas", "Pacific/Marquesas"),
("Pacific/Midway", "Pacific/Midway"),
("Pacific/Nauru", "Pacific/Nauru"),
("Pacific/Niue", "Pacific/Niue"),
("Pacific/Norfolk", "Pacific/Norfolk"),
("Pacific/Noumea", "Pacific/Noumea"),
("Pacific/Pago_Pago", "Pacific/Pago_Pago"),
("Pacific/Palau", "Pacific/Palau"),
("Pacific/Pitcairn", "Pacific/Pitcairn"),
("Pacific/Pohnpei", "Pacific/Pohnpei"),
("Pacific/Port_Moresby", "Pacific/Port_Moresby"),
("Pacific/Rarotonga", "Pacific/Rarotonga"),
("Pacific/Saipan", "Pacific/Saipan"),
("Pacific/Tahiti", "Pacific/Tahiti"),
("Pacific/Tarawa", "Pacific/Tarawa"),
("Pacific/Tongatapu", "Pacific/Tongatapu"),
("Pacific/Wake", "Pacific/Wake"),
("Pacific/Wallis", "Pacific/Wallis"),
("US/Alaska", "US/Alaska"),
("US/Arizona", "US/Arizona"),
("US/Central", "US/Central"),
("US/Eastern", "US/Eastern"),
("US/Hawaii", "US/Hawaii"),
("US/Mountain", "US/Mountain"),
("US/Pacific", "US/Pacific"),
("UTC", "UTC"),
],
default="UTC",
max_length=100,
verbose_name="Timezone",
),
),
]

View File

@ -144,6 +144,14 @@ LOGIN_URL = "babybuddy:login"
LOGOUT_REDIRECT_URL = "babybuddy:login" LOGOUT_REDIRECT_URL = "babybuddy:login"
REVERSE_PROXY_AUTH = bool(strtobool(os.environ.get("REVERSE_PROXY_AUTH") or "False"))
# Use remote user middleware when reverse proxy auth is enabled.
if REVERSE_PROXY_AUTH:
# Must appear AFTER AuthenticationMiddleware.
MIDDLEWARE.append("babybuddy.middleware.CustomRemoteUser")
AUTHENTICATION_BACKENDS.append("django.contrib.auth.backends.RemoteUserBackend")
# Timezone # Timezone
# https://docs.djangoproject.com/en/4.0/topics/i18n/timezones/ # https://docs.djangoproject.com/en/4.0/topics/i18n/timezones/

View File

@ -22,3 +22,24 @@ class CommandsTestCase(TransactionTestCase):
call_command("reset", verbosity=0, interactive=False) call_command("reset", verbosity=0, interactive=False)
self.assertIsInstance(User.objects.get(username="admin"), User) self.assertIsInstance(User.objects.get(username="admin"), User)
self.assertEqual(Child.objects.count(), 1) self.assertEqual(Child.objects.count(), 1)
def test_createuser(self):
call_command(
"createuser",
username="test",
email="test@test.test",
password="test",
verbosity=0,
)
self.assertIsInstance(User.objects.get(username="test"), User)
self.assertFalse(User.objects.filter(username="test", is_staff=True))
call_command(
"createuser",
"--is-staff",
username="testadmin",
email="testadmin@testadmin.testadmin",
password="test",
verbosity=0,
)
self.assertIsInstance(User.objects.get(username="testadmin"), User)
self.assertTrue(User.objects.filter(username="testadmin", is_staff=True))

View File

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
from django.core.management import call_command
from django.test import Client as HttpClient, TestCase, modify_settings
class ReverseProxyAuthTestCase(TestCase):
"""
Notes:
- A class method cannot be used to establish the HTTP client because of the
settings overrides required for these tests.
- Overriding the `REVERSE_PROXY_AUTH` environment variable directly is not
possible because environments variables are only evaluated once for the run.
"""
def test_remote_user_authentication_disabled(self):
call_command("migrate", verbosity=0)
c = HttpClient()
response = c.get("/welcome/", HTTP_REMOTE_USER="admin", follow=True)
self.assertRedirects(response, "/login/?next=/welcome/")
@modify_settings(
MIDDLEWARE={"append": "babybuddy.middleware.CustomRemoteUser"},
AUTHENTICATION_BACKENDS={
"append": "django.contrib.auth.backends.RemoteUserBackend"
},
)
def test_remote_user_authentication_enabled(self):
call_command("migrate", verbosity=0)
c = HttpClient()
response = c.get("/welcome/", HTTP_REMOTE_USER="admin")
self.assertEqual(response.status_code, 200)

View File

@ -0,0 +1,20 @@
# Generated by Django 4.1.2 on 2022-10-12 02:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("core", "0023_alter_tag_options_alter_bmi_tags_and_more"),
]
operations = [
migrations.AlterField(
model_name="tag",
name="slug",
field=models.SlugField(
allow_unicode=True, max_length=100, unique=True, verbose_name="slug"
),
),
]

View File

@ -63,7 +63,7 @@
</div> </div>
{% include 'babybuddy/paginator.html' %} {% include 'babybuddy/paginator.html' %}
{% if perms.core.delete_timer %} {% if object_list and perms.core.delete_timer %}
<a href="{% url 'core:timer-delete-inactive' %}" class="btn btn-sm btn-danger"> <a href="{% url 'core:timer-delete-inactive' %}" class="btn btn-sm btn-danger">
<i class="icon-delete" aria-hidden="true"></i> {% trans "Delete Inactive Timers" %} <i class="icon-delete" aria-hidden="true"></i> {% trans "Delete Inactive Timers" %}
</a> </a>

View File

@ -24,6 +24,7 @@
<button class="btn btn-outline-primary bg-dark btn-add-new-tag" type="button">{% trans "Add" %}</button> <button class="btn btn-outline-primary bg-dark btn-add-new-tag" type="button">{% trans "Add" %}</button>
</div> </div>
</div> </div>
{% if widget.tag_suggestions.quick %}
<span>{% trans "Recently used:" %}</span> <span>{% trans "Recently used:" %}</span>
{% for t in widget.tag_suggestions.quick %} {% for t in widget.tag_suggestions.quick %}
<span data-value="{{ t.name }}" data-color="{{ t.color }}" class="tag btn badge badge-pill cursor-pointer mr-1" style="background-color: {{ t.color }};"> <span data-value="{{ t.name }}" data-color="{{ t.color }}" class="tag btn badge badge-pill cursor-pointer mr-1" style="background-color: {{ t.color }};">
@ -31,6 +32,13 @@
<span class="add-remove-icon pl-1 pr-1">+</span> <span class="add-remove-icon pl-1 pr-1">+</span>
</span> </span>
{% endfor %} {% endfor %}
{% else %}
<style>
.help-block{
display: none;
}
</style>
{%endif%}
</div> </div>
<input <input
type="hidden" type="hidden"

View File

@ -33,7 +33,7 @@ def child_age_string(birth_date):
def duration_string(duration, precision="s"): def duration_string(duration, precision="s"):
""" """
Format a duration (e.g. "2 hours, 3 minutes, 35 seconds"). Format a duration (e.g. "2 hours, 3 minutes, 35 seconds").
:param duration: a timedetla instance. :param duration: a timedelta instance.
:param precision: the level of precision to return (h for hours, m for :param precision: the level of precision to return (h for hours, m for
minutes, s for seconds) minutes, s for seconds)
:returns: a string representation of the duration. :returns: a string representation of the duration.
@ -50,7 +50,7 @@ def duration_string(duration, precision="s"):
def hours(duration): def hours(duration):
""" """
Return the "hours" portion of a duration. Return the "hours" portion of a duration.
:param duration: a timedetla instance. :param duration: a timedelta instance.
:returns: an integer representing the number of hours in duration. :returns: an integer representing the number of hours in duration.
""" """
if not duration: if not duration:
@ -66,7 +66,7 @@ def hours(duration):
def minutes(duration): def minutes(duration):
""" """
Return the "minutes" portion of a duration. Return the "minutes" portion of a duration.
:param duration: a timedetla instance. :param duration: a timedelta instance.
:returns: an integer representing the number of minutes in duration. :returns: an integer representing the number of minutes in duration.
""" """
if not duration: if not duration:
@ -82,7 +82,7 @@ def minutes(duration):
def seconds(duration): def seconds(duration):
""" """
Return the "seconds" portion of a duration. Return the "seconds" portion of a duration.
:param duration: a timedetla instance. :param duration: a timedelta instance.
:returns: an integer representing the number of seconds in duration. :returns: an integer representing the number of seconds in duration.
""" """
if not duration: if not duration:
@ -114,3 +114,19 @@ def dayssince(value, today=None):
# use standard timesince for anything beyond yesterday # use standard timesince for anything beyond yesterday
return str(delta.days) + _(" days ago") return str(delta.days) + _(" days ago")
@register.filter
def deltasince(value, now=None):
"""
Returns a timedelta representing the time since passed datetime
:param value: a datetime instance
:param now: datetime to compare to (defaults to now)
:returns: a timedelta representing the elapsed time
"""
if now is None:
now = timezone.now()
delta = now - value
return delta

View File

@ -95,6 +95,26 @@ class TemplateTagsTestCase(TestCase):
"60 days ago", "60 days ago",
) )
def test_duration_deltasince(self):
datetimes = [
(
timezone.datetime(2022, 1, 1, 0, 0, 1),
timezone.timedelta(seconds=1),
), # new year
(
timezone.datetime(2021, 12, 31, 23, 59, 59),
timezone.timedelta(seconds=3),
), # almost new year
(
timezone.datetime(1969, 2, 1, 23, 59, 59),
timezone.timedelta(days=19326, seconds=3),
), # old but middle of the year
]
now = timezone.datetime(2022, 1, 1, 0, 0, 2)
for d, expected_delta in datetimes:
with self.subTest():
self.assertEqual(duration.deltasince(d, now), expected_delta)
def test_instance_add_url(self): def test_instance_add_url(self):
child = Child.objects.create( child = Child.objects.create(
first_name="Test", last_name="Child", birth_date=timezone.localdate() first_name="Test", last_name="Child", birth_date=timezone.localdate()

View File

@ -1,5 +1,5 @@
{% extends 'cards/base.html' %} {% extends 'cards/base.html' %}
{% load i18n %} {% load duration i18n %}
{% block header %} {% block header %}
<a href="{% url "core:diaperchange-list" %}"> <a href="{% url "core:diaperchange-list" %}">
@ -9,7 +9,7 @@
{% block title %} {% block title %}
{% if change %} {% if change %}
{% blocktrans trimmed with since=change.time|timesince time=change.time|time %} {% blocktrans trimmed with since=change.time|deltasince|duration_string:'m' time=change.time|time %}
<div>{{ since }} ago</div> <div>{{ since }} ago</div>
<small>{{ time }}</small> <small>{{ time }}</small>
{% endblocktrans %} {% endblocktrans %}

View File

@ -1,5 +1,5 @@
{% extends 'cards/base.html' %} {% extends 'cards/base.html' %}
{% load i18n %} {% load duration i18n %}
{% block header %} {% block header %}
<a href="{% url "core:feeding-list" %}"> <a href="{% url "core:feeding-list" %}">
@ -9,7 +9,7 @@
{% block title %} {% block title %}
{% if feeding %} {% if feeding %}
{% blocktrans trimmed with since=feeding.start|timesince time=feeding.start|time %} {% blocktrans trimmed with since=feeding.start|deltasince|duration_string:'m' time=feeding.start|time %}
<div>{{ since }} ago</div> <div>{{ since }} ago</div>
<small>{{ time }}</small> <small>{{ time }}</small>
{% endblocktrans %} {% endblocktrans %}

View File

@ -9,7 +9,7 @@
{% block title %} {% block title %}
{% if sleep %} {% if sleep %}
{% blocktrans trimmed with since=sleep.end|timesince time=sleep.end|time %} {% blocktrans trimmed with since=sleep.end|deltasince|duration_string:'m' time=sleep.end|time %}
<div>{{ since }} ago</div> <div>{{ since }} ago</div>
<small>{{ time }}</small> <small>{{ time }}</small>
{% endblocktrans %} {% endblocktrans %}

View File

@ -10,7 +10,7 @@
{% block title %} {% block title %}
{% if tummytime %} {% if tummytime %}
{% blocktrans trimmed with since=tummytime.time|timesince time=tummytime.time|time %} {% blocktrans trimmed with since=tummytime.time|deltasince|duration_string:'m' time=tummytime.time|time %}
<div>{{ since }} ago</div> <div>{{ since }} ago</div>
<small>{{ time }}</small> <small>{{ time }}</small>
{% endblocktrans %} {% endblocktrans %}

View File

@ -135,7 +135,7 @@ def card_feeding_day(context, child, end_date=None):
# do one pass over the data and add it to the appropriate day # do one pass over the data and add it to the appropriate day
for instance in instances: for instance in instances:
# convert to local tz and push feed_date to end so we're comparing apples to apples for the date # convert to local tz and push feed_date to end so we're comparing apples to apples for the date
feed_date = timezone.localtime(instance.start).replace( feed_date = timezone.localtime(instance.end).replace(
hour=23, minute=59, second=59, microsecond=9999 hour=23, minute=59, second=59, microsecond=9999
) )
idx = (end_date - feed_date).days idx = (end_date - feed_date).days

View File

@ -38,6 +38,34 @@ Each entry must contain both the scheme (http, https) and fully-qualified domain
- [`ALLOWED_HOSTS`](#allowed_hosts) - [`ALLOWED_HOSTS`](#allowed_hosts)
- [`SECURE_PROXY_SSL_HEADER`](#secure_proxy_ssl_header) - [`SECURE_PROXY_SSL_HEADER`](#secure_proxy_ssl_header)
## `PROXY_HEADER`
*Default:* `HTTP_REMOTE_USER`
Sets the header to read the authenticated username from when
`REVERSE_PROXY_AUTH` has been enabled.
**Example value**
HTTP_X_AUTH_USER
**See also**
- [Django's documentation on the `REMOTE_USER` authentication method](https://docs.djangoproject.com/en/4.1/howto/auth-remote-user/)
- [`REVERSE_PROXY_AUTH`](#reverse_proxy_auth)
## `REVERSE_PROXY_AUTH`
*Default:* `False`
Enable use of `PROXY_HEADER` to pass the username of an authenticated user.
This setting should *only* be used with a properly configured reverse proxy to
ensure the headers are not forwarded from sources other than your proxy.
**See also**
- [`PROXY_HEADER`](#proxy_header)
## `SECRET_KEY` ## `SECRET_KEY`
*Default:* `None` *Default:* `None`

View File

@ -17,3 +17,39 @@
<video style="max-width: 320px;" autoplay controls loop muted playsinline> <video style="max-width: 320px;" autoplay controls loop muted playsinline>
<source src="../../assets/videos/user_password.mp4" type="video/mp4"> <source src="../../assets/videos/user_password.mp4" type="video/mp4">
</video> </video>
## Creating a User from the Command Line
There are 2 ways you can create a user from the command line:
1. Passing user's password as an argument:
```shell
python manage.py createuser --username <username> --password <password>
```
2. Interactively setting user's password:
```shell
python manage.py createuser --username <username>
```
You will then be prompted to enter and confirm a password.
- If you want to make the user a staff, you can append the `--is-staff` argument:
```shell
python manage.py createuser --username <username> --is-staff
```
- Another argument you can use with this command is `--email`
```shell
python manage.py createuser --username <username> --email <email>
```
- To get a list of supported commands:
```shell
python manage.py createuser --help
```

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -133,7 +133,7 @@ msgstr "Changement de couche"
#: babybuddy/templates/babybuddy/nav-dropdown.html:281 core/models.py:312 #: babybuddy/templates/babybuddy/nav-dropdown.html:281 core/models.py:312
#: core/models.py:316 core/templates/core/timer_detail.html:43 #: core/models.py:316 core/templates/core/timer_detail.html:43
msgid "Feeding" msgid "Feeding"
msgstr "Allaitement" msgstr "Alimentation"
#: babybuddy/templates/babybuddy/nav-dropdown.html:63 #: babybuddy/templates/babybuddy/nav-dropdown.html:63
#: babybuddy/templates/babybuddy/nav-dropdown.html:157 core/models.py:396 #: babybuddy/templates/babybuddy/nav-dropdown.html:157 core/models.py:396
@ -377,7 +377,7 @@ msgstr "Supprimer"
#: core/templates/core/tummytime_confirm_delete.html:14 #: core/templates/core/tummytime_confirm_delete.html:14
#: core/templates/core/weight_confirm_delete.html:14 #: core/templates/core/weight_confirm_delete.html:14
msgid "<h1>Are you sure you want to delete <span class=\"text-info\">%(object)s</span>?</h1>" msgid "<h1>Are you sure you want to delete <span class=\"text-info\">%(object)s</span>?</h1>"
msgstr "<h1>Êtes-vous sûr de vouloir supprimer <span class=\"text-info\">%(object)s</span>?</h1>" msgstr "<h1>Êtes-vous sûr(e) de vouloir supprimer <span class=\"text-info\">%(object)s</span>?</h1>"
#: babybuddy/templates/babybuddy/user_confirm_delete.html:19 #: babybuddy/templates/babybuddy/user_confirm_delete.html:19
#: core/templates/core/bmi_confirm_delete.html:18 #: core/templates/core/bmi_confirm_delete.html:18
@ -452,7 +452,7 @@ msgstr "Email"
#: babybuddy/templates/babybuddy/user_list.html:21 #: babybuddy/templates/babybuddy/user_list.html:21
msgid "Staff" msgid "Staff"
msgstr "Personnel" msgstr "Administrateur"
#: babybuddy/templates/babybuddy/user_list.html:22 core/models.py:551 #: babybuddy/templates/babybuddy/user_list.html:22 core/models.py:551
#: core/templates/core/timer_list.html:31 #: core/templates/core/timer_list.html:31
@ -533,7 +533,7 @@ msgstr "Bienvenue sur Baby Buddy!"
#: babybuddy/templates/babybuddy/welcome.html:14 #: babybuddy/templates/babybuddy/welcome.html:14
msgid "Learn about and predict baby's needs without\n" msgid "Learn about and predict baby's needs without\n"
" (<em>as much</em>) guess work by using Baby Buddy to track &mdash;" " (<em>as much</em>) guess work by using Baby Buddy to track &mdash;"
msgstr "Apprendre et prédire les besoins de bébé deviens un jeu d'enfants avec Baby Buddy &mdash;" msgstr "Apprendre et prédire les besoins de bébé devient (<em>un peu plus</em>) facile avec Baby Buddy &mdash;"
#: babybuddy/templates/babybuddy/welcome.html:26 core/models.py:249 #: babybuddy/templates/babybuddy/welcome.html:26 core/models.py:249
#: core/templates/core/diaperchange_confirm_delete.html:7 #: core/templates/core/diaperchange_confirm_delete.html:7
@ -1180,7 +1180,7 @@ msgstr "Pas assez de données"
#: dashboard/templates/cards/timer_list.html:12 #: dashboard/templates/cards/timer_list.html:12
msgid "%(count)s active timer%(plural)s" msgid "%(count)s active timer%(plural)s"
msgstr "%(count)s chronomètre%(plural)s actif" msgstr "%(count)s chronomètre%(plural)s actif%(plural)s"
#: dashboard/templates/cards/timer_list.html:19 #: dashboard/templates/cards/timer_list.html:19
msgid "Started by %(instance.user)s at %(start)s" msgid "Started by %(instance.user)s at %(start)s"
@ -1464,7 +1464,7 @@ msgstr "Lancé par %(user)s à %(start)s"
#: reports/templates/reports/feeding_amounts.html:8 #: reports/templates/reports/feeding_amounts.html:8
#: reports/templates/reports/report_list.html:14 #: reports/templates/reports/report_list.html:14
msgid "Feeding Amounts" msgid "Feeding Amounts"
msgstr "Allaitements" msgstr "Quantités d'alimentation"
#: reports/graphs/feeding_amounts.py:27 #: reports/graphs/feeding_amounts.py:27
msgid "Total feeding amount" msgid "Total feeding amount"
@ -1476,7 +1476,7 @@ msgstr "<b>Durée moyenne d'alimentation</b>"
#: reports/graphs/feeding_amounts.py:72 #: reports/graphs/feeding_amounts.py:72
msgid "Feeding amount" msgid "Feeding amount"
msgstr "Allaitement" msgstr "Quantité d'alimentation"
#: reports/templates/reports/report_base.html:17 #: reports/templates/reports/report_base.html:17
msgid "There is not enough data to generate this report." msgid "There is not enough data to generate this report."
@ -1887,7 +1887,7 @@ msgstr "Aucun événement"
#: core/timeline.py:185 #: core/timeline.py:185
msgid "%(child)s had a %(type)s diaper change." msgid "%(child)s had a %(type)s diaper change."
msgstr "%(child)s a eu sa %(type)s couche changée." msgstr "La couche %(type)s de %(child)s a été changée."
#: dashboard/templatetags/cards.py:372 #: dashboard/templatetags/cards.py:372
msgid "Height change per week" msgid "Height change per week"
@ -2089,8 +2089,8 @@ msgstr "Quantités pompées"
#: core/templates/core/timer_confirm_delete_inactive.html:17 #: core/templates/core/timer_confirm_delete_inactive.html:17
msgid "Are you sure you want to delete %(number)s inactive timer?" msgid "Are you sure you want to delete %(number)s inactive timer?"
msgid_plural "Are you sure you want to delete %(number)s inactive timers?" msgid_plural "Are you sure you want to delete %(number)s inactive timers?"
msgstr[0] "Voulez-vous vraiment supprimer %(number)s chronomètre inactif%(plural)s?" msgstr[0] "Voulez-vous vraiment supprimer %(number)s chronomètre inactif ?"
msgstr[1] "Voulez-vous vraiment supprimer %(number)s chronomètres inactif%(plural)s?" msgstr[1] "Voulez-vous vraiment supprimer %(number)s chronomètres inactifs ?"
#: dashboard/templates/cards/feeding_day.html:25 #: dashboard/templates/cards/feeding_day.html:25
msgid "%(counter)s feeding" msgid "%(counter)s feeding"
@ -2101,8 +2101,8 @@ msgstr[1] "%(counter)s alimentations"
#: dashboard/templates/cards/feeding_last_method.html:21 #: dashboard/templates/cards/feeding_last_method.html:21
msgid "%(n)s feeding ago" msgid "%(n)s feeding ago"
msgid_plural "%(n)s feedings ago" msgid_plural "%(n)s feedings ago"
msgstr[0] "il y a %(n)s alimentation%(plural)s" msgstr[0] "il y a %(n)s alimentation"
msgstr[1] "il y a %(n)s alimentation%(plural)s" msgstr[1] "il y a %(n)s alimentations"
#: dashboard/templates/cards/sleep_naps_day.html:12 #: dashboard/templates/cards/sleep_naps_day.html:12
msgid "%(count)s nap" msgid "%(count)s nap"
@ -2113,6 +2113,6 @@ msgstr[1] "%(count)s Sieste%(plural)s"
#: dashboard/templates/cards/timer_list.html:12 #: dashboard/templates/cards/timer_list.html:12
msgid "%(count)s active timer" msgid "%(count)s active timer"
msgid_plural "%(count)s active timers" msgid_plural "%(count)s active timers"
msgstr[0] "%(count)s chronomètre%(plural)s actif" msgstr[0] "%(count)s chronomètre actif"
msgstr[1] "%(count)s chronomètre%(plural)s actif" msgstr[1] "%(count)s chronomètre%(plural)s actifs"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -20,16 +20,16 @@
"gulp-sass-glob": "^1.1.0", "gulp-sass-glob": "^1.1.0",
"gulp-spawn": "^1.0.0", "gulp-spawn": "^1.0.0",
"gulp-uglify": "^3.0.2", "gulp-uglify": "^3.0.2",
"jquery": "^3.6.0", "jquery": "^3.6.1",
"moment": "^2.29.4", "moment": "^2.29.4",
"moment-timezone": "^0.5.34", "moment-timezone": "^0.5.37",
"npm-force-resolutions": "^0.0.10", "npm-force-resolutions": "^0.0.10",
"plotly.js": "^2.13.2", "plotly.js": "^2.15.1",
"popper.js": "^1.16.1", "popper.js": "^1.16.1",
"pulltorefreshjs": "^0.1.22", "pulltorefreshjs": "^0.1.22",
"pump": "^3.0.0", "pump": "^3.0.0",
"sass": "^1.54.0", "sass": "^1.55.0",
"stylelint": "^14.9.1", "stylelint": "^14.13.0",
"stylelint-config-recommended-scss": "^7.0.0", "stylelint-config-recommended-scss": "^7.0.0",
"stylelint-order": "^5.0.0", "stylelint-order": "^5.0.0",
"stylelint-scss": "^4.3.0", "stylelint-scss": "^4.3.0",

View File

@ -1,45 +1,45 @@
-i https://pypi.python.org/simple -i https://pypi.python.org/simple
asgiref==3.5.2 asgiref==3.5.2; python_version >= '3.7'
boto3==1.24.28 boto3==1.24.89
botocore==1.27.28 botocore==1.27.89; python_version >= '3.7'
defusedxml==0.7.1 defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
diff-match-patch==20200713 diff-match-patch==20200713; python_version >= '2.7'
dj-database-url==0.5.0 dj-database-url==1.0.0
django==4.0.6 django==4.1.2
django-appconf==1.0.5 django-appconf==1.0.5; python_version >= '3.1'
django-axes==5.35.0 django-axes==5.39.0
django-filter==22.1 django-filter==22.1
django-imagekit==4.1.0 django-imagekit==4.1.0
django-import-export==2.8.0 django-import-export==2.9.0
django-ipware==4.0.2 django-ipware==4.0.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'
django-storages==1.13.1
django-qr-code==3.1.1 django-qr-code==3.1.1
django-storages==1.12.3
django-taggit==3.0.0 django-taggit==3.0.0
django-widget-tweaks==1.4.12 django-widget-tweaks==1.4.12
djangorestframework==3.13.1 djangorestframework==3.14.0
et-xmlfile==1.1.0 et-xmlfile==1.1.0; python_version >= '3.6'
faker==13.15.0 faker==15.1.0
gunicorn==20.1.0 gunicorn==20.1.0
jmespath==1.0.1 jmespath==1.0.1; python_version >= '3.7'
markuppy==1.14 markuppy==1.14
odfpy==1.4.1 odfpy==1.4.1
openpyxl==3.0.10 openpyxl==3.0.10
pilkit==2.0 pilkit==2.0
pillow==9.2.0 pillow==9.2.0
plotly==5.9.0 plotly==5.10.0
psycopg2-binary==2.9.3 psycopg2-binary==2.9.4
python-dateutil==2.8.2 python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
python-dotenv==0.20.0 python-dotenv==0.21.0
pytz==2022.1 pytz==2022.4
pyyaml==6.0 pyyaml==6.0
s3transfer==0.6.0 s3transfer==0.6.0; python_version >= '3.7'
setuptools==63.1.0 setuptools==65.4.1; python_version >= '3.7'
six==1.16.0 six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
sqlparse==0.4.2 sqlparse==0.4.3; python_version >= '3.5'
tablib[html,ods,xls,xlsx,yaml]==3.2.1 tablib[html,ods,xls,xlsx,yaml]==3.2.1; python_version >= '3.7'
tenacity==8.0.1 tenacity==8.1.0; python_version >= '3.6'
uritemplate==4.1.1 uritemplate==4.1.1
urllib3==1.26.10 urllib3==1.26.12; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4'
whitenoise==6.2.0 whitenoise==6.2.0
xlrd==2.0.1 xlrd==2.0.1
xlwt==1.3.0 xlwt==1.3.0

View File

@ -57,40 +57,6 @@
--object-tools-hover-bg: var(--close-button-hover-bg); --object-tools-hover-bg: var(--close-button-hover-bg);
} }
@media (prefers-color-scheme: dark) {
:root {
--primary: #264b5d;
--primary-fg: #eee;
--body-fg: #eeeeee;
--body-bg: #121212;
--body-quiet-color: #e0e0e0;
--body-loud-color: #ffffff;
--breadcrumbs-link-fg: #e0e0e0;
--breadcrumbs-bg: var(--primary);
--link-fg: #81d4fa;
--link-hover-color: #4ac1f7;
--link-selected-fg: #6f94c6;
--hairline-color: #272727;
--border-color: #353535;
--error-fg: #e35f5f;
--message-success-bg: #006b1b;
--message-warning-bg: #583305;
--message-error-bg: #570808;
--darkened-bg: #212121;
--selected-bg: #1b1b1b;
--selected-row: #00363a;
--close-button-bg: #333333;
--close-button-hover-bg: #666666;
}
}
html, body { html, body {
height: 100%; height: 100%;
} }
@ -98,7 +64,7 @@ html, body {
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 14px; font-size: 0.875rem;
font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif;
color: var(--body-fg); color: var(--body-fg);
background: var(--body-bg); background: var(--body-bg);
@ -151,12 +117,12 @@ h1,h2,h3,h4,h5 {
h1 { h1 {
margin: 0 0 20px; margin: 0 0 20px;
font-weight: 300; font-weight: 300;
font-size: 20px; font-size: 1.25rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
h2 { h2 {
font-size: 16px; font-size: 1rem;
margin: 1em 0 .5em 0; margin: 1em 0 .5em 0;
} }
@ -166,20 +132,20 @@ h2.subhead {
} }
h3 { h3 {
font-size: 14px; font-size: 0.875rem;
margin: .8em 0 .3em 0; margin: .8em 0 .3em 0;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-weight: bold; font-weight: bold;
} }
h4 { h4 {
font-size: 12px; font-size: 0.75rem;
margin: 1em 0 .8em 0; margin: 1em 0 .8em 0;
padding-bottom: 3px; padding-bottom: 3px;
} }
h5 { h5 {
font-size: 10px; font-size: 0.625rem;
margin: 1.5em 0 .5em 0; margin: 1.5em 0 .5em 0;
color: var(--body-quiet-color); color: var(--body-quiet-color);
text-transform: uppercase; text-transform: uppercase;
@ -196,7 +162,7 @@ li ul {
} }
li, dt, dd { li, dt, dd {
font-size: 13px; font-size: 0.8125rem;
line-height: 20px; line-height: 20px;
} }
@ -223,7 +189,7 @@ fieldset {
} }
blockquote { blockquote {
font-size: 11px; font-size: 0.6875rem;
color: #777; color: #777;
margin-left: 2px; margin-left: 2px;
padding-left: 10px; padding-left: 10px;
@ -233,7 +199,7 @@ blockquote {
code, pre { code, pre {
font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 12px; font-size: 0.75rem;
overflow-x: auto; overflow-x: auto;
} }
@ -255,22 +221,21 @@ hr {
border: none; border: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 1px;
line-height: 1px; line-height: 1px;
} }
/* TEXT STYLES & MODIFIERS */ /* TEXT STYLES & MODIFIERS */
.small { .small {
font-size: 11px; font-size: 0.6875rem;
} }
.mini { .mini {
font-size: 10px; font-size: 0.625rem;
} }
.help, p.help, form p.help, div.help, form div.help, div.help li { .help, p.help, form p.help, div.help, form div.help, div.help li {
font-size: 11px; font-size: 0.6875rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
@ -300,7 +265,7 @@ p img, h1 img, h2 img, h3 img, h4 img, td img {
} }
.hidden { .hidden {
display: none; display: none !important;
} }
/* TABLES */ /* TABLES */
@ -311,7 +276,7 @@ table {
} }
td, th { td, th {
font-size: 13px; font-size: 0.8125rem;
line-height: 16px; line-height: 16px;
border-bottom: 1px solid var(--hairline-color); border-bottom: 1px solid var(--hairline-color);
vertical-align: top; vertical-align: top;
@ -327,7 +292,7 @@ thead th,
tfoot td { tfoot td {
color: var(--body-quiet-color); color: var(--body-quiet-color);
padding: 5px 10px; padding: 5px 10px;
font-size: 11px; font-size: 0.6875rem;
background: var(--body-bg); background: var(--body-bg);
border: none; border: none;
border-top: 1px solid var(--hairline-color); border-top: 1px solid var(--hairline-color);
@ -437,7 +402,7 @@ table thead th.sorted .sortoptions a.sortremove:after {
top: -6px; top: -6px;
left: 3px; left: 3px;
font-weight: 200; font-weight: 200;
font-size: 18px; font-size: 1.125rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
@ -478,7 +443,7 @@ input, textarea, select, .form-row p, form .button {
vertical-align: middle; vertical-align: middle;
font-family: "Roboto", "Lucida Grande", Verdana, Arial, sans-serif; font-family: "Roboto", "Lucida Grande", Verdana, Arial, sans-serif;
font-weight: normal; font-weight: normal;
font-size: 13px; font-size: 0.8125rem;
} }
.form-row div.help { .form-row div.help {
padding: 2px 3px; padding: 2px 3px;
@ -589,7 +554,7 @@ input[type=button][disabled].default {
margin: 0; margin: 0;
padding: 8px; padding: 8px;
font-weight: 400; font-weight: 400;
font-size: 13px; font-size: 0.8125rem;
text-align: left; text-align: left;
background: var(--primary); background: var(--primary);
color: var(--header-link-color); color: var(--header-link-color);
@ -597,7 +562,7 @@ input[type=button][disabled].default {
.module caption, .module caption,
.inline-group h2 { .inline-group h2 {
font-size: 12px; font-size: 0.75rem;
letter-spacing: 0.5px; letter-spacing: 0.5px;
text-transform: uppercase; text-transform: uppercase;
} }
@ -616,12 +581,13 @@ ul.messagelist {
ul.messagelist li { ul.messagelist li {
display: block; display: block;
font-weight: 400; font-weight: 400;
font-size: 13px; font-size: 0.8125rem;
padding: 10px 10px 10px 65px; padding: 10px 10px 10px 65px;
margin: 0 0 10px 0; margin: 0 0 10px 0;
background: var(--message-success-bg) url("../img/icon-yes.d2f9f035226a.svg") 40px 12px no-repeat; background: var(--message-success-bg) url("../img/icon-yes.d2f9f035226a.svg") 40px 12px no-repeat;
background-size: 16px auto; background-size: 16px auto;
color: var(--body-fg); color: var(--body-fg);
word-break: break-word;
} }
ul.messagelist li.warning { ul.messagelist li.warning {
@ -635,7 +601,7 @@ ul.messagelist li.error {
} }
.errornote { .errornote {
font-size: 14px; font-size: 0.875rem;
font-weight: 700; font-weight: 700;
display: block; display: block;
padding: 10px 12px; padding: 10px 12px;
@ -656,7 +622,7 @@ ul.errorlist {
} }
ul.errorlist li { ul.errorlist li {
font-size: 13px; font-size: 0.8125rem;
display: block; display: block;
margin-bottom: 4px; margin-bottom: 4px;
overflow-wrap: break-word; overflow-wrap: break-word;
@ -697,7 +663,7 @@ td ul.errorlist + input, td ul.errorlist + select, td ul.errorlist + textarea {
} }
.description { .description {
font-size: 12px; font-size: 0.75rem;
padding: 5px 0 0 12px; padding: 5px 0 0 12px;
} }
@ -753,7 +719,7 @@ a.deletelink:focus, a.deletelink:hover {
/* OBJECT TOOLS */ /* OBJECT TOOLS */
.object-tools { .object-tools {
font-size: 10px; font-size: 0.625rem;
font-weight: bold; font-weight: bold;
padding-left: 0; padding-left: 0;
float: right; float: right;
@ -779,7 +745,7 @@ a.deletelink:focus, a.deletelink:hover {
background: var(--object-tools-bg); background: var(--object-tools-bg);
color: var(--object-tools-fg); color: var(--object-tools-fg);
font-weight: 400; font-weight: 400;
font-size: 11px; font-size: 0.6875rem;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.5px; letter-spacing: 0.5px;
} }
@ -808,14 +774,21 @@ a.deletelink:focus, a.deletelink:hover {
/* OBJECT HISTORY */ /* OBJECT HISTORY */
table#change-history { #change-history table {
width: 100%; width: 100%;
} }
table#change-history tbody th { #change-history table tbody th {
width: 16em; width: 16em;
} }
#change-history .paginator {
color: var(--body-quiet-color);
border-bottom: 1px solid var(--hairline-color);
background: var(--body-bg);
overflow: hidden;
}
/* PAGE STRUCTURE */ /* PAGE STRUCTURE */
#container { #container {
@ -905,7 +878,7 @@ table#change-history tbody th {
overflow: hidden; overflow: hidden;
} }
#header a:link, #header a:visited { #header a:link, #header a:visited, #logout-form button {
color: var(--header-link-color); color: var(--header-link-color);
} }
@ -921,17 +894,17 @@ table#change-history tbody th {
padding: 0; padding: 0;
margin: 0 20px 0 0; margin: 0 20px 0 0;
font-weight: 300; font-weight: 300;
font-size: 24px; font-size: 1.5rem;
color: var(--accent); color: var(--header-branding-color);
} }
#branding h1, #branding h1 a:link, #branding h1 a:visited { #branding h1 a:link, #branding h1 a:visited {
color: var(--accent); color: var(--accent);
} }
#branding h2 { #branding h2 {
padding: 0 10px; padding: 0 10px;
font-size: 14px; font-size: 0.875rem;
margin: -8px 0 8px 0; margin: -8px 0 8px 0;
font-weight: normal; font-weight: normal;
color: var(--header-color); color: var(--header-color);
@ -941,25 +914,43 @@ table#change-history tbody th {
text-decoration: none; text-decoration: none;
} }
#logout-form {
display: inline;
}
#logout-form button {
background: none;
border: 0;
cursor: pointer;
font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif;
}
#user-tools { #user-tools {
float: right; float: right;
padding: 0;
margin: 0 0 0 20px; margin: 0 0 0 20px;
font-weight: 300;
font-size: 11px;
letter-spacing: 0.5px;
text-transform: uppercase;
text-align: right; text-align: right;
} }
#user-tools a { #user-tools, #logout-form button{
padding: 0;
font-weight: 300;
font-size: 0.6875rem;
letter-spacing: 0.5px;
text-transform: uppercase;
}
#user-tools a, #logout-form button {
border-bottom: 1px solid rgba(255, 255, 255, 0.25); border-bottom: 1px solid rgba(255, 255, 255, 0.25);
} }
#user-tools a:focus, #user-tools a:hover { #user-tools a:focus, #user-tools a:hover,
#logout-form button:active, #logout-form button:hover {
text-decoration: none; text-decoration: none;
border-bottom-color: var(--primary); border-bottom: 0;
color: var(--primary); }
#logout-form button:active, #logout-form button:hover {
margin-bottom: 1px;
} }
/* SIDEBAR */ /* SIDEBAR */
@ -979,7 +970,7 @@ table#change-history tbody th {
} }
#content-related h4 { #content-related h4 {
font-size: 13px; font-size: 0.8125rem;
} }
#content-related p { #content-related p {
@ -1003,7 +994,7 @@ table#change-history tbody th {
padding: 16px; padding: 16px;
margin-bottom: 16px; margin-bottom: 16px;
border-bottom: 1px solid var(--hairline-color); border-bottom: 1px solid var(--hairline-color);
font-size: 18px; font-size: 1.125rem;
color: var(--body-fg); color: var(--body-fg);
} }
@ -1050,3 +1041,49 @@ table#change-history tbody th {
.popup #header { .popup #header {
padding: 10px 20px; padding: 10px 20px;
} }
/* PAGINATOR */
.paginator {
font-size: 0.8125rem;
padding-top: 10px;
padding-bottom: 10px;
line-height: 22px;
margin: 0;
border-top: 1px solid var(--hairline-color);
width: 100%;
}
.paginator a:link, .paginator a:visited {
padding: 2px 6px;
background: var(--button-bg);
text-decoration: none;
color: var(--button-fg);
}
.paginator a.showall {
border: none;
background: none;
color: var(--link-fg);
}
.paginator a.showall:focus, .paginator a.showall:hover {
background: none;
color: var(--link-hover-color);
}
.paginator .end {
margin-right: 6px;
}
.paginator .this-page {
padding: 2px 6px;
font-weight: bold;
font-size: 0.8125rem;
vertical-align: top;
}
.paginator a:focus, .paginator a:hover {
color: white;
background: var(--link-hover-color);
}

BIN
static/admin/css/base.01580fff1759.css.gz generated Normal file

Binary file not shown.

Binary file not shown.

View File

@ -57,40 +57,6 @@
--object-tools-hover-bg: var(--close-button-hover-bg); --object-tools-hover-bg: var(--close-button-hover-bg);
} }
@media (prefers-color-scheme: dark) {
:root {
--primary: #264b5d;
--primary-fg: #eee;
--body-fg: #eeeeee;
--body-bg: #121212;
--body-quiet-color: #e0e0e0;
--body-loud-color: #ffffff;
--breadcrumbs-link-fg: #e0e0e0;
--breadcrumbs-bg: var(--primary);
--link-fg: #81d4fa;
--link-hover-color: #4ac1f7;
--link-selected-fg: #6f94c6;
--hairline-color: #272727;
--border-color: #353535;
--error-fg: #e35f5f;
--message-success-bg: #006b1b;
--message-warning-bg: #583305;
--message-error-bg: #570808;
--darkened-bg: #212121;
--selected-bg: #1b1b1b;
--selected-row: #00363a;
--close-button-bg: #333333;
--close-button-hover-bg: #666666;
}
}
html, body { html, body {
height: 100%; height: 100%;
} }
@ -98,7 +64,7 @@ html, body {
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 14px; font-size: 0.875rem;
font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif;
color: var(--body-fg); color: var(--body-fg);
background: var(--body-bg); background: var(--body-bg);
@ -151,12 +117,12 @@ h1,h2,h3,h4,h5 {
h1 { h1 {
margin: 0 0 20px; margin: 0 0 20px;
font-weight: 300; font-weight: 300;
font-size: 20px; font-size: 1.25rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
h2 { h2 {
font-size: 16px; font-size: 1rem;
margin: 1em 0 .5em 0; margin: 1em 0 .5em 0;
} }
@ -166,20 +132,20 @@ h2.subhead {
} }
h3 { h3 {
font-size: 14px; font-size: 0.875rem;
margin: .8em 0 .3em 0; margin: .8em 0 .3em 0;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-weight: bold; font-weight: bold;
} }
h4 { h4 {
font-size: 12px; font-size: 0.75rem;
margin: 1em 0 .8em 0; margin: 1em 0 .8em 0;
padding-bottom: 3px; padding-bottom: 3px;
} }
h5 { h5 {
font-size: 10px; font-size: 0.625rem;
margin: 1.5em 0 .5em 0; margin: 1.5em 0 .5em 0;
color: var(--body-quiet-color); color: var(--body-quiet-color);
text-transform: uppercase; text-transform: uppercase;
@ -196,7 +162,7 @@ li ul {
} }
li, dt, dd { li, dt, dd {
font-size: 13px; font-size: 0.8125rem;
line-height: 20px; line-height: 20px;
} }
@ -223,7 +189,7 @@ fieldset {
} }
blockquote { blockquote {
font-size: 11px; font-size: 0.6875rem;
color: #777; color: #777;
margin-left: 2px; margin-left: 2px;
padding-left: 10px; padding-left: 10px;
@ -233,7 +199,7 @@ blockquote {
code, pre { code, pre {
font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 12px; font-size: 0.75rem;
overflow-x: auto; overflow-x: auto;
} }
@ -255,22 +221,21 @@ hr {
border: none; border: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 1px;
line-height: 1px; line-height: 1px;
} }
/* TEXT STYLES & MODIFIERS */ /* TEXT STYLES & MODIFIERS */
.small { .small {
font-size: 11px; font-size: 0.6875rem;
} }
.mini { .mini {
font-size: 10px; font-size: 0.625rem;
} }
.help, p.help, form p.help, div.help, form div.help, div.help li { .help, p.help, form p.help, div.help, form div.help, div.help li {
font-size: 11px; font-size: 0.6875rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
@ -300,7 +265,7 @@ p img, h1 img, h2 img, h3 img, h4 img, td img {
} }
.hidden { .hidden {
display: none; display: none !important;
} }
/* TABLES */ /* TABLES */
@ -311,7 +276,7 @@ table {
} }
td, th { td, th {
font-size: 13px; font-size: 0.8125rem;
line-height: 16px; line-height: 16px;
border-bottom: 1px solid var(--hairline-color); border-bottom: 1px solid var(--hairline-color);
vertical-align: top; vertical-align: top;
@ -327,7 +292,7 @@ thead th,
tfoot td { tfoot td {
color: var(--body-quiet-color); color: var(--body-quiet-color);
padding: 5px 10px; padding: 5px 10px;
font-size: 11px; font-size: 0.6875rem;
background: var(--body-bg); background: var(--body-bg);
border: none; border: none;
border-top: 1px solid var(--hairline-color); border-top: 1px solid var(--hairline-color);
@ -437,7 +402,7 @@ table thead th.sorted .sortoptions a.sortremove:after {
top: -6px; top: -6px;
left: 3px; left: 3px;
font-weight: 200; font-weight: 200;
font-size: 18px; font-size: 1.125rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
@ -478,7 +443,7 @@ input, textarea, select, .form-row p, form .button {
vertical-align: middle; vertical-align: middle;
font-family: "Roboto", "Lucida Grande", Verdana, Arial, sans-serif; font-family: "Roboto", "Lucida Grande", Verdana, Arial, sans-serif;
font-weight: normal; font-weight: normal;
font-size: 13px; font-size: 0.8125rem;
} }
.form-row div.help { .form-row div.help {
padding: 2px 3px; padding: 2px 3px;
@ -589,7 +554,7 @@ input[type=button][disabled].default {
margin: 0; margin: 0;
padding: 8px; padding: 8px;
font-weight: 400; font-weight: 400;
font-size: 13px; font-size: 0.8125rem;
text-align: left; text-align: left;
background: var(--primary); background: var(--primary);
color: var(--header-link-color); color: var(--header-link-color);
@ -597,7 +562,7 @@ input[type=button][disabled].default {
.module caption, .module caption,
.inline-group h2 { .inline-group h2 {
font-size: 12px; font-size: 0.75rem;
letter-spacing: 0.5px; letter-spacing: 0.5px;
text-transform: uppercase; text-transform: uppercase;
} }
@ -616,12 +581,13 @@ ul.messagelist {
ul.messagelist li { ul.messagelist li {
display: block; display: block;
font-weight: 400; font-weight: 400;
font-size: 13px; font-size: 0.8125rem;
padding: 10px 10px 10px 65px; padding: 10px 10px 10px 65px;
margin: 0 0 10px 0; margin: 0 0 10px 0;
background: var(--message-success-bg) url(../img/icon-yes.svg) 40px 12px no-repeat; background: var(--message-success-bg) url(../img/icon-yes.svg) 40px 12px no-repeat;
background-size: 16px auto; background-size: 16px auto;
color: var(--body-fg); color: var(--body-fg);
word-break: break-word;
} }
ul.messagelist li.warning { ul.messagelist li.warning {
@ -635,7 +601,7 @@ ul.messagelist li.error {
} }
.errornote { .errornote {
font-size: 14px; font-size: 0.875rem;
font-weight: 700; font-weight: 700;
display: block; display: block;
padding: 10px 12px; padding: 10px 12px;
@ -656,7 +622,7 @@ ul.errorlist {
} }
ul.errorlist li { ul.errorlist li {
font-size: 13px; font-size: 0.8125rem;
display: block; display: block;
margin-bottom: 4px; margin-bottom: 4px;
overflow-wrap: break-word; overflow-wrap: break-word;
@ -697,7 +663,7 @@ td ul.errorlist + input, td ul.errorlist + select, td ul.errorlist + textarea {
} }
.description { .description {
font-size: 12px; font-size: 0.75rem;
padding: 5px 0 0 12px; padding: 5px 0 0 12px;
} }
@ -753,7 +719,7 @@ a.deletelink:focus, a.deletelink:hover {
/* OBJECT TOOLS */ /* OBJECT TOOLS */
.object-tools { .object-tools {
font-size: 10px; font-size: 0.625rem;
font-weight: bold; font-weight: bold;
padding-left: 0; padding-left: 0;
float: right; float: right;
@ -779,7 +745,7 @@ a.deletelink:focus, a.deletelink:hover {
background: var(--object-tools-bg); background: var(--object-tools-bg);
color: var(--object-tools-fg); color: var(--object-tools-fg);
font-weight: 400; font-weight: 400;
font-size: 11px; font-size: 0.6875rem;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.5px; letter-spacing: 0.5px;
} }
@ -808,14 +774,21 @@ a.deletelink:focus, a.deletelink:hover {
/* OBJECT HISTORY */ /* OBJECT HISTORY */
table#change-history { #change-history table {
width: 100%; width: 100%;
} }
table#change-history tbody th { #change-history table tbody th {
width: 16em; width: 16em;
} }
#change-history .paginator {
color: var(--body-quiet-color);
border-bottom: 1px solid var(--hairline-color);
background: var(--body-bg);
overflow: hidden;
}
/* PAGE STRUCTURE */ /* PAGE STRUCTURE */
#container { #container {
@ -905,7 +878,7 @@ table#change-history tbody th {
overflow: hidden; overflow: hidden;
} }
#header a:link, #header a:visited { #header a:link, #header a:visited, #logout-form button {
color: var(--header-link-color); color: var(--header-link-color);
} }
@ -921,17 +894,17 @@ table#change-history tbody th {
padding: 0; padding: 0;
margin: 0 20px 0 0; margin: 0 20px 0 0;
font-weight: 300; font-weight: 300;
font-size: 24px; font-size: 1.5rem;
color: var(--accent); color: var(--header-branding-color);
} }
#branding h1, #branding h1 a:link, #branding h1 a:visited { #branding h1 a:link, #branding h1 a:visited {
color: var(--accent); color: var(--accent);
} }
#branding h2 { #branding h2 {
padding: 0 10px; padding: 0 10px;
font-size: 14px; font-size: 0.875rem;
margin: -8px 0 8px 0; margin: -8px 0 8px 0;
font-weight: normal; font-weight: normal;
color: var(--header-color); color: var(--header-color);
@ -941,25 +914,43 @@ table#change-history tbody th {
text-decoration: none; text-decoration: none;
} }
#logout-form {
display: inline;
}
#logout-form button {
background: none;
border: 0;
cursor: pointer;
font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif;
}
#user-tools { #user-tools {
float: right; float: right;
padding: 0;
margin: 0 0 0 20px; margin: 0 0 0 20px;
font-weight: 300;
font-size: 11px;
letter-spacing: 0.5px;
text-transform: uppercase;
text-align: right; text-align: right;
} }
#user-tools a { #user-tools, #logout-form button{
padding: 0;
font-weight: 300;
font-size: 0.6875rem;
letter-spacing: 0.5px;
text-transform: uppercase;
}
#user-tools a, #logout-form button {
border-bottom: 1px solid rgba(255, 255, 255, 0.25); border-bottom: 1px solid rgba(255, 255, 255, 0.25);
} }
#user-tools a:focus, #user-tools a:hover { #user-tools a:focus, #user-tools a:hover,
#logout-form button:active, #logout-form button:hover {
text-decoration: none; text-decoration: none;
border-bottom-color: var(--primary); border-bottom: 0;
color: var(--primary); }
#logout-form button:active, #logout-form button:hover {
margin-bottom: 1px;
} }
/* SIDEBAR */ /* SIDEBAR */
@ -979,7 +970,7 @@ table#change-history tbody th {
} }
#content-related h4 { #content-related h4 {
font-size: 13px; font-size: 0.8125rem;
} }
#content-related p { #content-related p {
@ -1003,7 +994,7 @@ table#change-history tbody th {
padding: 16px; padding: 16px;
margin-bottom: 16px; margin-bottom: 16px;
border-bottom: 1px solid var(--hairline-color); border-bottom: 1px solid var(--hairline-color);
font-size: 18px; font-size: 1.125rem;
color: var(--body-fg); color: var(--body-fg);
} }
@ -1050,3 +1041,49 @@ table#change-history tbody th {
.popup #header { .popup #header {
padding: 10px 20px; padding: 10px 20px;
} }
/* PAGINATOR */
.paginator {
font-size: 0.8125rem;
padding-top: 10px;
padding-bottom: 10px;
line-height: 22px;
margin: 0;
border-top: 1px solid var(--hairline-color);
width: 100%;
}
.paginator a:link, .paginator a:visited {
padding: 2px 6px;
background: var(--button-bg);
text-decoration: none;
color: var(--button-fg);
}
.paginator a.showall {
border: none;
background: none;
color: var(--link-fg);
}
.paginator a.showall:focus, .paginator a.showall:hover {
background: none;
color: var(--link-hover-color);
}
.paginator .end {
margin-right: 6px;
}
.paginator .this-page {
padding: 2px 6px;
font-weight: bold;
font-size: 0.8125rem;
vertical-align: top;
}
.paginator a:focus, .paginator a:hover {
color: white;
background: var(--link-hover-color);
}

Binary file not shown.

View File

@ -84,7 +84,7 @@
#toolbar form input { #toolbar form input {
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 0.875rem;
padding: 5px; padding: 5px;
color: var(--body-fg); color: var(--body-fg);
} }
@ -95,7 +95,7 @@
padding: 2px 5px; padding: 2px 5px;
margin: 0; margin: 0;
vertical-align: top; vertical-align: top;
font-size: 13px; font-size: 0.8125rem;
max-width: 100%; max-width: 100%;
} }
@ -105,7 +105,7 @@
#toolbar form input[type="submit"] { #toolbar form input[type="submit"] {
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
font-size: 13px; font-size: 0.8125rem;
padding: 4px 8px; padding: 4px 8px;
margin: 0; margin: 0;
vertical-align: middle; vertical-align: middle;
@ -140,7 +140,7 @@
} }
#changelist-filter h2 { #changelist-filter h2 {
font-size: 14px; font-size: 0.875rem;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.5px; letter-spacing: 0.5px;
padding: 5px 15px; padding: 5px 15px;
@ -148,12 +148,35 @@
border-bottom: none; border-bottom: none;
} }
#changelist-filter h3 { #changelist-filter h3,
#changelist-filter details summary {
font-weight: 400; font-weight: 400;
padding: 0 15px; padding: 0 15px;
margin-bottom: 10px; margin-bottom: 10px;
} }
#changelist-filter details summary > * {
display: inline;
}
#changelist-filter details > summary {
list-style-type: none;
}
#changelist-filter details > summary::-webkit-details-marker {
display: none;
}
#changelist-filter details > summary::before {
content: '→';
font-weight: bold;
color: var(--link-hover-color);
}
#changelist-filter details[open] > summary::before {
content: '↓';
}
#changelist-filter ul { #changelist-filter ul {
margin: 5px 0; margin: 5px 0;
padding: 0 15px 15px; padding: 0 15px 15px;
@ -173,8 +196,7 @@
#changelist-filter a { #changelist-filter a {
display: block; display: block;
color: var(--body-quiet-color); color: var(--body-quiet-color);
text-overflow: ellipsis; word-break: break-word;
overflow-x: hidden;
} }
#changelist-filter li.selected { #changelist-filter li.selected {
@ -194,7 +216,7 @@
} }
#changelist-filter #changelist-filter-clear a { #changelist-filter #changelist-filter-clear a {
font-size: 13px; font-size: 0.8125rem;
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid var(--hairline-color); border-bottom: 1px solid var(--hairline-color);
} }
@ -225,52 +247,6 @@
color: var(--link-hover-color); color: var(--link-hover-color);
} }
/* PAGINATOR */
.paginator {
font-size: 13px;
padding-top: 10px;
padding-bottom: 10px;
line-height: 22px;
margin: 0;
border-top: 1px solid var(--hairline-color);
width: 100%;
}
.paginator a:link, .paginator a:visited {
padding: 2px 6px;
background: var(--button-bg);
text-decoration: none;
color: var(--button-fg);
}
.paginator a.showall {
border: none;
background: none;
color: var(--link-fg);
}
.paginator a.showall:focus, .paginator a.showall:hover {
background: none;
color: var(--link-hover-color);
}
.paginator .end {
margin-right: 6px;
}
.paginator .this-page {
padding: 2px 6px;
font-weight: bold;
font-size: 13px;
vertical-align: top;
}
.paginator a:focus, .paginator a:hover {
color: white;
background: var(--link-hover-color);
}
/* ACTIONS */ /* ACTIONS */
.filtered .actions { .filtered .actions {
@ -296,17 +272,11 @@
width: 100%; width: 100%;
} }
#changelist .actions.selected { /* XXX Probably unused? */
background: var(--body-bg);
border-top: 1px solid var(--body-bg);
border-bottom: 1px solid #edecd6;
}
#changelist .actions span.all, #changelist .actions span.all,
#changelist .actions span.action-counter, #changelist .actions span.action-counter,
#changelist .actions span.clear, #changelist .actions span.clear,
#changelist .actions span.question { #changelist .actions span.question {
font-size: 13px; font-size: 0.8125rem;
margin: 0 0.5em; margin: 0 0.5em;
} }
@ -320,7 +290,7 @@
color: var(--body-fg); color: var(--body-fg);
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 0.875rem;
padding: 0 0 0 4px; padding: 0 0 0 4px;
margin: 0; margin: 0;
margin-left: 10px; margin-left: 10px;
@ -333,11 +303,11 @@
#changelist .actions label { #changelist .actions label {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
font-size: 13px; font-size: 0.8125rem;
} }
#changelist .actions .button { #changelist .actions .button {
font-size: 13px; font-size: 0.8125rem;
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
border-radius: 4px; border-radius: 4px;
background: var(--body-bg); background: var(--body-bg);

Binary file not shown.

Binary file not shown.

View File

@ -84,7 +84,7 @@
#toolbar form input { #toolbar form input {
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 0.875rem;
padding: 5px; padding: 5px;
color: var(--body-fg); color: var(--body-fg);
} }
@ -95,7 +95,7 @@
padding: 2px 5px; padding: 2px 5px;
margin: 0; margin: 0;
vertical-align: top; vertical-align: top;
font-size: 13px; font-size: 0.8125rem;
max-width: 100%; max-width: 100%;
} }
@ -105,7 +105,7 @@
#toolbar form input[type="submit"] { #toolbar form input[type="submit"] {
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
font-size: 13px; font-size: 0.8125rem;
padding: 4px 8px; padding: 4px 8px;
margin: 0; margin: 0;
vertical-align: middle; vertical-align: middle;
@ -140,7 +140,7 @@
} }
#changelist-filter h2 { #changelist-filter h2 {
font-size: 14px; font-size: 0.875rem;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.5px; letter-spacing: 0.5px;
padding: 5px 15px; padding: 5px 15px;
@ -148,12 +148,35 @@
border-bottom: none; border-bottom: none;
} }
#changelist-filter h3 { #changelist-filter h3,
#changelist-filter details summary {
font-weight: 400; font-weight: 400;
padding: 0 15px; padding: 0 15px;
margin-bottom: 10px; margin-bottom: 10px;
} }
#changelist-filter details summary > * {
display: inline;
}
#changelist-filter details > summary {
list-style-type: none;
}
#changelist-filter details > summary::-webkit-details-marker {
display: none;
}
#changelist-filter details > summary::before {
content: '→';
font-weight: bold;
color: var(--link-hover-color);
}
#changelist-filter details[open] > summary::before {
content: '↓';
}
#changelist-filter ul { #changelist-filter ul {
margin: 5px 0; margin: 5px 0;
padding: 0 15px 15px; padding: 0 15px 15px;
@ -173,8 +196,7 @@
#changelist-filter a { #changelist-filter a {
display: block; display: block;
color: var(--body-quiet-color); color: var(--body-quiet-color);
text-overflow: ellipsis; word-break: break-word;
overflow-x: hidden;
} }
#changelist-filter li.selected { #changelist-filter li.selected {
@ -194,7 +216,7 @@
} }
#changelist-filter #changelist-filter-clear a { #changelist-filter #changelist-filter-clear a {
font-size: 13px; font-size: 0.8125rem;
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid var(--hairline-color); border-bottom: 1px solid var(--hairline-color);
} }
@ -225,52 +247,6 @@
color: var(--link-hover-color); color: var(--link-hover-color);
} }
/* PAGINATOR */
.paginator {
font-size: 13px;
padding-top: 10px;
padding-bottom: 10px;
line-height: 22px;
margin: 0;
border-top: 1px solid var(--hairline-color);
width: 100%;
}
.paginator a:link, .paginator a:visited {
padding: 2px 6px;
background: var(--button-bg);
text-decoration: none;
color: var(--button-fg);
}
.paginator a.showall {
border: none;
background: none;
color: var(--link-fg);
}
.paginator a.showall:focus, .paginator a.showall:hover {
background: none;
color: var(--link-hover-color);
}
.paginator .end {
margin-right: 6px;
}
.paginator .this-page {
padding: 2px 6px;
font-weight: bold;
font-size: 13px;
vertical-align: top;
}
.paginator a:focus, .paginator a:hover {
color: white;
background: var(--link-hover-color);
}
/* ACTIONS */ /* ACTIONS */
.filtered .actions { .filtered .actions {
@ -296,17 +272,11 @@
width: 100%; width: 100%;
} }
#changelist .actions.selected { /* XXX Probably unused? */
background: var(--body-bg);
border-top: 1px solid var(--body-bg);
border-bottom: 1px solid #edecd6;
}
#changelist .actions span.all, #changelist .actions span.all,
#changelist .actions span.action-counter, #changelist .actions span.action-counter,
#changelist .actions span.clear, #changelist .actions span.clear,
#changelist .actions span.question { #changelist .actions span.question {
font-size: 13px; font-size: 0.8125rem;
margin: 0 0.5em; margin: 0 0.5em;
} }
@ -320,7 +290,7 @@
color: var(--body-fg); color: var(--body-fg);
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 0.875rem;
padding: 0 0 0 4px; padding: 0 0 0 4px;
margin: 0; margin: 0;
margin-left: 10px; margin-left: 10px;
@ -333,11 +303,11 @@
#changelist .actions label { #changelist .actions label {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
font-size: 13px; font-size: 0.8125rem;
} }
#changelist .actions .button { #changelist .actions .button {
font-size: 13px; font-size: 0.8125rem;
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
border-radius: 4px; border-radius: 4px;
background: var(--body-bg); background: var(--body-bg);

Binary file not shown.

View File

@ -0,0 +1,33 @@
@media (prefers-color-scheme: dark) {
:root {
--primary: #264b5d;
--primary-fg: #f7f7f7;
--body-fg: #eeeeee;
--body-bg: #121212;
--body-quiet-color: #e0e0e0;
--body-loud-color: #ffffff;
--breadcrumbs-link-fg: #e0e0e0;
--breadcrumbs-bg: var(--primary);
--link-fg: #81d4fa;
--link-hover-color: #4ac1f7;
--link-selected-fg: #6f94c6;
--hairline-color: #272727;
--border-color: #353535;
--error-fg: #e35f5f;
--message-success-bg: #006b1b;
--message-warning-bg: #583305;
--message-error-bg: #570808;
--darkened-bg: #212121;
--selected-bg: #1b1b1b;
--selected-row: #00363a;
--close-button-bg: #333333;
--close-button-hover-bg: #666666;
}
}

Binary file not shown.

33
static/admin/css/dark_mode.css generated Normal file
View File

@ -0,0 +1,33 @@
@media (prefers-color-scheme: dark) {
:root {
--primary: #264b5d;
--primary-fg: #f7f7f7;
--body-fg: #eeeeee;
--body-bg: #121212;
--body-quiet-color: #e0e0e0;
--body-loud-color: #ffffff;
--breadcrumbs-link-fg: #e0e0e0;
--breadcrumbs-bg: var(--primary);
--link-fg: #81d4fa;
--link-hover-color: #4ac1f7;
--link-selected-fg: #6f94c6;
--hairline-color: #272727;
--border-color: #353535;
--error-fg: #e35f5f;
--message-success-bg: #006b1b;
--message-warning-bg: #583305;
--message-error-bg: #570808;
--darkened-bg: #212121;
--selected-bg: #1b1b1b;
--selected-row: #00363a;
--close-button-bg: #333333;
--close-button-hover-bg: #666666;
}
}

BIN
static/admin/css/dark_mode.css.gz generated Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,11 +1,11 @@
@import url("widgets.694d845b2cb1.css"); @import url("widgets.00318bc424d3.css");
/* FORM ROWS */ /* FORM ROWS */
.form-row { .form-row {
overflow: hidden; overflow: hidden;
padding: 10px; padding: 10px;
font-size: 13px; font-size: 0.8125rem;
border-bottom: 1px solid var(--hairline-color); border-bottom: 1px solid var(--hairline-color);
} }
@ -27,7 +27,7 @@ form .form-row p {
label { label {
font-weight: normal; font-weight: normal;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 13px; font-size: 0.8125rem;
} }
.required label, label.required { .required label, label.required {
@ -248,7 +248,7 @@ fieldset.monospace textarea {
/* SUBMIT ROW */ /* SUBMIT ROW */
.submit-row { .submit-row {
padding: 12px 14px; padding: 12px 14px 7px;
margin: 0 0 20px; margin: 0 0 20px;
background: var(--darkened-bg); background: var(--darkened-bg);
border: 1px solid var(--hairline-color); border: 1px solid var(--hairline-color);
@ -264,11 +264,11 @@ body.popup .submit-row {
.submit-row input { .submit-row input {
height: 35px; height: 35px;
line-height: 15px; line-height: 15px;
margin: 0 0 0 5px; margin: 0 0 5px 5px;
} }
.submit-row input.default { .submit-row input.default {
margin: 0 0 0 8px; margin: 0 0 5px 8px;
text-transform: uppercase; text-transform: uppercase;
} }
@ -288,6 +288,7 @@ body.popup .submit-row {
padding: 10px 15px; padding: 10px 15px;
height: 15px; height: 15px;
line-height: 15px; line-height: 15px;
margin-bottom: 5px;
color: var(--button-fg); color: var(--button-fg);
} }
@ -353,10 +354,6 @@ body.popup .submit-row {
width: 2.2em; width: 2.2em;
} }
.vTextField, .vUUIDField {
width: 20em;
}
.vIntegerField { .vIntegerField {
width: 5em; width: 5em;
} }
@ -369,6 +366,10 @@ body.popup .submit-row {
width: 5em; width: 5em;
} }
.vTextField, .vUUIDField {
width: 20em;
}
/* INLINES */ /* INLINES */
.inline-group { .inline-group {
@ -392,7 +393,7 @@ body.popup .submit-row {
margin: 0; margin: 0;
color: var(--body-quiet-color); color: var(--body-quiet-color);
padding: 5px; padding: 5px;
font-size: 13px; font-size: 0.8125rem;
background: var(--darkened-bg); background: var(--darkened-bg);
border-top: 1px solid var(--hairline-color); border-top: 1px solid var(--hairline-color);
border-bottom: 1px solid var(--hairline-color); border-bottom: 1px solid var(--hairline-color);
@ -404,7 +405,7 @@ body.popup .submit-row {
.inline-related h3 span.delete label { .inline-related h3 span.delete label {
margin-left: 2px; margin-left: 2px;
font-size: 11px; font-size: 0.6875rem;
} }
.inline-related fieldset { .inline-related fieldset {
@ -417,7 +418,7 @@ body.popup .submit-row {
.inline-related fieldset.module h3 { .inline-related fieldset.module h3 {
margin: 0; margin: 0;
padding: 2px 5px 3px 5px; padding: 2px 5px 3px 5px;
font-size: 11px; font-size: 0.6875rem;
text-align: left; text-align: left;
font-weight: bold; font-weight: bold;
background: #bcd; background: #bcd;
@ -458,7 +459,7 @@ body.popup .submit-row {
height: 1.1em; height: 1.1em;
padding: 2px 9px; padding: 2px 9px;
overflow: hidden; overflow: hidden;
font-size: 9px; font-size: 0.5625rem;
font-weight: bold; font-weight: bold;
color: var(--body-quiet-color); color: var(--body-quiet-color);
_width: 700px; _width: 700px;
@ -493,7 +494,7 @@ body.popup .submit-row {
.inline-group .tabular tr.add-row td a { .inline-group .tabular tr.add-row td a {
background: url("../img/icon-addlink.d519b3bab011.svg") 0 1px no-repeat; background: url("../img/icon-addlink.d519b3bab011.svg") 0 1px no-repeat;
padding-left: 16px; padding-left: 16px;
font-size: 12px; font-size: 0.75rem;
} }
.empty-form { .empty-form {

BIN
static/admin/css/forms.c192d1ec6902.css.gz generated Normal file

Binary file not shown.

View File

@ -5,7 +5,7 @@
.form-row { .form-row {
overflow: hidden; overflow: hidden;
padding: 10px; padding: 10px;
font-size: 13px; font-size: 0.8125rem;
border-bottom: 1px solid var(--hairline-color); border-bottom: 1px solid var(--hairline-color);
} }
@ -27,7 +27,7 @@ form .form-row p {
label { label {
font-weight: normal; font-weight: normal;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 13px; font-size: 0.8125rem;
} }
.required label, label.required { .required label, label.required {
@ -248,7 +248,7 @@ fieldset.monospace textarea {
/* SUBMIT ROW */ /* SUBMIT ROW */
.submit-row { .submit-row {
padding: 12px 14px; padding: 12px 14px 7px;
margin: 0 0 20px; margin: 0 0 20px;
background: var(--darkened-bg); background: var(--darkened-bg);
border: 1px solid var(--hairline-color); border: 1px solid var(--hairline-color);
@ -264,11 +264,11 @@ body.popup .submit-row {
.submit-row input { .submit-row input {
height: 35px; height: 35px;
line-height: 15px; line-height: 15px;
margin: 0 0 0 5px; margin: 0 0 5px 5px;
} }
.submit-row input.default { .submit-row input.default {
margin: 0 0 0 8px; margin: 0 0 5px 8px;
text-transform: uppercase; text-transform: uppercase;
} }
@ -288,6 +288,7 @@ body.popup .submit-row {
padding: 10px 15px; padding: 10px 15px;
height: 15px; height: 15px;
line-height: 15px; line-height: 15px;
margin-bottom: 5px;
color: var(--button-fg); color: var(--button-fg);
} }
@ -353,10 +354,6 @@ body.popup .submit-row {
width: 2.2em; width: 2.2em;
} }
.vTextField, .vUUIDField {
width: 20em;
}
.vIntegerField { .vIntegerField {
width: 5em; width: 5em;
} }
@ -369,6 +366,10 @@ body.popup .submit-row {
width: 5em; width: 5em;
} }
.vTextField, .vUUIDField {
width: 20em;
}
/* INLINES */ /* INLINES */
.inline-group { .inline-group {
@ -392,7 +393,7 @@ body.popup .submit-row {
margin: 0; margin: 0;
color: var(--body-quiet-color); color: var(--body-quiet-color);
padding: 5px; padding: 5px;
font-size: 13px; font-size: 0.8125rem;
background: var(--darkened-bg); background: var(--darkened-bg);
border-top: 1px solid var(--hairline-color); border-top: 1px solid var(--hairline-color);
border-bottom: 1px solid var(--hairline-color); border-bottom: 1px solid var(--hairline-color);
@ -404,7 +405,7 @@ body.popup .submit-row {
.inline-related h3 span.delete label { .inline-related h3 span.delete label {
margin-left: 2px; margin-left: 2px;
font-size: 11px; font-size: 0.6875rem;
} }
.inline-related fieldset { .inline-related fieldset {
@ -417,7 +418,7 @@ body.popup .submit-row {
.inline-related fieldset.module h3 { .inline-related fieldset.module h3 {
margin: 0; margin: 0;
padding: 2px 5px 3px 5px; padding: 2px 5px 3px 5px;
font-size: 11px; font-size: 0.6875rem;
text-align: left; text-align: left;
font-weight: bold; font-weight: bold;
background: #bcd; background: #bcd;
@ -458,7 +459,7 @@ body.popup .submit-row {
height: 1.1em; height: 1.1em;
padding: 2px 9px; padding: 2px 9px;
overflow: hidden; overflow: hidden;
font-size: 9px; font-size: 0.5625rem;
font-weight: bold; font-weight: bold;
color: var(--body-quiet-color); color: var(--body-quiet-color);
_width: 700px; _width: 700px;
@ -493,7 +494,7 @@ body.popup .submit-row {
.inline-group .tabular tr.add-row td a { .inline-group .tabular tr.add-row td a {
background: url(../img/icon-addlink.svg) 0 1px no-repeat; background: url(../img/icon-addlink.svg) 0 1px no-repeat;
padding-left: 16px; padding-left: 16px;
font-size: 12px; font-size: 0.75rem;
} }
.empty-form { .empty-form {

Binary file not shown.

View File

@ -12,7 +12,7 @@
} }
.login #header h1 { .login #header h1 {
font-size: 18px; font-size: 1.125rem;
margin: 0; margin: 0;
} }

BIN
static/admin/css/login.586129c60a93.css.gz generated Normal file

Binary file not shown.

Binary file not shown.

View File

@ -12,7 +12,7 @@
} }
.login #header h1 { .login #header h1 {
font-size: 18px; font-size: 1.125rem;
margin: 0; margin: 0;
} }

Binary file not shown.

View File

@ -16,7 +16,7 @@
border-right: 1px solid var(--hairline-color); border-right: 1px solid var(--hairline-color);
background-color: var(--body-bg); background-color: var(--body-bg);
cursor: pointer; cursor: pointer;
font-size: 20px; font-size: 1.25rem;
color: var(--link-fg); color: var(--link-fg);
padding: 0; padding: 0;
} }

Binary file not shown.

View File

@ -16,7 +16,7 @@
border-right: 1px solid var(--hairline-color); border-right: 1px solid var(--hairline-color);
background-color: var(--body-bg); background-color: var(--body-bg);
cursor: pointer; cursor: pointer;
font-size: 20px; font-size: 1.25rem;
color: var(--link-fg); color: var(--link-fg);
padding: 0; padding: 0;
} }

Binary file not shown.

Binary file not shown.

View File

@ -14,11 +14,11 @@ input[type="submit"], button {
td, th { td, th {
padding: 10px; padding: 10px;
font-size: 14px; font-size: 0.875rem;
} }
.small { .small {
font-size: 12px; font-size: 0.75rem;
} }
/* Layout */ /* Layout */
@ -28,7 +28,7 @@ input[type="submit"], button {
} }
#content { #content {
padding: 20px 30px 30px; padding: 15px 20px 20px;
} }
div.breadcrumbs { div.breadcrumbs {
@ -45,7 +45,6 @@ input[type="submit"], button {
#branding h1 { #branding h1 {
margin: 0 0 8px; margin: 0 0 8px;
font-size: 20px;
line-height: 1.2; line-height: 1.2;
} }
@ -88,7 +87,7 @@ input[type="submit"], button {
} }
td .changelink, td .addlink { td .changelink, td .addlink {
font-size: 13px; font-size: 0.8125rem;
} }
/* Changelist */ /* Changelist */
@ -131,10 +130,6 @@ input[type="submit"], button {
padding: 15px 0; padding: 15px 0;
} }
#changelist .actions.selected {
border: none;
}
#changelist .actions label { #changelist .actions label {
display: flex; display: flex;
} }
@ -152,7 +147,7 @@ input[type="submit"], button {
#changelist .actions span.clear, #changelist .actions span.clear,
#changelist .actions span.question, #changelist .actions span.question,
#changelist .actions span.action-counter { #changelist .actions span.action-counter {
font-size: 11px; font-size: 0.6875rem;
margin: 0 10px 0 0; margin: 0 10px 0 0;
} }
@ -176,7 +171,7 @@ input[type="submit"], button {
/* Forms */ /* Forms */
label { label {
font-size: 14px; font-size: 0.875rem;
} }
.form-row input[type=text], .form-row input[type=text],
@ -192,7 +187,7 @@ input[type="submit"], button {
margin: 0; margin: 0;
padding: 6px 8px; padding: 6px 8px;
min-height: 36px; min-height: 36px;
font-size: 14px; font-size: 0.875rem;
} }
.form-row select { .form-row select {
@ -236,6 +231,22 @@ input[type="submit"], button {
margin-left: 2px; margin-left: 2px;
} }
.submit-row {
padding: 8px 8px 3px 8px;
}
.submit-row a.deletelink {
padding: 10px 7px;
}
.submit-row input.default {
margin: 0 0 5px 5px;
}
.button, input[type=submit], input[type=button], .submit-row input, a.button {
padding: 7px;
}
/* Related widget */ /* Related widget */
.related-widget-wrapper { .related-widget-wrapper {
@ -393,12 +404,12 @@ input[type="submit"], button {
} }
.datetime span { .datetime span {
font-size: 13px; font-size: 0.8125rem;
} }
.datetime .timezonewarning { .datetime .timezonewarning {
display: block; display: block;
font-size: 11px; font-size: 0.6875rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
@ -496,7 +507,7 @@ input[type="submit"], button {
#content-related .module h2 { #content-related .module h2 {
padding: 10px 15px; padding: 10px 15px;
font-size: 16px; font-size: 1rem;
} }
/* Changelist */ /* Changelist */
@ -622,7 +633,7 @@ input[type="submit"], button {
.aligned p.file-upload { .aligned p.file-upload {
margin-left: 0; margin-left: 0;
font-size: 13px; font-size: 0.8125rem;
} }
span.clearable-file-input { span.clearable-file-input {
@ -630,7 +641,7 @@ input[type="submit"], button {
} }
span.clearable-file-input label { span.clearable-file-input label {
font-size: 13px; font-size: 0.8125rem;
padding-bottom: 0; padding-bottom: 0;
} }
@ -812,7 +823,7 @@ input[type="submit"], button {
/* Submit row */ /* Submit row */
.submit-row { .submit-row {
padding: 10px 10px 0; padding: 10px 10px 5px;
margin: 0 0 15px; margin: 0 0 15px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -907,7 +918,7 @@ input[type="submit"], button {
.errornote { .errornote {
margin: 0 0 20px; margin: 0 0 20px;
padding: 8px 12px; padding: 8px 12px;
font-size: 13px; font-size: 0.8125rem;
} }
/* Calendar and clock */ /* Calendar and clock */
@ -954,7 +965,7 @@ input[type="submit"], button {
.calendar-shortcuts { .calendar-shortcuts {
padding: 10px 0; padding: 10px 0;
font-size: 12px; font-size: 0.75rem;
line-height: 12px; line-height: 12px;
} }
@ -987,7 +998,7 @@ input[type="submit"], button {
/* History */ /* History */
table#change-history tbody th, table#change-history tbody td { table#change-history tbody th, table#change-history tbody td {
font-size: 13px; font-size: 0.8125rem;
word-break: break-word; word-break: break-word;
} }
@ -998,7 +1009,7 @@ input[type="submit"], button {
/* Docs */ /* Docs */
table.model tbody th, table.model tbody td { table.model tbody th, table.model tbody td {
font-size: 13px; font-size: 0.8125rem;
word-break: break-word; word-break: break-word;
} }
} }

Binary file not shown.

Binary file not shown.

View File

@ -14,11 +14,11 @@ input[type="submit"], button {
td, th { td, th {
padding: 10px; padding: 10px;
font-size: 14px; font-size: 0.875rem;
} }
.small { .small {
font-size: 12px; font-size: 0.75rem;
} }
/* Layout */ /* Layout */
@ -28,7 +28,7 @@ input[type="submit"], button {
} }
#content { #content {
padding: 20px 30px 30px; padding: 15px 20px 20px;
} }
div.breadcrumbs { div.breadcrumbs {
@ -45,7 +45,6 @@ input[type="submit"], button {
#branding h1 { #branding h1 {
margin: 0 0 8px; margin: 0 0 8px;
font-size: 20px;
line-height: 1.2; line-height: 1.2;
} }
@ -88,7 +87,7 @@ input[type="submit"], button {
} }
td .changelink, td .addlink { td .changelink, td .addlink {
font-size: 13px; font-size: 0.8125rem;
} }
/* Changelist */ /* Changelist */
@ -131,10 +130,6 @@ input[type="submit"], button {
padding: 15px 0; padding: 15px 0;
} }
#changelist .actions.selected {
border: none;
}
#changelist .actions label { #changelist .actions label {
display: flex; display: flex;
} }
@ -152,7 +147,7 @@ input[type="submit"], button {
#changelist .actions span.clear, #changelist .actions span.clear,
#changelist .actions span.question, #changelist .actions span.question,
#changelist .actions span.action-counter { #changelist .actions span.action-counter {
font-size: 11px; font-size: 0.6875rem;
margin: 0 10px 0 0; margin: 0 10px 0 0;
} }
@ -176,7 +171,7 @@ input[type="submit"], button {
/* Forms */ /* Forms */
label { label {
font-size: 14px; font-size: 0.875rem;
} }
.form-row input[type=text], .form-row input[type=text],
@ -192,7 +187,7 @@ input[type="submit"], button {
margin: 0; margin: 0;
padding: 6px 8px; padding: 6px 8px;
min-height: 36px; min-height: 36px;
font-size: 14px; font-size: 0.875rem;
} }
.form-row select { .form-row select {
@ -236,6 +231,22 @@ input[type="submit"], button {
margin-left: 2px; margin-left: 2px;
} }
.submit-row {
padding: 8px 8px 3px 8px;
}
.submit-row a.deletelink {
padding: 10px 7px;
}
.submit-row input.default {
margin: 0 0 5px 5px;
}
.button, input[type=submit], input[type=button], .submit-row input, a.button {
padding: 7px;
}
/* Related widget */ /* Related widget */
.related-widget-wrapper { .related-widget-wrapper {
@ -393,12 +404,12 @@ input[type="submit"], button {
} }
.datetime span { .datetime span {
font-size: 13px; font-size: 0.8125rem;
} }
.datetime .timezonewarning { .datetime .timezonewarning {
display: block; display: block;
font-size: 11px; font-size: 0.6875rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
@ -496,7 +507,7 @@ input[type="submit"], button {
#content-related .module h2 { #content-related .module h2 {
padding: 10px 15px; padding: 10px 15px;
font-size: 16px; font-size: 1rem;
} }
/* Changelist */ /* Changelist */
@ -622,7 +633,7 @@ input[type="submit"], button {
.aligned p.file-upload { .aligned p.file-upload {
margin-left: 0; margin-left: 0;
font-size: 13px; font-size: 0.8125rem;
} }
span.clearable-file-input { span.clearable-file-input {
@ -630,7 +641,7 @@ input[type="submit"], button {
} }
span.clearable-file-input label { span.clearable-file-input label {
font-size: 13px; font-size: 0.8125rem;
padding-bottom: 0; padding-bottom: 0;
} }
@ -812,7 +823,7 @@ input[type="submit"], button {
/* Submit row */ /* Submit row */
.submit-row { .submit-row {
padding: 10px 10px 0; padding: 10px 10px 5px;
margin: 0 0 15px; margin: 0 0 15px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -907,7 +918,7 @@ input[type="submit"], button {
.errornote { .errornote {
margin: 0 0 20px; margin: 0 0 20px;
padding: 8px 12px; padding: 8px 12px;
font-size: 13px; font-size: 0.8125rem;
} }
/* Calendar and clock */ /* Calendar and clock */
@ -954,7 +965,7 @@ input[type="submit"], button {
.calendar-shortcuts { .calendar-shortcuts {
padding: 10px 0; padding: 10px 0;
font-size: 12px; font-size: 0.75rem;
line-height: 12px; line-height: 12px;
} }
@ -987,7 +998,7 @@ input[type="submit"], button {
/* History */ /* History */
table#change-history tbody th, table#change-history tbody td { table#change-history tbody th, table#change-history tbody td {
font-size: 13px; font-size: 0.8125rem;
word-break: break-word; word-break: break-word;
} }
@ -998,7 +1009,7 @@ input[type="submit"], button {
/* Docs */ /* Docs */
table.model tbody th, table.model tbody td { table.model tbody th, table.model tbody td {
font-size: 13px; font-size: 0.8125rem;
word-break: break-word; word-break: break-word;
} }
} }

Binary file not shown.

Binary file not shown.

View File

@ -175,12 +175,24 @@ fieldset .fieldBox {
top: 0; top: 0;
left: auto; left: auto;
right: 10px; right: 10px;
background: url("../img/calendar-icons.39b290681a8b.svg") 0 -30px no-repeat;
}
.calendarbox .calendarnav-previous:focus,
.calendarbox .calendarnav-previous:hover {
background-position: 0 -45px;
} }
.calendarnav-next { .calendarnav-next {
top: 0; top: 0;
right: auto; right: auto;
left: 10px; left: 10px;
background: url("../img/calendar-icons.39b290681a8b.svg") 0 0 no-repeat;
}
.calendarbox .calendarnav-next:focus,
.calendarbox .calendarnav-next:hover {
background-position: 0 -15px;
} }
.calendar caption, .calendarbox h2 { .calendar caption, .calendarbox h2 {

BIN
static/admin/css/rtl.8473f45bd49b.css.gz generated Normal file

Binary file not shown.

View File

@ -175,12 +175,24 @@ fieldset .fieldBox {
top: 0; top: 0;
left: auto; left: auto;
right: 10px; right: 10px;
background: url(../img/calendar-icons.svg) 0 -30px no-repeat;
}
.calendarbox .calendarnav-previous:focus,
.calendarbox .calendarnav-previous:hover {
background-position: 0 -45px;
} }
.calendarnav-next { .calendarnav-next {
top: 0; top: 0;
right: auto; right: auto;
left: 10px; left: 10px;
background: url(../img/calendar-icons.svg) 0 0 no-repeat;
}
.calendarbox .calendarnav-next:focus,
.calendarbox .calendarnav-next:hover {
background-position: 0 -15px;
} }
.calendar caption, .calendarbox h2 { .calendar caption, .calendarbox h2 {

Binary file not shown.

View File

@ -3,18 +3,21 @@
.selector { .selector {
width: 800px; width: 800px;
float: left; float: left;
display: flex;
} }
.selector select { .selector select {
width: 380px; width: 380px;
height: 17.2em; height: 17.2em;
flex: 1 0 auto;
} }
.selector-available, .selector-chosen { .selector-available, .selector-chosen {
float: left;
width: 380px; width: 380px;
text-align: center; text-align: center;
margin-bottom: 5px; margin-bottom: 5px;
display: flex;
flex-direction: column;
} }
.selector-chosen select { .selector-chosen select {
@ -41,7 +44,7 @@
border-width: 0 1px; border-width: 0 1px;
padding: 8px; padding: 8px;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 10px; font-size: 0.625rem;
margin: 0; margin: 0;
text-align: left; text-align: left;
} }
@ -63,12 +66,13 @@
} }
.selector ul.selector-chooser { .selector ul.selector-chooser {
float: left; align-self: center;
width: 22px; width: 22px;
background-color: var(--selected-bg); background-color: var(--selected-bg);
border-radius: 10px; border-radius: 10px;
margin: 10em 5px 0 5px; margin: 0 5px;
padding: 0; padding: 0;
transform: translateY(-17px);
} }
.selector-chooser li { .selector-chooser li {
@ -168,6 +172,7 @@ a.active.selector-clearall:focus, a.active.selector-clearall:hover {
.stacked { .stacked {
float: left; float: left;
width: 490px; width: 490px;
display: block;
} }
.stacked select { .stacked select {
@ -193,6 +198,7 @@ a.active.selector-clearall:focus, a.active.selector-clearall:hover {
margin: 0 0 10px 40%; margin: 0 0 10px 40%;
background-color: #eee; background-color: #eee;
border-radius: 10px; border-radius: 10px;
transform: none;
} }
.stacked .selector-chooser li { .stacked .selector-chooser li {
@ -267,7 +273,7 @@ p.datetime {
.datetime span { .datetime span {
white-space: nowrap; white-space: nowrap;
font-weight: normal; font-weight: normal;
font-size: 11px; font-size: 0.6875rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
@ -277,7 +283,7 @@ p.datetime {
} }
table p.datetime { table p.datetime {
font-size: 11px; font-size: 0.6875rem;
margin-left: 0; margin-left: 0;
padding-left: 0; padding-left: 0;
} }
@ -311,7 +317,7 @@ table p.datetime {
} }
.timezonewarning { .timezonewarning {
font-size: 11px; font-size: 0.6875rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
@ -322,7 +328,7 @@ p.url {
margin: 0; margin: 0;
padding: 0; padding: 0;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 11px; font-size: 0.6875rem;
font-weight: bold; font-weight: bold;
} }
@ -337,7 +343,7 @@ p.file-upload {
margin: 0; margin: 0;
padding: 0; padding: 0;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 11px; font-size: 0.6875rem;
font-weight: bold; font-weight: bold;
} }
@ -355,7 +361,7 @@ p.file-upload {
span.clearable-file-input label { span.clearable-file-input label {
color: var(--body-fg); color: var(--body-fg);
font-size: 11px; font-size: 0.6875rem;
display: inline; display: inline;
float: none; float: none;
} }
@ -364,7 +370,7 @@ span.clearable-file-input label {
.calendarbox, .clockbox { .calendarbox, .clockbox {
margin: 5px auto; margin: 5px auto;
font-size: 12px; font-size: 0.75rem;
width: 19em; width: 19em;
text-align: center; text-align: center;
background: var(--body-bg); background: var(--body-bg);
@ -398,7 +404,7 @@ span.clearable-file-input label {
text-align: center; text-align: center;
border-top: none; border-top: none;
font-weight: 700; font-weight: 700;
font-size: 12px; font-size: 0.75rem;
color: #333; color: #333;
background: var(--accent); background: var(--accent);
} }
@ -408,14 +414,14 @@ span.clearable-file-input label {
background: var(--darkened-bg); background: var(--darkened-bg);
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 0.75rem;
text-align: center; text-align: center;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
.calendar td { .calendar td {
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 0.75rem;
text-align: center; text-align: center;
padding: 0; padding: 0;
border-top: 1px solid var(--hairline-color); border-top: 1px solid var(--hairline-color);
@ -455,7 +461,7 @@ span.clearable-file-input label {
} }
.calendarnav { .calendarnav {
font-size: 10px; font-size: 0.625rem;
text-align: center; text-align: center;
color: #ccc; color: #ccc;
margin: 0; margin: 0;
@ -470,7 +476,7 @@ span.clearable-file-input label {
.calendar-shortcuts { .calendar-shortcuts {
background: var(--body-bg); background: var(--body-bg);
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 11px; font-size: 0.6875rem;
line-height: 11px; line-height: 11px;
border-top: 1px solid var(--hairline-color); border-top: 1px solid var(--hairline-color);
padding: 8px 0; padding: 8px 0;
@ -509,7 +515,7 @@ span.clearable-file-input label {
.calendar-cancel { .calendar-cancel {
margin: 0; margin: 0;
padding: 4px 0; padding: 4px 0;
font-size: 12px; font-size: 0.75rem;
background: #eee; background: #eee;
border-top: 1px solid var(--border-color); border-top: 1px solid var(--border-color);
color: var(--body-fg); color: var(--body-fg);

Binary file not shown.

Binary file not shown.

View File

@ -3,18 +3,21 @@
.selector { .selector {
width: 800px; width: 800px;
float: left; float: left;
display: flex;
} }
.selector select { .selector select {
width: 380px; width: 380px;
height: 17.2em; height: 17.2em;
flex: 1 0 auto;
} }
.selector-available, .selector-chosen { .selector-available, .selector-chosen {
float: left;
width: 380px; width: 380px;
text-align: center; text-align: center;
margin-bottom: 5px; margin-bottom: 5px;
display: flex;
flex-direction: column;
} }
.selector-chosen select { .selector-chosen select {
@ -41,7 +44,7 @@
border-width: 0 1px; border-width: 0 1px;
padding: 8px; padding: 8px;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 10px; font-size: 0.625rem;
margin: 0; margin: 0;
text-align: left; text-align: left;
} }
@ -63,12 +66,13 @@
} }
.selector ul.selector-chooser { .selector ul.selector-chooser {
float: left; align-self: center;
width: 22px; width: 22px;
background-color: var(--selected-bg); background-color: var(--selected-bg);
border-radius: 10px; border-radius: 10px;
margin: 10em 5px 0 5px; margin: 0 5px;
padding: 0; padding: 0;
transform: translateY(-17px);
} }
.selector-chooser li { .selector-chooser li {
@ -168,6 +172,7 @@ a.active.selector-clearall:focus, a.active.selector-clearall:hover {
.stacked { .stacked {
float: left; float: left;
width: 490px; width: 490px;
display: block;
} }
.stacked select { .stacked select {
@ -193,6 +198,7 @@ a.active.selector-clearall:focus, a.active.selector-clearall:hover {
margin: 0 0 10px 40%; margin: 0 0 10px 40%;
background-color: #eee; background-color: #eee;
border-radius: 10px; border-radius: 10px;
transform: none;
} }
.stacked .selector-chooser li { .stacked .selector-chooser li {
@ -267,7 +273,7 @@ p.datetime {
.datetime span { .datetime span {
white-space: nowrap; white-space: nowrap;
font-weight: normal; font-weight: normal;
font-size: 11px; font-size: 0.6875rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
@ -277,7 +283,7 @@ p.datetime {
} }
table p.datetime { table p.datetime {
font-size: 11px; font-size: 0.6875rem;
margin-left: 0; margin-left: 0;
padding-left: 0; padding-left: 0;
} }
@ -311,7 +317,7 @@ table p.datetime {
} }
.timezonewarning { .timezonewarning {
font-size: 11px; font-size: 0.6875rem;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
@ -322,7 +328,7 @@ p.url {
margin: 0; margin: 0;
padding: 0; padding: 0;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 11px; font-size: 0.6875rem;
font-weight: bold; font-weight: bold;
} }
@ -337,7 +343,7 @@ p.file-upload {
margin: 0; margin: 0;
padding: 0; padding: 0;
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 11px; font-size: 0.6875rem;
font-weight: bold; font-weight: bold;
} }
@ -355,7 +361,7 @@ p.file-upload {
span.clearable-file-input label { span.clearable-file-input label {
color: var(--body-fg); color: var(--body-fg);
font-size: 11px; font-size: 0.6875rem;
display: inline; display: inline;
float: none; float: none;
} }
@ -364,7 +370,7 @@ span.clearable-file-input label {
.calendarbox, .clockbox { .calendarbox, .clockbox {
margin: 5px auto; margin: 5px auto;
font-size: 12px; font-size: 0.75rem;
width: 19em; width: 19em;
text-align: center; text-align: center;
background: var(--body-bg); background: var(--body-bg);
@ -398,7 +404,7 @@ span.clearable-file-input label {
text-align: center; text-align: center;
border-top: none; border-top: none;
font-weight: 700; font-weight: 700;
font-size: 12px; font-size: 0.75rem;
color: #333; color: #333;
background: var(--accent); background: var(--accent);
} }
@ -408,14 +414,14 @@ span.clearable-file-input label {
background: var(--darkened-bg); background: var(--darkened-bg);
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 0.75rem;
text-align: center; text-align: center;
color: var(--body-quiet-color); color: var(--body-quiet-color);
} }
.calendar td { .calendar td {
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 0.75rem;
text-align: center; text-align: center;
padding: 0; padding: 0;
border-top: 1px solid var(--hairline-color); border-top: 1px solid var(--hairline-color);
@ -455,7 +461,7 @@ span.clearable-file-input label {
} }
.calendarnav { .calendarnav {
font-size: 10px; font-size: 0.625rem;
text-align: center; text-align: center;
color: #ccc; color: #ccc;
margin: 0; margin: 0;
@ -470,7 +476,7 @@ span.clearable-file-input label {
.calendar-shortcuts { .calendar-shortcuts {
background: var(--body-bg); background: var(--body-bg);
color: var(--body-quiet-color); color: var(--body-quiet-color);
font-size: 11px; font-size: 0.6875rem;
line-height: 11px; line-height: 11px;
border-top: 1px solid var(--hairline-color); border-top: 1px solid var(--hairline-color);
padding: 8px 0; padding: 8px 0;
@ -509,7 +515,7 @@ span.clearable-file-input label {
.calendar-cancel { .calendar-cancel {
margin: 0; margin: 0;
padding: 4px 0; padding: 4px 0;
font-size: 12px; font-size: 0.75rem;
background: #eee; background: #eee;
border-top: 1px solid var(--border-color); border-top: 1px solid var(--border-color);
color: var(--body-fg); color: var(--body-fg);

Binary file not shown.

View File

@ -153,24 +153,6 @@ Requires core.js and SelectBox.js.
// Move selected from_box options to to_box // Move selected from_box options to to_box
SelectBox.move(field_id + '_from', field_id + '_to'); SelectBox.move(field_id + '_from', field_id + '_to');
if (!is_stacked) {
// In horizontal mode, give the same height to the two boxes.
const j_from_box = document.getElementById(field_id + '_from');
const j_to_box = document.getElementById(field_id + '_to');
let height = filter_p.offsetHeight + j_from_box.offsetHeight;
const j_to_box_style = window.getComputedStyle(j_to_box);
if (j_to_box_style.getPropertyValue('box-sizing') === 'border-box') {
// Add the padding and border to the final height.
height += parseInt(j_to_box_style.getPropertyValue('padding-top'), 10)
+ parseInt(j_to_box_style.getPropertyValue('padding-bottom'), 10)
+ parseInt(j_to_box_style.getPropertyValue('border-top-width'), 10)
+ parseInt(j_to_box_style.getPropertyValue('border-bottom-width'), 10);
}
j_to_box.style.height = height + 'px';
}
// Initial icon refresh // Initial icon refresh
SelectFilter.refresh_icons(field_id); SelectFilter.refresh_icons(field_id);
}, },

Binary file not shown.

Binary file not shown.

View File

@ -153,24 +153,6 @@ Requires core.js and SelectBox.js.
// Move selected from_box options to to_box // Move selected from_box options to to_box
SelectBox.move(field_id + '_from', field_id + '_to'); SelectBox.move(field_id + '_from', field_id + '_to');
if (!is_stacked) {
// In horizontal mode, give the same height to the two boxes.
const j_from_box = document.getElementById(field_id + '_from');
const j_to_box = document.getElementById(field_id + '_to');
let height = filter_p.offsetHeight + j_from_box.offsetHeight;
const j_to_box_style = window.getComputedStyle(j_to_box);
if (j_to_box_style.getPropertyValue('box-sizing') === 'border-box') {
// Add the padding and border to the final height.
height += parseInt(j_to_box_style.getPropertyValue('padding-top'), 10)
+ parseInt(j_to_box_style.getPropertyValue('padding-bottom'), 10)
+ parseInt(j_to_box_style.getPropertyValue('border-top-width'), 10)
+ parseInt(j_to_box_style.getPropertyValue('border-bottom-width'), 10);
}
j_to_box.style.height = height + 'px';
}
// Initial icon refresh // Initial icon refresh
SelectFilter.refresh_icons(field_id); SelectFilter.refresh_icons(field_id);
}, },

Binary file not shown.

View File

@ -388,13 +388,7 @@
DateTimeShortcuts.calendars[num].drawNextMonth(); DateTimeShortcuts.calendars[num].drawNextMonth();
}, },
handleCalendarCallback: function(num) { handleCalendarCallback: function(num) {
let format = get_format('DATE_INPUT_FORMATS')[0]; const format = get_format('DATE_INPUT_FORMATS')[0];
// the format needs to be escaped a little
format = format.replace('\\', '\\\\')
.replace('\r', '\\r')
.replace('\n', '\\n')
.replace('\t', '\\t')
.replace("'", "\\'");
return function(y, m, d) { return function(y, m, d) {
DateTimeShortcuts.calendarInputs[num].value = new Date(y, m - 1, d).strftime(format); DateTimeShortcuts.calendarInputs[num].value = new Date(y, m - 1, d).strftime(format);
DateTimeShortcuts.calendarInputs[num].focus(); DateTimeShortcuts.calendarInputs[num].focus();

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More