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="shuup_admin/img/logo_icon.svg", done=shop.logo, required=False ) shop = get_shop(request) yield SimpleHelpBlock( priority=1000, text=_("Publish your store"), description=_("Let customers browse your store and make purchases"), css_class="green ", actions=[{ "method": "POST", "text": _("Publish shop"), "url": reverse("shuup_admin:shop.enable", kwargs={"pk": shop.pk}), "data": { "enable": True, "redirect": reverse("shuup_admin:dashboard") } }], icon_url="shuup_admin/img/publish.png", done=(not shop.maintenance_mode), required=False )
def get_help_blocks(self, request, kind): if kind != "setup": return shop = get_shop(request) connection_info = get_connection_info(shop) last_check_success = connection_info.get("check_success", False) connected = (connection_info.get("last_check") and last_check_success) if kind == "setup": actions = [{ "text": _("Re-connect Mailchimp") if connected else _("Connect Mailchimp"), "url": reverse_lazy("shuup_admin:mailchimp.connect"), }] yield SimpleHelpBlock( priority=0.1, # not the first but pretty high... text=_("MailChimp"), description_html=True, description=_( "Connect your Mailchimp account to Shuup store. " "Once connected, your customers can be added to your mailing list." ), actions=actions, icon_url="shuup_mailchimp/Mailchimp_Logo-Vertical_Black.png", done=connected, )
def get_help_blocks(self, request, kind): actions = [] from shuup.admin.utils.permissions import has_permission if has_permission(request.user, "shop_product.new"): actions.append({ "text": _("New product"), "url": self.get_model_url(ShopProduct, "new") }) if "shuup.importer" in settings.INSTALLED_APPS and has_permission( request.user, "importer.import"): actions.append({ "text": _("Import"), "url": reverse("shuup_admin:importer.import") }) if actions: yield SimpleHelpBlock( text=_("Add a product to see it in your store"), actions=actions, icon_url="shuup_admin/img/product.png", priority=0, category=HelpBlockCategory.PRODUCTS, done=Product.objects.filter( shop_products__shop=request.shop).exists() if kind == "setup" else False)
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", )
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(User, "new")}], priority=3, category=HelpBlockCategory.CONTACTS, icon_url="shuup_admin/img/users.png", done=request.shop.staff_members.exclude(id=request.user.id).exists() if kind == "setup" else False, required=False, )
def get_help_blocks(self, request, kind): if kind == "quicklink": yield SimpleHelpBlock( text=_("Add a web page"), actions=[{ "text": _("Add a page"), "url": self.get_model_url(Page, "new") }], icon_url="simple_cms/page.png" )
def get_help_blocks(self, request, kind): if kind == "quicklink": yield SimpleHelpBlock( text=_("Add some users to help manage your shop"), actions=[{ "text": _("Add a user"), "url": self.get_model_url(get_user_model(), "new") }], icon_url="shuup_admin/img/users.png" )
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="shuup_admin/img/category.png", category=HelpBlockCategory.PRODUCTS, priority=1, done=Category.objects.exists() if kind == "setup" else False)
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="shuup_admin/img/logo-icon.svg", done=shop.logo)
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="shuup_admin/img/users.png", done=get_user_model().objects.exists() if kind == "setup" else False)
def get_help_blocks(self, request, kind): theme = getattr(request, "theme", None) or 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("shuup_admin:xtheme.config_detail", kwargs={"theme_identifier": theme.identifier}) }], priority=200, category=HelpBlockCategory.STOREFRONT, icon_url="xtheme/theme.png" )
def get_help_blocks(self, request, kind): theme = get_current_theme(request) if kind == "quicklink" and theme: yield SimpleHelpBlock( text=_("Customize the look and feel of your shop"), actions=[{ "text": _("Customize theme"), "url": reverse("shuup_admin:xtheme.config_detail", kwargs={"theme_identifier": theme.identifier}) }], icon_url="xtheme/theme.png")
def get_help_blocks(self, request, kind): actions = [{ "text": _("New order"), "url": self.get_model_url(Order, "new") }] yield SimpleHelpBlock( text=_("New order"), actions=actions, icon_url="shuup_admin/img/product.png", priority=0, category=HelpBlockCategory.ORDERS, done=Order.objects.exists() if kind == "setup" else False)
def get_help_blocks(self, request, kind): actions = [{ "text": _("New product"), "url": self.get_model_url(Product, "new") }] yield SimpleHelpBlock( text=_("Add a product to see it in your store"), actions=actions, icon_url="shuup_admin/img/product.png", priority=0, category=HelpBlockCategory.PRODUCTS, done=Product.objects.exists() if kind == "setup" else False )
def get_help_blocks(self, request, kind): from shuup.admin.utils.permissions import has_permission if has_permission(request.user, "category.new"): yield SimpleHelpBlock( text=_("Add a product category to organize your products"), actions=[{ "text": _("New category"), "url": get_model_url(Category, "new") }], icon_url="shuup_admin/img/category.png", category=HelpBlockCategory.PRODUCTS, priority=1, done=Category.objects.filter( shops=request.shop).exists() if kind == "setup" else False)
def get_help_blocks(self, request, kind): if kind == "quicklink": yield SimpleHelpBlock( text=_("Set up a sales campaign"), actions=[{ "text": _("Add a basket campaign"), "url": self.get_model_url(BasketCampaign, "new") }, { "text": _("Add a catalog campaign"), "url": self.get_model_url(CatalogCampaign, "new") }, { "text": _("Add a coupon"), "url": self.get_model_url(Coupon, "new") }], icon_url="shuup/campaigns/img/campaign.png")
def get_help_blocks(self, request, kind): from shuup.admin.utils.permissions import has_permission if kind == "quicklink" and has_permission(request.user, "order.new"): actions = [{ "text": _("New order"), "url": self.get_model_url(Order, "new") }] yield SimpleHelpBlock( text=_("New order"), actions=actions, icon_url="shuup_admin/img/product.png", priority=0, category=HelpBlockCategory.ORDERS, done=Order.objects.filter( shop=request.shop).exists() if kind == "setup" else False)
def get_help_blocks(self, request, kind): actions = [{ "text": _("Add a product"), "url": self.get_model_url(Product, "new") }] if "shuup.importer" in settings.INSTALLED_APPS: actions.append({ "text": _("Import products"), "url": reverse("shuup_admin:importer.import") }) yield SimpleHelpBlock( text=_("Add a product to see it in your store"), actions=actions, icon_url="shuup_admin/img/product.png", done=Product.objects.exists() if kind == "setup" else False)
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 coupon"), "url": self.get_model_url(Coupon, "new") }, ], priority=1, category=HelpBlockCategory.CAMPAIGNS, icon_url="shuup/campaigns/img/campaign.png", )