diff --git a/signbank/dictionary/adminviews.py b/signbank/dictionary/adminviews.py index 01410074a..d3633b8d0 100755 --- a/signbank/dictionary/adminviews.py +++ b/signbank/dictionary/adminviews.py @@ -479,6 +479,7 @@ class GlossListView(ListView): query_parameters = dict() search_form_data = QueryDict(mutable=True) search_form = GlossSearchForm() + public = False def get_template_names(self): return ['dictionary/admin_gloss_list.html'] @@ -492,6 +493,9 @@ def get_context_data(self, **kwargs): # Call the base implementation first to get a context context = super(GlossListView, self).get_context_data(**kwargs) + context['public'] = self.public + context['PUBLIC_PHONOLOGY_FIELDS'] = settings.PUBLIC_PHONOLOGY_FIELDS + set_up_language_fields(Gloss, self, self.search_form) set_up_signlanguage_dialects_fields(self, self.search_form) @@ -517,6 +521,8 @@ def get_context_data(self, **kwargs): 'dataset').filter(lemma__dataset__in=context['selected_datasets'], archived__exact=False).count() + context['public'] = self.public + context['page_number'] = context['page_obj'].number context['objects_on_page'] = [ g.id for g in context['page_obj'].object_list ] @@ -697,6 +703,8 @@ def get_queryset(self): self.web_search = get_web_search(self.request) setattr(self.request, 'web_search', self.web_search) + self.public = not self.request.user.is_authenticated + if self.show_all: self.query_parameters = dict() # erase the previous query @@ -1047,18 +1055,33 @@ class GlossDetailView(DetailView): last_used_dataset = None query_parameters = dict() dark_mode = False + public = False def get_template_names(self): + if 'public' in self.kwargs: + self.public = True + return ['dictionary/gloss.html'] return ['dictionary/gloss_detail.html'] # Overriding the get method get permissions right def get(self, request, *args, **kwargs): - selected_datasets = get_selected_datasets_for_user(self.request.user) + + if 'selected_datasets' in self.request.session.keys(): + selected_datasets = Dataset.objects.filter(acronym__in=self.request.session['selected_datasets']) + else: + selected_datasets = get_selected_datasets_for_user(request.user) + self.request.session['selected_datasets'] = [ds.acronym for ds in selected_datasets] + self.request.session.modified = True try: self.object = super().get_object() - if self.object.archived: + except AttributeError: + if 'glossid' not in self.kwargs: raise ObjectDoesNotExist + # if we get to here, this is public view + glossid = self.kwargs['glossid'] + self.object = Gloss.objects.get(id=int(glossid), archived=False) + self.public = True except (Http404, ObjectDoesNotExist): translated_message = _('The requested gloss does not exist.') return show_warning(request, translated_message, selected_datasets) @@ -1067,29 +1090,36 @@ def get(self, request, *args, **kwargs): translated_message = _('Requested gloss has no lemma or dataset.') return show_warning(request, translated_message, selected_datasets) - if not request.user.is_authenticated: - if self.object.inWeb: - return HttpResponseRedirect(reverse('dictionary:public_gloss', kwargs={'glossid': self.object.pk})) - else: - return HttpResponseRedirect(reverse('registration:login')) + if self.public and not self.object.inWeb: + translated_message = _('Requested gloss is not available for public viewing.') + return show_warning(request, translated_message, selected_datasets) dataset_of_requested_gloss = self.object.lemma.dataset - datasets_user_can_view = get_objects_for_user(request.user, ['view_dataset'], - Dataset, accept_global_perms=True, any_perm=True) - - if dataset_of_requested_gloss not in selected_datasets: + if not self.public: + from guardian.shortcuts import get_objects_for_user + datasets_user_can_view = get_objects_for_user(request.user, ['view_dataset'], + Dataset, accept_global_perms=True, any_perm=True) + if dataset_of_requested_gloss not in selected_datasets: + translated_message = _('The gloss you are trying to view is not in your selected datasets.') + translated_message2 = _(' It is in dataset ') + dataset_of_requested_gloss.acronym + return show_warning(request, translated_message + translated_message2, selected_datasets) + if dataset_of_requested_gloss not in datasets_user_can_view: + if self.object.inWeb: + return HttpResponseRedirect(reverse('dictionary:public_gloss', kwargs={'glossid': self.object.pk})) + else: + translated_message = _('The gloss you are trying to view is not in a dataset you can view.') + translated_message2 = _(' It is in dataset ') + dataset_of_requested_gloss.name + return show_warning(request, translated_message + translated_message2, selected_datasets) + elif not dataset_of_requested_gloss.is_public or not self.object.inWeb: + # user is anonymous, check if the gloss can be viewed + translated_message = _('The gloss you are trying to view is not in a dataset you can view.') + translated_message2 = _(' It is in dataset ') + dataset_of_requested_gloss.name + return show_warning(request, translated_message + translated_message2, selected_datasets) + elif dataset_of_requested_gloss not in selected_datasets: translated_message = _('The gloss you are trying to view is not in your selected datasets.') translated_message2 = _(' It is in dataset ') + dataset_of_requested_gloss.acronym return show_warning(request, translated_message + translated_message2, selected_datasets) - if dataset_of_requested_gloss not in datasets_user_can_view: - if self.object.inWeb: - return HttpResponseRedirect(reverse('dictionary:public_gloss', kwargs={'glossid': self.object.pk})) - else: - translated_message = _('The gloss you are trying to view is not in a dataset you can view.') - translated_message2 = _(' It is in dataset ') + dataset_of_requested_gloss.name - return show_warning(request, translated_message + translated_message2, selected_datasets) - senses_consistent = consistent_senses(self.object, include_translations=True, allow_empty_language=True) if not senses_consistent: @@ -1124,6 +1154,10 @@ def get_context_data(self, **kwargs): # Call the base implementation first to get a context context = super(GlossDetailView, self).get_context_data(**kwargs) + context['public'] = self.public + context['gloss_or_morpheme'] = 'gloss' + context['translations_per_language'] = {} + context['search_type'] = self.request.session['search_type'] if 'dark_mode' in self.request.session.keys(): @@ -1137,6 +1171,115 @@ def get_context_data(self, **kwargs): dataset_languages = get_dataset_languages(selected_datasets) context['dataset_languages'] = dataset_languages + labels = self.object.field_labels() + + context['gloss'] = self.object + gloss = self.object + + otherrelations = [] + for oth_rel in gloss.relation_sources.filter(target__archived__exact=False, + source__archived__exact=False): + otherrelations.append((oth_rel, oth_rel.get_target_display())) + context['otherrelations'] = otherrelations + + annotated_sentences_1 = AnnotatedSentence.objects.filter(annotated_glosses__gloss=gloss, + annotated_glosses__isRepresentative=True).distinct().annotate(is_representative=V(1, output_field=IntegerField())) + annotated_sentences_2 = AnnotatedSentence.objects.filter(annotated_glosses__gloss=gloss, + annotated_glosses__isRepresentative=False).distinct().annotate(is_representative=V(0, output_field=IntegerField())) + annotated_sentences = annotated_sentences_1.union(annotated_sentences_2).order_by('-is_representative') + annotated_sentences_with_video = [] + for annotated_sentence in annotated_sentences: + video_path = annotated_sentence.get_video_path() + if video_path and annotated_sentence not in annotated_sentences_with_video: + annotated_sentences_with_video.append(annotated_sentence) + annotated_sentences = annotated_sentences_with_video + if len(annotated_sentences) <= 3: + context['annotated_sentences'] = annotated_sentences + else: + context['annotated_sentences'] = annotated_sentences[0:3] + + # Put nme video descriptions per language in the context + glossnmevideos = GlossVideoNME.objects.filter(gloss=gloss) + nme_video_descriptions = dict() + for nmevideo in glossnmevideos: + nme_video_descriptions[nmevideo] = {} + for language in gloss.dataset.translation_languages.all(): + try: + description_text = GlossVideoDescription.objects.get(nmevideo=nmevideo, language=language).text + except ObjectDoesNotExist: + description_text = "" + nme_video_descriptions[nmevideo][language] = description_text + context['nme_video_descriptions'] = nme_video_descriptions + + if self.public: + + # Put annotation_idgloss per language in the context + annotation_idgloss = {} + if gloss.lemma.dataset: + for language in gloss.lemma.dataset.translation_languages.all(): + annotation_idgloss[language] = gloss.annotationidglosstranslation_set.filter(language=language) + else: + language = Language.objects.get(id=get_default_language_id()) + annotation_idgloss[language] = gloss.annotationidglosstranslation_set.filter(language=language) + context['annotation_idgloss'] = annotation_idgloss + + # Regroup notes + note_role_choices = FieldChoice.objects.filter(field__iexact='NoteType') + notes = gloss.definition_set.filter(published__exact=True) + notes_groupedby_role = {} + for note in notes: + note_role_machine_value = note.role.machine_value if note.role else 0 + translated_note_role = machine_value_to_translated_human_value(note_role_machine_value, + note_role_choices) + role_id = (note.role, translated_note_role) + if role_id not in notes_groupedby_role: + notes_groupedby_role[role_id] = [] + notes_groupedby_role[role_id].append(note) + context['notes_groupedby_role'] = notes_groupedby_role + + # Put translations (senses) per language in the context + sensetranslations_per_language = dict() + for language in gloss.lemma.dataset.translation_languages.all(): + sensetranslations_per_language[language] = dict() + sensetranslations_for_language = dict() + for sensei, sense in enumerate(gloss.ordered_senses().all(), 1): + if sense.senseTranslations.filter(language=language).exists(): + sensetranslation = sense.senseTranslations.get(language=language) + translations = sensetranslation.translations.all().order_by('index') + if translations: + keywords_list = [trans.translation.text for trans in translations] + sensetranslations_for_language[sensei] = ', '.join(keywords_list) + sensetranslations_per_language[language] = sensetranslations_for_language + context['sensetranslations_per_language'] = sensetranslations_per_language + + for topic in ['phonology', 'semantics']: + context[topic + '_fields'] = [] + for field in FIELDS[topic]: + if topic == 'phonology' and field not in settings.PUBLIC_PHONOLOGY_FIELDS: + continue + kind = fieldname_to_kind(field) + + if field in ['semField', 'derivHist']: + # these are many to many fields and not in the gloss table of the database + # they are not fields of Gloss + continue + + # Take the human value in the language we are using + field_value = getattr(gloss, field) + if isinstance(field_value, FieldChoice) or isinstance(field_value, Handshape): + human_value = field_value.name if field_value else field_value + else: + # take care of different representations of empty text in database + if fieldname_to_kind(field) == 'text' and ( + field_value is None or field_value in ['-', ' ', '------', '']): + human_value = '' + else: + human_value = field_value + + context[topic + '_fields'].append([human_value, field, labels[field], kind]) + + return context + phonology_matrix = context['gloss'].phonology_matrix_homonymns(use_machine_value=True) phonology_focus = [field for field in phonology_matrix.keys() if phonology_matrix[field] is not None @@ -1198,7 +1341,6 @@ def get_context_data(self, **kwargs): # Pass info about which fields we want to see gl = context['gloss'] context['active_id'] = gl.id - labels = gl.field_labels() # the lemma field is non-empty because it's caught in the get method dataset_of_requested_gloss = gl.lemma.dataset @@ -1429,20 +1571,6 @@ def get_context_data(self, **kwargs): context['sense_to_similar_senses'] = sense_to_similar_senses - annotated_sentences_1 = AnnotatedSentence.objects.filter(annotated_glosses__gloss=gl, annotated_glosses__isRepresentative=True).distinct().annotate(is_representative=V(1, output_field=IntegerField())) - annotated_sentences_2 = AnnotatedSentence.objects.filter(annotated_glosses__gloss=gl, annotated_glosses__isRepresentative=False).distinct().annotate(is_representative=V(0, output_field=IntegerField())) - annotated_sentences = annotated_sentences_1.union(annotated_sentences_2).order_by('-is_representative') - annotated_sentences_with_video = [] - for annotated_sentence in annotated_sentences: - video_path = annotated_sentence.get_video_path() - if video_path and annotated_sentence not in annotated_sentences_with_video: - annotated_sentences_with_video.append(annotated_sentence) - annotated_sentences = annotated_sentences_with_video - if len(annotated_sentences) <= 3: - context['annotated_sentences'] = annotated_sentences - else: - context['annotated_sentences'] = annotated_sentences[0:3] - bad_dialect = False gloss_dialects = [] @@ -1507,12 +1635,6 @@ def get_context_data(self, **kwargs): blend_morphology.append((ble_morph, morpheme_display)) context['blend_morphology'] = blend_morphology - otherrelations = [] - for oth_rel in gl.relation_sources.filter(target__archived__exact=False, - source__archived__exact=False): - otherrelations.append((oth_rel, oth_rel.get_target_display())) - context['otherrelations'] = otherrelations - context['related_objects'] = gloss_is_related_to(gl, interface_language_code, default_language_code) related_objects = [get_default_annotationidglosstranslation(ro) for ro in transitive_related_objects(gl)] diff --git a/signbank/dictionary/templates/dictionary/admin_gloss_list.html b/signbank/dictionary/templates/dictionary/admin_gloss_list.html index 90b4efa95..d8135a81a 100755 --- a/signbank/dictionary/templates/dictionary/admin_gloss_list.html +++ b/signbank/dictionary/templates/dictionary/admin_gloss_list.html @@ -754,7 +754,7 @@ {{ searchform.dialects }} - + {% if not public %} {% for fieldname,field,label in input_names_fields_and_labels.main %} @@ -762,7 +762,7 @@ {{field}} {% endfor %} - + {% endif %} @@ -776,6 +776,7 @@ + {% if not public %} + {% endif %} @@ -812,24 +814,27 @@
@@ -786,6 +787,7 @@
{{searchform.hasComponentOfType}}
{% for fieldname,field,label in input_names_fields_and_labels.phonology %} - + {% if not public or fieldname in PUBLIC_PHONOLOGY_FIELDS %} - - - {% if fieldname == 'handedness' %} + + + {% if fieldname == 'handedness' and not public %} {% for handednessfieldname,handednessfield,handednesslabel in input_names_fields_labels_handedness %} {% endfor %} - {% elif fieldname == 'domhndsh' %} + {% elif fieldname == 'domhndsh' and not public %} {% for domhndshfieldname,domhndshfield,domhndshlabel in input_names_fields_labels_domhndsh %} {% endfor %} - {% elif fieldname == 'subhndsh' %} + {% elif fieldname == 'subhndsh' and not public %} {% for subhndshfieldname,subhndshfield,subhndshlabel in input_names_fields_labels_subhndsh %} {% endfor %} + {% else %} + {% endif %} + {% endif %} {% endfor %}
{{field}}{{field}}{{handednessfield}}{{domhndshfield}}{{subhndshfield}}
diff --git a/signbank/dictionary/templates/dictionary/gloss.html b/signbank/dictionary/templates/dictionary/gloss.html new file mode 100755 index 000000000..fcca534fd --- /dev/null +++ b/signbank/dictionary/templates/dictionary/gloss.html @@ -0,0 +1,549 @@ +{% extends "baselayout.html" %} +{% load i18n %} +{% load stylesheet %} +{% load annotation_idgloss_translation %} +{% load bootstrap3 %} +{% load guardian_tags %} + +{% block bootstrap3_title %} +{% blocktrans %}Sign for {{gloss}}{% endblocktrans %} +{% endblock %} + + +{% block jqueryready %} + + +{% endblock %} + +{% block script %} + function replay() { + $f('player').play(); + } +{% endblock %} + +{% block extrahead %} + + + + + + + + + + +{% endblock %} + +{% block extrajs %} + +{% endblock %} + + +{% block content %} +{% url 'dictionary:protected_media' '' as protected_media_url %} + + + + + +
+ +
+
+ + + {% for lang, annotation_idgloss_translations in annotation_idgloss.items %} + + + + + {% endfor %} + + {% if gloss.dialect.all %} + + + + + {% endif %} + + {% if gloss_or_morpheme == 'gloss' %} + {% if sensetranslations_per_language %} + {% for lang, sensetranslations in sensetranslations_per_language.items %} + {% if sensetranslations %} + + + + + {% endif %} + {% endfor %} + {% endif %} + {% else %} + {% if translations_per_language %} + {% for lang, translations in translations_per_language.items %} + + + + + {% endfor %} + {% endif %} + {% endif %} + {% if notes_groupedby_role %} + + + + + {% endif %} +
+ {% trans "Annotation ID Gloss" %} ({{ lang }}) + {{ annotation_idgloss_translations.0.text|safe }}
{% trans "Dialects" %} + {% for dialect in gloss.dialect.all %} + {{ dialect.name}} + {% if not forloop.last %}, {% endif %} + {% endfor %} +
{% trans "Senses" %} ({{lang.name}}) +
+ {% for key, value in sensetranslations.items %} + {% if value != "" %} + {{key}}. {{ value|safe }} + {% if not forloop.last %}
{% endif %} + {% endif %} + {% endfor %} +
+
+ {% trans "Abstract Meaning" %} ({{ lang }}) + {% for trn in translations %}{{ trn.translation.text|safe }} + {% if not forloop.last %}, {% endif %}{% endfor %}
{% blocktrans %}Note(s){% endblocktrans %} + + {% for role_id, note_list in notes_groupedby_role.items %} + {% for def in note_list %} + {% if def.published %} + + + {% endif %} + {% endfor %} + {% endfor %} +
{{role_id.1}}
{{def.text}}
+
+
+
+
+
+ +
+
+ {% if gloss.has_perspective_videos %} +
+ {% for perspvideo in gloss.get_perspective_videos %} + {% if perspvideo.perspective == 'left' %} + + {% endif %} + {% endfor %} + + {% for perspvideo in gloss.get_perspective_videos %} + {% if perspvideo.perspective == 'right' %} + + {% endif %} + {% endfor %} +
+ {% endif %} + {% if gloss.has_video %} +
+ + + {% for perspvideo in gloss.get_perspective_videos %} + + {% endfor %} +
+
+ + + +
+ {% else %} +
+ +
+
+ {% endif %} +
+
+
+
+{% if gloss.has_nme_videos %} +
+
{% trans "NME Videos" %} +
+
+ + + + +
+ {% for videonme in gloss.get_nme_videos %} +
+ + + + + {% with nme_video_descriptions|get_item:videonme as nme_descriptions %} + {% for lang, description in nme_descriptions.items %} + + + + + {% endfor %} + {% endwith %} +
+
+ +
+
+ {% if SHOW_DATASET_INTERFACE_OPTIONS %}{{lang.name}}:{% endif %} + {{description}}
+
+ {% endfor %} +
+
+
+{% endif %} + +
+
{% trans "Phonology" %} +
+
+ + {% for value,name,label,kind in phonology_fields %} + {% if value == '-' or value == ' ' or value == '' or value == None %} + {% else %} + + + {% if kind == "check" %} + + {% else %} + + {% endif %} + + {% endif %} + {% endfor %} +
{{label}}{% if value %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}{% value value %}
+
+
+ +
+
{% trans "Relations to Other Signs" %} +
+
+ + {% for rel, target_display in otherrelations %} + + + + + + {% endfor %} +
{{rel.get_role_display}} + {{target_display}} +
+
+
+ +
+
{% trans "Example Sentences" %} +
+ +
+ + + + {% for annotated_sentence in annotated_sentences %} + {% if annotated_sentence.get_video_path %} + + {% else %} + + {% endif %} + {% endfor %} + +
+ + + + + +

{% trans "Glosses" %}
+
+ {% for annotated_gloss in annotated_sentence.annotated_glosses.all %} + + {{ annotated_gloss.show_annotationidglosstranslation }} + + {% endfor %} +

+ +

+ {% if annotated_sentence.has_contexts %} + {% trans "Sentence context" %}
+ {% for annotated_sentence_context in annotated_sentence.annotated_sentence_contexts.all %} + {{ annotated_sentence_context.language }}: {{ annotated_sentence_context.text }}{% if not forloop.last %}
{% endif %} + {% endfor %} + {% endif %} +

+

+ {% if annotated_sentence.has_translations %} + {% trans "Sentence translation" %}
+ {% for annotated_sentence_translation in annotated_sentence.annotated_sentence_translations.all %} + {{ annotated_sentence_translation.language }}: {{ annotated_sentence_translation.text }}{% if not forloop.last %}
{% endif %} + {% endfor %} + {% endif %} +

+

+ {% if annotated_sentence.annotatedvideo.source %} + {% trans "Source" %}
+ {{ annotated_sentence.annotatedvideo.source.source }} + {% if annotated_sentence.annotatedvideo.source.url %} + , {{ annotated_sentence.annotatedvideo.source.url }} + {% endif %} + {% endif %} +

+

+ {% if annotated_sentence.annotatedvideo.url %} + {% trans "Original video" %}
+ {{ annotated_sentence.annotatedvideo.url }} + {% endif %} +

