Commit c27d679dff6c20c8937f99e776935cacb02d390e
1 parent
1e63a067
Zablokowane w interfejsie dołączenia ram z haseł niesprawdzonych
Showing
2 changed files
with
11 additions
and
4 deletions
semantics/static/js/semantics_frames.js
... | ... | @@ -24,10 +24,12 @@ function getFrames(frames_display){ |
24 | 24 | var frames = frames_display[i].frames; |
25 | 25 | var visible = frames_display[i].visible; |
26 | 26 | var local = frames_display[i].local; |
27 | + var locked = frames_display[i].locked; | |
27 | 28 | for (j = 0; j < frames.length; j++) { |
28 | 29 | frame_content[frames[j].frame_id] = frames[j]; |
29 | 30 | frame_content[frames[j].frame_id]['visible'] = visible; |
30 | 31 | frame_content[frames[j].frame_id]['local'] = local; |
32 | + frame_content[frames[j].frame_id]['locked'] = locked; | |
31 | 33 | frame_localization[frames[j].frame_id] = {"units": i, "position": j}; |
32 | 34 | lexical_units_frames[i].push(frames[j].frame_id); |
33 | 35 | } |
... | ... | @@ -64,7 +66,11 @@ function getDisplay(visibility, checkboxes) { |
64 | 66 | display += '<div>'; |
65 | 67 | if (checkboxes) { |
66 | 68 | var frame_id = frame_content[lexical_units_frames[i][0]].frame_id; |
67 | - display += '<input type="checkbox" name= "frames" value="' + frame_id + '">'; | |
69 | + display += '<input type="checkbox" name= "frames" value="' + frame_id + '"'; | |
70 | + if (frame_content[lexical_units_frames[i][0]].locked) { | |
71 | + display += " disabled" | |
72 | + } | |
73 | + display += '>'; | |
68 | 74 | } |
69 | 75 | |
70 | 76 | var units = []; |
... | ... |
semantics/views.py
... | ... | @@ -119,7 +119,7 @@ def create_frames_context(lemma_id, user): |
119 | 119 | for t in k: |
120 | 120 | |
121 | 121 | # for t in type_frames: |
122 | - frame_display = {"lexical_units": [], "frames": [], "visible": False, "local": None} | |
122 | + frame_display = {"lexical_units": [], "frames": [], "visible": False, "local": False, "locked": False} | |
123 | 123 | for lu in list(t): |
124 | 124 | frame_display["lexical_units"].append({"id": str(lu.id), "base": lu.base, "sense": str(lu.sense)}) |
125 | 125 | lu_entry = lu.entry |
... | ... | @@ -134,7 +134,9 @@ def create_frames_context(lemma_id, user): |
134 | 134 | frame_display["local"] = True |
135 | 135 | frame_display["visible"] = True |
136 | 136 | else: |
137 | - frame_display["local"] = False | |
137 | + min_priority = [x.priority for x in Lemma_Status.objects.all() if x.status == "(S) sprawdzone"][0] | |
138 | + if frame_entry.actual_lemma().status.priority < min_priority: | |
139 | + frame_display["locked"] = True | |
138 | 140 | |
139 | 141 | # frame_complements = Complement.objects.filter(frame=frame) |
140 | 142 | # frame_complements = frame.complements.all() |
... | ... | @@ -246,7 +248,6 @@ def create_frames_context(lemma_id, user): |
246 | 248 | alternations[frame.id][schema.id] = alternation |
247 | 249 | # alternations[frame.id] = {} |
248 | 250 | |
249 | - | |
250 | 251 | frames_display.append(frame_display) |
251 | 252 | |
252 | 253 | # ala["ma"] = "kot" |
... | ... |