2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Added modal form success messages

- More to be done, just a start
- Create / edit / delete
This commit is contained in:
Oliver
2018-04-30 00:23:02 +10:00
parent a2c1eda5c0
commit a9c20f5d95
4 changed files with 45 additions and 22 deletions

View File

@ -43,6 +43,11 @@ class CompanyEdit(AjaxUpdateView):
ajax_template_name = 'modal_form.html'
ajax_form_title = 'Edit Company'
def get_data(self):
return {
'info': 'Edited company information',
}
class CompanyCreate(AjaxCreateView):
model = Company
@ -52,9 +57,19 @@ class CompanyCreate(AjaxCreateView):
ajax_template_name = 'modal_form.html'
ajax_form_title = "Create new Company"
def get_data(self):
return {
'success': "Created new company",
}
class CompanyDelete(AjaxDeleteView):
model = Company
success_url = '/company/'
template_name = 'company/delete.html'
ajax_form_title = 'Delete Company'
def get_data(self):
return {
'danger': 'Company was deleted',
}