From 385e3bc4675a73697468856fe5b8cc2ec8484ba0 Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 1 Sep 2011 07:34:48 +0530 Subject: [PATCH] JS handler to display initial relations, drop-down, etc. --- gazetteer/places/views.py | 3 ++- gazetteer/static/js/feature_admin.js | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/gazetteer/places/views.py b/gazetteer/places/views.py index 7e0b959..8f6772c 100644 --- a/gazetteer/places/views.py +++ b/gazetteer/places/views.py @@ -70,7 +70,8 @@ def search_related(request): 'feature_type': FeatureType.objects.get(pk=s.feature_type_id), 'preferred_name': s.preferred_name, 'similarity': s.similarity, - 'distance': s.distance + 'distance': s.distance, + 'relationship': '' }) return render_to_response("search_related.html", { diff --git a/gazetteer/static/js/feature_admin.js b/gazetteer/static/js/feature_admin.js index facbac9..7000816 100644 --- a/gazetteer/static/js/feature_admin.js +++ b/gazetteer/static/js/feature_admin.js @@ -14,6 +14,8 @@ $(function() { }); }); +var RELATIONSHIP_OPTIONS = ['conflates', 'contains', 'consumes', 'supersedes'] + function getRow(d) { var $tr = $(''); var $one = $('').appendTo($tr); @@ -31,7 +33,25 @@ function getRow(d) { } else { $.noop(); } - + + var $relations_td = $('').appendTo($tr); + var $relationselect = $('