Skip to content

Commit e354b00

Browse files
authored
Feat: project_name in template & search card for BHF (#1913)
1 parent dc5b1d6 commit e354b00

File tree

2 files changed

+76
-1
lines changed

2 files changed

+76
-1
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{% load static %}
2+
{% load entity_renderer %}
3+
4+
<article class="entity-card" data-target="{% url 'entity_history_detail' pk=entity.id history_id=entity.history_id %}"
5+
data-entity-id="{{ entity.id }}" data-entity-version-id="{{ entity.history_id }}" data-layout-id="{{ layout.id }}"
6+
aria-label="View {{ entity.name }}">
7+
8+
<a class="entity-card__click" href="{% url 'entity_history_detail' pk=entity.id history_id=entity.history_id %}">
9+
<div class="entity-card__header">
10+
<div class="entity-card__header-item">
11+
<h3 class="entity-card__title">{{ entity.id }} - {{ entity.name }}</h3>
12+
<p class="entity-card__author">{{ entity.author }}</p>
13+
</div>
14+
{% render_field_value entity layout "project_name" None as type_value %}
15+
{% if project_name and project_name|length %}
16+
<div class="entity-card__header-item">
17+
<span tooltip="This is yet to be moderated" direction="left">
18+
<div class="chip bold washed-accent text-accent-darkest draft-icon icon-accent-highlight">
19+
<span class="chip-text" href="#">{{ project_name }}</span>
20+
</div>
21+
</span>
22+
</div>
23+
{% elif entity.publish_status != 2 %}
24+
<div class="entity-card__header-item">
25+
<span tooltip="This is yet to be moderated" direction="left">
26+
<div class="chip bold washed-accent text-accent-darkest draft-icon icon-accent-highlight">
27+
<span class="chip-text" href="#">UNPUBLISHED</span>
28+
</div>
29+
</span>
30+
</div>
31+
{% endif %}
32+
</div>
33+
<div class="entity-card__snippet">
34+
<div class="entity-card__snippet-metadata">
35+
{% render_field_value entity layout "type" None as type_value %}
36+
{% if not type_value %}
37+
<span class="entity-card__snippet-metadata-date">Last updated {{ entity.created|stylise_date }}</span>
38+
{% else %}
39+
<span class="entity-card__snippet-metadata-type">{{ type_value }}</span>
40+
<span class="entity-card__snippet-metadata-divider"></span>
41+
<span class="entity-card__snippet-metadata-date">Last updated {{ entity.created|stylise_date }}</span>
42+
{% endif %}
43+
</div>
44+
<div class="entity-card__snippet-tags">
45+
<div class="entity-card__snippet-tags-group">
46+
{% renderable_field_values entity layout "coding_system" as coding_systems %}
47+
{% for code in coding_systems %}
48+
<div class="meta-chip meta-chip-washed-accent">
49+
<span class="meta-chip__name meta-chip__name-text-accent-dark meta-chip__name-bold">{{ code.name }}</span>
50+
</div>
51+
{% endfor %}
52+
</div>
53+
<div class="entity-card__snippet-tags-group">
54+
{% renderable_field_values entity layout "collections" as collections %}
55+
{% for collection in collections %}
56+
<div class="meta-chip meta-chip-tertiary-accent">
57+
<span class="meta-chip__name meta-chip__name-text-accent-dark meta-chip__name-bold">{{ collection.name }}</span>
58+
</div>
59+
{% endfor %}
60+
</div>
61+
</div>
62+
</div>
63+
</a>
64+
</article>

CodeListLibrary_project/dynamic_templates/bhf_phenotype.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@
127127
"api": true
128128
}
129129
},
130+
"project_name": {
131+
"title": "Project Name",
132+
"active": true,
133+
"field_type": "string_inputbox",
134+
"validation": {
135+
"type": "string",
136+
"mandatory": false
137+
},
138+
"description": "The BHF project this Phenotype is associated with."
139+
},
130140
"corresp_email": {
131141
"title": "Email Address",
132142
"active": true,
@@ -331,6 +341,7 @@
331341
{
332342
"title": "Overview",
333343
"fields": [
344+
"project_name",
334345
"type",
335346
"phenotype_uuid",
336347
"sex",
@@ -391,7 +402,7 @@
391402
"template_details": {
392403
"name": "BHF Data Science Centre Phenotype",
393404
"version": 1,
394-
"card_type": "clinical",
405+
"card_type": "bhf",
395406
"description": "BHF Data Science Centre Phenotype definitions that describe a list of clinical codes, algorithms using clinical codes, or set of clinical trials. Visit the BHF Data Science Centre website to learn more: https://bhfdatasciencecentre.org"
396407
}
397408
}

0 commit comments

Comments
 (0)