Exemplo n.º 1
0
 def get_context_data(self, **kwargs):
     context = super(CouponListView, self).get_context_data(**kwargs)
     context["toolbar"] = Toolbar([
         NewActionButton("shoop_admin:coupons.new",
                         text=_("Create new Coupon")),
     ])
     return context
Exemplo n.º 2
0
 def get_context_data(self, **kwargs):
     context = super(CampaignListView, self).get_context_data(**kwargs)
     context["toolbar"] = Toolbar([
         NewActionButton("shoop_admin:basket_campaigns.new",
                         text=_("Create new Basket Campaign")),
     ])
     return context
Exemplo n.º 3
0
    def get_context_data(self, **kwargs):
        context = super(AddonListView, self).get_context_data(**kwargs)
        context["toolbar"] = Toolbar([
            PostActionButton(
                icon="fa fa-save",
                form_id="addon_list",
                text=_("Save addon changes"),
                extra_css_class="btn-success",
            ),
            NewActionButton(
                reverse("shoop_admin:addon.upload"),
                text=_("Upload new addon"),
                extra_css_class="btn-info",
                icon="fa fa-upload",
            )
        ])
        if self.request.GET.get("reload"):
            context["toolbar"].append(
                URLActionButton(
                    reverse("shoop_admin:addon.reload"),
                    text=_("Reload application"),
                    extra_css_class="btn-warning",
                    icon="fa fa-refresh",
                ))

        return context
Exemplo n.º 4
0
 def get_toolbar(self):
     buttons = []
     model = self.model
     if hasattr(self, "get_model"):
         model = self.get_model()
     new_button = NewActionButton.for_model(model)
     if new_button:
         buttons.append(new_button)
     return Toolbar(buttons)
Exemplo n.º 5
0
 def get_toolbar(self):
     buttons = []
     model = self.model
     if hasattr(self, "get_model"):
         model = self.get_model()
     new_button = NewActionButton.for_model(model)
     if new_button:
         buttons.append(new_button)
     return Toolbar(buttons)
Exemplo n.º 6
0
 def get_context_data(self, **kwargs):
     context = super(ContactGroupListView, self).get_context_data(**kwargs)
     context["toolbar"] = Toolbar(
         [NewActionButton("shoop_admin:contact-group.new")])
     return context