Skip to content
Snippets Groups Projects
Commit f01e0a29 authored by dcz's avatar dcz
Browse files

Free lus for lexicografs.

parent bee2e686
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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>
{% if is_superlexicograf %}
<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
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>
......
......@@ -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)
......
......@@ -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"
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment