mirror of
				https://github.com/eduardogsilva/wireguard_webadmin.git
				synced 2025-10-31 10:36:17 +00:00 
			
		
		
		
	
		
			
	
	
		
			46 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
		
		
			
		
	
	
			46 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
|   | {% if messages %} | ||
|  |     <script> | ||
|  |       {% for message in messages %} | ||
|  |         var fullMessage = "{{ message.message|escapejs }}"; | ||
|  |         var parts = fullMessage.split("|"); | ||
|  |         if (parts.length > 1) { | ||
|  |             $(document).Toasts('create', { | ||
|  |                 {% if message.tags %} | ||
|  |                 class: 'bg-{{ message.tags }}', | ||
|  |                 {% endif %} | ||
|  |                 title: parts[0], | ||
|  |                 subtitle: '{{ message.tags }}', | ||
|  |                 body: parts[1], | ||
|  |                 delay: 10000,  | ||
|  |                 autohide: true,  | ||
|  |             }); | ||
|  |         } else { | ||
|  |             $(document).Toasts('create', { | ||
|  |                 {% if message.tags %} | ||
|  |                 class: 'bg-{{ message.tags }}', | ||
|  |                 {% endif %} | ||
|  |                 subtitle: '{{ message.tags }}', | ||
|  |                 body: parts[0], | ||
|  |                 delay: 10000,  | ||
|  |                 autohide: true,  | ||
|  |             }); | ||
|  |         } | ||
|  |       {% endfor %} | ||
|  |     </script> | ||
|  | {% endif %} | ||
|  | 
 | ||
|  | {% if form.errors %} | ||
|  |     <script> | ||
|  |         {% for field, errors in form.errors.items %} | ||
|  |             {% for error in errors %} | ||
|  |                 $(document).Toasts('create', { | ||
|  |                     class: 'bg-danger',  | ||
|  |                     title: 'Error!', | ||
|  |                     body: '{{ error|escapejs }}', | ||
|  |                     delay: 10000,  | ||
|  |                     autohide: true,  | ||
|  |                 }); | ||
|  |             {% endfor %} | ||
|  |         {% endfor %} | ||
|  |     </script> | ||
|  | {% endif %} |