mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-28 02:28:43 +00:00
Add context flag to enable editing mode
- pass ?edit=1 to the BOM - Display page differently if in editing mode -
This commit is contained in:
1 parent
258555a813
commit
ec98f7829e
3 files changed
+146
-55
No files matched your search
@@ -90,6 +90,17 @@ class PartDetail(DetailView):
|
||||
queryset = Part.objects.all()
|
||||
template_name = 'part/detail.html'
|
||||
|
||||
# Add in some extra context information based on query params
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(PartDetail, self).get_context_data(**kwargs)
|
||||
|
||||
if str(self.request.GET.get('edit', None)) == '1':
|
||||
context['editing_enabled'] = True
|
||||
else:
|
||||
context['editing_enabled'] = False
|
||||
|
||||
return context
|
||||
|
||||
|
||||
class PartImage(AjaxUpdateView):
|
||||
|
||||
|
||||
Reference in new issue
Block a user