Exemplo n.º 1
0
 def get_help_blocks(self, request, kind):
     yield SimpleHelpBlock(
         text=_("Add some users to help manage your shop"),
         actions=[{
             "text": _("New user"),
             "url": self.get_model_url(get_user_model(), "new")
         }],
         priority=3,
         category=HelpBlockCategory.CONTACTS,
         icon_url="wshop_admin/img/users.png",
         done=request.shop.staff_members.exclude(
             id=request.user.id).exists() if kind == "setup" else False)
Exemplo n.º 2
0
 def get_help_blocks(self, request, kind):
     yield SimpleHelpBlock(
         text=_("Add a product category to organize your products"),
         actions=[{
             "text": _("New category"),
             "url": get_model_url(Category, "new")
         }],
         icon_url="wshop_admin/img/category.png",
         category=HelpBlockCategory.PRODUCTS,
         priority=1,
         done=Category.objects.filter(
             shops=request.shop).exists() if kind == "setup" else False)
Exemplo n.º 3
0
 def get_help_blocks(self, request, kind):
     if kind == "quicklink":
         yield SimpleHelpBlock(text=_("Add a web page"),
                               actions=[{
                                   "text":
                                   _("New page"),
                                   "url":
                                   self.get_model_url(Page, "new")
                               }],
                               priority=100,
                               category=HelpBlockCategory.STOREFRONT,
                               icon_url="simple_cms/page.png")
Exemplo n.º 4
0
 def get_help_blocks(self, request, kind):
     if kind == "setup":
         shop = request.shop
         yield SimpleHelpBlock(
             text=_("Add a logo to make your store stand out"),
             actions=[{
                 "text": _("Add logo"),
                 "url": self.get_model_url(shop, "edit"),
                 "hash": "#shop-images-section"
             }],
             icon_url="wshop_admin/img/logo-icon.svg",
             done=shop.logo)
Exemplo n.º 5
0
 def get_help_blocks(self, request, kind):
     theme = get_current_theme(request.shop)
     if kind == "quicklink" and theme:
         yield SimpleHelpBlock(
             text=_("Customize the look and feel of your shop"),
             actions=[{
                 "text":
                 _("Customize theme"),
                 "url":
                 reverse("wshop_admin:xtheme.config_detail",
                         kwargs={"theme_identifier": theme.identifier})
             }],
             priority=200,
             category=HelpBlockCategory.STOREFRONT,
             icon_url="xtheme/theme.png")
Exemplo n.º 6
0
    def get_help_blocks(self, request, kind):
        if kind == "quicklink":
            actions = [{
                "text": _("New order"),
                "url": self.get_model_url(Order, "new")
            }]

            yield SimpleHelpBlock(
                text=_("New order"),
                actions=actions,
                icon_url="wshop_admin/img/product.png",
                priority=0,
                category=HelpBlockCategory.ORDERS,
                done=Order.objects.filter(
                    shop=request.shop).exists() if kind == "setup" else False)
Exemplo n.º 7
0
 def get_help_blocks(self, request, kind):
     if kind == "quicklink":
         yield SimpleHelpBlock(
             text=_("Set up a sales campaign"),
             actions=[{
                 "text": _("New basket campaign"),
                 "url": self.get_model_url(BasketCampaign, "new")
             }, {
                 "text": _("New catalog campaign"),
                 "url": self.get_model_url(CatalogCampaign, "new")
             }, {
                 "text": _("New coupon"),
                 "url": self.get_model_url(Coupon, "new")
             }],
             priority=1,
             category=HelpBlockCategory.CAMPAIGNS,
             icon_url="wshop/campaigns/img/campaign.png")
Exemplo n.º 8
0
    def get_help_blocks(self, request, kind):
        actions = [{
            "text": _("New product"),
            "url": self.get_model_url(ShopProduct, "new")
        }]
        if "wshop.importer" in settings.INSTALLED_APPS:
            actions.append({
                "text": _("Import"),
                "url": reverse("wshop_admin:importer.import")
            })

        yield SimpleHelpBlock(text=_("Add a product to see it in your store"),
                              actions=actions,
                              icon_url="wshop_admin/img/product.png",
                              priority=0,
                              category=HelpBlockCategory.PRODUCTS,
                              done=Product.objects.filter(
                                  shop_products__shop=request.shop).exists()
                              if kind == "setup" else False)