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:
@ -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',
|
||||
}
|
||||
|
Reference in New Issue
Block a user