<%def name="formSearchFields()"> ${self.searchExpressions('form')} ${self.orderBy(app_globals.searchLocations['form'])} ${self.additionalFormSearchFilters()} <%def name="fileSearchFields()"> ${self.searchExpressions('file')} ${self.orderBy(app_globals.searchLocations['file'])} ${self.additionalFileSearchFilters()} <%def name="collectionSearchFields()"> ${self.searchExpressions('collection')} ${self.orderBy(app_globals.searchLocations['collection'])} ${self.additionalCollectionSearchFilters()} <%def name="searchExpressions(entity)">
Search Expression 1
  1. ${h.text(name='searchTerm1', tabindex=1)} ${h.select(name='searchType1', selected_values="", options=app_globals.searchTypes, tabindex=2)} ${h.select(name='searchLocation1', selected_values="transcription", options=app_globals.searchLocations[entity], tabindex=3)}
${h.select(name='andOrNot', selected_values="and", options=app_globals.andOrNot, tabindex=4)}
Search Expression 2
  1. ${h.text(name='searchTerm2', tabindex=5)} ${h.select(name='searchType2', selected_values="", options=app_globals.searchTypes, tabindex=6)} ${h.select(name='searchLocation2', selected_values="gloss", options=app_globals.searchLocations[entity], tabindex=7)}
<%def name="additionalFormSearchFilters()"> <%doc> Additional Form Search Filters (ASF) use the searchFilter(), searchDateFilter() and searchIntegerFiler() defs to add more ASFs if desired ${self.searchFiltersHeader()} ${self.searchFilter(['speaker'], ['is', 'is not'], ['any of'], [(None, 'empty')] + app_globals.speakers, 1)} ${self.searchFilter(['elicitor', 'enterer', 'verifier'], ['is', 'is not'], ['any of'], [(None, 'empty')] + app_globals.users, 2)} ${self.searchFilter(['source'], ['is', 'is not'], ['any of'], [(None, 'empty')] + app_globals.sources, 3)} ${self.searchFilter([('grammaticality', 'grammaticality')], ['is', 'is not'], ['any of'], [(None, 'empty'), ('*', '*'), ('?', '?')], 4)} ${self.searchFilter([('glossGrammaticality', 'gloss grammaticality')], ['contains', 'does not contain'], ['all of', 'any of'], [(None, 'empty'), ('*', '*'), ('?', '?')], 5)} ${self.searchFilter([('elicitationMethod', 'elicitation method')], ['is', 'is not'], ['any of'], [(None, 'empty')] + app_globals.elicitationMethods, 6)} ${self.searchFilter([('syntacticCategory', 'syntactic category')], ['is', 'is not'], ['any of'], [(None, 'empty')] + app_globals.syncats, 7)} ${self.searchFilter(['keywords'], ['contains', 'does not contain'], ['all of', 'any of'], [(None, 'empty')] + app_globals.keywords, 8)} ${self.searchDateFilter(0)} ${self.searchDateFilter(1)} ${self.searchDateFilter(2)} ${self.searchDateFilter(3)} ${self.searchFiltersFooter()} <%def name="additionalFileSearchFilters()"> <%doc> Additional File Search Filters (ASF) use the searchFilter() and searchDateFilter() defs to add more ASFs if desired ${self.searchFiltersHeader()} ${self.searchFilter([('MIMEtype', 'MIME type')], ['is', 'is not'], ['any of'], [(None, 'empty')] + [('"' + key + '"', key) for key in sorted(app_globals.allowedFileTypes.keys())], 1)} ${self.searchFilter(['elicitor', 'enterer'], ['is', 'is not'], ['any of'], [(None, 'empty')] + app_globals.users, 2)} ${self.searchFilter(['speaker'], ['is', 'is not'], ['any of'], [(None, 'empty')] + app_globals.speakers, 3)} ${self.searchFilter([('utteranceType', 'utterance type')], ['is', 'is not'], ['any of'], [(None, 'empty'), ('Object Language Utterance', 'Object Language Utterance'), ('Metalanguage Utterance', 'Metalanguage Utterance'), ('Mixed Utterance', 'Mixed Utterance')], 4)} ${self.searchDateFilter(0)} ${self.searchDateFilter(1)} ${self.searchDateFilter(2)} ${self.searchDateFilter(3)} ${self.searchIntegerFilter('file', 0, ['', 'bytes', 'KB', 'MB', 'GB'])} ${self.searchFiltersFooter()} <%def name="additionalCollectionSearchFilters()"> <%doc> Additional Collection Search Filters (ASF) use the searchFilter() and searchDateFilter() defs to add more ASFs if desired ${self.searchFiltersHeader()} ${self.searchFilter(['elicitor', 'enterer'], ['is', 'is not'], ['any of'], [(None, 'empty')] + app_globals.users, 0)} ${self.searchFilter(['speaker'], ['is', 'is not'], ['any of'], [(None, 'empty')] + app_globals.speakers, 1)} ${self.searchFilter(['source'], ['is', 'is not'], ['any of'], [(None, 'empty')] + app_globals.sources, 2)} ${self.searchDateFilter(0)} ${self.searchDateFilter(1)} ${self.searchDateFilter(2)} ${self.searchDateFilter(3)} ${self.searchIntegerFilter('collection', 0)} ${self.searchFiltersFooter()} <%def name="searchFiltersHeader()">
% if hasattr(c, 'viewRestrictors') and c.viewRestrictors: Additional Search Filters -
    % else: Additional Search Filters +
      % endif <%def name="searchFiltersFooter()">
