Úprava chování korektury (schovává text korektury!!!)
This commit is contained in:
		
							parent
							
								
									524593b7ef
								
							
						
					
					
						commit
						3528a44d3c
					
				
					 3 changed files with 35 additions and 63 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 307 B | 
|  | @ -132,12 +132,15 @@ function img_click(element, ev) { | ||||||
| function toggle_visibility(oid){ | function toggle_visibility(oid){ | ||||||
| 	var buttondiv = document.getElementById(oid+'-buttons') | 	var buttondiv = document.getElementById(oid+'-buttons') | ||||||
| 	var text = document.getElementById(oid+'-body'); | 	var text = document.getElementById(oid+'-body'); | ||||||
|  |     var toggleimg = document.getElementById(oid+'-toggleimg'); | ||||||
| 	if (text.style.display == 'none'){ | 	if (text.style.display == 'none'){ | ||||||
| 		text.style.display = 'block'; | 		text.style.display = 'block'; | ||||||
| 		buttondiv.style.display = 'inline-block'; | 		buttondiv.style.display = 'inline-block'; | ||||||
|  |         toggleimg.style.transform = ""; | ||||||
| 	}else { | 	}else { | ||||||
| 		text.style.display = 'none'; | 		text.style.display = 'none'; | ||||||
| 		buttondiv.style.display = 'none'; | 		buttondiv.style.display = 'none'; | ||||||
|  |         toggleimg.style.transform = "rotate(180deg)"; | ||||||
| 	} | 	} | ||||||
| 	for (var i=0;i<comments.length-1;i++){ | 	for (var i=0;i<comments.length-1;i++){ | ||||||
| 		 place_comments_one_div(comments[i][0], comments[i][1]) | 		 place_comments_one_div(comments[i][0], comments[i][1]) | ||||||
|  |  | ||||||
|  | @ -111,8 +111,35 @@ | ||||||
| 	    onmouseover='box_onmouseover(this)'  | 	    onmouseover='box_onmouseover(this)'  | ||||||
| 	    onmouseout='box_onmouseout(this)'>  | 	    onmouseout='box_onmouseout(this)'>  | ||||||
| 
 | 
 | ||||||
|     	<div class='corr-header'>  | 		<div class='corr-body' id='op{{o.id}}-body'> | ||||||
| 			<span class='author' id='op{{o.id}}-autor'>{{o.autor}}</span> | 
 | ||||||
|  | 		{% for k in o.komentare %} | ||||||
|  | 		<div class='comment' id='k{{k.id}}'> | ||||||
|  |     		<div class='corr-header'> | ||||||
|  |         		<div class='author'>{{k.autor}}</div> | ||||||
|  |             	<div class="float-right"> | ||||||
|  | 		<!-- Komentar !--> | ||||||
|  |                     <form  action='' onsubmit='save_scroll(this)' method='POST'> | ||||||
|  | 						{% csrf_token %} | ||||||
|  | 						<input type='hidden' name='id' value='{{k.id}}'> | ||||||
|  |                     	<input type='hidden' name='scroll'> | ||||||
|  |                     	  <button style="display: none" type='submit' name='action' value='del-comment' title='Smaž komentář' | ||||||
|  |                       	  onclick='return confirm("Opravdu smazat komentář?")'> | ||||||
|  |                             <img src="{% static "korektury/imgs/delete.png" %}"/> | ||||||
|  | 					 	            </button> | ||||||
|  |                     </form> | ||||||
|  | 					<!-- /Komentar !--> | ||||||
|  |                         <button type='button' onclick="update_comment('op{{o.id}}','kt{{k.id}}');" title='Uprav komentář'> | ||||||
|  |                                     <img src="{% static "korektury/imgs/edit.png"%}"/> | ||||||
|  |                         </button> | ||||||
|  | 				</div> | ||||||
|  | 			</div> | ||||||
|  | 			<div id='kt{{k.id}}'>{{k.text|linebreaks}}</div> | ||||||
|  | 		</div> | ||||||
|  |     	<hr> | ||||||
|  | 		{% endfor %}  | ||||||
|  | 		</div> | ||||||
|  |     	<div class='corr-header'> | ||||||
| 			<span class='float-right'> | 			<span class='float-right'> | ||||||
| 				<span id='op{{o.id}}-buttons'> | 				<span id='op{{o.id}}-buttons'> | ||||||
| 				<!-- Existujici korektura !--> | 				<!-- Existujici korektura !--> | ||||||
|  | @ -122,16 +149,9 @@ | ||||||
| 	   				<input type='hidden' name='id' value='{{o.id}}'> | 	   				<input type='hidden' name='id' value='{{o.id}}'> | ||||||
| 	   				<input type='hidden' name='scroll'> | 	   				<input type='hidden' name='scroll'> | ||||||
| 	   				 | 	   				 | ||||||
| 					{% if o.komentare %} | 					<button style="display: none" type='submit' name='action' value='del' title='Smaž opravu'> | ||||||
| 	   				<button name='action' value='del' type='button' |  | ||||||
|             			title="Opravu nelze smazat – už ji někdo okomentoval"> |  | ||||||
|                   <img src="{% static "korektury/imgs/delete-gr.png"%}"/> |  | ||||||
| 	   				</button> |  | ||||||
| 					{% else %} |  | ||||||
| 					<button type='submit' name='action' value='del' title='Smaž opravu'> |  | ||||||
|             <img src="{% static "korektury/imgs/delete.png"%}"/> |             <img src="{% static "korektury/imgs/delete.png"%}"/> | ||||||
| 					</button> | 					</button>  | ||||||
| 					{% endif %}  |  | ||||||
| 					{% if o.status != o.STATUS.K_OPRAVE %} | 					{% if o.status != o.STATUS.K_OPRAVE %} | ||||||
| 					<button type='submit' name='action' value='{{ o.STATUS.K_OPRAVE }}' title='Označ jako neopravené'> | 					<button type='submit' name='action' value='{{ o.STATUS.K_OPRAVE }}' title='Označ jako neopravené'> | ||||||
|             <img src="{% static "korektury/imgs/undo.png"%}"/> |             <img src="{% static "korektury/imgs/undo.png"%}"/> | ||||||
|  | @ -155,15 +175,6 @@ | ||||||
| 				</form> | 				</form> | ||||||
| 				<!-- /Existujici korektura !--> | 				<!-- /Existujici korektura !--> | ||||||
| 						 | 						 | ||||||
| 				{% if o.komentare %} |  | ||||||
| 				<button type='button' title="Korekturu nelze upravit – už ji někdo okomentoval"> |  | ||||||
|           <img src="{% static "korektury/imgs/edit-gr.png" %}"/> |  | ||||||
| 				</button> |  | ||||||
| 				{% else %} |  | ||||||
| 				<button type='button' onclick='box_edit("op{{o.id}}","update");' title='Oprav opravu'> |  | ||||||
|           <img src="{% static "korektury/imgs/edit.png" %}"/> |  | ||||||
| 				</button> |  | ||||||
| 				{% endif %} |  | ||||||
| 				{% if o.status == 'opraveno' or o.status == 'neni_chyba'  %} | 				{% if o.status == 'opraveno' or o.status == 'neni_chyba'  %} | ||||||
| 				<button type='button' title='Korekturu nelze komentovat, protože už je uzavřená'> | 				<button type='button' title='Korekturu nelze komentovat, protože už je uzavřená'> | ||||||
|           <img src="{% static "korektury/imgs/comment-gr.png" %}"/> |           <img src="{% static "korektury/imgs/comment-gr.png" %}"/> | ||||||
|  | @ -176,53 +187,11 @@ | ||||||
| 
 | 
 | ||||||
| 				</span> | 				</span> | ||||||
| 				<button type='button' onclick='toggle_visibility("op{{o.id}}");' title='Skrýt/Zobrazit'> | 				<button type='button' onclick='toggle_visibility("op{{o.id}}");' title='Skrýt/Zobrazit'> | ||||||
|           <img src="{% static "korektury/imgs/hide.png" %}"/> |           <img id='op{{o.id}}-toggleimg' src="{% static "korektury/imgs/hide.png" %}"/> | ||||||
| 				</button> | 				</button> | ||||||
| 
 | 
 | ||||||
| 			</span> | 			</span> | ||||||
| 		</div> | 		</div> | ||||||
| 		<div class='corr-body' id='op{{o.id}}-body'> |  | ||||||
| 		<div id='op{{o.id}}-text'>{{o.text|linebreaks}}</div> |  | ||||||
| 
 |  | ||||||
| 		{% for k in o.komentare %} |  | ||||||
|     	<hr> |  | ||||||
| 		<div class='comment' id='k{{k.id}}'> |  | ||||||
|     		<div class='corr-header'> |  | ||||||
|         		<div class='author'>{{k.autor}}</div> |  | ||||||
|             	<div class="float-right"> |  | ||||||
| 		<!-- Komentar !--> |  | ||||||
|                     <form  action='' onsubmit='save_scroll(this)' method='POST'> |  | ||||||
| 						{% csrf_token %} |  | ||||||
| 						<input type='hidden' name='id' value='{{k.id}}'> |  | ||||||
|                     	<input type='hidden' name='scroll'> |  | ||||||
|                         {% if forloop.last %} |  | ||||||
|                     	  <button type='submit' name='action' value='del-comment' title='Smaž komentář' |  | ||||||
|                       	  onclick='return confirm("Opravdu smazat komentář?")'> |  | ||||||
|                             <img src="{% static "korektury/imgs/delete.png" %}"/> |  | ||||||
| 					 	  </button> |  | ||||||
|                         {% else %} |  | ||||||
|                           <button name='action' value='del-comment' type='button' |  | ||||||
|             			  title="Komentář nelze smazat – existuje novější"> |  | ||||||
|                             <img src="{% static "korektury/imgs/delete-gr.png"%}"/> |  | ||||||
|                           </button> |  | ||||||
|                         {% endif %} |  | ||||||
|                     </form> |  | ||||||
| 					<!-- /Komentar !--> |  | ||||||
|                     {% if forloop.last %} |  | ||||||
| 					  <button type='button' onclick="update_comment('op{{o.id}}','kt{{k.id}}');" title='Uprav komentář'> |  | ||||||
|                         <img src="{% static "korektury/imgs/edit.png"%}"/> |  | ||||||
| 					  </button> |  | ||||||
|                     {% else %} |  | ||||||
|                       <button type='button' title="Komentář nelze upravit – existuje novější"> |  | ||||||
|                         <img src="{% static "korektury/imgs/edit-gr.png" %}"/> |  | ||||||
|                       </button> |  | ||||||
|                     {% endif %} |  | ||||||
| 				</div> |  | ||||||
| 			</div> |  | ||||||
| 			<div id='kt{{k.id}}'>{{k.text|linebreaks}}</div> |  | ||||||
| 		</div> |  | ||||||
| 		{% endfor %}  |  | ||||||
| 		</div> |  | ||||||
| 	</div>	 | 	</div>	 | ||||||
| 	{% endfor %} | 	{% endfor %} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue