diff --git a/entries/static/entries/js/free_lus_list.js b/entries/static/entries/js/free_lus_list.js index 9b9a6910259c4353ff4a0ffdd411308fe790e621..908c223f47b89069e35ef04385fa4f6dced49f84 100644 --- a/entries/static/entries/js/free_lus_list.js +++ b/entries/static/entries/js/free_lus_list.js @@ -2,7 +2,7 @@ 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) { + if(!can_see_assignees && !options.show_all) { ajaxURL += '&restrict_to_user='+window.USER_USERNAME; } diff --git a/entries/templates/entries_base.html b/entries/templates/entries_base.html index 2acdd293d7548e2279e0858693158d8d6740e2e6..d75b1475121188878b34a3ad35bb8a01c9c1648f 100644 --- a/entries/templates/entries_base.html +++ b/entries/templates/entries_base.html @@ -33,8 +33,8 @@ <li class="nav-item mr-1"><a onclick='window.location.replace(window.currUnifiedFrameId ? "/pl/entries/hierarchy/?unified_frame_id="+window.currUnifiedFrameId : "/pl/entries/hierarchy")' class="nav-link cursor-pointer">{% trans "Hierarchia" %}</a></li> + <li class="nav-item mr-1"><a href="{% url 'entries:lu_free' %}" class="nav-link">{% trans "Wolne jednostki" %}</a></li> {% if is_superlexicograf %} - <li class="nav-item mr-1"><a href="{% url 'entries:lu_free' %}" class="nav-link">{% trans "Wolne jednostki" %}</a></li> <li class="nav-item mr-1"><a onclick='window.location.replace(window.currUnifiedFrameId ? "/pl/entries/vertical-relations/?unified_frame_id="+window.currUnifiedFrameId : "/pl/entries/vertical-relations")' class="nav-link cursor-pointer">{% trans "Relacie poziome" %}</a></li> diff --git a/freelus/views.py b/freelus/views.py index 1a9544fe51fb8805c36c045ae851267f1eeb77d2..820d48e25b9995959554a74d3441163ec5435a87 100644 --- a/freelus/views.py +++ b/freelus/views.py @@ -87,6 +87,8 @@ def create_new_slowal_frame(request): frame = Frame(opinion=FrameOpinion.objects.get(key='unk'), in_building=True) frame.save() + Assignment.assign(user=request.user, subject=frame) + entry = Entry.objects.get(pk=entry_id) for lu_id in lu_ids: lu = LexicalUnit.objects.get(pk=lu_id) diff --git a/frontend/src/components/unification/free_lu/FreeLuEdit.vue b/frontend/src/components/unification/free_lu/FreeLuEdit.vue index 0135b6b7df221e0b9818361596147085f615ac8c..ff6da8dec336d3182069cc293a4db4f3a9b0f80e 100644 --- a/frontend/src/components/unification/free_lu/FreeLuEdit.vue +++ b/frontend/src/components/unification/free_lu/FreeLuEdit.vue @@ -63,6 +63,9 @@ }, }, methods: { + isSuperLeksykograf() { + return has_permission("users.view_assignment"); + }, hideLexicalUnits() { this.lexicalUnitsVisible = false; }, @@ -357,7 +360,7 @@ example_sources_display += "</select>" return '<div class="attach-examples-table-wrapper-scroll-y attach-examples-custom-scrollbar"><table id="attach-examples" class="table table-bordered table-striped mb-0"><thead><tr class="font-weight-bold"><th>Zdanie</th><th>Źródło</th><th>Opinia</th></tr></thead>' + - '<tr><td><input type="text" name="sentence"/></td><td>'+example_sources_display+'</td><td>'+example_opinions_display+'</td></tr></table></div>'; + '<tr><td><input size="100" type="text" name="sentence"/></td><td>'+example_sources_display+'</td><td>'+example_opinions_display+'</td></tr></table></div>'; }.bind(this); const attach_examples_popup = { @@ -718,7 +721,7 @@ </td> </tr> <tr style="background-color: white;"> - <td id="modify-frame" class="table-button-menu-td" @click="change_frame_status_to_building()" + <td v-if="isSuperLeksykograf()" id="modify-frame" class="table-button-menu-td" @click="change_frame_status_to_building()" style="padding: 10px 15px 10px 15px; color: #000000;">{{'Modyfikuj ramę'}} </td> <td id="change-role" class="table-button-menu-td" diff --git a/frontend/src/components/unification/free_lu/FreeLusList.vue b/frontend/src/components/unification/free_lu/FreeLusList.vue index 39193e4852edf69c832e9b01ef442f15b25fd683..03e8d1175d5ba14114d428c647282e30d2c85dfc 100644 --- a/frontend/src/components/unification/free_lu/FreeLusList.vue +++ b/frontend/src/components/unification/free_lu/FreeLusList.vue @@ -40,7 +40,7 @@ </script> <template> - <label class="mt-2 position-absolute" style="z-index: 2"><input type="checkbox" v-model="show_all" /> {{ !show_all ? gettext('Wszystkie') : gettext('Tylko luźne') }}</label> + <label class="mt-2 position-absolute" style="z-index: 2"><input type="checkbox" v-model="show_all" /> {{ !show_all ? gettext('Wszystkie') : canViewAssignment ? gettext('Tylko luźne') : gettext('Tylko moje') }}</label> <table ref="framestable" class="table table-sm table-hover text-dark"> <thead> <tr>