Ejemplo n.º 1
0
 def get_toolbar(self):
     toolbar = Toolbar.for_view(self)
     toolbar.extend([
         JavaScriptActionButton(onclick="window.saveCategories();",
                                text=_("Save"),
                                icon="fa fa-save",
                                extra_css_class="btn-success"),
         JavaScriptActionButton(onclick="window.createNewCategory();",
                                text=_("Create New"),
                                icon="fa fa-plus")
     ])
     return toolbar
Ejemplo n.º 2
0
    def get_toolbar(self):
        toolbar = Toolbar()

        model = self.model
        if hasattr(self, "get_model"):
            model = self.get_model()
        new_button = NewActionButton.for_model(model)
        if new_button:
            toolbar.append(new_button)

        return_url = self.url_identifier if self.url_identifier else None
        if self.request.user.is_superuser:
            settings_button = SettingsActionButton.for_model(model, return_url=return_url)
        else:
            settings_button = None
        if settings_button:
            toolbar.append(settings_button)

        toolbar.extend(Toolbar.for_view(self))
        return toolbar
Ejemplo n.º 3
0
    def get_toolbar(self):
        toolbar = Toolbar()

        model = self.model
        if hasattr(self, "get_model"):
            model = self.get_model()
        new_button = NewActionButton.for_model(model)
        if new_button:
            toolbar.append(new_button)

        return_url = self.url_identifier if self.url_identifier else None
        if self.request.user.is_superuser:
            settings_button = SettingsActionButton.for_model(model, return_url=return_url)
        else:
            settings_button = None
        if settings_button:
            toolbar.append(settings_button)

        toolbar.extend(Toolbar.for_view(self))
        return toolbar
Ejemplo n.º 4
0
 def get_toolbar(self):
     return Toolbar.for_view(self)
Ejemplo n.º 5
0
 def get_toolbar(self):
     if settings.SHUUP_ENABLE_MULTIPLE_SUPPLIERS:
         return super(SupplierListView, self).get_toolbar()
     else:
         return Toolbar.for_view(self)
Ejemplo n.º 6
0
 def get_toolbar(self):
     if ShuupSettings.get_setting("SHUUP_ENABLE_MULTIPLE_SHOPS"):
         return super(ShopListView, self).get_toolbar()
     else:
         return Toolbar.for_view(self)
Ejemplo n.º 7
0
 def get_toolbar(self):
     return Toolbar.for_view(self)