Skip to content
Snippets Groups Projects
Select Git revision
  • 75ef7daa3ce44abc7b7a716a6570e9e44420a442
  • master default protected
  • fix-words-ann
  • wccl-rules-migration
  • develop
5 results

nor.h

Blame
  • free_lus_list.js 1.13 KiB
    function setup_free_lus_list(options) {
        const can_see_assignees = has_permission("users.view_assignment");
    
        let ajaxURL = '/' + lang + '/entries/get_entries/?has_unified_frame=false&with_lexical_units=false&without_frames='+ (options.show_all ? 'false' : 'true') +'&show_linked_entries_disabled=true';
        if(!can_see_assignees && !options.show_all) {
            ajaxURL += '&restrict_to_user='+window.USER_USERNAME;
        }
    
        const datatable = setup_datatable({
            element: options.table,
            url: ajaxURL,
            columns: [
                { data: 'lemma' },
                { data: 'status' },
                { data: 'id' },
            ],
            hidden_columns: [2],
            selectEntryId: options.selectEntryId,
            setup_hierarchy_marking: false,
            disable_display_graphical_status: true,
        });
        datatable.on('click', 'tr.entry', function () {
            const data = datatable.row(this).data();
            if (!data) return;
            const related = data.related === true;
            $('.entry', options.table).removeClass('table-primary');
            options.entrySelected(Number(data.id));
            $(this).addClass('table-primary');
        });
    }