-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update version footers * add model class label to filters * set color labels * add and format * remove bmds version number from input and validation * show version in bmds desktop table * fix rendering of collections and form bugs if errors * validate bad colors and fix error message styling * show bmds-ui version instead of pybmds version
- Loading branch information
1 parent
bfbc081
commit 48776dd
Showing
24 changed files
with
221 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
model_types = { | ||
"D": "Dichotomous", | ||
"C": "Continuous", | ||
"ND": "Nested Dichotomous", | ||
"MT": "Multistage Cancer / Multitumor", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 5.0.6 on 2024-07-27 00:35 | ||
import re | ||
|
||
import django | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("analysis", "0004_collection_analysis_last_updated_analysis_starred_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="collection", | ||
name="bg_color", | ||
field=models.CharField( | ||
default="#17A2B8", | ||
max_length=7, | ||
validators=[ | ||
django.core.validators.RegexValidator( | ||
regex=re.compile("^#(?:[0-9a-fA-F]{3}){1,2}$") | ||
) | ||
], | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 36 additions & 23 deletions
59
bmds_ui/analysis/templates/analysis/fragments/collection_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,36 @@ | ||
<form class="form-inline" hx-target="closest li" hx-swap="outerHTML"> | ||
{% csrf_token %} | ||
<div class="form-group">{{ form.name }}</div> | ||
<div class="form-group d-flex"> | ||
{% if object.id %} | ||
<a class="btn btn-primary" type="submit" | ||
hx-target="#collection-list" | ||
hx-post="{% url 'actions' action='collection_update' %}?id={{object.id}}">Update</a> | ||
<a class="btn btn-light" href="#" | ||
hx-get="{% url 'actions' action='collection_detail' %}?id={{object.id}}">Cancel</a> | ||
<a class="btn btn-danger" href="#" | ||
hx-confirm="Are you sure you wish to delete?" | ||
hx-delete="{% url 'actions' action='collection_delete' %}?id={{object.id}}" | ||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>Delete</a> | ||
{% else %} | ||
<button class="btn btn-primary" type="submit" | ||
hx-target="#collection-list" | ||
hx-post="{% url 'actions' action='collection_create' %}">Create</button> | ||
<button class="btn btn-light" type='button' | ||
onclick="$(this).closest('form').remove()">Cancel</button> | ||
{% endif %} | ||
</div> | ||
</form> | ||
<li class="list-group-item bg-lightblue" hx-target="this" hx-swap="outerHTML"> | ||
<form> | ||
{% csrf_token %} | ||
<div class="form-group row"> | ||
<label for="name" class="col-sm-3 col-form-label">Name</label> | ||
<div class="col-sm-9"> | ||
{{ form.name }} | ||
{{ form.name.errors }} | ||
</div> | ||
</div> | ||
<div class="form-group row"> | ||
<label for="bg_color" class="col-sm-3 col-form-label">Color</label> | ||
<div class="col-sm-9"> | ||
{{ form.bg_color }} | ||
{{form.bg_color.errors}} | ||
</div> | ||
</div> | ||
<div class="form-group row d-flex justify-content-center"> | ||
{% if object.id %} | ||
<button class="btn btn-primary" type="submit" | ||
hx-post="{% url 'actions' action='collection_update' %}?id={{object.id}}">Update</button> | ||
<a class="btn btn-light mx-4" href="#" | ||
hx-get="{% url 'actions' action='collection_detail' %}?id={{object.id}}">Cancel</a> | ||
<a class="btn btn-danger" href="#" | ||
hx-confirm="Are you sure you wish to delete?" | ||
hx-delete="{% url 'actions' action='collection_delete' %}?id={{object.id}}" | ||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>Delete</a> | ||
{% else %} | ||
<button class="btn btn-primary mr-3" type="submit" | ||
hx-post="{% url 'actions' action='collection_create' %}">Create</button> | ||
<button class="btn btn-light" type="button" | ||
onclick="$(this).closest('.list-group-item').remove(); event.stopPropagation();">Cancel</button> | ||
{% endif %} | ||
</div> | ||
</form> | ||
</li> |
4 changes: 3 additions & 1 deletion
4
bmds_ui/analysis/templates/analysis/fragments/collection_li.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<li class="list-group-item" hx-swap="innerHTML">{{object.name}} | ||
<li class="list-group-item" hx-swap="outerHTML"> | ||
<span style="background: {{object.bg_color}}1F; border: 3px solid {{object.bg_color}};" > </span> | ||
<span class="ml-2">{{object.name}}</span> | ||
<a class="btn btn-primary float-right" href="#" hx-get="{% url 'actions' action='collection_update' %}?id={{object.id}}" hx-target='closest li'><span class="bi bi-pencil-square mr-1"></span>Update</a> | ||
</li> |
14 changes: 0 additions & 14 deletions
14
bmds_ui/analysis/templates/analysis/fragments/collection_list.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.