diff --git a/entries/static/entries/js/components/LexicalUnitEdit.js b/entries/static/entries/js/components/LexicalUnitEdit.js index e84294f8dea075482d532a0e84c368a62dd53897..69e953235b68a51888c470c2f574aeebe423df45 100644 --- a/entries/static/entries/js/components/LexicalUnitEdit.js +++ b/entries/static/entries/js/components/LexicalUnitEdit.js @@ -468,6 +468,7 @@ Object.assign(LexicalUnitEdit, { timeout: 60000, success: function (response) { show_info('Zunifikowana rama została zduplikowana.'); + this.currentPreviewedUnifiedFrameId = response.unified_frame_id; $.prompt.close(); }.bind(this), error: function (request, errorType, errorMessage) { diff --git a/entries/static/entries/js/unification_entries_for_frames_list.js b/entries/static/entries/js/unification_entries_for_frames_list.js index f1a1649dd8d2d3804ac5f5eaa278552634f19f2c..65a7ece2f51243414d4f45a4e7af1a684752e76f 100644 --- a/entries/static/entries/js/unification_entries_for_frames_list.js +++ b/entries/static/entries/js/unification_entries_for_frames_list.js @@ -9,7 +9,7 @@ function setup_entries_for_frames_list(options) { ) ? gettext("tak") : gettext("nie"); } - const ajaxURL = can_see_assignees ? '/' + window.lang + '/entries/get_entries/?with_lexical_units=true' : '/' + window.lang + '/entries/get_entries/?with_lexical_units=true&exclude_status=N&restrict_to_user='+window.USER_USERNAME; + const ajaxURL = can_see_assignees ? '/' + window.lang + '/entries/get_entries/?with_lexical_units=true&has_unified_frame=true' : '/' + window.lang + '/entries/get_entries/?with_lexical_units=true&has_unified_frame=true&exclude_status=N&restrict_to_user='+window.USER_USERNAME; var datatable = setup_datatable({ element: options.table, diff --git a/entries/views.py b/entries/views.py index e506a5e188d84f5a610d14b5b13c0d16cc420456..8bafae57aea97f2f9ddde4d4132ad8732cb7f7a4 100644 --- a/entries/views.py +++ b/entries/views.py @@ -356,6 +356,7 @@ def get_entries(request): with_lexical_units = request.GET.get('with_lexical_units') == 'true' exclude_status = request.GET.get('exclude_status') restrict_to_user = request.GET.get('restrict_to_user') + has_unified_frame = request.GET.get('has_unified_frame') entries = get_filtered_objects(forms).filter(import_error=False) # TODO restrictions for testing – remove!!! @@ -429,7 +430,8 @@ def get_entries(request): filteredLexicalUnits = [] for lexicalUnit in lexicalUnits: if (exclude_status == None or lexicalUnit['status'] != exclude_status) and \ - (restrict_to_user == None or lexicalUnit['assignee_username'] == restrict_to_user): + (restrict_to_user == None or lexicalUnit['assignee_username'] == restrict_to_user) and \ + (has_unified_frame != 'true' or lexicalUnit['unified_frame_id'] != -1): filteredLexicalUnits.append(lexicalUnit) entry['lexical_units'] = filteredLexicalUnits if len(filteredLexicalUnits) > 0: