diff --git a/media/js/glosses_toggle_edit.js b/media/js/glosses_toggle_edit.js index 4eacd5614..460aff8ce 100644 --- a/media/js/glosses_toggle_edit.js +++ b/media/js/glosses_toggle_edit.js @@ -133,6 +133,23 @@ function toggle_handCh(data) { buttonCell.attr('value', button_contents); } +function toggle_relatArtic(data) { + if ($.isEmptyObject(data)) { + return; + }; + var glossid = data.glossid; + var relatArtic = data.relatArtic; + var hCell = $("#relatArtic_cell_"+glossid); + $(hCell).empty(); + var cell = ""+relatArtic+""; + hCell.html(cell); + + var button_lookup = '#button_' + glossid + '_relatArtic'; + var buttonCell = $(button_lookup); + var button_contents = similar_gloss_fields_labels['relatArtic'] + ': ' + relatArtic; + buttonCell.attr('value', button_contents); +} + function toggle_locprim(data) { if ($.isEmptyObject(data)) { return; @@ -434,6 +451,20 @@ $(document).ready(function() { }); }); + $('.quick_relatArtic').click(function(e) + { + e.preventDefault(); + var glossid = $(this).attr('value'); + var relatArtic = $(this).attr("data-relatArtic"); + $.ajax({ + url : url + "/dictionary/update/toggle_relatArtic/" + glossid + "/" + relatArtic, + type: 'POST', + data: { 'csrfmiddlewaretoken': csrf_token }, + datatype: "json", + success : toggle_relatArtic + }); + }); + $('.quick_locprim').click(function(e) { e.preventDefault(); diff --git a/signbank/dictionary/adminviews.py b/signbank/dictionary/adminviews.py index 3397ee52f..21e8d0121 100755 --- a/signbank/dictionary/adminviews.py +++ b/signbank/dictionary/adminviews.py @@ -6539,7 +6539,7 @@ def get_context_data(self, **kwargs): context['available_tags'] = [tag for tag in Tag.objects.all()] - similar_gloss_fields = ['handedness', 'domhndsh', 'subhndsh', 'handCh', 'locprim', + similar_gloss_fields = ['handedness', 'domhndsh', 'subhndsh', 'handCh', 'relatArtic', 'locprim', 'movSh', 'repeat', 'altern'] context['similar_gloss_fields'] = json.dumps(similar_gloss_fields) similar_gloss_fields_labels = {} @@ -6568,6 +6568,12 @@ def get_context_data(self, **kwargs): field='HandshapeChange', machine_value__gt=1).order_by('name')] context['available_handCh'] = available_handCh + available_relatArtic = [fc for fc in FieldChoice.objects.filter( + field='RelatArtic', machine_value__in=[0, 1]).order_by('machine_value')] + available_relatArtic += [fc for fc in FieldChoice.objects.filter( + field='RelatArtic', machine_value__gt=1).order_by('name')] + context['available_relatArtic'] = available_relatArtic + available_locprim = [fc for fc in FieldChoice.objects.filter( field='Location', machine_value__in=[0, 1]).order_by('machine_value')] available_locprim += [fc for fc in FieldChoice.objects.filter( diff --git a/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html b/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html index b6c9b8fde..fc8f3af45 100644 --- a/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html +++ b/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html @@ -500,6 +500,14 @@