shoop.xtheme.plugins package¶
Submodules¶
shoop.xtheme.plugins.category_links module¶
-
class
shoop.xtheme.plugins.category_links.
CategoryLinksConfigForm
(**kwargs)[source]¶ Bases:
shoop.xtheme.plugins.forms.GenericPluginForm
A configuration form for the CategoryLinksPlugin
-
clean
()[source]¶ A custom clean method to save category configuration information in a serializable form
-
base_fields
= OrderedDict()¶
-
declared_fields
= OrderedDict()¶
-
media
¶
-
-
class
shoop.xtheme.plugins.category_links.
CategoryLinksPlugin
(config)[source]¶ Bases:
shoop.xtheme.TemplatedPlugin
A plugin for displaying links to visible categories on the shop front
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'category_links'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
template_name
= 'shoop/xtheme/plugins/category_links.jinja'¶
-
editor_form_class
¶ alias of
CategoryLinksConfigForm
-
fields
= [('title', <shoop.xtheme.plugins.forms.TranslatableField object at 0x7f52fe668470>), ('show_all_categories', <django.forms.fields.BooleanField object at 0x7f52fe256438>), 'categories']¶
-
shoop.xtheme.plugins.consts module¶
-
shoop.xtheme.plugins.consts.
FALLBACK_LANGUAGE_CODE
= '*'¶ The pseudo-language code used by TranslatedFields and the relevant Plugin API to mark the untranslated/fallback content
shoop.xtheme.plugins.forms module¶
-
class
shoop.xtheme.plugins.forms.
PluginForm
(**kwargs)[source]¶ Bases:
django.forms.forms.Form
Base class for plugin configuration forms.
-
get_config
()[source]¶ Get the new
config
dict for a plugin.Called when the form is valid, akin to
django.forms.models.ModelForm.save
.The default implementation just augments the old config with the cleaned data for the form.
Returns: A new JSONable (!) config dict Return type: dict
-
base_fields
= OrderedDict()¶
-
declared_fields
= OrderedDict()¶
-
media
¶
-
shoop.xtheme.plugins.image module¶
-
class
shoop.xtheme.plugins.image.
ImagePluginChoiceWidget
(attrs=None, clearable=False, empty_text='—')[source]¶ Bases:
shoop.admin.forms.widgets.ImageChoiceWidget
Subclass of ImageChoiceWidget that will not raise an exception if given an invalid initial image ID (in case the image has been deleted)
-
media
¶
-
-
class
shoop.xtheme.plugins.image.
ImageIDField
(max_value=None, min_value=None, *args, **kwargs)[source]¶ Bases:
django.forms.fields.IntegerField
A custom field that stores the ID value of a Filer image and presents Shoop admin’s image popup widget
-
widget
= <shoop.xtheme.plugins.image.ImagePluginChoiceWidget object>¶
-
-
class
shoop.xtheme.plugins.image.
ImagePlugin
(config)[source]¶ Bases:
shoop.xtheme.TemplatedPlugin
A linkable image plugin
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'images'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
template_name
= 'shoop/xtheme/plugins/image.jinja'¶
-
fields
= [('title', <shoop.xtheme.plugins.forms.TranslatableField object at 0x7f52fe965898>), ('image_id', <shoop.xtheme.plugins.image.ImageIDField object at 0x7f530058d748>), ('url', <django.forms.fields.URLField object at 0x7f52fe62b080>), ('full_width', <django.forms.fields.BooleanField object at 0x7f52fe3a6860>), ('width', <django.forms.fields.IntegerField object at 0x7f52fe3a6828>), ('height', <django.forms.fields.IntegerField object at 0x7f52fe6320f0>)]¶
-
shoop.xtheme.plugins.snippets module¶
-
class
shoop.xtheme.plugins.snippets.
SnippetsPlugin
(config)[source]¶ Bases:
shoop.xtheme.Plugin
Simple plugin class for including snippets and resources on the page, mostly for simple integrations.
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'snippets'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
fields
= [('in_place', <django.forms.fields.CharField object at 0x7f5301dc2f60>), ('head_end', <django.forms.fields.CharField object at 0x7f5301dc2dd8>), ('body_start', <django.forms.fields.CharField object at 0x7f5301dc2fd0>), ('body_end', <django.forms.fields.CharField object at 0x7f5301dc2c50>)]¶
-
shoop.xtheme.plugins.social_media_links module¶
Bases:
shoop.xtheme.plugins.forms.GenericPluginForm
Form for the social media links xtheme plugin. One field is provided for each entry in the plugin’s icon_classes attribute, which maps social media site names to font-awesome icon classes by default.
Populates form with default plugin fields as well as any social media link type included in the plugin’s
icon_classes
attribute.Also adds an ordering field for each link type to change display order.
Returns cleaned data from default plugin fields and any link fields.
Processed link configuration information is stored and returned as a dictionary (
links
).
Bases:
shoop.xtheme.TemplatedPlugin
An xtheme plugin for displaying site links to common social media sites.
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data alias of
SocialMediaLinksPluginForm
Returns plugin settings and a sorted list of social media links
Returns: Plugin context data Return type: dict
Returns the list of social media links sorted according to ordering
Returns: List of link tuples (ordering, icon class, url) Return type: [(int, str, str)]
shoop.xtheme.plugins.text module¶
-
class
shoop.xtheme.plugins.text.
TextPlugin
(config)[source]¶ Bases:
shoop.xtheme.Plugin
Very basic Markdown rendering plugin.
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'text'¶
-
name
= 'Text'¶
-
fields
= [('text', <shoop.xtheme.plugins.forms.TranslatableField object at 0x7f52fee10a90>)]¶
-
shoop.xtheme.plugins.widgets module¶
-
class
shoop.xtheme.plugins.widgets.
TranslatableFieldWidget
(languages, input_widget=<class 'django.forms.widgets.TextInput'>, attrs=None)[source]¶ Bases:
django.forms.widgets.Widget
-
media
¶
-
-
class
shoop.xtheme.plugins.widgets.
XThemeModelChoiceWidget
(attrs=None, choices=())[source]¶ Bases:
django.forms.widgets.Select
-
media
¶
-
-
class
shoop.xtheme.plugins.widgets.
XThemeModelChoiceField
(queryset, empty_label='---------', cache_choices=None, required=True, widget=None, label=None, initial=None, help_text='', to_field_name=None, limit_choices_to=None, *args, **kwargs)[source]¶ Bases:
django.forms.models.ModelChoiceField
-
widget
¶ alias of
XThemeModelChoiceWidget
-