diff --git a/shuup_boilerplate_theme/plugins/store_info_plugin.py b/shuup_boilerplate_theme/plugins/store_info_plugin.py index 6075359..5bc0d1d 100644 --- a/shuup_boilerplate_theme/plugins/store_info_plugin.py +++ b/shuup_boilerplate_theme/plugins/store_info_plugin.py @@ -6,7 +6,7 @@ # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shuup.xtheme import TemplatedPlugin from shuup.xtheme.plugins.forms import TranslatableField @@ -16,6 +16,7 @@ class StoreInfoPlugin(TemplatedPlugin): """ A simple plugin to show store info in front """ + identifier = "boilerplate_store_information" name = _("Store information") template_name = "boilerplate/plugins/store_info.jinja" @@ -23,23 +24,32 @@ class StoreInfoPlugin(TemplatedPlugin): fields = [ ("title", TranslatableField(label=_("Title"), required=False, initial="")), - ("show_logo", forms.BooleanField( - label=_("Show Logo"), - required=False, - initial=True, - help_text=_("Show logo of the shop inside information box."), - )), - ("show_contact_address", forms.BooleanField( - label=_("Show Contact Address information"), - required=False, - initial=True, - help_text=_("Show store contact address information"), - )), - ("show_name", forms.BooleanField( - label=_("Show public name"), - initial=True, - required=False, - )), + ( + "show_logo", + forms.BooleanField( + label=_("Show Logo"), + required=False, + initial=True, + help_text=_("Show logo of the shop inside information box."), + ), + ), + ( + "show_contact_address", + forms.BooleanField( + label=_("Show Contact Address information"), + required=False, + initial=True, + help_text=_("Show store contact address information"), + ), + ), + ( + "show_name", + forms.BooleanField( + label=_("Show public name"), + initial=True, + required=False, + ), + ), ] def get_context_data(self, context): @@ -53,5 +63,5 @@ def get_context_data(self, context): "show_logo": show_logo, "show_contact_address": show_contact_address, "show_name": show_name, - "shop": request.shop + "shop": request.shop, } diff --git a/shuup_boilerplate_theme/theme.py b/shuup_boilerplate_theme/theme.py index 84513fe..55c2186 100644 --- a/shuup_boilerplate_theme/theme.py +++ b/shuup_boilerplate_theme/theme.py @@ -6,7 +6,7 @@ # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from shuup.themes.classic_gray.theme import ClassicGrayTheme @@ -17,6 +17,7 @@ class ShuupBoilerplateTheme(ClassicGrayTheme): This is a simple theme that shows the inheritance from one of the Shuup base themes """ + identifier = "shuup_boilerplate_theme" # internal identifier for theme, used system wide to differentiate themes name = _("Shuup Boilerplate Theme") # Template name, shown in admin author = "Shoop Commerce Ltd" # The author of the theme, shown in admin @@ -29,9 +30,7 @@ class ShuupBoilerplateTheme(ClassicGrayTheme): Boilerplate offers one plugin that shows store information for visiting customer. """ - plugins = [ - "shuup_boilerplate_theme.plugins:StoreInfoPlugin" - ] + plugins = ["shuup_boilerplate_theme.plugins:StoreInfoPlugin"] """ Configurable fields @@ -45,10 +44,22 @@ class ShuupBoilerplateTheme(ClassicGrayTheme): Example usage of this can be found below. """ fields = [ - ("show_boilerplate", forms.BooleanField( - required=False, initial=True, label=_("Show the boilerplate information on frontpage"))), - ("boilerplate_text", forms.CharField(required=False, label=_("Boilerplate text"))), - ("boilerplate_date", forms.DateField(required=False, label=_("Boilerplate date"))) + ( + "show_boilerplate", + forms.BooleanField( + required=False, + initial=True, + label=_("Show the boilerplate information on frontpage"), + ), + ), + ( + "boilerplate_text", + forms.CharField(required=False, label=_("Boilerplate text")), + ), + ( + "boilerplate_date", + forms.DateField(required=False, label=_("Boilerplate date")), + ), ] def should_show_boilerplate(self):