Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 30558e7

Browse files
author
Alan Rubin
authored
Merge pull request #99 from VariantEffect/develop
1.6.1-beta
2 parents 33cbf5b + e1b554f commit 30558e7

File tree

13 files changed

+196
-159
lines changed

13 files changed

+196
-159
lines changed

core/static/core/mavedb/base.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Global
1+
/* Global
22
----------------------------------- */
33
/* COLORS
44
#343a40 - 'Charcoal gray'
@@ -19,6 +19,7 @@
1919
*/
2020

2121
* {
22+
text-rendering: optimizeLegibility;
2223
font-family: 'Raleway', sans-serif;
2324
/*border-radius: 0px !important;*/
2425
/* border: 1px solid red !important; */

data/main/site_info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"md_privacy": "",
77
"md_terms": "",
88
"md_usage_guide": "",
9-
"version": "1.6.0-beta"
9+
"version": "1.6.1-beta"
1010
}

dataset/forms/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from django import forms as forms
22
from django.db import transaction
33

4-
from accounts.permissions import assign_superusers_as_admin
54
from metadata.fields import FlexibleModelMultipleChoiceField
65

76
from metadata.models import (

dataset/templates/dataset/base/base.html

Lines changed: 67 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -165,28 +165,6 @@ <h1>
165165
{# </div>#}
166166

167167
<div class="model-detail">
168-
<!-- Renders contributors as ORCID url-->
169-
<h2 id="contributors" class="underline left-align section-heading">Contributors</h2>
170-
<ul>
171-
{% for contributor in instance.contributors %}
172-
<li>
173-
{{ contributor.profile.get_display_name_hyperlink }}
174-
<i class="external-link fas fa-external-link-alt"></i>
175-
</li>
176-
{% endfor %}
177-
</ul>
178-
179-
{% if instance.class_name == "scoreset" %}
180-
<h2 id="data-usage" class="underline left-align section-heading">
181-
Data usage policy
182-
</h2>
183-
{% if instance.data_usage_policy|length %}
184-
<p>{{ instance.data_usage_policy }}</p>
185-
{% else %}
186-
<p>Not specified.</p>
187-
{% endif %}
188-
{% endif %}
189-
190168
<!-- Renders markdown abstract text -->
191169
{% if instance.class_name != "experimentset" %}
192170
<h2 id="title" class="underline left-align section-heading">Title</h2>
@@ -218,6 +196,73 @@ <h2 id="method" class="underline left-align section-heading">Method</h2>
218196
<p>{{ instance.md_method|safe}}</p>
219197
{% endif %}
220198

199+
<!-- Renders PubMed references -->
200+
<h2 id="references" class="underline left-align section-heading">References</h2>
201+
{% if instance.pubmed_ids.count %}
202+
<ol>
203+
{% for pm in instance.pubmed_ids.all %}
204+
<li>{{ pm.reference_html|safe }} PMID:
205+
<a target="_blank" href="{{pm.url}}">{{pm.identifier}}</a>
206+
<i class="external-link fas fa-external-link-alt"></i>
207+
</li>
208+
{% endfor %}
209+
</ol>
210+
{% if instance.class_name == 'scoreset' %}
211+
{% parent_references instance as parent_refs %}
212+
{% if parent_refs|length %}
213+
<p class="pl-4">References from
214+
<a href="{% url 'dataset:experiment_detail' instance.parent.urn %}">{{instance.parent}}</a>:
215+
</p>
216+
<ol start="{{instance.pubmed_ids.count|add:1}}">
217+
{% for pm in parent_refs %}
218+
<li>{{ pm.reference_html|safe }} PMID:
219+
<a target="_blank" href="{{pm.url}}">{{pm.identifier}}</a>
220+
<i class="external-link fas fa-external-link-alt"></i>
221+
</li>
222+
{% endfor %}
223+
</ol>
224+
{% endif %}
225+
{% endif %}
226+
{% else %}
227+
<p>No associated publications.</p>
228+
{% endif %}
229+
230+
<!-- Renders contributors as ORCID url-->
231+
<h2 id="contributors" class="underline left-align section-heading">Contributors</h2>
232+
<ul>
233+
{% for contributor in instance.administrators %}
234+
<li>
235+
{{ contributor.profile.get_display_name_hyperlink }}
236+
<i class="external-link fas fa-external-link-alt"></i>
237+
</li>
238+
{% endfor %}
239+
240+
{% for contributor in instance.editors %}
241+
<li>
242+
{{ contributor.profile.get_display_name_hyperlink }}
243+
<i class="external-link fas fa-external-link-alt"></i>
244+
</li>
245+
{% endfor %}
246+
247+
{% for contributor in instance.viewers %}
248+
<li>
249+
{{ contributor.profile.get_display_name_hyperlink }}
250+
<i class="external-link fas fa-external-link-alt"></i>
251+
</li>
252+
{% endfor %}
253+
</ul>
254+
255+
{% if instance.class_name == "scoreset" %}
256+
<h2 id="data-usage" class="underline left-align section-heading">
257+
Data usage policy
258+
</h2>
259+
{% if instance.data_usage_policy|length %}
260+
<p>{{ instance.data_usage_policy }}</p>
261+
{% else %}
262+
<p>Not specified.</p>
263+
{% endif %}
264+
{% endif %}
265+
221266
<!-- Renders Keywords -->
222267
<h2 id="method" class="underline left-align section-heading">Keywords</h2>
223268
{% if not keywords %}
@@ -269,37 +314,6 @@ <h2 id="metadata" class="underline left-align section-heading">
269314
<p><strong>SRA:</strong> No associated SRAs </p>
270315
{% endif %}
271316
{% endif %}
272-
273-
<!-- Renders PubMed references -->
274-
<h2 id="references" class="underline left-align section-heading">References</h2>
275-
{% if instance.pubmed_ids.count %}
276-
<ol>
277-
{% for pm in instance.pubmed_ids.all %}
278-
<li>{{ pm.reference_html|safe }} PMID:
279-
<a target="_blank" href="{{pm.url}}">{{pm.identifier}}</a>
280-
<i class="external-link fas fa-external-link-alt"></i>
281-
</li>
282-
{% endfor %}
283-
</ol>
284-
{% if instance.class_name == 'scoreset' %}
285-
{% parent_references instance as parent_refs %}
286-
{% if parent_refs|length %}
287-
<p class="pl-4">References from
288-
<a href="{% url 'dataset:experiment_detail' instance.parent.urn %}">{{instance.parent}}</a>:
289-
</p>
290-
<ol start="{{instance.pubmed_ids.count|add:1}}">
291-
{% for pm in parent_refs %}
292-
<li>{{ pm.reference_html|safe }} PMID:
293-
<a target="_blank" href="{{pm.url}}">{{pm.identifier}}</a>
294-
<i class="external-link fas fa-external-link-alt"></i>
295-
</li>
296-
{% endfor %}
297-
</ol>
298-
{% endif %}
299-
{% endif %}
300-
{% else %}
301-
<p>No associated publications.</p>
302-
{% endif %}
303317
{% endif %}
304318

305319
{% block child_list %}

dataset/templates/dataset/scoreset/scoreset.html

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,6 @@ <h2 id="variants" class="underline left-align section-heading"> Variants </h2>
112112
<!-- Scores data tab -->
113113
<div class="tab-pane fade show active" id="scores" role="tabpanel" aria-labelledby="scores-tab">
114114
<div class="container-fluid mt-4">
115-
116-
<div class="row mt-1 mb-3">
117-
<div class="col-sm-3 col-md-3">
118-
<h3 style="margin: 0;">Scores dataset</h3>
119-
</div>
120-
</div>
121-
122115
{% if not instance.has_score_dataset %}
123116
<p class="text-muted"> No score data available.</p>
124117
{% else %}
@@ -146,13 +139,6 @@ <h3 style="margin: 0;">Scores dataset</h3>
146139
<div class="tab-pane fade" id="counts" role="tabpanel"
147140
aria-labelledby="counts-tab">
148141
<div class="container-fluid mt-4">
149-
150-
<div class="row mt-1 mb-3">
151-
<div class="col-sm-3 col-md-3">
152-
<h3 style="margin: 0;">Counts dataset</h3>
153-
</div>
154-
</div>
155-
156142
{% if not instance.has_count_dataset %}
157143
<p class="text-muted"> No count data available.</p>
158144
{% else %}

dataset/templatetags/dataset_tags.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def group_targets(scoresets):
4343

4444
@register.simple_tag
4545
def display_targets(instance, user, javascript=False,
46-
categories=False, organisms=False):
46+
categories=False, organisms=False, all_fields=False):
4747
targets = []
4848
if isinstance(instance, models.experiment.Experiment):
4949
children = visible_children(instance, user)
@@ -62,6 +62,8 @@ def display_targets(instance, user, javascript=False,
6262
if not targets:
6363
if javascript:
6464
return mark_safe(json.dumps(['-']))
65+
if all_fields:
66+
return '-', '-', '-'
6567
return '-'
6668

6769
t_categories = [t.category for t in targets]
@@ -72,12 +74,21 @@ def display_targets(instance, user, javascript=False,
7274
for t in targets
7375
]
7476
if javascript:
75-
if categories:
77+
if all_fields:
78+
return mark_safe(json.dumps(t_names)), \
79+
mark_safe(json.dumps(t_categories)), \
80+
mark_safe(json.dumps(t_organisms))
81+
elif categories:
7682
return mark_safe(json.dumps(t_categories))
7783
elif organisms:
7884
return mark_safe(json.dumps(t_organisms))
7985
else:
8086
return mark_safe(json.dumps(t_names))
87+
88+
if all_fields:
89+
return mark_safe(', '.join(t_names)), \
90+
mark_safe(', '.join(t_categories)), \
91+
mark_safe(', '.join(t_organisms))
8192
if categories:
8293
return mark_safe(', '.join(t_categories))
8394
elif organisms:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import sys
2+
import os
3+
4+
from django.core.management.base import BaseCommand
5+
from django.db import transaction
6+
7+
from main.models import News
8+
9+
LEVELS = [i[0] for i in News.STATUS_CHOICES]
10+
11+
12+
class Command(BaseCommand):
13+
def add_arguments(self, parser):
14+
parser.add_argument(
15+
'--message',
16+
type=str,
17+
help="Announcemnet message string or file (markdown supported)",
18+
)
19+
parser.add_argument(
20+
'--level',
21+
type=str,
22+
help="Message level ({})".format(', '.join(LEVELS)),
23+
)
24+
25+
@transaction.atomic
26+
def handle(self, *args, **kwargs):
27+
message = kwargs.get('message')
28+
level = kwargs.get('level')
29+
30+
path = os.path.normpath(os.path.expanduser(message))
31+
if not message:
32+
sys.stderr.write("Please supply a message.\n")
33+
sys.exit()
34+
35+
if os.path.isfile(path):
36+
message = open(path, 'rt').read()
37+
if not message:
38+
sys.stderr.write("Please supply a message.\n")
39+
sys.exit()
40+
41+
if level not in LEVELS:
42+
sys.stderr.write("Unsupported level {}.\n".format(level))
43+
sys.exit()
44+
45+
News.objects.create(text=message, level=level)
46+
sys.stdout.write("Created news item.")

main/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from django.conf import settings
66
from django.db import models
7-
from django.db.models import ObjectDoesNotExist
87

98
from core.models import TimeStampedModel
109

main/templates/main/base.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@
1414
<meta name="author" content="Daniel C. Esposito, Alan F. Rubin">
1515
<meta name="keywords" content="dms,deep mutational scanning,mave,multiplex assays of
1616
variant effect,variant effect,gene,genomic,variants,functional assay,multiplex assay">
17-
<link href="{% static 'core/google/fonts_icons.css' %}" rel="stylesheet" type="text/css">
17+
{# <link href="{% static 'core/google/fonts_icons.css' %}" rel="stylesheet" type="text/css">#}
18+
19+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css"
20+
integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ"
21+
crossorigin="anonymous">
22+
<link href="https://fonts.googleapis.com/css?family=Raleway:200,200i,300,300i,400,400i"
23+
rel="stylesheet">
24+
1825
<link href="{% static 'core/bootstrap/bootstrap.min.css' %}" rel="stylesheet" type="text/css">
1926
<link href="{% static 'core/tocbot/tocbot_4.3.0.css' %}" rel="stylesheet" type="text/css">
2027
<link href="{% static 'core/select2/select2_4.0.5.min.css' %}" rel="stylesheet" type="text/css">
21-
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css"
22-
integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
2328
<link href="{% static 'core/datatables/datatables.min.css' %}" rel="stylesheet" type="text/css">
2429
<link href="{% static 'core/mavedb/dna.png' %}" rel="icon" type="image/png"/>
2530
<link href="{% static 'core/mavedb/base.css' %}" rel="stylesheet" type="text/css">
@@ -218,7 +223,7 @@ <h5 class="modal-title" id="exampleModalLabel">Log in with ORCID</h5>
218223
{% endif %}
219224

220225
<div class="row justify-content-center">
221-
<a target="_blank" href="https://github.com/FowlerLab/mavedb">
226+
<a target="_blank" href="https://github.com/VariantEffect/mavedb">
222227
<img class="mb-2" src="{% static 'core/mavedb/github_64px.png' %}" alt="" width="24" height="24">
223228
</a>
224229
</div>

main/templates/main/home.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@
88
<div id="about-citation-wrapper">
99
<h1> About </h1>
1010
<div id="about">
11-
{{ site_information.about|safe|escape|default:"None" }}
11+
<p>{{ site_information.about|safe|escape|default:"None" }}</p>
1212
</div>
1313
<hr>
1414
<h1> Citation </h1>
1515
<div id="citation">
16-
{{ site_information.citation|safe|escape|default:"None" }}
16+
{% if site_information.citation|length %}
17+
<p>{{ site_information.citation|safe|escape|default:"Coming soon." }}</p>
18+
{% else %}
19+
<p>Coming soon.</p>
20+
{% endif %}
1721
</div>
1822
<hr class="visible-xs invisible">
1923
</div>
@@ -22,7 +26,7 @@ <h1> Citation </h1>
2226
<div class="col-md-6">
2327
<div id="news-items">
2428
<h1> News <i class="far fa-newspaper" style="font-size: 32px"></i> </h1>
25-
<div class="news hover-card">
29+
<div class="news hover-card" style="min-height: 208px; max-height: 350px; overflow-y: scroll;">
2630
{% if news_items %}
2731
{% for news_item in news_items %}
2832
<div id="news-item-{{forloop.counter}}">

0 commit comments

Comments
 (0)