shuup.xtheme.views package

Submodules

shuup.xtheme.views.command module

shuup.xtheme.views.command.handle_command(request, command)[source]

Internal dispatch function.

Parameters:
  • request (django.http.HttpRequest) – A request
  • command (str) – Command string
Returns:

A response

Return type:

django.http.HttpResponse

shuup.xtheme.views.command.command_dispatch(request)[source]

Xtheme command dispatch view.

Parameters:request (django.http.HttpRequest) – A request
Returns:A response
Return type:django.http.HttpResponse

shuup.xtheme.views.editor module

class shuup.xtheme.views.editor.EditorView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name = 'shuup/xtheme/editor.jinja'
xtheme_injection = False
changed = False
get_context_data(**kwargs)[source]
dispatch(request, *args, **kwargs)[source]
post(request, *args, **kwargs)[source]
build_form()[source]
save_layout(layout=None)[source]
dispatch_add_cell(y, **kwargs)[source]
dispatch_add_row(y=None, **kwargs)[source]
dispatch_del_row(y, **kwargs)[source]
dispatch_move_row_to_index(from_y, to_y, **kwargs)[source]
dispatch_move_cell_to_position(from_x, from_y, to_x, to_y, **kwargs)[source]
dispatch_del_cell(x, y, **kwargs)[source]
dispatch_change_plugin(plugin='', **kwargs)[source]
dispatch_publish(**kwargs)[source]
dispatch_revert(**kwargs)[source]

shuup.xtheme.views.extra module

shuup.xtheme.views.extra.clear_view_cache(**kwargs)[source]
shuup.xtheme.views.extra.get_view_by_name(theme, view_name)[source]
shuup.xtheme.views.extra.extra_view_dispatch(request, view)[source]

Dispatch to an Xtheme extra view.

Parameters:
  • request (django.http.HttpRequest) – A request.
  • view (str) – View name.
Returns:

A response of some kind.

Return type:

django.http.HttpResponse

shuup.xtheme.views.forms module

class shuup.xtheme.views.forms.LayoutCellGeneralInfoForm(**kwargs)[source]

Bases: django.forms.forms.Form

CELL_FULL_WIDTH = 12
CELL_WIDTH_CHOICES = [(0, 'Custom'), (12, 'Full Width'), (9, 'Three Fourths (3/4)'), (8, 'Two Thirds (2/3)'), (6, 'Half (1/2)'), (4, 'One Third (1/3)'), (3, 'One Fourth (1/4)')]
CELL_ALIGN_CHOICES = [(' ', 'Auto'), ('pull-left', 'Left'), ('pull-right', 'Right')]
populate()[source]

Populate the form with fields for size and plugin selection.

save()[source]

Save size configuration. Plugin configuration is done via JavaScript POST.

Both breakpoints (sm`and `md) are set to same value defined in cell_width_field. The reason for this is that the difference between these breakpoints is so minor that manually assigning both of these by shop admin introduces too much complexity to row-cell management UI.

base_fields = OrderedDict([('plugin', <django.forms.fields.ChoiceField object>)])
declared_fields = OrderedDict([('plugin', <django.forms.fields.ChoiceField object>)])
media
class shuup.xtheme.views.forms.LayoutCellFormGroup(**kwargs)[source]

Bases: shuup.utils.form_group.FormGroup

Form group containing the LayoutCellGeneralInfoForm and a possible plugin-dependent configuration form.

save()[source]

shuup.xtheme.views.plugins module

shuup.xtheme.views.plugins.get_category_products_highlight(request, category_id, count, cache_timeout)[source]
shuup.xtheme.views.plugins.get_product_cross_sell_highlight(request, product_id, relation_type, use_parents, count, cache_timeout)[source]
shuup.xtheme.views.plugins.get_product_highlight(request, plugin_type, cutoff_days, count, cache_timeout)[source]
shuup.xtheme.views.plugins.get_prouduct_selections_highlight(request, product_ids, cache_timeout)[source]

Module contents