This commit is contained in:
Ross
2021-12-05 19:02:20 +00:00
parent ccbf8a5bcd
commit 5c23549b59
5 changed files with 79 additions and 12 deletions
+25 -11
View File
@@ -133,13 +133,10 @@ class SeriesTable(tables.Table):
) )
class ConditionTable(tables.Table): class ConditionTable(tables.Table):
name = tables.Column(linkify=('atlas:condition_detail', {'pk': tables.A('pk')})) name = tables.Column(linkify=('atlas:condition_detail', {'pk': tables.A('pk')}), verbose_name="Condition")
#edit = tables.LinkColumn( edit = tables.LinkColumn(
# "atlas:condition_update", text="Edit", args=[A("pk")], orderable=False "atlas:condition_update", text="Edit", args=[A("pk")], orderable=False
#)
view = tables.LinkColumn(
"atlas:condition_detail", text="View", args=[A("pk")], orderable=False
) )
delete = tables.LinkColumn( delete = tables.LinkColumn(
"atlas:condition_delete", text="Delete", args=[A("pk")], orderable=False "atlas:condition_delete", text="Delete", args=[A("pk")], orderable=False
@@ -157,12 +154,10 @@ class ConditionTable(tables.Table):
class FindingTable(tables.Table): class FindingTable(tables.Table):
name = tables.Column(linkify=('atlas:finding_detail', {'pk': tables.A('pk')}), verbose_name="Finding")
edit = tables.LinkColumn( edit = tables.LinkColumn(
"atlas:finding_update", text="Edit", args=[A("pk")], orderable=False "atlas:finding_update", text="Edit", args=[A("pk")], orderable=False
) )
view = tables.LinkColumn(
"atlas:finding_detail", text="View", args=[A("pk")], orderable=False
)
delete = tables.LinkColumn( delete = tables.LinkColumn(
"atlas:finding_delete", text="Delete", args=[A("pk")], orderable=False "atlas:finding_delete", text="Delete", args=[A("pk")], orderable=False
) )
@@ -174,5 +169,24 @@ class FindingTable(tables.Table):
class Meta: class Meta:
model = Finding model = Finding
template_name = "django_tables2/bootstrap4.html" template_name = "django_tables2/bootstrap4.html"
fields = ("name", "primary", "subspecialty") fields = ("name", "primary")
sequence = () sequence = ("name",)
class StructureTable(tables.Table):
name = tables.Column(linkify=('atlas:structure_detail', {'pk': tables.A('pk')}), verbose_name="Structure")
edit = tables.LinkColumn(
"atlas:structure_update", text="Edit", args=[A("pk")], orderable=False
)
delete = tables.LinkColumn(
"atlas:structure_delete", text="Delete", args=[A("pk")], orderable=False
)
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
synonym = tables.ManyToManyColumn(verbose_name="Synonyms")
parent = tables.ManyToManyColumn(verbose_name="Parents")
class Meta:
model = Structure
template_name = "django_tables2/bootstrap4.html"
fields = ("name", "primary")
sequence = ("name",)
+25
View File
@@ -0,0 +1,25 @@
{% extends 'atlas/base.html' %}
{% block content %}
<div class="floating-header">
<a href="{% url 'atlas:finding_update' pk=finding.pk %}" title="Edit the Finding">Edit</a>
<a href="{% url 'atlas:finding_delete' pk=finding.pk %}" title="Delete the Finding">Delete</a>
{% if request.user.is_superuser %}
<a href="{% url 'admin:atlas_finding_change' finding.id %}"
title="Edit the Finding using the admin interface">Admin Edit</a>
{% endif %}
</div>
<div>
<h3>Name: {{finding.name}}</h3>
Primary name: {{finding.primary}}<br />
Synonyms: {{finding.synonym.all|join:", "}}<br />
</div>
{% endblock %}
{% block js %}
{% endblock %}
@@ -1 +0,0 @@
{% include 'confirm_delete.html' %}
+25
View File
@@ -0,0 +1,25 @@
{% extends 'atlas/base.html' %}
{% block content %}
<div class="floating-header">
<a href="{% url 'atlas:structure_update' pk=structure.pk %}" title="Edit the Structure">Edit</a>
<a href="{% url 'atlas:structure_delete' pk=structure.pk %}" title="Delete the Structure">Delete</a>
{% if request.user.is_superuser %}
<a href="{% url 'admin:atlas_structure_change' structure.id %}"
title="Edit the Structure using the admin interface">Admin Edit</a>
{% endif %}
</div>
<div>
<h3>Name: {{structure.name}}</h3>
Primary name: {{structure.primary}}<br />
Synonyms: {{structure.synonym.all|join:", "}}<br />
</div>
{% endblock %}
{% block js %}
{% endblock %}
+4
View File
@@ -221,18 +221,22 @@ class SeriesFindingDelete(RevisionMixin, PermissionRequiredMixin, DeleteView):
class SeriesDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView): class SeriesDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
model = Series model = Series
template_name = "confirm_delete.html"
success_url = reverse_lazy("atlas:series_view") success_url = reverse_lazy("atlas:series_view")
class ConditionDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView): class ConditionDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
model = Condition model = Condition
template_name = "confirm_delete.html"
success_url = reverse_lazy("atlas:condition_view") success_url = reverse_lazy("atlas:condition_view")
class FindingDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView): class FindingDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
model = Finding model = Finding
template_name = "confirm_delete.html"
success_url = reverse_lazy("atlas:finding_view") success_url = reverse_lazy("atlas:finding_view")
class StructureDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView): class StructureDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
model = Structure model = Structure
template_name = "confirm_delete.html"
success_url = reverse_lazy("atlas:structure_view") success_url = reverse_lazy("atlas:structure_view")
@login_required @login_required