Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions dandiapi/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
6 changes: 6 additions & 0 deletions dandiapi/api/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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],
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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],
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions dandiapi/api/migrations/0001_default_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)


Expand Down
2 changes: 2 additions & 0 deletions dandiapi/api/templates/api/account/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">

<!-- TODO: BRANDING(name) - hardcoded archive title -->
<title>DANDI Archive</title>

<style>
Expand Down Expand Up @@ -38,6 +39,7 @@
<nav style="background-color: #f5f5f5;">
<div class="nav-wrapper logo-container">
<a href="{{ dandi_web_app_url }}" class="brand-logo">
<!-- TODO: BRANDING - hardcoded logo URL -->
<img src="https://raw.githubusercontent.com/dandi/dandi.github.io/master/assets/dandi_logo.svg" class="logo">
</a>
</div>
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/templates/api/account/questionnaire_form.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends 'api/account/base.html' %}

{% block body %}
{# TODO: BRANDING - hardcoded archive name and support email #}
<h5>Welcome to DANDI! Please take a moment to fill out this form.</h5>
<h6><b>Note:</b> No account is necessary to access public data!</h6>
<form method="POST" class="col s12">
Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/templates/api/mail/approved_user_message.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# TODO: BRANDING - hardcoded archive name, docs URLs, YouTube URL, team name #}
{% autoescape off %}
Dear {{ greeting_name }},

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/templates/api/mail/new_user_message.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# TODO: BRANDING(name) - hardcoded archive name #}
{% autoescape off %}
A new user ({{ username }}) has signed up for DANDI.

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/templates/api/mail/pending_users_message.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# TODO: BRANDING(name) - hardcoded archive name #}
{% autoescape off %}
The following new DANDI users are awaiting approval:

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/templates/api/mail/registered_message.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# TODO: BRANDING - hardcoded archive name, hub URL, docs URLs, YouTube URL, team name #}
{% autoescape off %}
Dear {{ greeting_name }},

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/templates/api/mail/rejected_user_message.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{# TODO: BRANDING - hardcoded archive name, support email, docs URL, team name #}
{% autoescape off %}
Dear {{ greeting_name }},

Expand Down
1 change: 1 addition & 0 deletions dandiapi/api/templates/api/root_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% block body %}
<h5>Welcome!</h5>

{# TODO: BRANDING - hardcoded archive name, about URL, support email #}
<p>This is the Django service that supports the DANDI API. There's
nothing specifically valuable at this exact location. You are probably
looking for one of the following instead:</p>
Expand Down
2 changes: 1 addition & 1 deletion dandiapi/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
]
schema_view = get_schema_view(
openapi.Info(
title='DANDI Archive',
title='DANDI Archive', # TODO: BRANDING(name) - hardcoded archive name in API schema
default_version='v1',
description='The BRAIN Initiative archive for publishing and sharing '
'cellular neurophysiology data',
Expand Down
Loading
Loading