Skip to content

Commit

Permalink
refactor: drop generic_network_viz and other vizualisation views
Browse files Browse the repository at this point in the history
The views are not needed anymore

Closes: #308
  • Loading branch information
b1rger committed Oct 4, 2023
1 parent e877213 commit 8ffa8fb
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 684 deletions.
100 changes: 0 additions & 100 deletions apis_core/apis_entities/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,106 +309,6 @@ def clean(self):
self.add_error("person", "This URI has already been added to the DB.")


class NetworkVizFilterForm(forms.Form):
ann_include_all = forms.BooleanField(
required=False,
label="Include general relations",
help_text="""Not all relations are connected to an annotation.\
If checked relations that are not attached to an annotation are include.\
This setting is only used when an Annotation project is specified.""",
)
start_date = forms.CharField(
label="Start date",
required=False,
widget=forms.TextInput(
attrs={"data-provide": "datepicker", "data-date-format": "dd.mm.yyyy"}
),
)
end_date = forms.CharField(
label="End date",
required=False,
widget=forms.TextInput(
attrs={"data-provide": "datepicker", "data-date-format": "dd.mm.yyyy"}
),
)

def __init__(self, *args, **kwargs):
rel_attrs = {
"data-placeholder": "Type to get suggestions",
"data-minimum-input-length": getattr(settings, "APIS_MIN_CHAR", 3),
"data-html": True,
}
attrs = {
"data-placeholder": "Type to get suggestions",
"data-minimum-input-length": getattr(settings, "APIS_MIN_CHAR", 3),
"data-html": True,
}
super(NetworkVizFilterForm, self).__init__(*args, **kwargs)
self.fields["select_relation"] = forms.ChoiceField(
label="Relation type",
choices=list(
("-".join(x.name.split()), x.name)
for x in ContentType.objects.filter(app_label="apis_relations")
),
help_text="Include only relations related to this annotation project \
(See the include general relations checkbox)",
)
self.fields["select_relation"].initial = ("person-place", "person place")
self.fields["search_source"] = autocomplete.Select2ListCreateChoiceField(
label="Search source",
widget=ListSelect2(
url=reverse(
"apis:apis_entities:generic_network_entities_autocomplete",
kwargs={"entity": "person"},
),
attrs=attrs,
),
)
self.fields["search_target"] = autocomplete.Select2ListCreateChoiceField(
label="Search target",
widget=ListSelect2(
url=reverse(
"apis:apis_entities:generic_network_entities_autocomplete",
kwargs={"entity": "place"},
),
attrs=attrs,
),
)
self.fields["select_kind"] = autocomplete.Select2ListCreateChoiceField(
label="Select kind",
widget=ListSelect2(
url=reverse(
"apis:apis_vocabularies:generic_vocabularies_autocomplete",
kwargs={"vocab": "personplacerelation", "direct": "normal"},
),
attrs=rel_attrs,
),
)
if "apis_highlighter" in settings.INSTALLED_APPS:
self.fields["annotation_proj"] = forms.ChoiceField(
label="Annotation Project",
choices=BLANK_CHOICE_DASH
+ list((x.pk, x.name) for x in AnnotationProject.objects.all()),
required=False,
help_text="Include only relations related to this annotation project \
(See the include general relations checkbox)",
)
self.helper = FormHelper()
self.helper.form_class = "FilterNodesForm"
self.helper.form_action = reverse("apis:apis_core:NetJson-list")
self.helper.add_input(Submit("Submit", "Add nodes"))
self.order_fields(
(
"select_relation",
"ann_include_all",
"annotation_proj",
"search_source",
"select_kind",
"search_target",
)
)


class GenericFilterFormHelper(FormHelper):
def __init__(self, *args, **kwargs):
super(GenericFilterFormHelper, self).__init__(*args, **kwargs)
Expand Down
106 changes: 0 additions & 106 deletions apis_core/apis_entities/templates/apis_entities/map_list.html

This file was deleted.

Loading

0 comments on commit 8ffa8fb

Please sign in to comment.