Skip to content

Commit

Permalink
merge: branch '93-bulma-v1' into 'dev'
Browse files Browse the repository at this point in the history
Fixes: #93
  • Loading branch information
rmnldwg committed Jan 24, 2025
2 parents 99e4f6d + a747dec commit a911393
Show file tree
Hide file tree
Showing 26 changed files with 453 additions and 12,287 deletions.
94 changes: 45 additions & 49 deletions lyprox/accounts/templates/accounts/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,51 @@
{% block content %}

<section class="section">
<div class="container">
<div class="block columns is-centered">
<div class="column is-4">
<div class="box">
<p class="title is-3">Login</p>

{% if form.errors %}
<div class="notification is-danger is-light">
Username and/or password wrong!
</div>
{% endif %}

<form action="{% url 'accounts:login' %}" method="post">
{% csrf_token %}

<div class="field">
<label for="{{ form.username.id_for_label }}" class="label">
{{ form.username.label }}
</label>
<div class="control">
{{ form.username }}
</div>
</div>

<div class="field">
<label for="{{ form.password.id_for_label }}" class="label">
{{ form.password.label }}
</label>
<div class="control">
{{ form.password }}
</div>
</div>

<div class="field is-grouped is-grouped-right">
<p class="control">
<button class="button is-primary">
<span class="icon">
<i class="fas fa-sign-in-alt"></i>
</span>
<span>Log in</span>
</button>
</p>
</div>

<input type="hidden" name="next" value="{{ next }}">
</form>
</div>
</div>
</div>
<div class="container is-max-tablet">
<div class="box">
<p class="title is-3">Login</p>

{% if form.errors %}
<div class="notification is-danger is-light">
Username and/or password wrong!
</div>
{% endif %}

<form action="{% url 'accounts:login' %}" method="post">
{% csrf_token %}

<div class="field">
<label for="{{ form.username.id_for_label }}" class="label">
{{ form.username.label }}
</label>
<div class="control">
{{ form.username }}
</div>
</div>

<div class="field">
<label for="{{ form.password.id_for_label }}" class="label">
{{ form.password.label }}
</label>
<div class="control">
{{ form.password }}
</div>
</div>

<div class="field is-grouped is-grouped-right">
<p class="control">
<button class="button is-primary has-text-white">
<span class="icon">
<i class="fas fa-sign-in-alt"></i>
</span>
<span>Log in</span>
</button>
</p>
</div>

<input type="hidden" name="next" value="{{ next }}">
</form>
</div>
</div>
</section>

Expand Down
44 changes: 20 additions & 24 deletions lyprox/accounts/templates/accounts/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,27 @@
{% block content %}

<section class="section">
<div class="container">
<div class="block columns is-centered">
<div class="column is-4">
<div class="box">
<p class="notification is-success is-light">
You have been successfully logged out.
</p>
<div class="container is-max-tablet">
<div class="box">
<p class="notification is-success is-light">
You have been successfully logged out.
</p>

<div class="buttons is-right">
<a href="{% url 'index' %}" class="button">
<span class="icon">
<i class="fas fa-home"></i>
</span>
<span>Home</span>
</a>
<a href="{% url 'accounts:login' %}" class="button is-primary">
<span class="icon">
<i class="fas fa-sign-in-alt"></i>
</span>
<span>Log in again</span>
</a>
</div>
</div>
</div>
</div>
<div class="buttons is-right">
<a href="{% url 'index' %}" class="button">
<span class="icon">
<i class="fas fa-home"></i>
</span>
<span>Home</span>
</a>
<a href="{% url 'accounts:login' %}" class="button is-primary has-text-white">
<span class="icon">
<i class="fas fa-sign-in-alt"></i>
</span>
<span>Log in again</span>
</a>
</div>
</div>
</div>
</section>

Expand Down
10 changes: 9 additions & 1 deletion lyprox/dataexplorer/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ def from_enum(cls, enum: type, **kwargs) -> "EasySubsiteChoiceField":
return cls(**default_kwargs)


