-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Managements views for algorithm interfaces for phases (#3812)
This adds the management views for algorithm interfaces for phases. The views are only accessible to staff users, and only for algorithm submission phases that are not external. The logic behind the views is the same as for the algorithm interfaces, but it only made sense to refactor the create view logic, and parts of the templates. ![image](https://github.com/user-attachments/assets/b9c3d86b-fd2e-4ee4-a558-7bef40f15ab5) Part of DIAGNijmegen/rse-roadmap#153
- Loading branch information
Showing
18 changed files
with
564 additions
and
113 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
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
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 |
---|---|---|
@@ -1,19 +1,18 @@ | ||
{% extends "base.html" %} | ||
{% load crispy_forms_tags %} | ||
|
||
{% block title %} | ||
Create Interface - {{ algorithm.title }} - {{ block.super }} | ||
Create Interface - {{ base_obj.title }} - {{ block.super }} | ||
{% endblock %} | ||
|
||
{% block breadcrumbs %} | ||
<ol class="breadcrumb"> | ||
<li class="breadcrumb-item"><a href="{% url 'algorithms:list' %}">Algorithms</a> | ||
</li> | ||
<li class="breadcrumb-item"><a | ||
href="{{ algorithm.get_absolute_url }}">{{ algorithm.title }} | ||
href="{{ algorithm.get_absolute_url }}">{{ base_obj.title }} | ||
</a></li> | ||
<li class="breadcrumb-item"><a | ||
href="{% url 'algorithms:interface-list' slug=algorithm.slug %}">Interfaces | ||
href="{% url 'algorithms:interface-list' slug=base_obj.slug %}">Interfaces | ||
</a></li> | ||
<li class="breadcrumb-item active" | ||
aria-current="page">Create Interface | ||
|
@@ -22,21 +21,5 @@ | |
{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<h2>Create An Algorithm Interface</h2> | ||
<br> | ||
<p> | ||
Create an interface for your algorithm: define any combination of inputs and outputs, and optionally mark the interface as default for the algorithm. | ||
</p> | ||
<p> | ||
Please see the <a href="{% url 'components:component-interface-list-input' %}">list of input options</a> and the <a href="{% url 'components:component-interface-list-output' %}"> | ||
list of output options | ||
</a> for more information and examples. | ||
</p> | ||
<p> | ||
If you cannot find suitable inputs or outputs, please contact <a href="mailto:[email protected]">[email protected]</a>. | ||
</p> | ||
|
||
{% crispy form %} | ||
|
||
{% include 'algorithms/partials/algorithminterface_form.html' %} | ||
{% endblock %} |
20 changes: 20 additions & 0 deletions
20
...challenge/algorithms/templates/algorithms/partials/algorithminterface_confirm_delete.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% load remove_whitespace %} | ||
|
||
<h2>Confirm Algorithm Interface Deletion</h2> | ||
<form action="" method="post"> | ||
{% csrf_token %} | ||
<p>Are you sure that you want to delete the following algorithm interface from this {{ base_obj.verbose_name }}?</p> | ||
<ul> | ||
<li>Inputs: {{ object.interface.inputs.all|oxford_comma }}</li> | ||
<li>Outputs: {{ object.interface.outputs.all|oxford_comma }}</li> | ||
</ul> | ||
<p> | ||
<b class="text-danger">WARNING: You are not able to undo this action. Once the interface is deleted, it is deleted forever.</b> | ||
</p> | ||
<a href="{{ base_obj.algorithm_interface_list_url }}" | ||
type="button" | ||
class="btn btn-secondary">Cancel</a> | ||
<input type="submit" | ||
value="I understand, delete interface" | ||
class="btn btn-danger"/> | ||
</form> |
15 changes: 15 additions & 0 deletions
15
app/grandchallenge/algorithms/templates/algorithms/partials/algorithminterface_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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% load crispy_forms_tags %} | ||
{% load meta_attr %} | ||
|
||
<h2>Create An Algorithm Interface</h2> | ||
<p> | ||
Create an interface: define any combination of inputs and outputs, and optionally mark the interface as default for the {{ base_obj|verbose_name }}.</p> | ||
<p> | ||
Please see the <a href="{% url 'components:component-interface-list-input' %}">list of input options</a> and the <a href="{% url 'components:component-interface-list-output' %}"> | ||
list of output options </a> for more information and examples. | ||
</p> | ||
<p> | ||
If you cannot find suitable inputs or outputs, please contact <a href="mailto:[email protected]">[email protected]</a>. | ||
</p> | ||
|
||
{% crispy form %} |
36 changes: 36 additions & 0 deletions
36
app/grandchallenge/algorithms/templates/algorithms/partials/algorithminterface_list.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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{% load crispy_forms_tags %} | ||
{% load remove_whitespace %} | ||
{% load meta_attr %} | ||
|
||
<h2>Algorithm Interfaces for {{ base_obj }}</h2> | ||
|
||
<p>The following interfaces are configured for your {{ base_obj|verbose_name }}:</p> | ||
<p> | ||
<a class="btn btn-primary" href="{{ base_obj.algorithm_interface_create_url }}">Add new interface</a> | ||
</p> | ||
|
||
<div class="table-responsive"> | ||
<table class="table table-hover table-borderless"> | ||
<thead class="thead-light"> | ||
<th>Inputs</th> | ||
<th>Outputs</th> | ||
<th>Delete</th> | ||
</thead> | ||
<tbody> | ||
{% for object in object_list %} | ||
<tr> | ||
<td>{{ object.interface.inputs.all|oxford_comma }}</td> | ||
<td>{{ object.interface.outputs.all|oxford_comma }}</td> | ||
<td> | ||
<a class="btn btn-sm btn-danger m-0" | ||
href="{% url base_obj.algorithm_interface_delete_viewname slug=base_obj.slug interface_pk=object.interface.pk %}"> | ||
<i class="fas fa-trash"></i> | ||
</a> | ||
</td> | ||
</tr> | ||
{% empty %} | ||
<tr><td colspan="100%" class="text-center">This {{ base_obj|verbose_name }} does not have any interfaces defined yet.</td></tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> |
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
26 changes: 26 additions & 0 deletions
26
app/grandchallenge/evaluation/templates/evaluation/algorithminterface_for_phase_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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% extends "pages/challenge_settings_base.html" %} | ||
{% load url %} | ||
{% load static %} | ||
|
||
{% block title %} | ||
Create Interface - {{ base_obj.title }} - {% firstof challenge.title challenge.short_name %} - {{ block.super }} | ||
{% endblock %} | ||
|
||
{% block breadcrumbs %} | ||
<ol class="breadcrumb"> | ||
<li class="breadcrumb-item"><a | ||
href="{% url 'challenges:list' %}">Challenges</a> | ||
</li> | ||
<li class="breadcrumb-item"><a | ||
href="{{ challenge.get_absolute_url }}">{% firstof challenge.title challenge.short_name %}</a></li> | ||
<li class="breadcrumb-item"><a | ||
href="{% url 'evaluation:interface-list' challenge_short_name=challenge.short_name slug=base_obj.slug %}">Interfaces | ||
</a></li> | ||
<li class="breadcrumb-item active" | ||
aria-current="page">Create interface</li> | ||
</ol> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% include 'algorithms/partials/algorithminterface_form.html' %} | ||
{% endblock %} |
26 changes: 26 additions & 0 deletions
26
...randchallenge/evaluation/templates/evaluation/phasealgorithminterface_confirm_delete.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% extends "pages/challenge_settings_base.html" %} | ||
{% load url %} | ||
{% load static %} | ||
|
||
{% block title %} | ||
Delete interface - {{ phase.title }} - {% firstof challenge.title challenge.short_name %} - {{ block.super }} | ||
{% endblock %} | ||
|
||
{% block breadcrumbs %} | ||
<ol class="breadcrumb"> | ||
<li class="breadcrumb-item"><a | ||
href="{% url 'challenges:list' %}">Challenges</a> | ||
</li> | ||
<li class="breadcrumb-item"><a | ||
href="{{ challenge.get_absolute_url }}">{% firstof challenge.title challenge.short_name %}</a></li> | ||
<li class="breadcrumb-item"><a | ||
href="{% url 'evaluation:interface-list' challenge_short_name=challenge.short_name slug=phase.slug %}">Interfaces | ||
</a></li> | ||
<li class="breadcrumb-item active" | ||
aria-current="page">Delete interface</li> | ||
</ol> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% include 'algorithms/partials/algorithminterface_confirm_delete.html' with base_obj=phase %} | ||
{% endblock %} |
23 changes: 23 additions & 0 deletions
23
app/grandchallenge/evaluation/templates/evaluation/phasealgorithminterface_list.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% extends "pages/challenge_settings_base.html" %} | ||
{% load url %} | ||
{% load static %} | ||
|
||
{% block title %} | ||
Algorithm interfaces for {{ phase.title }} - {% firstof challenge.title challenge.short_name %} - {{ block.super }} | ||
{% endblock %} | ||
|
||
{% block breadcrumbs %} | ||
<ol class="breadcrumb"> | ||
<li class="breadcrumb-item"><a | ||
href="{% url 'challenges:list' %}">Challenges</a> | ||
</li> | ||
<li class="breadcrumb-item"><a | ||
href="{{ challenge.get_absolute_url }}">{% firstof challenge.title challenge.short_name %}</a></li> | ||
<li class="breadcrumb-item active" | ||
aria-current="page">Algorithm Interfaces for {{ phase.title }}</li> | ||
</ol> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% include 'algorithms/partials/algorithminterface_list.html' with base_obj=phase %} | ||
{% endblock %} |
Oops, something went wrong.