Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge email functionality into staging #83

Merged
merged 5 commits into from
Feb 13, 2024
Merged
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
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
# DANDI Archive
# LINC Archive

![](https://www.dandiarchive.org/assets/dandi_logo.svg)
![Alt text](web/src/assets/linc-logo.svg "LINC Logo")

## DANDI: Distributed Archives for Neurophysiology Data Integration
LINC Archive is cloud infrastructure and data archival platform for the center for Large-scale Imaging of Neural Circuits (LINC). [See here for details](https://connects.mgh.harvard.edu/)

[DANDI](https://dandiarchive.org/) is a platform for publishing, sharing, and processing neurophysiology data
funded by the [BRAIN Initiative](https://braininitiative.nih.gov/). The archive
accepts cellular neurophysiology data including electrophysiology,
optophysiology, and behavioral time-series, and images from immunostaining
experiments. This archive is not just an endpoint to store data, it is intended as a living repository that enables
collaboration within and across labs, as well as the entry point for research.
The LINC Archive site can be (visited online here)[https://lincbrain.org]

This repository is a fork of the [DANDI Archive](https://github.com/dandi/dandi-archive) project. For more information, please visit the [DANDI Archive](https://dandiarchive.org/)

## Structure

The dandi-archive repository contains a Django-based [backend](dandiapi/) to run the DANDI REST API, and a
The linc-archive repository contains a Django-based [backend](dandiapi/) to run the LINC REST API, and a
Vue-based [frontend](web/) to provide a user interface to the archive.

## Resources

* To learn how to interact with the archive,
* To learn how to interact with LINC Archive, please temporarily refer to the DANDI Handbook,
see [the handbook](https://www.dandiarchive.org/handbook/).

* To get help:
Expand Down
4 changes: 2 additions & 2 deletions dandiapi/api/templates/api/account/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +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">

<title>LINC Platform</title>
<title>LINC Archive</title>

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

{% block body %}
<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>
<h5>Welcome to LINC Brain! Please take a moment to fill out this form.</h5>
<form method="POST" class="col s12">
{% csrf_token %}
{{ form }}
Expand Down
4 changes: 2 additions & 2 deletions dandiapi/api/templates/api/mail/added_message.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% autoescape off %}
You have been made an owner of dandiset {{ dandiset_identifier }} - "{{ dandiset_name }}".
You have been made an owner of dataset {{ dandiset_identifier }} - "{{ dandiset_name }}".

View this dandiset: {{ dandi_web_app_url }}/dandiset/{{ dandiset_identifier }}
View this dataset: {{ dandi_web_app_url }}/dandiset/{{ dandiset_identifier }}
{% endautoescape %}
11 changes: 3 additions & 8 deletions dandiapi/api/templates/api/mail/approved_user_message.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
{% autoescape off %}
Dear {{ greeting_name }},

Your DANDI account has been approved. You can go to {{ dandi_web_app_url }} and login with your GitHub account
Your LINC Brain account has been approved. You can go to {{ dandi_web_app_url }} and login with your GitHub account
to start creating dandisets and uploading data.

Please use the following links to post any questions or issues.

Discussions: https://github.com/dandi/helpdesk/discussions
Issues: https://github.com/dandi/helpdesk/issues/new/choose
YouTube: https://www.youtube.com/@dandiarchive
(please Subscribe)

Thank you for choosing DANDI for your neurophysiology data needs.
Thank you for joining the LINC Archive.

Sincerely,

The DANDI team
The LINC team
{% endautoescape %}
2 changes: 1 addition & 1 deletion dandiapi/api/templates/api/mail/new_user_message.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% autoescape off %}
A new user ({{ username }}) has signed up for DANDI.
A new user ({{ username }}) has signed up for LINC.

Please proceed to the following URL to approve or reject their account:

Expand Down
2 changes: 1 addition & 1 deletion dandiapi/api/templates/api/mail/pending_users_message.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% autoescape off %}
The following new DANDI users are awaiting approval:
The following new LINC users are awaiting approval:

{% for user in users %}
Username: {{ user.username }}
Expand Down
20 changes: 5 additions & 15 deletions dandiapi/api/templates/api/mail/registered_message.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
{% autoescape off %}
Dear {{ greeting_name }},

Welcome to DANDI.
Welcome to LINC.


Thank you for registering on the DANDI archive. Your account is now pending approval by
a DANDI admin. Once approved, you will be able to create Dandisets and upload data right
away. You will also be able to use the Jupyterhub (https://hub.dandiarchive.org) for
computing on dandisets in the cloud.
Thank you for registering on the LINC archive. Your account is now pending approval by
a LINC admin. Once approved, you will be able to create datasets and upload data right
away.

It may take up to 48 hours for your account to be approved and for your email to be
registered with our Slack workspace.

Please use the following links to post any questions or issues.

Discussions: https://github.com/dandi/helpdesk/discussions
Issues: https://github.com/dandi/helpdesk/issues/new/choose
YouTube: https://www.youtube.com/@dandiarchive
(please Subscribe)

Thank you for choosing DANDI for your neurophysiology data needs.

Sincerely,

The DANDI team
The LINC team
{% endautoescape %}
6 changes: 3 additions & 3 deletions dandiapi/api/templates/api/mail/rejected_user_message.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{% autoescape off %}
Dear {{ greeting_name }},

Your DANDI account has been denied approval.
Your LINC account has been denied approval.
{% if rejection_reason %}
Reason:
{{ rejection_reason }}
{% endif %}

If you would like to appeal this decision, please contact the DANDI admins at help@dandiarchive.org.
If you would like to appeal this decision, please contact the DANDI admins at help@lincbrain.org.

Sincerely,

The DANDI team
The LINC team
{% endautoescape %}
2 changes: 1 addition & 1 deletion dandiapi/api/templates/api/mail/removed_message.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% autoescape off %}
You have been removed as an owner of Dandiset "{{ dandiset_name }}".
You have been removed as an owner of dataset "{{ dandiset_name }}".
{% endautoescape %}
2 changes: 1 addition & 1 deletion dandiapi/api/templates/api/root_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h5>Welcome! Are you lost?</h5>
<li>The <a href="{{ web_app_url }}">LINC Archive</a>
instance associated with this API server</li>

<li>The <a href="https://www.dandiarchive.org">LINC Brain project</a>
<li>The <a href="https://www.lincbrain.org">LINC Brain project</a>
website</li>
</ul>

Expand Down
41 changes: 19 additions & 22 deletions dandiapi/api/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def auth_token_view(request: Request) -> HttpResponseBase:
QUESTIONS = [
{'question': 'First Name', 'max_length': 100},
{'question': 'Last Name', 'max_length': 100},
{'question': 'What do you plan to use DANDI for?', 'max_length': 1000},
{'question': 'What do you plan to use LINC Archive for?', 'max_length': 1000},
{'question': 'Please list any affiliations you have.', 'max_length': 1000},
]

Expand All @@ -63,28 +63,25 @@ def auth_token_view(request: Request) -> HttpResponseBase:

@require_http_methods(['GET'])
def authorize_view(request: HttpRequest) -> HttpResponse:
# from django.contrib.sites.models import Site

# raise Exception(Site.objects.get_current())
"""Override authorization endpoint to handle user questionnaire."""
# user: User = request.user
# if (
# user.is_authenticated
# and not user.is_superuser
# and user.metadata.status == UserMetadata.Status.INCOMPLETE
# ):
# # send user to questionnaire if they haven't filled it out yet
# return HttpResponseRedirect(
# f'{reverse("user-questionnaire")}'
# f'?{request.META["QUERY_STRING"]}&QUESTIONS={json.dumps(NEW_USER_QUESTIONS)}'
# )
# elif not user.is_anonymous and (not user.first_name or not user.last_name):
# # if this user doesn't have a first/last name available, redirect them to a
# # form to provide those before they can log in.
# return HttpResponseRedirect(
# f'{reverse("user-questionnaire")}'
# f'?{request.META["QUERY_STRING"]}&QUESTIONS={json.dumps(COLLECT_USER_NAME_QUESTIONS)}'
# )
user: User = request.user
if (
user.is_authenticated
and not user.is_superuser
and user.metadata.status == UserMetadata.Status.INCOMPLETE
):
# send user to questionnaire if they haven't filled it out yet
return HttpResponseRedirect(
f'{reverse("user-questionnaire")}'
f'?{request.META["QUERY_STRING"]}&QUESTIONS={json.dumps(NEW_USER_QUESTIONS)}'
)
elif not user.is_anonymous and (not user.first_name or not user.last_name):
# if this user doesn't have a first/last name available, redirect them to a
# form to provide those before they can log in.
return HttpResponseRedirect(
f'{reverse("user-questionnaire")}'
f'?{request.META["QUERY_STRING"]}&QUESTIONS={json.dumps(COLLECT_USER_NAME_QUESTIONS)}'
)

# otherwise, continue with normal authorization workflow
return AuthorizationView.as_view()(request)
Expand Down
6 changes: 3 additions & 3 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# DANDI Archive Web Application ![ci](https://github.com/dandi/dandi-archive/actions/workflows/frontend-ci.yml/badge.svg) [![Netlify Status](https://api.netlify.com/api/v1/badges/e7424684-fbdb-4b77-a546-d5757a0f7552/deploy-status)](https://app.netlify.com/sites/gui-dandiarchive-org/deploys)
The DANDI Archive web application (i.e. the dandi-archive frontend).
# LINC Archive Web Application
The LINC Archive web application (i.e. the linc-archive frontend).

## Develop

### Build and Run

```bash
git clone https://github.com/dandi/dandi-archive
git clone https://github.com/lincbrain/linc-archive
cd web
yarn install
yarn run serve
Expand Down
Loading