mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 21:25:42 +00:00 
			
		
		
		
	Modal form is working for 'create new category'
- Had to set form.helper.form_tag to False (so we could control form tags manually) - Created a 'json' model view
This commit is contained in:
		| @@ -1,18 +1,17 @@ | ||||
| {% load static %} | ||||
|  | ||||
| <form method='post'> | ||||
|     {% csrf_token %} | ||||
|     <div class='modal-header'> | ||||
|         <h4 class='modal-title'>{{ title }}</h4> | ||||
|     </div> | ||||
|     <div class='modal-body'> | ||||
|     {% load crispy_forms_tags %} | ||||
|     {% crispy form %} | ||||
|     </div> | ||||
|     <div class='modal-footer'> | ||||
|         <button type='button' class='btn btn-default' data-dismiss='modal'>Close</button> | ||||
|         <button type='submit' class='btn btn-primary'> | ||||
|             {% if ok_text %}{{ ok_text }}{% else %}Submit{% endif %} | ||||
|         </button> | ||||
|     </div> | ||||
| <form method="post" action='/part/category/new/' class='js-modal-form'> | ||||
|   {% csrf_token %} | ||||
|   <div class="modal-header"> | ||||
|     <button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||||
|       <span aria-hidden="true">×</span> | ||||
|     </button> | ||||
|     <h4 class="modal-title">Form Title Here</h4> | ||||
|   </div> | ||||
|   <div class="modal-body"> | ||||
|       {% load crispy_forms_tags %} | ||||
|       {% crispy form %} | ||||
|   </div> | ||||
|   <div class="modal-footer"> | ||||
|     <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | ||||
|     <button type="submit" class="btn btn-primary">Submit</button> | ||||
|   </div> | ||||
| </form> | ||||
		Reference in New Issue
	
	Block a user