<%def name="searchFilter(locations, containsNots, allAnyOfs, options, index)">
  • ${h.select(name='restrictors-%s.location'%(index), selected_values='', options=locations, tabindex=8)} ${h.select(name='restrictors-%s.containsNot'%(index), selected_values='', options=containsNots, tabindex=8)} ${h.select(name='restrictors-%s.allAnyOf'%(index), selected_values='', options=allAnyOfs, tabindex=8)}
  • <%def name="searchDateFilter(index)">
  • ${h.select(name='dateRestrictors-%s.location'%(index), selected_values='', options=[('dateElicited', 'date elicited'), ('datetimeEntered', 'date entered'), ('datetimeModified', 'date modified')], tabindex=8)} ${h.select(name='dateRestrictors-%s.relation'%(index), selected_values='', options=[('', 'is'), ('not_', 'is not'), ('earlier_than', 'is earlier than'), ('later_than', 'is later than')], tabindex=8)} ${h.text(name='dateRestrictors-%s.date'%(index), size='10', maxlength='10', tabindex=8)} (mm/dd/yyyy)
  • <%def name="searchIntegerFilter(entity, index, units=None)">
  • ${h.select(name='integerRestrictors-%s.location'%(index), selected_values='', options=app_globals.searchIntegerFilterLocations[entity], tabindex=8)} ${h.select(name='integerRestrictors-%s.relation'%(index), selected_values='', options=[('==', 'is'), ('!=', 'is not'), ('lt', 'is less than'), ('gt', 'is greater than')], tabindex=8)} ${h.text(name='integerRestrictors-%s.integer'%(index), size='10', maxlength='10', tabindex=8)} % if units: ${h.select(name='integerRestrictors-%s.unit'%(index), selected_values='', options=units, tabindex=8)} % endif
  • <%def name="orderBy(columns, selected='id')">
    Order By
    1. ${h.select(name='orderByColumn', selected_values='', options=columns, tabindex=8)} ${h.select(name='orderByDirection', selected_values='', options=[('desc', 'descending'), ('asc', 'ascending')], tabindex=8)}
    <%def name="dictionarySearch()"> <% choices = [ ( 'ol', '%s to %s' % (app_globals.objectLanguageName, app_globals.metaLanguageName) ), ( 'ml', '%s to %s' % (app_globals.metaLanguageName, app_globals.objectLanguageName) ) ] %> ${h.text(name='dictionarySearchTerm', size='40', tabindex=1)} ${h.select(name='dictionarySearchType', selected_values="", options=choices, tabindex=2)}