diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index eced9615e..f14d0ef7f 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -154,6 +154,19 @@ This creates a dummy dandiset with valid metadata and a single dummy asset. The dandiset should be valid and publishable out of the box. This script is a simple way to get test data into your DB without having to use dandi-cli. +## Branding Annotations + +All locations where instance-specific branding is hardcoded are marked with +`TODO: BRANDING` comments (`TODO: BRANDING START`/`TODO: BRANDING END` for +multi-line blocks). To find all branding touchpoints: + +```bash +git grep -rn "TODO: BRANDING" +``` + +See [doc/design/branding.md](doc/design/branding.md) for the full inventory, +annotation conventions, and design notes. + ## Abbreviations - DLP: Dataset Landing Page (e.g. https://dandiarchive.org/dandiset/000027) diff --git a/dandiapi/api/admin.py b/dandiapi/api/admin.py index c03ca1a67..8396c2452 100644 --- a/dandiapi/api/admin.py +++ b/dandiapi/api/admin.py @@ -35,6 +35,7 @@ if TYPE_CHECKING: from django.http.request import HttpRequest +# TODO: BRANDING(name) - hardcoded admin site header/title admin.site.site_header = 'DANDI Admin' admin.site.site_title = 'DANDI Admin' diff --git a/dandiapi/api/mail.py b/dandiapi/api/mail.py index 469bcc56a..536a2b16e 100644 --- a/dandiapi/api/mail.py +++ b/dandiapi/api/mail.py @@ -97,6 +97,7 @@ def send_ownership_change_emails(dandiset, removed_owners, added_owners): def build_registered_message(user: User, socialaccount: SocialAccount): # Email sent to the DANDI list when a new user logs in for the first time return build_message( + # TODO: BRANDING(name) - hardcoded archive name in email subject subject=f'DANDI: New user registered: {user.email}', message=render_to_string( 'api/mail/registered_message.txt', @@ -120,6 +121,7 @@ def build_new_user_messsage(user: User, socialaccount: SocialAccount = None): } # Email sent to the DANDI list when a new user logs in for the first time return build_message( + # TODO: BRANDING(name) - hardcoded archive name in email subject subject=f'DANDI: Review new user: {user.username}', message=render_to_string('api/mail/new_user_message.txt', render_context), to=[settings.DANDI_ADMIN_EMAIL], @@ -135,6 +137,7 @@ def send_new_user_message_email(user: User, socialaccount: SocialAccount): def build_approved_user_message(user: User, socialaccount: SocialAccount = None): return build_message( + # TODO: BRANDING(name) - hardcoded archive name in email subject subject='Your DANDI Account', message=render_to_string( 'api/mail/approved_user_message.txt', @@ -156,6 +159,7 @@ def send_approved_user_message(user: User, socialaccount: SocialAccount): def build_rejected_user_message(user: User, socialaccount: SocialAccount = None): return build_message( + # TODO: BRANDING(name) - hardcoded archive name in email subject subject='Your DANDI Account', message=render_to_string( 'api/mail/rejected_user_message.txt', @@ -178,6 +182,7 @@ def send_rejected_user_message(user: User, socialaccount: SocialAccount): def build_pending_users_message(users: Iterable[User]): render_context = {**BASE_RENDER_CONTEXT, 'users': users} return build_message( + # TODO: BRANDING(name) - hardcoded archive name in email subject subject='DANDI: new user registrations to review', message=render_to_string('api/mail/pending_users_message.txt', render_context), to=[settings.DANDI_ADMIN_EMAIL], @@ -225,6 +230,7 @@ def build_dandiset_unembargo_failed_message(dandiset: Dandiset): render_context = {**BASE_RENDER_CONTEXT, 'dandiset': dandiset_context} html_message = render_to_string('api/mail/dandiset_unembargo_failed.html', render_context) return build_message( + # TODO: BRANDING(name) - hardcoded archive name in email subject subject=f'DANDI: Unembargo failed for dandiset {dandiset.identifier}', message=strip_tags(html_message), html_message=html_message, diff --git a/dandiapi/api/migrations/0001_default_site.py b/dandiapi/api/migrations/0001_default_site.py index 19679e0fb..0247e5acc 100644 --- a/dandiapi/api/migrations/0001_default_site.py +++ b/dandiapi/api/migrations/0001_default_site.py @@ -20,10 +20,12 @@ def update_default_site(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor # object already. Site.objects.update_or_create( pk=settings.SITE_ID, + # TODO: BRANDING START - hardcoded site domain and name defaults={ 'domain': 'api.dandiarchive.org', 'name': 'DANDI Archive', }, + # TODO: BRANDING END ) diff --git a/dandiapi/api/templates/api/account/base.html b/dandiapi/api/templates/api/account/base.html index ecfdfda91..a35afbb6b 100644 --- a/dandiapi/api/templates/api/account/base.html +++ b/dandiapi/api/templates/api/account/base.html @@ -9,6 +9,7 @@ +