diff --git a/entries/forms.py b/entries/forms.py index 7cc5e7229edc49b4afe598caa44fcad574005a81..e334e2d07459d957638a51d1406f4997cc47e3b5 100644 --- a/entries/forms.py +++ b/entries/forms.py @@ -624,12 +624,16 @@ class UnifiedFrameFormFactory(FormFactory): field_makers = ( ( 'status', - lambda: ModelMultipleChoiceFilter( + lambda: MultipleChoiceFilter( label=_('Status'), - queryset=UnifiedFrame.objects.distinct(), - key='status', + choices=( + (UnifiedFrameStatus.PROCESSING, (_('W obróbce'), None)), + (UnifiedFrameStatus.READY, (_('Gotowe'), None)), + (UnifiedFrameStatus.VERIFIED, (_('Sprawdzone'), None)), + ), lookup='status', - ), None, + ), + None, ), ( None, None, diff --git a/entries/static/entries/js/entries.js b/entries/static/entries/js/entries.js index e43355fc541e489a13ecdcacb53558e3cb1d0f7e..67bca83ef75bcaa1b37bfb17518da4c36100e354 100644 --- a/entries/static/entries/js/entries.js +++ b/entries/static/entries/js/entries.js @@ -1090,7 +1090,7 @@ function initialize_entries_list() { function getRoles() { $.ajax({ dataType: "json", - url: 'roles', + url: '/' + lang + '/entries/roles', success: function(data){ roles = data.roles; }, @@ -1101,7 +1101,7 @@ function getRoles() { function getRoleAttributes() { $.ajax({ dataType: "json", - url: 'role_attributes', + url: '/' + lang + '/entries/role_attributes', success: function(data){ role_attributes = data.role_attributes; }, @@ -1136,9 +1136,9 @@ $(document).ready(function() { // getPredefinedSelections(); - // getRoles(); - // - // getRoleAttributes(); + getRoles(); + + getRoleAttributes(); // $.getJSON('relations', function(data){ // memorizeRelations(data.relations); diff --git a/entries/static/entries/js/entries_list.js b/entries/static/entries/js/entries_list.js index 4d9b59a47b546f5c4783a972cb1a2886b15bd5c2..c1bb874449ddae941ecf49fe015e720922a5da94 100644 --- a/entries/static/entries/js/entries_list.js +++ b/entries/static/entries/js/entries_list.js @@ -1,4 +1,4 @@ -function update_entries() { +function update_entries2() { var datatable = setup_datatable({ element: $("#entries-table"), selectFirst: true, diff --git a/entries/static/entries/js/unification_frames_list.js b/entries/static/entries/js/unification_frames_list.js index bada75f7a6630bcca476f86e569713ae260a8d16..58bb40db4fed866a8f7fbcaeca5d06809510cbaf 100644 --- a/entries/static/entries/js/unification_frames_list.js +++ b/entries/static/entries/js/unification_frames_list.js @@ -19,7 +19,8 @@ function setup_frames_list(options) { can_see_assignees ? { data: 'assignee_username' } : { render: is_assigned_to_user_renderer }, { data: 'id' }, ], - hidden_columns: can_see_assignees ? [3] : [2,3] + hidden_columns: can_see_assignees ? [3] : [2,3], + selectEntryId: options.selectEntryId, }); datatable.on('click', 'tr.entry', function () { const data = datatable.row(this).data(); diff --git a/frontend/src/components/unification/Entries/EntriesList.vue b/frontend/src/components/unification/Entries/EntriesList.vue index e72897d4d7d831d701ec58f85103f50c37eb55ce..d51b85960054b344cbf3d8228a63f7323c9c7818 100644 --- a/frontend/src/components/unification/Entries/EntriesList.vue +++ b/frontend/src/components/unification/Entries/EntriesList.vue @@ -10,7 +10,7 @@ // TODO: reload data and click in selected row // this.datatableObject.ajax.reload(); setup_entries_list({ - table: this.$refs.table, + table: this.$refs.entriestable, lexicalUnitSelected: (entryId, lexicalUnitId) => { this.$emit('lexicalUnitSelected', entryId, lexicalUnitId); }, selectEntryId: this.initialEntryId, secondarySelectEntryId: this.initialLexicalUnitId, @@ -27,7 +27,7 @@ reset_list() { this.$emit('lexicalUnitSelected', null, null); setup_entries_list({ - table: this.$refs.table, + table: this.$refs.entriestable, lexicalUnitSelected: (entryId, lexicalUnitId) => { this.$emit('lexicalUnitSelected', entryId, lexicalUnitId); }, }); } @@ -36,7 +36,7 @@ mounted () { this.$.appContext.config.globalProperties.$entries_list = this; setup_entries_list({ - table: this.$refs.table, + table: this.$refs.entriestable, lexicalUnitSelected: (entryId, lexicalUnitId) => { this.$emit('lexicalUnitSelected', entryId, lexicalUnitId); }, selectEntryId: this.initialEntryId }); @@ -45,7 +45,7 @@ </script> <template> - <table ref="table" class="table table-sm text-dark"> + <table ref="entriestable" class="table table-sm text-dark"> <thead> <tr> <th class="p-1">{{ gettext('Lemat') }}</th> diff --git a/frontend/src/components/unification/Unification/UnificationFramesList.vue b/frontend/src/components/unification/Unification/UnificationFramesList.vue index 933bae26bbab537a3d9f9f01273e44313805bc22..981ec7778d13db67a990b35523ee8f4675cc9d0c 100644 --- a/frontend/src/components/unification/Unification/UnificationFramesList.vue +++ b/frontend/src/components/unification/Unification/UnificationFramesList.vue @@ -14,7 +14,7 @@ export default { reset_list() { this.$emit('unifiedFrameSelected', null); setup_frames_list({ - table: this.$refs.table, + table: this.$refs.framestable, unifiedFrameSelected: (unifiedFrameId) => { this.$emit('unifiedFrameSelected', unifiedFrameId); }, @@ -27,7 +27,7 @@ export default { // TODO: reload data and click in selected row // this.datatableObject.ajax.reload(); setup_frames_list({ - table: this.$refs.table, + table: this.$refs.framestable, unifiedFrameSelected: (unifiedFrameId) => { this.$emit('unifiedFrameSelected', unifiedFrameId); }, @@ -39,7 +39,7 @@ export default { mounted() { this.$.appContext.config.globalProperties.$entries_list = this; setup_frames_list({ - table: this.$refs.table, + table: this.$refs.framestable, unifiedFrameSelected: (unifiedFrameId) => { this.$emit('unifiedFrameSelected', unifiedFrameId); }, @@ -50,12 +50,12 @@ export default { </script> <template> - <table ref="table" class="table table-sm table-hover text-dark"> + <table ref="framestable" class="table table-sm table-hover text-dark"> <thead> <tr> <th class="p-1">{{ gettext('Rama') }}</th> <th class="p-1">{{ gettext('Status') }}</th> - <th v-if="canViewAssignment" class="p-1">{{ gettext('Leksykograf') }}</th> + <th class="p-1">{{ gettext('Leksykograf') }}</th> <th class="p-1" hidden="true">{{ gettext('Id') }}</th> </tr> </thead>