Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Nov 16, 2023
1 parent 062078a commit 9fca506
Show file tree
Hide file tree
Showing 17 changed files with 169 additions and 118 deletions.
45 changes: 23 additions & 22 deletions apis_core/apis_entities/api_urls.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
from django.conf import settings
from django.conf.urls import url
from django.urls import path

from . import api_views

app_name = 'apis_entities'
app_name = "apis_entities"

urlpatterns = [
url(r'^savenetworkfiles/$', api_views.SaveNetworkFiles.as_view()),
url(r'^getorcreateentity/$', api_views.GetOrCreateEntity.as_view(), name='GetOrCreateEntity'),
path(r'entity/<int:pk>/', api_views.GetEntityGeneric.as_view(), name="GetEntityGeneric"),
path(r'uri/', api_views.uri_resolver, name="UriResolver"),
path(r'getrelatedplaces/', api_views.GetRelatedPlaces.as_view(), name="GetRelatedPlaces"),
path(r'lifepath/<int:pk>/', api_views.LifePathViewset.as_view(), name="Lifepathviewset")
path("savenetworkfiles/", api_views.SaveNetworkFiles.as_view()),
path(
"getorcreateentity/",
api_views.GetOrCreateEntity.as_view(),
name="GetOrCreateEntity",
),
path(
r"entity/<int:pk>/",
api_views.GetEntityGeneric.as_view(),
name="GetEntityGeneric",
),
path(r"uri/", api_views.uri_resolver, name="UriResolver"),
path(
r"getrelatedplaces/",
api_views.GetRelatedPlaces.as_view(),
name="GetRelatedPlaces",
),
path(
r"lifepath/<int:pk>/",
api_views.LifePathViewset.as_view(),
name="Lifepathviewset",
),
]

if 'deep learning' in getattr(settings, "APIS_COMPONENTS", []) and 'apis_highlighter' in settings.INSTALLED_APPS:
from apis_highlighter.api_views import TestDLModel
urlpatterns.append(url(r'^nlp_model/$', TestDLModel.as_view(), name='TestDLModel'),)

