Ejemplo n.º 1
0
 def __init__(self, view):
     super(ProductParentBaseToolbar, self).__init__()
     self.view = view
     self.parent_product = view.object
     self.request = view.request
     get_default_edit_toolbar(self.view,
                              "product_form",
                              with_split_save=False,
                              toolbar=self)
Ejemplo n.º 2
0
 def get_toolbar(self):
     toolbar = get_default_edit_toolbar(self,
                                        "permissions_form",
                                        discard_url=get_model_url(
                                            self.object),
                                        with_split_save=False)
     return toolbar
Ejemplo n.º 3
0
 def get_toolbar(self):
     toolbar = get_default_edit_toolbar(self,
                                        "change_password_form",
                                        discard_url=get_model_url(
                                            self.object),
                                        with_split_save=False)
     return toolbar
Ejemplo n.º 4
0
 def __init__(self, view):
     self.view = view
     self.request = view.request
     self.user = view.object
     super(UserDetailToolbar, self).__init__()
     self.extend(get_default_edit_toolbar(self.view, "user_form", with_split_save=False))
     if self.user.pk:
         self._build_existing_user()
Ejemplo n.º 5
0
 def get_toolbar(self):
     save_form_id = self.get_save_form_id()
     object = self.get_object()
     delete_url = get_model_url(object, "delete") if object.pk else None
     return get_default_edit_toolbar(
         self,
         save_form_id,
         delete_url=(delete_url if object.can_delete() else None))
Ejemplo n.º 6
0
 def get_toolbar(self):
     save_form_id = self.get_save_form_id()
     object = self.get_object()
     delete_url = reverse_lazy("wshop_admin:contact_group.delete",
                               kwargs={"pk": object.pk})
     return get_default_edit_toolbar(
         self,
         save_form_id,
         delete_url=delete_url if object.can_delete() else None)
Ejemplo n.º 7
0
    def get_toolbar(self):
        toolbar = get_default_edit_toolbar(
            self,
            self.get_save_form_id(),
            discard_url=(get_model_url(self.object)
                         if self.object.pk else None))

        for button in get_provide_objects("admin_contact_edit_toolbar_button"):
            toolbar.append(button(self.object))

        return toolbar
Ejemplo n.º 8
0
 def __init__(self, view):
     super(EditProductToolbar, self).__init__()
     self.view = view
     self.request = view.request
     self.product = view.object.product
     self.extend(get_default_edit_toolbar(
         self.view, "product_form",
         delete_url="wshop_admin:shop_product.delete"
     ))
     if self.product.pk:
         self._build_existing_product()
Ejemplo n.º 9
0
    def get_toolbar(self):
        save_form_id = self.get_save_form_id()
        object = self.get_object()
        delete_url = reverse_lazy("wshop_admin:service_provider.delete",
                                  kwargs={"pk": object.pk})
        toolbar = get_default_edit_toolbar(self,
                                           save_form_id,
                                           delete_url=delete_url)
        if self.object.pk:
            toolbar.append(
                URLActionButton(text=_("Create {service_name}").format(
                    service_name=self.object.service_model._meta.verbose_name),
                                icon="fa fa-plus",
                                url="{model_url}?provider={id}".format(
                                    model_url=get_model_url(
                                        self.object.service_model, "new"),
                                    id=self.object.id),
                                extra_css_class="btn-info"))

        return toolbar
Ejemplo n.º 10
0
 def get_toolbar(self):
     save_form_id = self.get_save_form_id()
     if save_form_id:
         return get_default_edit_toolbar(
             self, save_form_id, delete_url="wshop_admin:carousel.delete")
Ejemplo n.º 11
0
 def get_toolbar(self):
     save_form_id = self.get_save_form_id()
     if save_form_id:
         return get_default_edit_toolbar(self, save_form_id)
Ejemplo n.º 12
0
 def get_toolbar(self):
     save_form_id = self.get_save_form_id()
     with_split_save = WshopSettings.get_setting("WSHOP_ENABLE_MULTIPLE_SHOPS")
     return get_default_edit_toolbar(self, save_form_id, with_split_save=with_split_save)