+
+
+
+
+
+ + + + +

+{% endblock %} \ No newline at end of file diff --git a/signbank/dictionary/urls.py b/signbank/dictionary/urls.py index 4e7d5ebf8..58f656747 100755 --- a/signbank/dictionary/urls.py +++ b/signbank/dictionary/urls.py @@ -32,7 +32,7 @@ re_path(r'^tag/(?P[^/]*)/?$', signbank.dictionary.tagviews.taglist), # an alternate view for direct display of a gloss - re_path(r'gloss/(?P\d+).html$', signbank.dictionary.views.gloss, name='public_gloss'), + re_path(r'gloss/(?P\d+).html$', GlossDetailView.as_view(), {'public': True}, name='public_gloss'), re_path(r'morpheme/(?P\d+).html$', signbank.dictionary.views.morpheme, name='public_morpheme'), re_path(r'^update/gloss/(?P\d+)$', signbank.dictionary.update.update_gloss, name='update_gloss'), diff --git a/signbank/dictionary/views.py b/signbank/dictionary/views.py index 562802f57..4cdc7efdc 100644 --- a/signbank/dictionary/views.py +++ b/signbank/dictionary/views.py @@ -2261,26 +2261,61 @@ def info(request): return HttpResponse(json.dumps(user_datasets_names), content_type='application/json') +def extract_glossid_from_filename(filename): + file = os.path.basename(filename) + filename_without_extension = file.split('.')[0] + + if filename_without_extension.endswith('_small'): + m = re.search(r".+-(\d+)\_small$", filename_without_extension) + gloss_pk = m.group(1) + elif filename_without_extension.endswith('_left'): + m = re.search(r".+-(\d+)\_left$", filename_without_extension) + gloss_pk = m.group(1) + elif filename_without_extension.endswith('_right'): + m = re.search(r".+-(\d+)\_right$", filename_without_extension) + gloss_pk = m.group(1) + elif re.search(r"\_nme_\d+$", filename_without_extension): + m = re.search(r".+-(\d+)\_nme_\d+$", filename_without_extension) + gloss_pk = m.group(1) + else: + gloss_pk = int(filename.split('.')[-2].split('-')[-1]) + + return gloss_pk + + def protected_media(request, filename, document_root=WRITABLE_FOLDER, show_indexes=False): if not request.user.is_authenticated: # If we are not logged in, try to find if this maybe belongs to a gloss that is free to see for everbody? (name, ext) = os.path.splitext(os.path.basename(filename)) - if 'handshape' in name: + if 'annotatedvideo' in filename: + # check that the sentence exists + try: + file = os.path.basename(filename) + sentence_pk = int(file.split('.')[0]) + except IndexError: + return HttpResponse(status=401) + + lookup_sentence = AnnotatedSentence.objects.filter(pk=sentence_pk).first() + if not lookup_sentence: + HttpResponse(status=401) + pass + elif 'handshape' in name: # handshape images are allowed to be seen in Show All Handshapes pass else: try: - gloss_pk = int(filename.split('.')[-2].split('-')[-1]) - except IndexError: + gloss_pk = extract_glossid_from_filename(filename) + glosspk = int(gloss_pk) + except (IndexError, ValueError): return HttpResponse(status=401) - lookup_gloss = Gloss.objects.filter(pk=gloss_pk, archived=False, inWeb=True) + lookup_gloss = Gloss.objects.filter(pk=glosspk, archived=False, inWeb=True) if not lookup_gloss.count() == 1: HttpResponse(status=401) - #If we got here, the gloss was found and in the web dictionary, so we can continue + # If we got here, the gloss was found and in the web dictionary, so we can continue filename = os.path.normpath(filename) @@ -2322,6 +2357,7 @@ def protected_media(request, filename, document_root=WRITABLE_FOLDER, show_index from django.views.static import serve return serve(request, filename, document_root, show_indexes) + def show_glosses_with_no_lemma(request): selected_datasets = get_selected_datasets_for_user(request.user) diff --git a/signbank/settings/server_specific/default.py b/signbank/settings/server_specific/default.py index 0e9bf3d82..ff4db4ad5 100644 --- a/signbank/settings/server_specific/default.py +++ b/signbank/settings/server_specific/default.py @@ -109,10 +109,10 @@ REGEX_SPECIAL_CHARACTERS = '[+]' USE_REGULAR_EXPRESSIONS = False -#From all possible gloss fields available, display these +# From all possible gloss fields available, display these FIELDS = {} -FIELDS['main'] = ['useInstr','wordClass'] +FIELDS['main'] = ['useInstr', 'wordClass'] # fields are ordered per kind: Field Choice Lists, Text, Boolean # followed by etymology and articulation @@ -124,6 +124,11 @@ 'domhndsh_letter', 'domhndsh_number', 'subhndsh_letter', 'subhndsh_number', 'weakdrop', 'weakprop'] +PUBLIC_PHONOLOGY_FIELDS = ['handedness', 'domhndsh', 'subhndsh', 'handCh', 'relatArtic', 'locprim', + 'contType', 'movSh', 'movDir', + 'repeat', 'altern', + 'relOriMov', 'relOriLoc', 'oriCh'] + FIELDS['semantics'] = ['semField', 'derivHist', 'namEnt','valence','iconImg','concConcSet'] FIELDS['frequency'] = ['tokNo','tokNoSgnr']