if 'apis_highlighter' in settings.INSTALLED_APPS:
from apis_highlighter.api_views import AnnotatorAgreementView, ShowOverlappingHighlights
urlpatterns.extend([url(r'^annotatoragreement/$',
AnnotatorAgreementView.as_view(),
name='AnnotatorAgreementView'),
url(r'^overlappinghighlights/$',
ShowOverlappingHighlights.as_view(),
name='ShowOverlappingHighlights')])
5 changes: 0 additions & 5 deletions apis_core/apis_entities/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ def eliminate_unused_filters(default_filter_dict):
"""

enabled_filters = settings.APIS_ENTITIES[self.Meta.model.__name__]["list_filters"]
if "apis_ampel" in settings.INSTALLED_APPS:
from apis_ampel.helper_functions import is_ampel_active
from apis_ampel.models import AmpelTemp
if is_ampel_active(self.Meta.model.__name__):
enabled_filters = ["ampel", "ampel_note", "ampel_notes_field", "ampel_references_field"] + enabled_filters


filter_dict_tmp = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ <h4 class="card-title">
$('#tab_'+data.tab).find('div:eq(1)').remove();
$('#tab_'+data.tab).append(data.form);
$('#form_PersonInstitutionForm div:first div:first select').focus();
//$(".form.ajax_form").unbind()
//(".form.ajax_form").unbind()
};
if (!$.ApisForms) {
$.ApisForms = {}
Expand Down Expand Up @@ -247,7 +247,7 @@ <h4 class="card-title">
function EntityRelationForm_response(response){
if (response.test == false) {
$('#'+response.DivID).replaceWith(response.form);
//$(".form.ajax_form").unbind();
//(".form.ajax_form").unbind();
if ($.ApisHigh.tt_instance_detail) {
if ($.ApisHigh.tt_instance_detail["__state"] == 'stable') {
$.ApisHigh.tt_instance_detail.content(response.form);
Expand Down Expand Up @@ -279,7 +279,7 @@ <h4 class="card-title">
function HighlForm_response(response){
if (response.test == false) {
$.ApisHigh.tt_instance.content(response.form);
//$(".form.ajax_form").unbind()
//(".form.ajax_form").unbind()
} else {
$('#tab_'+response.tab+' div.table-container').remove();
$('#tab_'+response.tab).prepend(response.table_html);
Expand All @@ -297,7 +297,7 @@ <h4 class="card-title">
function PAddRelation_response(response){
if (response.test == false) {
$.ApisHigh.tt_instance.content(response.form);
//$(".form.ajax_form").unbind()
//(".form.ajax_form").unbind()
} else {
$('#htxt_'+response.text.id).html($.parseHTML(response.text.text))
$.ApisHigh.tt_instance.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ <h4 class="panel-title">

n.x = Math.random();
n.y = Math.random();
n.size = 10*(1-1/$.ApisNet.instance.graph.degree(n.id));
n.size = 10*(1-1/.ApisNet.instance.graph.degree(n.id));
if (n.type === 'person') {
n.color = '#5FB404';
} else if (n.type === 'institution') {
Expand Down Expand Up @@ -634,7 +634,7 @@ <h4 class="panel-title">
};
// Instanciate the tooltips plugin with a Mustache renderer for node tooltips:
$.ApisNet.tooltip = sigma.plugins.tooltips($.ApisNet.instance, $.ApisNet.instance.renderers[0], config);
//$.ApisNet.instance.bind("rightClickNode", delete_nodes);
//.ApisNet.instance.bind("rightClickNode", delete_nodes);
$.ApisNet.instance.bind("rightClickNode", select_unselect_node);

};
Expand All @@ -647,8 +647,8 @@ <h4 class="panel-title">
$('#id_select_relation').on("change", function(){
var list_ent = $(this).val().split('-')
console.log(list_ent);
//$('#id_select_kind-autocomplete').yourlabsAutocomplete('destroy');
//$('#id_select_kind-autocomplete').yourlabsAutocomplete({'url': new_val, 'minimumCharacters': 2});
//('#id_select_kind-autocomplete').yourlabsAutocomplete('destroy');
//('#id_select_kind-autocomplete').yourlabsAutocomplete({'url': new_val, 'minimumCharacters': 2});

$('#id_search_source').select2('destroy');
$('#id_search_source').select2({
Expand Down Expand Up @@ -676,8 +676,8 @@ <h4 class="panel-title">
// Additional AJAX parameters go here; see the end of this chapter for the full code of this example
}
});
//$('#id_search_target-autocomplete').yourlabsAutocomplete('destroy');
//$('#id_search_target-autocomplete').yourlabsAutocomplete({'url': new_val_target, 'minimumCharacters': 2});
//('#id_search_target-autocomplete').yourlabsAutocomplete('destroy');
//('#id_search_target-autocomplete').yourlabsAutocomplete({'url': new_val_target, 'minimumCharacters': 2});
})
})
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@

n.x = Math.random();
n.y = Math.random();
n.size = 10*(1-1/$.ApisNet.instance.graph.degree(n.id));
n.size = 10*(1-1/.ApisNet.instance.graph.degree(n.id));
if (n.type === 'person') {
n.color = '#5FB404';
} else if (n.type === 'institution') {
Expand Down Expand Up @@ -461,16 +461,16 @@
};
// Instanciate the tooltips plugin with a Mustache renderer for node tooltips:
$.ApisNet.tooltip = sigma.plugins.tooltips($.ApisNet.instance, $.ApisNet.instance.renderers[0], config);
//$.ApisNet.instance.bind("rightClickNode", delete_nodes);
//.ApisNet.instance.bind("rightClickNode", delete_nodes);
$.ApisNet.instance.bind("rightClickNode", select_unselect_node);

};
$('#id_select_relation').on("change", function(){
var list_ent = $(this).val().split('-')
console.log(list_ent);
console.log("changed");
//$('#id_select_kind-autocomplete').yourlabsAutocomplete('destroy');
//$('#id_select_kind-autocomplete').yourlabsAutocomplete({'url': new_val, 'minimumCharacters': 2});
//('#id_select_kind-autocomplete').yourlabsAutocomplete('destroy');
//('#id_select_kind-autocomplete').yourlabsAutocomplete({'url': new_val, 'minimumCharacters': 2});

$('#id_search_source').select2('destroy');
$('#id_search_source').select2({
Expand Down Expand Up @@ -498,8 +498,8 @@
// Additional AJAX parameters go here; see the end of this chapter for the full code of this example
}
});
//$('#id_search_target-autocomplete').yourlabsAutocomplete('destroy');
//$('#id_search_target-autocomplete').yourlabsAutocomplete({'url': new_val_target, 'minimumCharacters': 2});
//('#id_search_target-autocomplete').yourlabsAutocomplete('destroy');
//('#id_search_target-autocomplete').yourlabsAutocomplete({'url': new_val_target, 'minimumCharacters': 2});
})
})
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ <h4 class="card-title">
success: function(data) {
console.log('yes')
// update our tooltip content with our returned data and cache it
//$('#tab_'+data.tab).find('div').remove();
//('#tab_'+data.tab).find('div').remove();
$('#tab_'+data.tab).append(data.form);
$(".form.ajax_form").unbind()
unbind_ajax_forms();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ <h4 class="card-title">
success: function(data) {
console.log('yes')
// update our tooltip content with our returned data and cache it
//$('#tab_'+data.tab).find('div').remove();
//('#tab_'+data.tab).find('div').remove();
$('#tab_'+data.tab).append(data.form);
$(".form.ajax_form").unbind()
unbind_ajax_forms();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h4 class="card-title">
}
$.ApisMaps.PlaceMap.map.fitBounds($.ApisMaps.PlaceMap.markers.getBounds(), {'maxZoom': 12})

//$(data).each(function(key, data) {
//(data).each(function(key, data) {
// district_boundary.addData(data);
//});

Expand Down
22 changes: 11 additions & 11 deletions apis_core/apis_entities/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,57 @@

urlpatterns = [
path(
"entity/(?P<entity>[a-z]+)/<int:pk>/edit",
"entity/<entity>/<int:pk>/edit",
views2.GenericEntitiesEditView.as_view(),
name="generic_entities_edit_view",
),
path(
"entity/(?P<entity>[a-z]+)/<int:pk>/detail",
"entity/<entity>/<int:pk>/detail",
detail_views.GenericEntitiesDetailView.as_view(),
name="generic_entities_detail_view",
),
path(
"entity/(?P<entity>[a-z]+)/create",
"entity/<entity>/create",
views2.GenericEntitiesCreateView.as_view(),
name="generic_entities_create_view",
),
path(
"entity/(?P<entity>[a-z]+)/<int:pk>/delete",
"entity/<entity>/<int:pk>/delete",
views2.GenericEntitiesDeleteView.as_view(),
name="generic_entities_delete_view",
),
path(
"entity/(?P<entity>[a-z]+)/list/",
"entity/<entity>/list/",
views.GenericListViewNew.as_view(),
name="generic_entities_list",
),
path(
"autocomplete/createstanbol/(?P<entity>[a-zA-Z0-9-]+)/",
"autocomplete/createstanbol/<entity>/",
GenericEntitiesCreateStanbolView.as_view(),
name="generic_entities_stanbol_create",
),
path(
"autocomplete/createstanbol/(?P<entity>[a-zA-Z0-9-]+)/(?P<ent_merge_pk>[0-9]+)/",
"autocomplete/createstanbol/<entity>/(?P<ent_merge_pk>[0-9]+)/",
GenericEntitiesCreateStanbolView.as_view(),
name="generic_entities_stanbol_create",
),
path(
"autocomplete/(?P<entity>[a-zA-Z0-9-]+)/(?P<ent_merge_pk>[0-9]+)/",
"autocomplete/<entity>/(?P<ent_merge_pk>[0-9]+)/",
GenericEntitiesAutocomplete.as_view(),
name="generic_entities_autocomplete",
),
path(
"autocomplete/(?P<entity>[a-zA-Z0-9-]+)/",
"autocomplete/<entity>/",
GenericEntitiesAutocomplete.as_view(),
name="generic_entities_autocomplete",
),
path(
"autocomplete/(?P<entity>[a-zA-Z0-9-]+)/(?P<db_include>[a-z]+)/",
"autocomplete/<entity>/(?P<db_include>[a-z]+)/",
GenericEntitiesAutocomplete.as_view(),
name="generic_entities_autocomplete",
),
path(
"autocomplete-network/(?P<entity>[a-zA-Z0-9-]+)/",
"autocomplete-network/<entity>/",
GenericNetworkEntitiesAutocomplete.as_view(),
name="generic_network_entities_autocomplete",
),
Expand Down
2 changes: 1 addition & 1 deletion apis_core/apis_metainfo/dal_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

urlpatterns = [
path(
"tempentity-autocomplete/$",
"tempentity-autocomplete/",
dal_views.TempEntityClassAC.as_view(),
name="apis_tempentity-autocomplete",
)
Expand Down
8 changes: 4 additions & 4 deletions apis_core/apis_relations/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
app_name = "apis_relations"

urlpatterns = [
path("ajax/get/$", views.get_form_ajax, name="get_form_ajax"),
path("ajax/save/(?P<entity_type>\w+)/(?P<kind_form>\w+)/(?P<SiteID>[0-9]+)(?:/(?P<ObjectID>[0-9]*))?/$",
path("ajax/get/", views.get_form_ajax, name="get_form_ajax"),
path("ajax/save/<entity_type>/<kind_form>/<int:SiteID>/<int:ObjectID>/",
views.save_ajax_form,
name="save_ajax_form",
),
path("(?P<entity>[a-z]+)/list/$",
path("<entity>/list/",
rel_views.GenericRelationView.as_view(),
name="generic_relations_list",
),
path("(?P<entity>[a-z]+)/<int:pk>/detail$",
path("<entity>/<int:pk>/detail",
rel_views.GenericRelationDetailView.as_view(),
name="generic_relations_detail_view",
),
Expand Down
14 changes: 7 additions & 7 deletions apis_core/apis_tei/tei_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@

urlpatterns = [
path(
"autocomplete/(?P<entity>[a-zA-Z0-9-]+)/$",
"autocomplete/<entity>/",
TeiEntAc.as_view(),
name="generic_entities_autocomplete",
),
path(
"tei-completer/(?P<entity>[a-zA-Z0-9-]+)/$",
"tei-completer/<entity>/",
TeiCompleterAc.as_view(),
name="tei_completer_autocomplete",
),
path("person/<int:pk>$", views.person_as_tei, name="person_as_tei"),
path("place/<int:pk>$", views.place_as_tei, name="place_as_tei"),
path("org/<int:pk>$", views.org_as_tei, name="org_as_tei"),
path("institution/<int:pk>$", views.org_as_tei, name="org_as_tei"),
path("work/<int:pk>$", views.work_as_tei, name="work_as_tei"),
path("person/<int:pk>", views.person_as_tei, name="person_as_tei"),
path("place/<int:pk>", views.place_as_tei, name="place_as_tei"),
path("org/<int:pk>", views.org_as_tei, name="org_as_tei"),
path("institution/<int:pk>", views.org_as_tei, name="org_as_tei"),
path("work/<int:pk>", views.work_as_tei, name="work_as_tei"),
path("uri-to-tei", views.uri_to_tei, name="uri_to_tei"),
]
18 changes: 9 additions & 9 deletions apis_core/apis_vis/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
app_name = 'apis_vis'

urlpatterns = [
url(r'^heatmap/$', views.HeatMapView.as_view(), name='heatmap_view'),
url(r'^heatmap-data/$', views.get_heatmap_data, name='get_heatmap_data'),
url(r'^avg-age-data/$', views.get_average_age_data, name='get_avg_age_data'),
url(r'^avg-age/$', views.AvgAge.as_view(), name='avgage_view'),
url(r'^avg-members-data/$', views.get_average_members_data, name='get_avg_members_data'),
url(r'^avg-members/$', views.MembersAmountPerYear.as_view(), name='avg_members_view'),
url(r'^heatmap/', views.HeatMapView.as_view(), name='heatmap_view'),
url(r'^heatmap-data/', views.get_heatmap_data, name='get_heatmap_data'),
url(r'^avg-age-data/', views.get_average_age_data, name='get_avg_age_data'),
url(r'^avg-age/', views.AvgAge.as_view(), name='avgage_view'),
url(r'^avg-members-data/', views.get_average_members_data, name='get_avg_members_data'),
url(r'^avg-members/', views.MembersAmountPerYear.as_view(), name='avg_members_view'),
url(
r'^(?P<relation>[a-z]+)/data/$',
r'^(?P<relation>[a-z]+)/data/',
api_views.GetVisJson.as_view(),
name='person-institution-data'
),
url(r'^inst-range-data/$', views.get_inst_range_data, name='get_inst_range_data'),
url(r'^inst-range/$', views.InstRange.as_view(), name='inst_range_view'),
url(r'^inst-range-data/', views.get_inst_range_data, name='get_inst_range_data'),
url(r'^inst-range/', views.InstRange.as_view(), name='inst_range_view'),
]
2 changes: 1 addition & 1 deletion apis_core/apis_vocabularies/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

urlpatterns = [
path("download/<model_name>/", views.dl_vocabs_as_csv, name="dl-vocabs"),
path("autocomplete/(?P<vocab>[a-zA-Z0-9-]+)/(?P<direct>[a-zA-Z0-9-]+)/$",
path("autocomplete/<vocab>/<direct>/",
GenericVocabulariesAutocomplete.as_view(),
name="generic_vocabularies_autocomplete",
),
Expand Down
Loading

0 comments on commit 9fca506

Please sign in to comment.