Skip to content

Commit

Permalink
Adding JOGL links and data to activity pages
Browse files Browse the repository at this point in the history
This is currently "hidden" with a feature flag.
  • Loading branch information
madprime authored Jul 24, 2020
1 parent a2e3bf3 commit 0d09901
Show file tree
Hide file tree
Showing 12 changed files with 351 additions and 1 deletion.
3 changes: 3 additions & 0 deletions open_humans/fixtures/test-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
"is_academic_or_nonprofit": false,
"contact_email": "[email protected]",
"info_url": "http://jimihendrix.com",
"jogl_page": "https://app.jogl.io/project/135",
"short_description": "Really groovy music",
"long_description": "Bork norps are coming!",
"returned_data_description": "Lots of music",
Expand Down Expand Up @@ -253,6 +254,7 @@
"is_academic_or_nonprofit": false,
"contact_email": "[email protected]",
"info_url": "https://en.wikipedia.org/wiki/Trance_music",
"jogl_page": "",
"short_description": "List your five favorite trance tracks",
"long_description": "Trance",
"returned_data_description": "Lists of songs",
Expand Down Expand Up @@ -282,6 +284,7 @@
"is_academic_or_nonprofit": false,
"contact_email": "[email protected]",
"info_url": "http://www.example.com",
"jogl_page": "",
"short_description": "Some data",
"long_description": "Some data, long description",
"returned_data_description": "Stuff",
Expand Down
34 changes: 34 additions & 0 deletions open_humans/templates/member/activity.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends 'base-bs4.html' %}
{% load static %}
{% load waffle_tags %}
{% load utilities %}

{% block head_title %}{{ project.name }}{% endblock %}
Expand Down Expand Up @@ -55,6 +56,22 @@ <h2>About {{ project.name }}</h2>
aria-selected="false">Data</a>
</li>
{% endif %}

{% flag "jogl_features" %}
{# JOGL news & needs tabs #}
{% if project.jogl_page %}
<li class="nav-item">
<a class="nav-link" id="activity-panel-news-tab" data-toggle="tab"
href="#activity-panel-news" role="tab" aria-controls="activity-panel-news"
aria-selected="false">News</a>
</li>
<li class="nav-item">
<a class="nav-link" id="activity-panel-needs-tab" data-toggle="tab"
href="#activity-panel-needs" role="tab" aria-controls="activity-panel-needs"
aria-selected="false">Needs</a>
</li>
{% endif %}
{% endflag %}
</ul>
<div class="tab-content mt-3" id="myTabContent">
<div class="tab-pane fade show active" id="activity-panel-info" role="tabpanel"
Expand All @@ -65,5 +82,22 @@ <h2>About {{ project.name }}</h2>
aria-labelledby="activity-panel-data-tab">
{% include 'partials/activity-panel-data.html' %}
</div>

{% flag "jogl_features" %}
{# JOGL news & needs panels #}
{% if project.jogl_page %}
<script>
var joglURL = "{{ project.jogl_page }}";
</script>
<div class="tab-pane fade" id="activity-panel-news" role="tabpanel"
aria-labelledby="activity-panel-news-tab">
{% include 'partials/activity-panel-news.html' %}
</div>
<div class="tab-pane fade" id="activity-panel-needs" role="tabpanel"
aria-labelledby="activity-panel-needs-tab">
{% include 'partials/activity-panel-needs.html' %}
</div>
{% endif %}
{% endflag %}
</div>
{% endblock main %}
16 changes: 16 additions & 0 deletions open_humans/templates/partials/activity-panel-info.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load static %}
{% load waffle_tags %}
{% load utilities %}
{# the "info" panel on an activity page #}
<div class="row">
Expand Down Expand Up @@ -194,6 +195,13 @@ <h3>

{% endif %} {# / if project_member #}

{% flag "jogl_features" %}
{% if project.jogl_page %}
<div id="info-jogl-news">
</div>
{% endif %}
{% endflag %}

<hr class="d-md-none">
</div>

Expand Down Expand Up @@ -339,5 +347,13 @@ <h5 class="modal-title" id="termsModalTitle">{{ project.name}}: {% if project.is
{# describe permissions and added data #}
{% include 'partials/activity-permissions-bs4.html' %}
</div>

{% flag "jogl_features" %}
{% if project.jogl_page %}
<div id="info-jogl-needs">
</div>
{% endif %}
{% endflag %}

</div>
</div>
5 changes: 5 additions & 0 deletions open_humans/templates/partials/activity-panel-needs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% load static %}
{% load utilities %}
{# the "needs" panel on an activity page #}
<div id="jogl-needs">
</div>
5 changes: 5 additions & 0 deletions open_humans/templates/partials/activity-panel-news.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% load static %}
{% load utilities %}
{# the "news" panel on an activity page #}
<div id="jogl-news">
</div>
3 changes: 3 additions & 0 deletions private_sharing/fixtures/test-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"is_academic_or_nonprofit": true,
"contact_email": "[email protected]",
"info_url": "https://beaugunderson.com/",
"jogl_page": "",
"short_description": "abc",
"long_description": "def",
"active": true,
Expand Down Expand Up @@ -47,6 +48,7 @@
"is_academic_or_nonprofit": true,
"contact_email": "[email protected]",
"info_url": "https://beaugunderson.com/",
"jogl_page": "https://app.jogl.io/project/135",
"short_description": "def",
"long_description": "ghk",
"active": true,
Expand Down Expand Up @@ -81,6 +83,7 @@
"is_academic_or_nonprofit": true,
"contact_email": "[email protected]",
"info_url": "https://beaugunderson.com/",
"jogl_page": "",
"short_description": "abc3",
"long_description": "def3",
"active": true,
Expand Down
1 change: 1 addition & 0 deletions private_sharing/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Meta: # noqa: D101
"erasure_supported",
"deauth_email_notification",
"requested_sources",
"jogl_page",
)

def __init__(self, *args, **kwargs):
Expand Down
18 changes: 18 additions & 0 deletions private_sharing/migrations/0028_datarequestproject_jogl_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.10 on 2020-07-16 22:52

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [("private_sharing", "0027_oauth2datarequestproject_webhook_secret")]

operations = [
migrations.AddField(
model_name="datarequestproject",
name="jogl_page",
field=models.URLField(
blank=True, help_text="JOGL project page URL (optional)"
),
)
]
3 changes: 3 additions & 0 deletions private_sharing/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ class DataRequestProject(models.Model):
DataType, blank=True, related_name="source_projects"
)
any_datatypes = models.BooleanField(default=False)
jogl_page = models.URLField(
help_text="JOGL project page URL (optional)", blank=True
)

class Meta:
ordering = ["name"]
Expand Down
30 changes: 30 additions & 0 deletions static/css/oh-proj-theming.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0d09901

Please sign in to comment.