def get_modality_choices() -> list[tuple[str, str]]:
"""Return the choices for the modality field."""
return [
(mod, mod.replace("_", " "))
for mod in get_default_modalities()
]


T = TypeVar("T", bound="DashboardForm")

class DashboardForm(FormLoggerMixin, forms.Form):
Expand All @@ -209,7 +217,7 @@ class DashboardForm(FormLoggerMixin, forms.Form):
modalities = forms.MultipleChoiceField(
required=False,
widget=forms.CheckboxSelectMultiple(attrs=checkbox_attrs),
choices=[(mod, mod) for mod in get_default_modalities()],
choices=get_modality_choices(),
initial=["CT", "MRI", "PET", "FNA", "diagnostic_consensus", "pathology", "pCT"],
)
"""Which modalities to combine into a consensus diagnosis."""
Expand Down
16 changes: 5 additions & 11 deletions lyprox/dataexplorer/static/dataexplorer/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ input[type="checkbox"].checkbox:checked:hover + label {
color: white;
}

input[type="checkbox"].checkbox:checked + .tags label {
background-color: #005EA8;
color: white;
}

input[type="checkbox"].checkbox:checked:hover + .tags label {
background-color: #005392;
color: white;
}

input[type="checkbox"].checkbox:checked + .tumor.buttons label {
background-color: #005EA8;
color: white;
Expand Down Expand Up @@ -79,6 +69,10 @@ div.stats.tag {
margin-top: 32px;
}

.is-toggle-all {
.is-margin-right-auto {
margin-right: auto !important;
}

.is-height-100 {
height: 100% !important;
}
1 change: 1 addition & 0 deletions lyprox/dataexplorer/static/dataexplorer/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function toggleAll(name) {
for (let i = 0; i < checkboxes.length; i++) {
checkboxes[i].checked = !checked;
}
changeHandler();
}

// Add the ability to submit the form via non-AJAX GET request to the server
Expand Down
92 changes: 45 additions & 47 deletions lyprox/dataexplorer/templates/dataexplorer/controls.html
Original file line number Diff line number Diff line change
@@ -1,56 +1,54 @@
<div class="tile is-parent">
<div class="tile is-child box">
<div class="level">
<div class="level-left">
<div class="level-item">
<div class="field has-addons">
{% for radio in form.show_percent %}
<div class="control">
{{ radio.tag }}
<label for="{{ radio.id_for_label }}" class="tag button is-medium is-info"
data-tooltip="Switch between displaying absolute numbers and percentages">
{% if radio.choice_label == 'percent' %}
<span class="icon">
<i class="fas fa-percentage"></i>
</span>
<span>percent</span>
{% elif radio.choice_label == 'absolute' %}
<span>absolute</span>
<span class="icon">
<i class="fab fa-slack-hash"></i>
</span>
{% endif %}
</label>
</div>
{% endfor %}
<div class="box is-height-100">
<div class="level">
<div class="level-left">
<div class="level-item">
<div class="field has-addons">
{% for radio in form.show_percent %}
<div class="control">
{{ radio.tag }}
<label for="{{ radio.id_for_label }}" class="tag button is-medium is-info"
data-tooltip="Switch between displaying absolute numbers and percentages">
{% if radio.choice_label == 'percent' %}
<span class="icon">
<i class="fas fa-percentage"></i>
</span>
<span>percent</span>
{% elif radio.choice_label == 'absolute' %}
<span>absolute</span>
<span class="icon">
<i class="fab fa-slack-hash"></i>
</span>
{% endif %}
</label>
</div>
{% endfor %}
</div>
</div>
<div class="level-right">
<div class="level-item">
<div class="buttons">
<div class="tooltip">
<a href="{% url 'dataexplorer:help' %}" class="button is-medium is-primary is-outlined">
<span class="icon">
<i class="fas fa-question"></i>
</span>
<span>Help</span>
</a>
{% include 'dataexplorer/help/tooltip.html' with side="left" position="top" image='dataexplorer/help/buttons.gif' markdown='dataexplorer/help/buttons.md' %}
</div>
<button class="button is-medium is-warning is-light is-outlined" type="submit"
formaction="{# url 'patients:list' #}" data-tooltip="Display selected subset in list">
<span>Patients in selection: <span class="stats" data-statfield="total">{{ stats.total }}</span></span>
</button>

<button class="button is-medium is-warning has-tooltip-multiline" type="submit" id="compute" disabled
data-tooltip="Display statistic of selected subset. Change selection to activate button">
</div>
<div class="level-right">
<div class="level-item">
<div class="buttons">
<div class="tooltip">
<a href="{% url 'dataexplorer:help' %}" class="button is-medium is-primary is-outlined">
<span class="icon">
<i class="fas fa-cogs"></i>
<i class="fas fa-question"></i>
</span>
<span><strong>Compute</strong></span>
</button>
<span>Help</span>
</a>
{% include 'dataexplorer/help/tooltip.html' with side="left" position="top" image='dataexplorer/help/buttons.gif' markdown='dataexplorer/help/buttons.md' %}
</div>
<button class="button is-medium is-warning is-light is-outlined" type="submit"
formaction="{# url 'patients:list' #}" data-tooltip="Display selected subset in list">
<span>Patients in selection: <span class="stats" data-statfield="total">{{ stats.total }}</span></span>
</button>

<button class="button is-medium is-warning has-tooltip-multiline has-text-white has-text-weight-bold" type="submit" id="compute" disabled
data-tooltip="Display statistic of selected subset. Change selection to activate button">
<span class="icon">
<i class="fas fa-cogs"></i>
</span>
<span>Compute</span>
</button>
</div>
</div>
</div>
Expand Down
21 changes: 14 additions & 7 deletions lyprox/dataexplorer/templates/dataexplorer/filter/datasets.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="stylesheet" href="{% static 'dataexplorer/datasets.css' %}">
{% endaddtoblock %}

<div class="tile is-child box">
<div class="box is-height-100">
<div class="level">
<div class="level-left">
<div class="level-item">
Expand All @@ -25,13 +25,20 @@
</div>
</div>

<div class="field is-grouped is-grouped-multiline">
<div class="grid is-col-min-7">
{% for checkbox in form.datasets %}
<div class="control">
{{ checkbox.tag }}
<label for="{{ checkbox.id_for_label }}" class="button is-primary is-light is-fullwidth">
{{ checkbox.choice_label}}
</label>
<div class="cell">
<div class="field">
<div class="control">
{{ checkbox.tag }}
<label for="{{ checkbox.id_for_label }}" class="button is-medium is-size-6 is-link is-light is-fullwidth p-2">
<span class="icon is-large tag has-background-white p-1">
<img src="{{ checkbox.choice_label|get_logo }}" alt="institution logo">
</span>
<span>{{ checkbox.choice_label|get_subsite }}</span>
</label>
</div>
</div>
</div>
{% endfor %}
</div>
Expand Down
18 changes: 11 additions & 7 deletions lyprox/dataexplorer/templates/dataexplorer/filter/modalities.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<div class="tile is-child box">
<div class="box is-height-100">
<div class="columns">
<div class="column is-2 is-flex is-flex-direction-row is-justify-content-left is-align-items-center">
<p id="modalities-title" class="title is-4">Modalities</p>
</div>

<div class="column is-8">
<div class="field is-grouped is-grouped-multiline">
<div class="grid">
{% for checkbox in form.modalities %}
<div class="control is-expanded">
{{ checkbox.tag }}
<label for="{{ checkbox.id_for_label }}" class="button is-primary is-light is-fullwidth">
{{ checkbox.choice_label }}
</label>
<div class="cell">
<div class="field">
<div class="control">
{{ checkbox.tag }}
<label for="{{ checkbox.id_for_label }}" class="button is-link is-light is-fullwidth">
{{ checkbox.choice_label }}
</label>
</div>
</div>
</div>
{% endfor %}
</div>
Expand Down
Loading

0 comments on commit a911393

Please sign in to comment.