.
This commit is contained in:
+1
-1
@@ -56,7 +56,7 @@ class CaseFilter(django_filters.FilterSet):
|
|||||||
):
|
):
|
||||||
if not request.user.groups.filter(name="atlas_editor").exists():
|
if not request.user.groups.filter(name="atlas_editor").exists():
|
||||||
# queryset = queryset.filter(open_access=True) | queryset.filter(author__id=request.user.id)
|
# queryset = queryset.filter(open_access=True) | queryset.filter(author__id=request.user.id)
|
||||||
queryset = queryset.filter(author__id=request.user.id)
|
queryset = queryset.prefetch_related("author").filter(author__id=request.user.id)
|
||||||
super(CaseFilter, self).__init__(
|
super(CaseFilter, self).__init__(
|
||||||
data=data, queryset=queryset, prefix=prefix, request=request
|
data=data, queryset=queryset, prefix=prefix, request=request
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Generated by Django 3.2.4 on 2022-03-25 21:38
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('atlas', '0026_auto_20220321_1612'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='casedetail',
|
||||||
|
options={'ordering': ('sort_order',)},
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='casecollection',
|
||||||
|
name='show_description',
|
||||||
|
field=models.BooleanField(default=False, help_text='Show the description of the cases'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='casecollection',
|
||||||
|
name='show_discussion',
|
||||||
|
field=models.BooleanField(default=False, help_text='Show the case discussion'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='casecollection',
|
||||||
|
name='show_title',
|
||||||
|
field=models.BooleanField(default=False, help_text='Show the title of the cases'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -78,6 +78,12 @@ class SynMixin(object):
|
|||||||
# abstract = True
|
# abstract = True
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
|
if self.primary:
|
||||||
|
return self.name
|
||||||
|
else:
|
||||||
|
return f"{self.name} [syn]"
|
||||||
|
|
||||||
|
def get_old_str(self) -> str:
|
||||||
if self.primary:
|
if self.primary:
|
||||||
if self.synonym.count() == 0:
|
if self.synonym.count() == 0:
|
||||||
return self.name
|
return self.name
|
||||||
@@ -559,6 +565,10 @@ class CaseCollection(models.Model):
|
|||||||
help_text="If a collection should be freely available to browse", default=True
|
help_text="If a collection should be freely available to browse", default=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
show_title = models.BooleanField(default=False, help_text="Show the title of the cases")
|
||||||
|
show_description = models.BooleanField(default=False, help_text="Show the description of the cases")
|
||||||
|
show_discussion = models.BooleanField(default=False, help_text="Show the case discussion")
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse("atlas:collection_detail_view", kwargs={"pk": self.pk})
|
return reverse("atlas:collection_detail_view", kwargs={"pk": self.pk})
|
||||||
|
|
||||||
|
|||||||
+12
-4
@@ -79,9 +79,9 @@ class CaseTable(tables.Table):
|
|||||||
delete = tables.LinkColumn(
|
delete = tables.LinkColumn(
|
||||||
"atlas:case_delete", text="Delete", args=[A("pk")], orderable=False
|
"atlas:case_delete", text="Delete", args=[A("pk")], orderable=False
|
||||||
)
|
)
|
||||||
series = AtlasImageColumn("Images", orderable=False)
|
#series = AtlasImageColumn("Images", orderable=False)
|
||||||
|
|
||||||
differential = tables.ManyToManyColumn(verbose_name="Differential")
|
#differential = tables.ManyToManyColumn(verbose_name="Differential")
|
||||||
|
|
||||||
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
||||||
|
|
||||||
@@ -92,12 +92,20 @@ class CaseTable(tables.Table):
|
|||||||
"title",
|
"title",
|
||||||
"description",
|
"description",
|
||||||
"history",
|
"history",
|
||||||
"condition",
|
#"condition",
|
||||||
"created_date",
|
"created_date",
|
||||||
"author",
|
"author",
|
||||||
)
|
)
|
||||||
sequence = ("view", "series")
|
sequence = ("view", )#, "series")
|
||||||
|
|
||||||
|
def __init__(self, data=None, *args, **kwargs):
|
||||||
|
super().__init__(
|
||||||
|
data.prefetch_related(
|
||||||
|
#"condition", "condition__synonym"
|
||||||
|
),
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
class PopupLinkColumn(tables.Column):
|
class PopupLinkColumn(tables.Column):
|
||||||
def render(self, value):
|
def render(self, value):
|
||||||
|
|||||||
@@ -11,9 +11,6 @@
|
|||||||
<a href="#" onclick='window.loadDicomViewer(window.images[{{forloop.counter0}}])'>
|
<a href="#" onclick='window.loadDicomViewer(window.images[{{forloop.counter0}}])'>
|
||||||
{{series.get_block}}
|
{{series.get_block}}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="#"
|
|
||||||
onclick="return window.create_popup_window('/atlas/series/{{series.pk}}', 'Series')">Popup</a>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -45,7 +42,9 @@ Return to <a href='{{collection.get_absolute_url}}'>collection</a>
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
setTimeout(() => {
|
||||||
window.loadDicomViewer(window.images[0])
|
window.loadDicomViewer(window.images[0])
|
||||||
|
}, 500);
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user