updated html with latest fixes

This commit is contained in:
Christopher Pickering 2021-08-02 09:18:05 -05:00
parent 2356970be7
commit 45871c14ab
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
221 changed files with 25466 additions and 25773 deletions

View file

@ -2,62 +2,62 @@
{% if app_list %}
{% for app in app_list %}
<div class="app-{{ app.app_label }} module{% if app.app_url in request.path %}current-app{% endif %}">
<table>
<caption>
<a href="{{ app.app_url }}"
class="section"
title="{% blocktranslate with name=app.name %}Models in the {{ name }} application{% endblocktranslate %}">
{{ app.name }}
</a>
</caption>
{% for model in app.models %}
<tr class="model-{{ model.object_name|lower }}{% if model.admin_url in request.path %} current-model{% endif %}">
{% if model.admin_url %}
<th scope="row">
<a href="{{ model.admin_url }}"
{% if model.admin_url in request.path %}
aria-current="page"
<table>
<caption>
<a href="{{ app.app_url }}"
class="section"
title="{% blocktranslate with name=app.name %}Models in the {{ name }} application{% endblocktranslate %}">
{{ app.name }}
</a>
</caption>
{% for model in app.models %}
<tr class="model-{{ model.object_name|lower }}{% if model.admin_url in request.path %} current-model{% endif %}">
{% if model.admin_url %}
<th scope="row">
<a href="{{ model.admin_url }}"
{% if model.admin_url in request.path %}
aria-current="page"
{% endif %}
>
{{ model.name }}
</a>
</th>
{% else %}
<th scope="row">{{ model.name }}</th>
{% endif %}
{% if model.add_url %}
<td>
<a href="{{ model.add_url }}" class="addlink">
{% translate 'Add' %}
</a>
</td>
{% else %}
<td></td>
{% endif %}
{% if model.admin_url and show_changelinks %}
{% if model.view_only %}
<td>
<a href="{{ model.admin_url }}" class="viewlink">
{% translate 'View' %}
</a>
</td>
{% else %}
<td>
<a href="{{ model.admin_url }}" class="changelink">
{% translate 'Change' %}
</a>
</td>
{% endif %}
>
{{ model.name }}
</a>
</th>
{% else %}
<th scope="row">{{ model.name }}</th>
{% endif %}
{% if model.add_url %}
<td>
<a href="{{ model.add_url }}" class="addlink">
{% translate 'Add' %}
</a>
</td>
{% else %}
<td></td>
{% endif %}
{% if model.admin_url and show_changelinks %}
{% if model.view_only %}
<td>
<a href="{{ model.admin_url }}" class="viewlink">
{% translate 'View' %}
</a>
</td>
{% else %}
<td>
<a href="{{ model.admin_url }}" class="changelink">
{% translate 'Change' %}
</a>
</td>
{% endif %}
{% elif show_changelinks %}
<td></td>
{% endif %}
</tr>
{% endfor %}
</table>
</div>
{% endfor %}
{% elif show_changelinks %}
<td></td>
{% endif %}
</tr>
{% endfor %}
</table>
</div>
{% endfor %}
{% else %}
<p>
{% translate 'You dont have permission to view or edit anything.' %}
</p>
<p>
{% translate 'You dont have permission to view or edit anything.' %}
</p>
{% endif %}

View file

@ -29,94 +29,94 @@
</head>
<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"
data-admin-utc-offset="{% now ">
<!-- Container -->
<div id="container">
{% if not is_popup %}
<!-- Header -->
{% block header %}
<div id="header">
<div id="branding">
{% block branding %}{% endblock %}
</div>
{% block usertools %}
{% if has_permission %}
<div id="user-tools">
{% block welcome-msg %}
{% translate 'Welcome,' %}
<strong>{% firstof user.get_short_name user.get_username %}</strong>
.
{% endblock %}
{% block userlinks %}
{% if site_url %}
<a href="{{ site_url }}">{% translate 'View site' %}</a>
/
{% endif %}
{% if user.is_active and user.is_staff %}
{% url 'django-admindocs-docroot' as docsroot %}
{% if docsroot %}
<a href="{{ docsroot }}">{% translate 'Documentation' %}</a>
<!-- Container -->
<div id="container">
{% if not is_popup %}
<!-- Header -->
{% block header %}
<div id="header">
<div id="branding">
{% block branding %}{% endblock %}
</div>
{% block usertools %}
{% if has_permission %}
<div id="user-tools">
{% block welcome-msg %}
{% translate 'Welcome,' %}
<strong>{% firstof user.get_short_name user.get_username %}</strong>
.
{% endblock %}
{% block userlinks %}
{% if site_url %}
<a href="{{ site_url }}">{% translate 'View site' %}</a>
/
{% endif %}
{% endif %}
{% if user.has_usable_password %}
<a href="{% url 'admin:password_change' %}">
{% translate 'Change password' %}
{% if user.is_active and user.is_staff %}
{% url 'django-admindocs-docroot' as docsroot %}
{% if docsroot %}
<a href="{{ docsroot }}">{% translate 'Documentation' %}</a>
/
{% endif %}
{% endif %}
{% if user.has_usable_password %}
<a href="{% url 'admin:password_change' %}">
{% translate 'Change password' %}
</a>
/
{% endif %}
<a href="{% url 'admin:logout' %}">
{% translate 'Log out' %}
</a>
/
{% endif %}
<a href="{% url 'admin:logout' %}">
{% translate 'Log out' %}
</a>
{% endblock %}
{% endblock %}
</div>
{% endif %}
{% endblock %}
{% block nav-global %}{% endblock %}</div>{% endblock %}
<!-- END Header -->
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
{% if title %}&rsaquo; {{ title }}{% endif %}
</div>
{% endif %}
{% endblock %}
{% block nav-global %}{% endblock %}</div>{% endblock %}
<!-- END Header -->
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
{% if title %}&rsaquo; {{ title }}{% endif %}
</div>
{% endblock %}{% endif %}
<div class="main" id="main">
{% if not is_popup and is_nav_sidebar_enabled %}
{% block nav-sidebar %}
{% include "admin/nav_sidebar.html" %}{% endblock %}{% endif %}
<div class="content">
{% block messages %}
{% if messages %}
<ul class="messagelist">
{% for message in messages %}
<li{% if message.tags %}class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock messages %}
<!-- Content -->
<div id="content" class="{% block coltype %}colM{% endblock %}">
{% block pretitle %}{% endblock %}
{% block content_title %}{% if title %}
<h1>{{ title }}</h1>
{% endif %}{% endblock %}
{% block content_subtitle %}{% if subtitle %}
<h2>{{ subtitle }}</h2>
{% endif %}{% endblock %}
{% block content %}
{% block object-tools %}{% endblock %}
{{ content }}
{% endblock %}
{% block sidebar %}{% endblock %}
<br class="clear">
{% endblock %}{% endif %}
<div class="main" id="main">
{% if not is_popup and is_nav_sidebar_enabled %}
{% block nav-sidebar %}
{% include "admin/nav_sidebar.html" %}{% endblock %}{% endif %}
<div class="content">
{% block messages %}
{% if messages %}
<ul class="messagelist">
{% for message in messages %}
<li{% if message.tags %}class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock messages %}
<!-- Content -->
<div id="content" class="{% block coltype %}colM{% endblock %}">
{% block pretitle %}{% endblock %}
{% block content_title %}{% if title %}
<h1>{{ title }}</h1>
{% endif %}{% endblock %}
{% block content_subtitle %}{% if subtitle %}
<h2>{{ subtitle }}</h2>
{% endif %}{% endblock %}
{% block content %}
{% block object-tools %}{% endblock %}
{{ content }}
{% endblock %}
{% block sidebar %}{% endblock %}
<br class="clear">
</div>
<!-- END Content -->
{% block footer %}
<div id="footer"></div>
{% endblock %}
</div>
</div>
</div>
<!-- END Content -->
{% block footer %}
<div id="footer"></div>
{% endblock %}
</div>
</div>
</div>
<!-- END Container -->
</body>
</html>
<!-- END Container -->
</body>
</html>

View file

@ -56,42 +56,42 @@
{% endif %} {% if form_url %}action="{{ form_url }}"
{% endif %} method="post"
id="{{ opts.model_name }}_form">
{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}
<input type="hidden" name="{{ is_popup_var }}" value="1">
{% endif %}
{% if to_field %}
<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">
{% endif %}
{% if save_on_top %}
{% block submit_buttons_top %}
{% submit_row %}{% endblock %}{% endif %}
{% if errors %}
<p class="errornote">
{% if errors|length == 1 %}{% translate "Please correct the error below." %}{% else %}
{% translate "Please correct the errors below." %}{% endif %}
</p>
{{ adminform.form.non_field_errors }}
{% endif %}
{% block field_sets %}
{% for fieldset in adminform %}
{% include "admin/includes/fieldset.html" %}{% endfor %}
{% endblock %}
{% block after_field_sets %}{% endblock %}
{% block inline_field_sets %}
{% for inline_admin_formset in inline_admin_formsets %}
{% include inline_admin_formset.opts.template %}{% endfor %}
{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}
<input type="hidden" name="{{ is_popup_var }}" value="1">
{% endif %}
{% if to_field %}
<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">
{% endif %}
{% if save_on_top %}
{% block submit_buttons_top %}
{% submit_row %}{% endblock %}{% endif %}
{% if errors %}
<p class="errornote">
{% if errors|length == 1 %}{% translate "Please correct the error below." %}{% else %}
{% translate "Please correct the errors below." %}{% endif %}
</p>
{{ adminform.form.non_field_errors }}
{% endif %}
{% block field_sets %}
{% for fieldset in adminform %}
{% include "admin/includes/fieldset.html" %}{% endfor %}
{% endblock %}
{% block after_related_objects %}{% endblock %}
{% block submit_buttons_bottom %}
{% submit_row %}{% endblock %}
{% block admin_change_form_document_ready %}
<script id="django-admin-form-add-constants" src="{% static 'admin/js/change_form.js' %}" {% if adminform and add %}data-model-name="{{ opts.model_name }}" {% endif %} async></script>
{% block after_field_sets %}{% endblock %}
{% block inline_field_sets %}
{% for inline_admin_formset in inline_admin_formsets %}
{% include inline_admin_formset.opts.template %}{% endfor %}
{% endblock %}
{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}
</div>
</form>
</div>
{% endblock %}
{% block after_related_objects %}{% endblock %}
{% block submit_buttons_bottom %}
{% submit_row %}{% endblock %}
{% block admin_change_form_document_ready %}
<script id="django-admin-form-add-constants" src="{% static 'admin/js/change_form.js' %}" {% if adminform and add %}data-model-name="{{ opts.model_name }}" {% endif %} async></script>
{% endblock %}
{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}
</div>
</form>
</div>
{% endblock %}

View file

@ -57,57 +57,57 @@
{{ cl.formset.non_form_errors }}
{% endif %}
<div class="module{% if cl.has_filters %}filtered{% endif %}" id="changelist">
<div class="changelist-form-container">
{% block search %}
{% search_form cl %}
{% endblock %}
{% block date_hierarchy %}
{% if cl.date_hierarchy %}
{% date_hierarchy cl %}
{% endif %}
{% endblock %}
<form id="changelist-form" method="post"
{% if cl.formset and cl.formset.is_multipart %}
enctype="multipart/form-data"
{% endif %}
novalidate>
{% csrf_token %}
{% if cl.formset %}
<div>
{{ cl.formset.management_form }}
<div class="changelist-form-container">
{% block search %}
{% search_form cl %}
{% endblock %}
{% block date_hierarchy %}
{% if cl.date_hierarchy %}
{% date_hierarchy cl %}
{% endif %}
{% endblock %}
<form id="changelist-form" method="post"
{% if cl.formset and cl.formset.is_multipart %}
enctype="multipart/form-data"
{% endif %}
novalidate>
{% csrf_token %}
{% if cl.formset %}
<div>
{{ cl.formset.management_form }}
</div>
{% endif %}
{% block result_list %}
{% if action_form and actions_on_top and cl.show_admin_actions %}
{% admin_actions %}
{% endif %}
{% result_list cl %}
{% if action_form and actions_on_bottom and cl.show_admin_actions %}
{% admin_actions %}
{% endif %}
{% endblock %}
{% block pagination %}
{% pagination cl %}
{% endblock %}
</form>
</div>
{% block filters %}
{% if cl.has_filters %}
<div id="changelist-filter">
<h2>{% translate 'Filter' %}</h2>
{% if cl.has_active_filters %}
<h3 id="changelist-filter-clear">
<a href="{{ cl.clear_all_filters_qs }}">
&#10006; {% translate "Clear all filters" %}
</a>
</h3>
{% endif %}
{% for spec in cl.filter_specs %}
{% admin_list_filter cl spec %}
{% endfor %}
</div>
{% endif %}
{% block result_list %}
{% if action_form and actions_on_top and cl.show_admin_actions %}
{% admin_actions %}
{% endif %}
{% result_list cl %}
{% if action_form and actions_on_bottom and cl.show_admin_actions %}
{% admin_actions %}
{% endif %}
{% endblock %}
{% block pagination %}
{% pagination cl %}
{% endblock %}
</form>
{% endblock %}
</div>
{% block filters %}
{% if cl.has_filters %}
<div id="changelist-filter">
<h2>{% translate 'Filter' %}</h2>
{% if cl.has_active_filters %}
<h3 id="changelist-filter-clear">
<a href="{{ cl.clear_all_filters_qs }}">
&#10006; {% translate "Clear all filters" %}
</a>
</h3>
{% endif %}
{% for spec in cl.filter_specs %}
{% admin_list_filter cl spec %}
{% endfor %}
</div>
{% endif %}
{% endblock %}
</div>
</div>
{% endblock %}

View file

@ -14,40 +14,40 @@
{% for inline_admin_form in inline_admin_formset %}
<div class="inline-related{% if inline_admin_form.original or inline_admin_form.show_url %} has_original{% endif %}{% if forloop.last and inline_admin_formset.has_add_permission %} empty-form last-related{% endif %}"
id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
<h3>
<b>
{{ inline_admin_formset.opts.verbose_name|capfirst }}:
</b>
<span class="inline_label">
{% if inline_admin_form.original %}
{{ inline_admin_form.original }}
{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}"
class="{% if inline_admin_formset.has_change_permission %}inlinechangelink{% else %}inlineviewlink{% endif %}">
{% if inline_admin_formset.has_change_permission %}{% translate "Change" %}{% else %}{% translate "View" %}{% endif %}
<h3>
<b>
{{ inline_admin_formset.opts.verbose_name|capfirst }}:
</b>
<span class="inline_label">
{% if inline_admin_form.original %}
{{ inline_admin_form.original }}
{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}"
class="{% if inline_admin_formset.has_change_permission %}inlinechangelink{% else %}inlineviewlink{% endif %}">
{% if inline_admin_formset.has_change_permission %}{% translate "Change" %}{% else %}{% translate "View" %}{% endif %}
</a>
{% endif %}
{% else %}
#{{ forloop.counter }}
{% endif %}
</span>
{% if inline_admin_form.show_url %}
<a href="{{ inline_admin_form.absolute_url }}">
{% translate "View on site" %}
</a>
{% endif %}
{% else %}
#{{ forloop.counter }}
{% endif %}
</span>
{% if inline_admin_form.show_url %}
<a href="{{ inline_admin_form.absolute_url }}">
{% translate "View on site" %}
</a>
{% endif %}
{% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission and inline_admin_form.original %}
<span class="delete">
{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}
</span>
{% endif %}
</h3>
{% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %}
{% for fieldset in inline_admin_form %}
{% include "admin/includes/fieldset.html" %}{% endfor %}
{% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
{% if inline_admin_form.fk_field %}{{ inline_admin_form.fk_field.field }}{% endif %}
</div>
{% endfor %}
</fieldset>
</div>
{% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission and inline_admin_form.original %}
<span class="delete">
{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}
</span>
{% endif %}
</h3>
{% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %}
{% for fieldset in inline_admin_form %}
{% include "admin/includes/fieldset.html" %}{% endfor %}
{% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
{% if inline_admin_form.fk_field %}{{ inline_admin_form.fk_field.field }}{% endif %}
</div>
{% endfor %}
</fieldset>
</div>

View file

@ -4,107 +4,107 @@
data-inline-type="tabular"
data-inline-formset="{{ inline_admin_formset.inline_formset_data }}">
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
{{ inline_admin_formset.formset.management_form }}
<fieldset class="module {{ inline_admin_formset.classes }}">
{% if inline_admin_formset.formset.max_num == 1 %}
<h2>{{ inline_admin_formset.opts.verbose_name|capfirst }}</h2>
{% else %}
<h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
{% endif %}
{{ inline_admin_formset.formset.non_form_errors }}
<table>
<thead>
<tr>
<th class="original"></th>
{% for field in inline_admin_formset.fields %}
{% if not field.widget.is_hidden %}
<th class="column-{{ field.name }}{% if field.required %}required{% endif %}">
{{ field.label|capfirst }}
{% if field.help_text %}
<img src="{% static "
admin/img/icon-unknown.svg" %}" class="help help-tooltip"
width="10"
height="10"
alt="({{ field.help_text|striptags }})"
title="{{ field.help_text|striptags }}">
{% endif %}
</th>
{{ inline_admin_formset.formset.management_form }}
<fieldset class="module {{ inline_admin_formset.classes }}">
{% if inline_admin_formset.formset.max_num == 1 %}
<h2>{{ inline_admin_formset.opts.verbose_name|capfirst }}</h2>
{% else %}
<h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
{% endif %}
{{ inline_admin_formset.formset.non_form_errors }}
<table>
<thead>
<tr>
<th class="original"></th>
{% for field in inline_admin_formset.fields %}
{% if not field.widget.is_hidden %}
<th class="column-{{ field.name }}{% if field.required %}required{% endif %}">
{{ field.label|capfirst }}
{% if field.help_text %}
<img src="{% static "
admin/img/icon-unknown.svg" %}" class="help help-tooltip"
width="10"
height="10"
alt="({{ field.help_text|striptags }})"
title="{{ field.help_text|striptags }}">
{% endif %}
</th>
{% endif %}
{% endfor %}
{% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
<th>{% translate "Delete?" %}</th>
{% endif %}
{% endfor %}
{% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
<th>{% translate "Delete?" %}</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for inline_admin_form in inline_admin_formset %}
{% if inline_admin_form.form.non_field_errors %}
<tr class="row-form-errors">
<td colspan="{{ inline_admin_form|cell_count }}">
{{ inline_admin_form.form.non_field_errors }}
</td>
</tr>
{% endif %}
<tr class="form-row {% if inline_admin_form.original or inline_admin_form.show_url %}has_original{% endif %}{% if forloop.last and inline_admin_formset.has_add_permission %} empty-form{% endif %}"
id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
<td class="original">
{% if inline_admin_form.original or inline_admin_form.show_url %}
<p>
{% if inline_admin_form.original %}
{{ inline_admin_form.original }}
{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}"
class="{% if inline_admin_formset.has_change_permission %}inlinechangelink{% else %}inlineviewlink{% endif %}">
{% if inline_admin_formset.has_change_permission %}{% translate "Change" %}{% else %}{% translate "View" %}{% endif %}
</a>
</tr>
</thead>
<tbody>
{% for inline_admin_form in inline_admin_formset %}
{% if inline_admin_form.form.non_field_errors %}
<tr class="row-form-errors">
<td colspan="{{ inline_admin_form|cell_count }}">
{{ inline_admin_form.form.non_field_errors }}
</td>
</tr>
{% endif %}
<tr class="form-row {% if inline_admin_form.original or inline_admin_form.show_url %}has_original{% endif %}{% if forloop.last and inline_admin_formset.has_add_permission %} empty-form{% endif %}"
id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
<td class="original">
{% if inline_admin_form.original or inline_admin_form.show_url %}
<p>
{% if inline_admin_form.original %}
{{ inline_admin_form.original }}
{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}"
class="{% if inline_admin_formset.has_change_permission %}inlinechangelink{% else %}inlineviewlink{% endif %}">
{% if inline_admin_formset.has_change_permission %}{% translate "Change" %}{% else %}{% translate "View" %}{% endif %}
</a>
{% endif %}
{% endif %}
{% if inline_admin_form.show_url %}
<a href="{{ inline_admin_form.absolute_url }}">
{% translate "View on site" %}
</a>
{% endif %}
</p>
{% endif %}
{% endif %}
{% if inline_admin_form.show_url %}
<a href="{{ inline_admin_form.absolute_url }}">
{% translate "View on site" %}
</a>
{% endif %}
</p>
{% endif %}
{% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
{% if inline_admin_form.fk_field %}{{ inline_admin_form.fk_field.field }}{% endif %}
{% spaceless %}
{% for fieldset in inline_admin_form %}
{% for line in fieldset %}
{% for field in line %}
{% if not field.is_readonly and field.field.is_hidden %}{{ field.field }}{% endif %}
{% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
{% if inline_admin_form.fk_field %}{{ inline_admin_form.fk_field.field }}{% endif %}
{% spaceless %}
{% for fieldset in inline_admin_form %}
{% for line in fieldset %}
{% for field in line %}
{% if not field.is_readonly and field.field.is_hidden %}{{ field.field }}{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endspaceless %}
</td>
{% for fieldset in inline_admin_form %}
{% for line in fieldset %}
{% for field in line %}
{% if field.is_readonly or not field.field.is_hidden %}
<td{% if field.field.name %}class="field-{{ field.field.name }}"{% endif %}>
{% if field.is_readonly %}
<p>
{{ field.contents }}
</p>
{% else %}
{{ field.field.errors.as_ul }}
{{ field.field }}
{% endif %}
</td>
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endspaceless %}
</td>
{% for fieldset in inline_admin_form %}
{% for line in fieldset %}
{% for field in line %}
{% if field.is_readonly or not field.field.is_hidden %}
<td{% if field.field.name %}class="field-{{ field.field.name }}"{% endif %}>
{% if field.is_readonly %}
<p>
{{ field.contents }}
</p>
{% else %}
{{ field.field.errors.as_ul }}
{{ field.field }}
{% endif %}
</td>
{% endif %}
{% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
<td class="delete">
{% if inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }}{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
{% endfor %}
{% endfor %}
{% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
<td class="delete">
{% if inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }}{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</fieldset>
</div>
</tbody>
</table>
</fieldset>
</div>
</div>

View file

@ -7,31 +7,31 @@
{% endif %}
{% for line in fieldset %}
<div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% if not line.has_visible_field %}hidden{% endif %}{% for field in line %}{% if field.field.name %}field-{{ field.field.name }}{% endif %}{% endfor %}">
{% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
{% for field in line %}
<div
{% if not line.fields|length_is:'1' %}
class="fieldBox {% if field.field.name %}field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %}hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
{% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
{% if field.is_checkbox %}
{{ field.field }}{{ field.label_tag }}
{% else %}
{{ field.label_tag }}
{% if field.is_readonly %}
<div class="readonly">
{{ field.contents }}
</div>
{% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
{% for field in line %}
<div
{% if not line.fields|length_is:'1' %}
class="fieldBox {% if field.field.name %}field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %}hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
{% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
{% if field.is_checkbox %}
{{ field.field }}{{ field.label_tag }}
{% else %}
{{ field.field }}
{{ field.label_tag }}
{% if field.is_readonly %}
<div class="readonly">
{{ field.contents }}
</div>
{% else %}
{{ field.field }}
{% endif %}
{% endif %}
{% endif %}
{% if field.field.help_text %}
<div class="help">
{{ field.field.help_text|safe }}
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endfor %}
</fieldset>
{% if field.field.help_text %}
<div class="help">
{{ field.field.help_text|safe }}
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endfor %}
</fieldset>

View file

@ -28,26 +28,26 @@
<ul class="actionlist">
{% for entry in admin_log %}
<li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
{% if entry.is_deletion or not entry.get_admin_url %}
{{ entry.object_repr }}
{% else %}
<a href="{{ entry.get_admin_url }}">
{% if entry.is_deletion or not entry.get_admin_url %}
{{ entry.object_repr }}
</a>
{% else %}
<a href="{{ entry.get_admin_url }}">
{{ entry.object_repr }}
</a>
{% endif %}
<br>
{% if entry.content_type %}
<span class="mini quiet">
{% filter capfirst %}{{ entry.content_type.name }}
{% endfilter %}
</span>
{% else %}
<span class="mini quiet">{% translate 'Unknown content' %}</span>
{% endif %}
<br>
{% if entry.content_type %}
<span class="mini quiet">
{% filter capfirst %}{{ entry.content_type.name }}
{% endfilter %}
</span>
{% else %}
<span class="mini quiet">{% translate 'Unknown content' %}</span>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</div>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
{% endblock %}

View file

@ -6,16 +6,16 @@
<!-- DIV needed for valid HTML -->
<label for="searchbar">
<img src="{% static "admin/img/search.svg" %}" alt="Search">
</label>
<input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar">
<input type="submit" value="{% translate 'Search' %}">
{% if show_result_count %}
<span class="small quiet">
{% blocktranslate count counter=cl.result_count %}
{{ counter }} result{% plural %}{{ counter }} results
{% endblocktranslate %}
(
<a href="?{% if cl.is_popup %}{{ is_popup_var }}=1{% endif %}">
</label>
<input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar">
<input type="submit" value="{% translate 'Search' %}">
{% if show_result_count %}
<span class="small quiet">
{% blocktranslate count counter=cl.result_count %}
{{ counter }} result{% plural %}{{ counter }} results
{% endblocktranslate %}
(
<a href="?{% if cl.is_popup %}{{ is_popup_var }}=1{% endif %}">
{% if cl.show_full_result_count %}
{% blocktranslate with full_result_count=cl.full_result_count %}
{{ full_result_count }} total

View file

@ -7,9 +7,7 @@
<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}"
{% if widget.attrs.disabled %}disabled {% endif %}
>
<label for="{{ widget.checkbox_id }}">
{{ widget.clear_checkbox_label }}
</label>
<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>
</span>
{% endif %}
<br>

View file

@ -10,25 +10,25 @@
data-href-template="{{ change_related_template_url }}?{{ url_params }}"
title="{% blocktranslate %}Change selected {{ model }}{% endblocktranslate %}">
<img src="{% static 'admin/img/icon-changelink.svg' %}" alt="{% translate 'Change' %}">
</a>
{% endif %}
{% if can_add_related %}
<a class="related-widget-wrapper-link add-related"
id="add_id_{{ name }}"
href="{{ add_related_url }}?{{ url_params }}"
title="{% blocktranslate %}Add another {{ model }}{% endblocktranslate %}">
<img src="{% static 'admin/img/icon-addlink.svg' %}" alt="{% translate 'Add' %}">
</a>
{% endif %}
{% if can_delete_related %}
<a class="related-widget-wrapper-link delete-related"
id="delete_id_{{ name }}"
data-href-template="{{ delete_related_template_url }}?{{ url_params }}"
title="{% blocktranslate %}Delete selected {{ model }}{% endblocktranslate %}">
<img src="{% static 'admin/img/icon-deletelink.svg' %}" alt="{% translate 'Delete' %}">
</a>
{% endif %}
{% endif %}
{% endspaceless %}
{% endblock %}
</div>
</a>
{% endif %}
{% if can_add_related %}
<a class="related-widget-wrapper-link add-related"
id="add_id_{{ name }}"
href="{{ add_related_url }}?{{ url_params }}"
title="{% blocktranslate %}Add another {{ model }}{% endblocktranslate %}">
<img src="{% static 'admin/img/icon-addlink.svg' %}" alt="{% translate 'Add' %}">
</a>
{% endif %}
{% if can_delete_related %}
<a class="related-widget-wrapper-link delete-related"
id="delete_id_{{ name }}"
data-href-template="{{ delete_related_template_url }}?{{ url_params }}"
title="{% blocktranslate %}Delete selected {{ model }}{% endblocktranslate %}">
<img src="{% static 'admin/img/icon-deletelink.svg' %}" alt="{% translate 'Delete' %}">
</a>
{% endif %}
{% endif %}
{% endspaceless %}
{% endblock %}
</div>

View file

@ -1,7 +1,11 @@
<p class="datetime">
{{ date_label }} {% with widget=widget.subwidgets.0 %}
{% include widget.template_name %}{% endwith %}
{{ date_label }}
{% with widget=widget.subwidgets.0 %}
{% include widget.template_name %}
{% endwith %}
<br>
{{ time_label }} {% with widget=widget.subwidgets.1 %}
{% include widget.template_name %}{% endwith %}
{{ time_label }}
{% with widget=widget.subwidgets.1 %}
{% include widget.template_name %}
{% endwith %}
</p>

View file

@ -21,16 +21,12 @@
<input class="hidden" autocomplete="username" value="{{ form.user.get_username }}">
<div class="form-row field-password1">
{{ form.new_password1.errors }}
<label for="id_new_password1">
{% translate 'New password:' %}
</label>
<label for="id_new_password1">{% translate 'New password:' %}</label>
{{ form.new_password1 }}
</div>
<div class="form-row field-password2">
{{ form.new_password2.errors }}
<label for="id_new_password2">
{% translate 'Confirm password:' %}
</label>
<label for="id_new_password2">{% translate 'Confirm password:' %}</label>
{{ form.new_password2 }}
</div>
<input type="submit" value="{% translate 'Change my password' %}">

View file

@ -19,9 +19,7 @@
<fieldset class="module aligned">
<div class="form-row field-email">
{{ form.email.errors }}
<label for="id_email">
{% translate 'Email address:' %}
</label>
<label for="id_email">{% translate 'Email address:' %}</label>
{{ form.email }}
</div>
<input type="submit" value="{% translate 'Reset my password' %}">

View file

@ -60,71 +60,74 @@
{% endif %}action="?language={{ language }}{% if request.GET.parent_node %}&amp;parent_node={{ request.GET.parent_node }}{% endif %}{% if request.GET.source %}&amp;source={{ request.GET.source }}{% endif %}"
method="post"
id="page_form">
{% csrf_token %}
{% block form_top %}{% endblock %}
<div style="display: none;"><input type="hidden"
{% csrf_token %}
{% block form_top %}{% endblock %}
<div style="display: none;"><input type="hidden"
name="language"
value="{{ language }}"
id="id_language"/></div>
{% if show_language_tabs and not show_permissions %}
<div id="page_form_lang_tabs">
{% for lang_code, lang_name in language_tabs %}
<input type="button"
onclick="CMS.API.changeLanguage('./?language={{ lang_code }}');"
class="language_button {% if lang_code == language %}selected{% else %}{% if not lang_code in filled_languages %} notfilled{% endif %}{% endif %}"
id="{{ lang_code }}button"
name="{{ lang_code }}"
value="{{ lang_name }}"/>
{% endfor %}
<div class="lang_tabs_line"></div>
</div>
{% endif %}
<div id="lang_tab_content">
{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
{% if save_on_top %}{% submit_row %}{% endif %}
{% if errors %}
<p class="errornote">
{% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
</p>
<ul class="errorlist">{% for error in adminform.form.non_field_errors %}<li>{{ error }}</li>{% endfor %}</ul>
{% endif %}
{% for fieldset in adminform %}
{% include "admin/cms/page/includes/fieldset.html" %}{% endfor %}
{% for inline_admin_formset in inline_admin_formsets %}
{% include inline_admin_formset.opts.template %}{% endfor %}
{% if show_permissions %}
{% if CMS_PERMISSION and can_change_permissions %}
<div class="inline-group">
<div class="tabular inline-related">
<fieldset id="inherited_permissions" class="module aligned collapse">
<h2>{% trans 'All permissions' %}</h2>
<div class="loading" rel="../permissions/">{% trans 'Loading...' %}</div>
</fieldset>
</div>
</div>
{% endif %}
{% endif %}
{% block after_related_objects %}{% endblock %}
{% if add %}
<div class="submit-row" {% if is_popup %} style="overflow: auto;">
<input type="submit" name="_save" class="default" value="{% trans 'Save' %}"/>
<input type="submit" name="_continue" value="{% trans 'Save and continue editing' %}"/>
</div>
{% else %}
{% page_submit_row %}
{% endif %}
</div>
</form>
</div>
{% block admin_change_form_document_ready %}
{{ block.super }}
{% endblock %}
{% for url in unihandecode_urls %}<script src="{{ url }}" type="text/javascript"></script>{% endfor %}
{% if unihandecode_urls %}
<script>
var UNIHANDECODER = unihandecode.Unihan('{{ unihandecode_lang }}');
</script>
{% if show_language_tabs and not show_permissions %}
<div id="page_form_lang_tabs">
{% for lang_code, lang_name in language_tabs %}
<input type="button"
onclick="CMS.API.changeLanguage('./?language={{ lang_code }}');"
class="language_button {% if lang_code == language %}selected{% else %}{% if not lang_code in filled_languages %} notfilled{% endif %}{% endif %}"
id="{{ lang_code }}button"
name="{{ lang_code }}"
value="{{ lang_name }}"/>
{% endfor %}
<div class="lang_tabs_line"></div>
</div>
{% endif %}
{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}
{% endblock %}
<div id="lang_tab_content">
{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
{% if save_on_top %}{% submit_row %}{% endif %}
{% if errors %}
<p class="errornote">
{% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
</p>
<ul class="errorlist">{% for error in adminform.form.non_field_errors %}<li>{{ error }}</li>{% endfor %}</ul>
{% endif %}
{% for fieldset in adminform %}
{% include "admin/cms/page/includes/fieldset.html" %}{% endfor %}
{% for inline_admin_formset in inline_admin_formsets %}
{% include inline_admin_formset.opts.template %}{% endfor %}
{% if show_permissions %}
{% if CMS_PERMISSION and can_change_permissions %}
<div class="inline-group">
<div class="tabular inline-related">
<fieldset id="inherited_permissions" class="module aligned collapse">
<h2>{% trans 'All permissions' %}</h2>
<div class="loading"
rel="../permissions/">{% trans 'Loading...' %}</div>
</fieldset>
</div>
</div>
{% endif %}
{% endif %}
{% block after_related_objects %}{% endblock %}
{% if add %}
<div class="submit-row" {% if is_popup %} style="overflow: auto;">
<input type="submit" name="_save" class="default" value="{% trans 'Save' %}"/>
<input type="submit"
name="_continue"
value="{% trans 'Save and continue editing' %}"/>
</div>
{% else %}
{% page_submit_row %}
{% endif %}
</div>
</form>
</div>
{% block admin_change_form_document_ready %}
{{ block.super }}
{% endblock %}
{% for url in unihandecode_urls %}<script src="{{ url }}" type="text/javascript"></script>{% endfor %}
{% if unihandecode_urls %}
<script>
var UNIHANDECODER = unihandecode.Unihan('{{ unihandecode_lang }}');
</script>
{% endif %}
{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}
{% endblock %}

View file

@ -21,55 +21,55 @@
<tbody>
{% for row in rows %}
{% with permission=row.permission %}
<tr class="{% cycle 'row1' 'row2' %}">
<td class="page">
{% if row.is_global %}
{% if row.can_change %}
<a href="{% cms_admin_url 'cms_globalpagepermission_change' permission.id %}">
{% trans "(global)" %}
</a>
{% else %}
{% trans "(global)" %}
{% endif %}
{% else %}
{% if permission.page_id == page.id %}
{% trans "(current)" %}
{% else %}
<tr class="{% cycle 'row1' 'row2' %}">
<td class="page">
{% if row.is_global %}
{% if row.can_change %}
<a href="{% url opts|admin_urlname:'change' permission.page_id %}">
{{ permission.page }}
<a href="{% cms_admin_url 'cms_globalpagepermission_change' permission.id %}">
{% trans "(global)" %}
</a>
{% else %}
{{ permission.page }}
{% trans "(global)" %}
{% endif %}
{% else %}
{% if permission.page_id == page.id %}
{% trans "(current)" %}
{% else %}
{% if row.can_change %}
<a href="{% url opts|admin_urlname:'change' permission.page_id %}">
{{ permission.page }}
</a>
{% else %}
{{ permission.page }}
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</td>
<td class="user">{{ permission.user|default_if_none:"-" }}</td>
<td class="group">{{ permission.group|default_if_none:"-" }}</td>
<td class="can_change">{{ permission.can_change|boolean_icon }}</td>
<td class="can_add">{{ permission.can_add|boolean_icon }}</td>
<td class="can_delete">{{ permission.can_delete|boolean_icon }}</td>
<td class="can_publish">{{ permission.can_publish|boolean_icon }}</td>
<td class="can_change_permissions">
{{ permission.can_change_permissions|boolean_icon }}
</td>
<td class="can_move_page">{{ permission.can_move_page|boolean_icon }}</td>
<td class="can_view">{{ permission.can_view|boolean_icon }}</td>
<td class="grant_on">
{% if row.is_global %}
{% trans "All" %}
{% else %}
{{ permission.get_grant_on_display }}
{% endif %}
</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
</td>
<td class="user">{{ permission.user|default_if_none:"-" }}</td>
<td class="group">{{ permission.group|default_if_none:"-" }}</td>
<td class="can_change">{{ permission.can_change|boolean_icon }}</td>
<td class="can_add">{{ permission.can_add|boolean_icon }}</td>
<td class="can_delete">{{ permission.can_delete|boolean_icon }}</td>
<td class="can_publish">{{ permission.can_publish|boolean_icon }}</td>
<td class="can_change_permissions">
{{ permission.can_change_permissions|boolean_icon }}
</td>
<td class="can_move_page">{{ permission.can_move_page|boolean_icon }}</td>
<td class="can_view">{{ permission.can_view|boolean_icon }}</td>
<td class="grant_on">
{% if row.is_global %}
{% trans "All" %}
{% else %}
{{ permission.get_grant_on_display }}
{% endif %}
</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
{% else %}
<p>
{% trans "Page doesn't inherit any permissions." %}
</p>
<p>
{% trans "Page doesn't inherit any permissions." %}
</p>
{% endif %}

View file

@ -14,21 +14,21 @@
{% if show_buttons %}
<a href="{% url opts|admin_urlname:'change' object_id %}?language={{ language }}"
class="cms-btn-group{% if basic_info_active %}cms-btn-active{% endif %}">
{% trans "Basic Settings" %}
</a>
<a href="{% url opts|admin_urlname:'advanced' object_id %}?language={{ language }}"
class="cms-btn-group{% if advanced_settings_active %}cms-btn-active{% endif %}">
{% trans "Advanced Settings" %}
</a>
{% endif %}
</p>
{% if show_save_as_new %}
<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" />
{% endif %}
{% if show_save_and_add_another %}
<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" />
{% endif %}
{% if show_save_and_continue %}
<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" />
{% endif %}
{% trans "Basic Settings" %}
</a>
<a href="{% url opts|admin_urlname:'advanced' object_id %}?language={{ language }}"
class="cms-btn-group{% if advanced_settings_active %}cms-btn-active{% endif %}">
{% trans "Advanced Settings" %}
</a>
{% endif %}
</p>
{% if show_save_as_new %}
<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" />
{% endif %}
{% if show_save_and_add_another %}
<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" />
{% endif %}
{% if show_save_and_continue %}
<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" />
{% endif %}
</div>

View file

@ -39,124 +39,124 @@
data-id="{{ page.pk }}"
data-node-id="{{ node.pk }}"
class="{% if has_add_permission %}js-cms-tree-item-paste{% endif %} {% if not has_add_permission or not paste_enabled %} cms-pagetree-dropdown-item-disabled{% endif %}">
<span class="cms-icon cms-icon-alias"></span>
<span>{% filter escapejs %}{% trans "Paste" %}{% endfilter %}</span>
</a>
</li>
<li>
{% if has_delete_permission %}
<a href="{% url opts|admin_urlname:'delete' page.id %}?language={{ preview_language }}"
title="{% filter escapejs %}{% trans ">
{% else %}
<a href="#" class="cms-pagetree-dropdown-item-disabled">
{% endif %}
<span class="cms-icon cms-icon-bin"></span>
<span>{% filter escapejs %}{% trans "Delete" %}...{% endfilter %}</span>
<span class="cms-icon cms-icon-alias"></span>
<span>{% filter escapejs %}{% trans "Paste" %}{% endfilter %}</span>
</a>
</li>
{% if has_change_permission and page.is_potential_home %}
<li class="js-cms-tree-item-set-home">
<a href="{% url opts|admin_urlname:'set_home' page.id %}"
title="{% filter escapejs %}{% trans ">
<span class="cms-icon cms-icon-home"></span>
<span>{% filter escapejs %}{% trans "Set as home" %}{% endfilter %}</span>
</a>
</li>
{% else %}
<li class="js-cms-tree-item-set-home">
<a href="#" class="cms-pagetree-dropdown-item-disabled">
<span class="cms-icon cms-icon-home"></span>
<span>{% filter escapejs %}{% trans "Set as home" %}{% endfilter %}</span>
</a>
</li>
{% endif %}
<li>
{% if has_change_advanced_settings_permission %}
<a href="{% url opts|admin_urlname:'advanced' page.id %}"
{% if has_delete_permission %}
<a href="{% url opts|admin_urlname:'delete' page.id %}?language={{ preview_language }}"
title="{% filter escapejs %}{% trans ">
{% else %}
<a href="#" class="cms-pagetree-dropdown-item-disabled">
{% endif %}
<span class="cms-icon cms-icon-cogs"></span>
<span>{% filter escapejs %}{% trans "Advanced settings" %}{% endfilter %}</span>
<span class="cms-icon cms-icon-bin"></span>
<span>{% filter escapejs %}{% trans "Delete" %}...{% endfilter %}</span>
</a>
</li>
{% if CMS_PERMISSION %}
<li>
{% if has_change_permissions_permission %}
<a href="{% url opts|admin_urlname:'permissions' page.id %}"
title="{% filter escapejs %}{% trans ">
{% else %}
<a href="#" class="cms-pagetree-dropdown-item-disabled">
{% endif %}
<span class="cms-icon cms-icon-lock"></span>
<span>{% filter escapejs %}{% trans "Permissions" %}{% endfilter %}</span>
</a>
</li>
{% endif %}
{% endblock actions %}
<li class="cms-pagetree-dropdown-separator">
&nbsp;
</li>
{% if has_change_permission and page.is_potential_home %}
<li class="js-cms-tree-item-set-home">
<a href="{% url opts|admin_urlname:'set_home' page.id %}"
title="{% filter escapejs %}{% trans ">
<span class="cms-icon cms-icon-home"></span>
<span>{% filter escapejs %}{% trans "Set as home" %}{% endfilter %}</span>
</a>
</li>
{% else %}
<li class="js-cms-tree-item-set-home">
<a href="#" class="cms-pagetree-dropdown-item-disabled">
<span class="cms-icon cms-icon-home"></span>
<span>{% filter escapejs %}{% trans "Set as home" %}{% endfilter %}</span>
</a>
</li>
{% endif %}
<li>
{% if page.publication_date %}
<p title="{% filter escapejs %}{% trans ">
<strong>{% filter escapejs %}{% trans "publication date" %}{% endfilter %}:</strong>
{{ page.publication_date|date:"Y-m-d" }}
</p>
{% endif %}
{% if page.publication_end_date %}
<p title="{% filter escapejs %}{% trans ">
<strong>{% filter escapejs %}{% trans "publication end date" %}{% endfilter %}:</strong>
{{ page.publication_end_date|date:"Y-m-d" }}
</p>
{% endif %}
<p title="{% filter escapejs %}{% trans ">
<strong>{% filter escapejs %}{% trans "is restricted" %}{% endfilter %}:</strong>
{% if page_is_restricted %}
{% filter escapejs %}{% trans "Yes" %}{% endfilter %}
{% if has_change_advanced_settings_permission %}
<a href="{% url opts|admin_urlname:'advanced' page.id %}"
title="{% filter escapejs %}{% trans ">
{% else %}
{% filter escapejs %}{% trans "No" %}{% endfilter %}
<a href="#" class="cms-pagetree-dropdown-item-disabled">
{% endif %}
<span class="cms-icon cms-icon-cogs"></span>
<span>{% filter escapejs %}{% trans "Advanced settings" %}{% endfilter %}</span>
</a>
</li>
{% if CMS_PERMISSION %}
<li>
{% if has_change_permissions_permission %}
<a href="{% url opts|admin_urlname:'permissions' page.id %}"
title="{% filter escapejs %}{% trans ">
{% else %}
<a href="#" class="cms-pagetree-dropdown-item-disabled">
{% endif %}
<span class="cms-icon cms-icon-lock"></span>
<span>{% filter escapejs %}{% trans "Permissions" %}{% endfilter %}</span>
</a>
</li>
{% endif %}
{% endblock actions %}
<li class="cms-pagetree-dropdown-separator">
&nbsp;
</li>
<li>
{% if page.publication_date %}
<p title="{% filter escapejs %}{% trans ">
<strong>{% filter escapejs %}{% trans "publication date" %}{% endfilter %}:</strong>
{{ page.publication_date|date:"Y-m-d" }}
</p>
{% endif %}
{% if page.publication_end_date %}
<p title="{% filter escapejs %}{% trans ">
<strong>{% filter escapejs %}{% trans "publication end date" %}{% endfilter %}:</strong>
{{ page.publication_end_date|date:"Y-m-d" }}
</p>
{% endif %}
</p>
{% if page.changed_by %}
<p title="{% filter escapejs %}{% trans ">
<strong>{% filter escapejs %}{% trans "last change by" %}{% endfilter %}:</strong>
{{ page.changed_by }}
<strong>{% filter escapejs %}{% trans "is restricted" %}{% endfilter %}:</strong>
{% if page_is_restricted %}
{% filter escapejs %}{% trans "Yes" %}{% endfilter %}
{% else %}
{% filter escapejs %}{% trans "No" %}{% endfilter %}
{% endif %}
</p>
{% endif %}
{% if page.changed_date %}
<p title="{% filter escapejs %}{% trans ">
<strong>
{% filter escapejs %}{% trans "last change on" %}{% endfilter %}:
</strong>
{{ page.changed_date|date:"Y-m-d H:i:s" }}
</p>
{% endif %}
{% if page.get_template_display %}
<p title="{% filter escapejs %}{% trans ">
<strong>
{% filter escapejs %}{% trans "template" %}{% endfilter %}:
</strong>
{{ page.get_template_display }}
</p>
{% endif %}
{% if metadata %}
<p title="{% filter escapejs %}{% trans ">
<strong>
{% filter escapejs %}{% trans "meta" %}{% endfilter %}:
</strong>
{{ metadata }}
</p>
{% endif %}
{% if page.site %}
<p title="{% filter escapejs %}{% trans ">
<strong>
{% filter escapejs %}{% trans "site" %}{% endfilter %}:
</strong>
{{ page.site }}
</p>
{% endif %}
</li>
</ul>
{% endspaceless %}
{% if page.changed_by %}
<p title="{% filter escapejs %}{% trans ">
<strong>{% filter escapejs %}{% trans "last change by" %}{% endfilter %}:</strong>
{{ page.changed_by }}
</p>
{% endif %}
{% if page.changed_date %}
<p title="{% filter escapejs %}{% trans ">
<strong>
{% filter escapejs %}{% trans "last change on" %}{% endfilter %}:
</strong>
{{ page.changed_date|date:"Y-m-d H:i:s" }}
</p>
{% endif %}
{% if page.get_template_display %}
<p title="{% filter escapejs %}{% trans ">
<strong>
{% filter escapejs %}{% trans "template" %}{% endfilter %}:
</strong>
{{ page.get_template_display }}
</p>
{% endif %}
{% if metadata %}
<p title="{% filter escapejs %}{% trans ">
<strong>
{% filter escapejs %}{% trans "meta" %}{% endfilter %}:
</strong>
{{ metadata }}
</p>
{% endif %}
{% if page.site %}
<p title="{% filter escapejs %}{% trans ">
<strong>
{% filter escapejs %}{% trans "site" %}{% endfilter %}:
</strong>
{{ page.site }}
</p>
{% endif %}
</li>
</ul>
{% endspaceless %}

View file

@ -3,6 +3,7 @@
<div class="cms-plugins"></div>
<div class="cms-clipboard-containers cms-dragarea cms-draggables">
{% if clipboard_plugin %}
{% include cms_toolbar.templates.drag_item_template with clipboard="true" plugin=clipboard_plugin %}{% endif %}
</div>
{% include cms_toolbar.templates.drag_item_template with clipboard="true" plugin=clipboard_plugin %}
{% endif %}
</div>
</div>

View file

@ -1,77 +1,79 @@
{% load i18n l10n cms_tags %}
{% with allow_children=plugin.get_plugin_class.allow_children disable_child_plugins=plugin.get_plugin_class.disable_child_plugins %}
<div class="cms-draggable cms-draggable-{{ plugin.pk|unlocalize }} {% if not allow_children %}cms-draggable-disabled{% endif %} {% if clipboard %}cms-draggable-from-clipboard{% endif %}">
<div class="cms-dragitem cms-dragitem-handler {% if plugin.child_plugin_instances %}cms-dragitem-collapsable{% endif %}">
{% if not disabled_child %}
<div class="cms-submenu-btn cms-submenu-edit cms-btn" data-rel="edit">
<span class="cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay"
data-cms-tooltip="{% trans "></span>
</div>
<div class="cms-submenu-btn cms-submenu-add cms-btn {% if not allow_children %}cms-btn-disabled{% endif %}">
{% if not allow_children %}
<span class="cms-hover-tooltip" data-cms-tooltip="{% trans "></span>
{% else %}
<span class="cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay"
data-cms-tooltip="{% trans "></span>
{% endif %}
</div>
<div class="cms-submenu cms-submenu-settings cms-submenu-btn cms-btn"></div>
{% else %}
<div class="cms-hover-tooltip cms-hover-tooltip-left cms-plugin-disabled" tabindex="-1" data-cms-tooltip="{% trans ">
<span class="cms-icon cms-icon-lock"></span>
</div>
{% endif %}
<div class="cms-submenu-dropdown cms-submenu-dropdown-settings">
<div class="cms-dropdown-inner">
<div class="cms-submenu-item">
<a data-cms-icon="scissors" data-rel="cut" href="#">
{% trans "Cut" %}
</a>
</div>
<div class="cms-submenu-item">
<a data-cms-icon="copy" data-rel="copy" href="#">
{% trans "Copy" %}
</a>
</div>
<div class="cms-submenu-item">
<a data-cms-icon="paste" data-rel="paste" href="#">
{% trans "Paste" %}
</a>
<span class="cms-submenu-item-paste-tooltip cms-submenu-item-paste-tooltip-empty cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay"
data-cms-tooltip="{% trans "></span>
<span class="cms-submenu-item-paste-tooltip cms-submenu-item-paste-tooltip-restricted cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay"
data-cms-tooltip="{% trans "></span>
<span class="cms-submenu-item-paste-tooltip cms-submenu-item-paste-tooltip-disabled cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay"
data-cms-tooltip="{% trans "></span>
</div>
<div class="cms-submenu-item">
<a data-cms-icon="bin" data-rel="delete" href="#">
{% trans "Delete" %}
</a>
</div>
{% render_extra_menu_items plugin %}
</div>
</div>
{% if not clipboard %}
<div class="cms-plugin-picker" data-touch-action="pan-y">
<div class="cms-quicksearch">
<label>
<input type="text" placeholder="{% trans 'Filter plugins...' %}" />
</label>
</div>
{# plugin child classes here #}
</div>
{% endif %}
<span class="cms-dragitem-text" title="{{ plugin.plugin_type }} ID: {{ plugin.pk }}">
<strong>{{ plugin.get_plugin_name }}</strong>
{{ plugin.get_short_description }}
</span>
</div>
<div class="cms-collapsable-container cms-hidden {% if allow_children %}cms-draggables{% endif %}">
{% if plugin.child_plugin_instances %}
{% for child in plugin.child_plugin_instances %}
{% include cms_toolbar.templates.drag_item_template with plugin=child disabled_child=disable_child_plugins %}{% endfor %}
{% endif %}
</div>
</div>
{% endwith %}
<div class="cms-draggable cms-draggable-{{ plugin.pk|unlocalize }} {% if not allow_children %}cms-draggable-disabled{% endif %} {% if clipboard %}cms-draggable-from-clipboard{% endif %}">
<div class="cms-dragitem cms-dragitem-handler {% if plugin.child_plugin_instances %}cms-dragitem-collapsable{% endif %}">
{% if not disabled_child %}
<div class="cms-submenu-btn cms-submenu-edit cms-btn" data-rel="edit">
<span class="cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay"
data-cms-tooltip="{% trans "></span>
</div>
<div class="cms-submenu-btn cms-submenu-add cms-btn {% if not allow_children %}cms-btn-disabled{% endif %}">
{% if not allow_children %}
<span class="cms-hover-tooltip" data-cms-tooltip="{% trans "></span>
{% else %}
<span class="cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay"
data-cms-tooltip="{% trans "></span>
{% endif %}
</div>
<div class="cms-submenu cms-submenu-settings cms-submenu-btn cms-btn"></div>
{% else %}
<div class="cms-hover-tooltip cms-hover-tooltip-left cms-plugin-disabled"
tabindex="-1"
data-cms-tooltip="{% trans ">
<span class="cms-icon cms-icon-lock"></span>
</div>
{% endif %}
<div class="cms-submenu-dropdown cms-submenu-dropdown-settings">
<div class="cms-dropdown-inner">
<div class="cms-submenu-item">
<a data-cms-icon="scissors" data-rel="cut" href="#">
{% trans "Cut" %}
</a>
</div>
<div class="cms-submenu-item">
<a data-cms-icon="copy" data-rel="copy" href="#">
{% trans "Copy" %}
</a>
</div>
<div class="cms-submenu-item">
<a data-cms-icon="paste" data-rel="paste" href="#">
{% trans "Paste" %}
</a>
<span class="cms-submenu-item-paste-tooltip cms-submenu-item-paste-tooltip-empty cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay"
data-cms-tooltip="{% trans "></span>
<span class="cms-submenu-item-paste-tooltip cms-submenu-item-paste-tooltip-restricted cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay"
data-cms-tooltip="{% trans "></span>
<span class="cms-submenu-item-paste-tooltip cms-submenu-item-paste-tooltip-disabled cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay"
data-cms-tooltip="{% trans "></span>
</div>
<div class="cms-submenu-item">
<a data-cms-icon="bin" data-rel="delete" href="#">
{% trans "Delete" %}
</a>
</div>
{% render_extra_menu_items plugin %}
</div>
</div>
{% if not clipboard %}
<div class="cms-plugin-picker" data-touch-action="pan-y">
<div class="cms-quicksearch">
<label>
<input type="text" placeholder="{% trans 'Filter plugins...' %}" />
</label>
</div>
{# plugin child classes here #}
</div>
{% endif %}
<span class="cms-dragitem-text" title="{{ plugin.plugin_type }} ID: {{ plugin.pk }}">
<strong>{{ plugin.get_plugin_name }}</strong>
{{ plugin.get_short_description }}
</span>
</div>
<div class="cms-collapsable-container cms-hidden {% if allow_children %}cms-draggables{% endif %}">
{% if plugin.child_plugin_instances %}
{% for child in plugin.child_plugin_instances %}
{% include cms_toolbar.templates.drag_item_template with plugin=child disabled_child=disable_child_plugins %}{% endfor %}
{% endif %}
</div>
</div>
{% endwith %}

View file

@ -1,4 +1,4 @@
<a href="{{ url }}"
class="cms-btn{% if active %}cms-btn-active{% endif %}{% if disabled %}cms-btn-disabled{% endif %}{% if extra_classes %}{{ extra_classes|join:' ' }}{% endif %}">
{{ name }}
{{ name }}
</a>

View file

@ -1,5 +1,5 @@
<a href="{{ url }}" class="cms-btn{% if active %}cms-btn-active{% endif %}{% if disabled %}cms-btn-disabled{% endif %} {{ extra_classes|join:' ' }}" data-rel="modal"
{% if on_close %}data-on-close="{{ on_close }}" {% endif %}
>
{{ name }}
{% if on_close %}data-on-close="{{ on_close }}" {% endif %}
>
{{ name }}
</a>

View file

@ -1,5 +1,5 @@
<a href="{{ url }}" class="cms-btn{% if active %}cms-btn-active{% endif %}{% if disabled %}cms-btn-disabled{% endif %} {{ extra_classes|join:' ' }}" data-rel="sideframe"
{% if on_close %}data-on-close="{{ on_close }}" {% endif %}
>
{{ name }}
{% if on_close %}data-on-close="{{ on_close }}" {% endif %}
>
{{ name }}
</a>

View file

@ -1,5 +1,5 @@
<a href="javascript: void 0"
class="cms-btn cms-dropdown-toggle {% if active %}cms-btn-active{% endif %}{% if disabled %}cms-btn-disabled{% endif %} {{ extra_classes|join:' ' }}">
{{ name }}
<span class="cms-dropdown-caret"></span>
{{ name }}
<span class="cms-dropdown-caret"></span>
</a>

View file

@ -1,13 +1,13 @@
<li class="{% if active %}cms-toolbar-item-navigation-active{% endif %}{% if disabled %}cms-toolbar-item-navigation-disabled{% endif %} {{ extra_classes|join:' ' }}">
<a
{% if disabled %}tabindex="-1" {% endif %}
href="{{ action }}" data-rel="ajax" data-method="{{ method }}" data-post="{{ data }}"
{% if question %}data-text="{{ question }}" {% endif %}
{% if on_success %}data-on-success="{{ on_success }}" {% endif %}
>
<span>
{{ name }}
<span class="cms-icon cms-icon-arrow"></span>
</span>
</a>
<a
{% if disabled %}tabindex="-1" {% endif %}
href="{{ action }}" data-rel="ajax" data-method="{{ method }}" data-post="{{ data }}"
{% if question %}data-text="{{ question }}" {% endif %}
{% if on_success %}data-on-success="{{ on_success }}" {% endif %}
>
<span>
{{ name }}
<span class="cms-icon cms-icon-arrow"></span>
</span>
</a>
</li>

View file

@ -1,10 +1,10 @@
<li class="{% if active %}cms-toolbar-item-navigation-active{% endif %}{% if disabled %}cms-toolbar-item-navigation-disabled{% endif %} {{ extra_classes|join:' ' }}">
<a
{% if disabled %}tabindex="-1" {% endif %}
href="{{ url }}">
<span>
{{ name }}
<span class="cms-icon cms-icon-arrow"></span>
</span>
</a>
<a
{% if disabled %}tabindex="-1" {% endif %}
href="{{ url }}">
<span>
{{ name }}
<span class="cms-icon cms-icon-arrow"></span>
</span>
</a>
</li>

View file

@ -1,12 +1,12 @@
<li class="{% if active %}cms-toolbar-item-navigation-active{% endif %}{% if disabled %}cms-toolbar-item-navigation-disabled{% endif %} {{ extra_classes|join:' ' }}">
<a
{% if disabled %}tabindex="-1" {% endif %}
href="{{ url }}" data-rel="modal"
{% if on_close %}data-on-close="{{ on_close }}" {% endif %}
>
<span>
{{ name }}
<span class="cms-icon cms-icon-arrow"></span>
</span>
</a>
<a
{% if disabled %}tabindex="-1" {% endif %}
href="{{ url }}" data-rel="modal"
{% if on_close %}data-on-close="{{ on_close }}" {% endif %}
>
<span>
{{ name }}
<span class="cms-icon cms-icon-arrow"></span>
</span>
</a>
</li>

View file

@ -1,12 +1,12 @@
<li class="{% if active %}cms-toolbar-item-navigation-active{% endif %}{% if disabled %}cms-toolbar-item-navigation-disabled{% endif %} {{ extra_classes|join:' ' }}">
<a
{% if disabled %}tabindex="-1" {% endif %}
href="{{ url }}" data-rel="sideframe"
{% if on_close %}data-on-close="{{ on_close }}" {% endif %}
>
<span>
{{ name }}
<span class="cms-icon cms-icon-arrow"></span>
</span>
</a>
<a
{% if disabled %}tabindex="-1" {% endif %}
href="{{ url }}" data-rel="sideframe"
{% if on_close %}data-on-close="{{ on_close }}" {% endif %}
>
<span>
{{ name }}
<span class="cms-icon cms-icon-arrow"></span>
</span>
</a>
</li>

View file

@ -1,15 +1,15 @@
<li class="{% if sub_level %}cms-toolbar-item-navigation-children {% endif %}{% if active %}cms-toolbar-item-navigation-active {% endif %}{% if disabled %}cms-toolbar-item-navigation-disabled {% endif %}">
<a
{% if disabled %}tabindex="-1" {% endif %}
href="{{ url }}">
<span>
{{ title }}
<span class="cms-icon cms-icon-arrow"></span>
</span>
</a>
{% if items %}
<ul>
{% for item in items %}{{ item.render }}{% endfor %}
</ul>
{% endif %}
<a
{% if disabled %}tabindex="-1" {% endif %}
href="{{ url }}">
<span>
{{ title }}
<span class="cms-icon cms-icon-arrow"></span>
</span>
</a>
{% if items %}
<ul>
{% for item in items %}{{ item.render }}{% endfor %}
</ul>
{% endif %}
</li>

View file

@ -5,15 +5,15 @@
{% if content %}
{{ content }}{% elif render_model_icon %}
<img src="{% static 'cms/img/toolbar/render_model_placeholder.png' %}">
{% elif render_model_add %}
<img src="{% static 'cms/img/toolbar/render_model_placeholder.png' %}">
{% else %}
{{ rendered_content }}
{% endif %}
{% spaceless %}
<template class="cms-plugin cms-plugin-end cms-plugin-{% if generic %}{{ generic.app_label }}-{{ generic.model_name }}-{% if attribute_name %}{{ attribute_name|slugify }}-{% endif %}{% endif %}{{ instance.pk|unlocalize }}{% if render_model_icon %} cms-render-model-icon{% elif render_model %} cms-render-model{% elif render_model_block %} cms-render-model cms-render-model-block{% elif render_model_add %} cms-render-model-add{% endif %}"></template>
{% addtoblock "js" %}
<script{% if generic %}data-cms-generic{% endif %} data-cms>
{% elif render_model_add %}
<img src="{% static 'cms/img/toolbar/render_model_placeholder.png' %}">
{% else %}
{{ rendered_content }}
{% endif %}
{% spaceless %}
<template class="cms-plugin cms-plugin-end cms-plugin-{% if generic %}{{ generic.app_label }}-{{ generic.model_name }}-{% if attribute_name %}{{ attribute_name|slugify }}-{% endif %}{% endif %}{{ instance.pk|unlocalize }}{% if render_model_icon %} cms-render-model-icon{% elif render_model %} cms-render-model{% elif render_model_block %} cms-render-model cms-render-model-block{% elif render_model_add %} cms-render-model-add{% endif %}"></template>
{% addtoblock "js" %}
<script{% if generic %}data-cms-generic{% endif %} data-cms>
CMS._plugins.push(['cms-plugin-{% if generic %}{{ generic.app_label }}-{{ generic.model_name }}-{% if attribute_name %}{{ attribute_name|slugify }}-{% endif %}{% endif %}{{ instance.pk|unlocalize }}', {
type: {% if generic %}'generic'{% else %}'plugin'{% endif %},
placeholder_id: '{{ instance.placeholder_id|unlocalize }}',
@ -39,6 +39,6 @@ CMS._plugins.push(['cms-plugin-{% if generic %}{{ generic.app_label }}-{{ generi
copy_plugin: '{% if copy_url %}{{ copy_url }}{% else %}{% cms_admin_url "cms_page_copy_plugins" %}{% endif %}'
} {% endlanguage %}
}]);
</script>
{% endaddtoblock %}
{% endspaceless %}
</script>
{% endaddtoblock %}
{% endspaceless %}

View file

@ -3,7 +3,7 @@
class="cms cms-reset {% if not user.is_authenticated %}cms-toolbar-auth{% endif %} {% if debug %}cms-toolbar-debug{% endif %}"
dir="ltr"
data-touch-action="none">
{% block toolbar_top %}{% endblock toolbar_top %}
{% block toolbar_top %}{% endblock toolbar_top %}
{# start: toolbar #}
<div class="cms-toolbar">
<div class="cms-debug-bar"></div>
@ -36,4 +36,4 @@
</div>
{# end: toolbar #}
{% block toolbar_bottom %}{% endblock toolbar_bottom %}
</div>
</div>

View file

@ -39,68 +39,70 @@
{% endspaceless %}
</div>
{% if cms_toolbar.edit_mode_active %}
{% include 'cms/toolbar/clipboard.html' with clipboard_plugin=cms_toolbar.clipboard_plugin %}{% endif %}
<div class="cms-modal" tabindex="-1" data-touch-action="none">
<div class="cms-modal-head" data-touch-action="none">
<span class="cms-modal-title" data-touch-action="none">
<span class="cms-modal-title-prefix"></span>
<span class="cms-modal-title-suffix"></span>
</span>
<span tabindex="0"
class="cms-modal-minimize cms-icon cms-icon-minus"
title="{% trans 'Minimize' %}"></span>
<span tabindex="0"
class="cms-modal-maximize cms-icon cms-icon-window"
title="{% trans 'Maximize' %}"></span>
<span tabindex="0" class="cms-modal-close cms-icon cms-icon-close" title="{% trans 'Close' %}"></span>
</div>
<div class="cms-modal-breadcrumb" data-touch-action="pan-x"></div>
<div class="cms-modal-body">
<div class="cms-modal-shim"></div>
<div class="cms-modal-frame"></div>
</div>
<div class="cms-modal-foot">
<div class="cms-modal-buttons"></div>
<div class="cms-modal-resize">
<span class="cms-icon cms-icon-handler"></span>
</div>
{% include 'cms/toolbar/clipboard.html' with clipboard_plugin=cms_toolbar.clipboard_plugin %}
{% endif %}
<div class="cms-modal" tabindex="-1" data-touch-action="none">
<div class="cms-modal-head" data-touch-action="none">
<span class="cms-modal-title" data-touch-action="none">
<span class="cms-modal-title-prefix"></span>
<span class="cms-modal-title-suffix"></span>
</span>
<span tabindex="0"
class="cms-modal-minimize cms-icon cms-icon-minus"
title="{% trans 'Minimize' %}"></span>
<span tabindex="0"
class="cms-modal-maximize cms-icon cms-icon-window"
title="{% trans 'Maximize' %}"></span>
<span tabindex="0" class="cms-modal-close cms-icon cms-icon-close" title="{% trans 'Close' %}"></span>
</div>
<div class="cms-modal-breadcrumb" data-touch-action="pan-x"></div>
<div class="cms-modal-body">
<div class="cms-modal-shim"></div>
<div class="cms-modal-frame"></div>
</div>
<div class="cms-modal-foot">
<div class="cms-modal-buttons"></div>
<div class="cms-modal-resize">
<span class="cms-icon cms-icon-handler"></span>
</div>
</div>
{# start: structure #}
<div class="cms-structure">
<div class="cms-structure-content" data-touch-action="pan-y">
{% if cms_renderer.load_structure %}
{% for placeholder in cms_renderer.get_rendered_editable_placeholders %}
<div class="cms-dragarea cms-dragarea-{{ placeholder.pk|unlocalize }}{% if placeholder.is_static %}cms-dragarea-static{% endif %}">
</div>
{# start: structure #}
<div class="cms-structure">
<div class="cms-structure-content" data-touch-action="pan-y">
{% if cms_renderer.load_structure %}
{% for placeholder in cms_renderer.get_rendered_editable_placeholders %}
<div class="cms-dragarea cms-dragarea-{{ placeholder.pk|unlocalize }}{% if placeholder.is_static %}cms-dragarea-static{% endif %}">
{% include cms_toolbar.templates.dragbar_template with placeholder=placeholder %}
<div class="cms-draggables cms-draggables-root">
<div class="cms-draggables-empty">
{% trans "Drop a plugin here" %}
</div>
{% for plugin in placeholder.get_cached_plugins %}
{% include cms_toolbar.templates.drag_item_template with plugin=plugin %}{% endfor %}
</div>
{% include cms_toolbar.templates.drag_item_template with plugin=plugin %}
{% endfor %}
</div>
{% endfor %}
{% endif %}
</div>
{% endfor %}
{% endif %}
</div>
</div>
{# end: structure #}
{% if cms_toolbar.redirect_url %}
<div class="cms-screenblock">
<div class="cms-screenblock-inner">
<h1>{% trans "This page has no preview!" %}</h1>
<p>
{% trans "It is being redirected to:" %}
<a href="{{ cms_toolbar.redirect_url }}">
{{ cms_toolbar.redirect_url }}
</a>
</p>
</div>
</div>
{# end: structure #}
{% if cms_toolbar.redirect_url %}
<div class="cms-screenblock">
<div class="cms-screenblock-inner">
<h1>{% trans "This page has no preview!" %}</h1>
<p>
{% trans "It is being redirected to:" %}
<a href="{{ cms_toolbar.redirect_url }}">
{{ cms_toolbar.redirect_url }}
</a>
</p>
</div>
</div>
{% endif %}
<script type="text/javascript" data-cms>
{% endif %}
<script type="text/javascript" data-cms>
var CMS = CMS || {};
CMS._plugins = CMS._plugins || [];
</script>
{% endblock toolbar_bottom %}
</script>
{% endblock toolbar_bottom %}

View file

@ -5,28 +5,28 @@
<fieldset class="module aligned">
{% for field in form.visible_fields %}
<div class="form-row {{ field.name }}{% if field.errors %}errors{% endif %}">
{% if field.errors %}
<ul class="errorlist">
{% for error in field.errors %}
<li>
{{ error }}
</li>
{% endfor %}
</ul>
{% endif %}
<div>
<label
{% if field.field.required %}class="required" {% endif %}
for="{{ field.id_for_label }}">
{{ field.label }}
</label>
{{ field }}
{% if field.help_text %}
<p class="help">
{{ field.help_text }}
</p>
{% if field.errors %}
<ul class="errorlist">
{% for error in field.errors %}
<li>
{{ error }}
</li>
{% endfor %}
</ul>
{% endif %}
<div>
<label
{% if field.field.required %}class="required" {% endif %}
for="{{ field.id_for_label }}">
{{ field.label }}
</label>
{{ field }}
{% if field.help_text %}
<p class="help">
{{ field.help_text }}
</p>
{% endif %}
</div>
</div>
</div>
{% endfor %}
{% endfor %}
</fieldset>

View file

@ -1,11 +1,11 @@
{% for group, entries, index in widget.optgroups %}
{% for entry in entries %}
<label tabindex="0" class="choice{% if forloop.parentloop.first %}active{% endif %}">
<input type="radio" name="{{ entry.name }}" value="{{ entry.value }}"
{% if forloop.parentloop.first %}checked {% endif %}
>
<strong>{{ entry.label }}</strong>
<span class="info">{{ entry.attrs.description }}</span>
</label>
{% endfor %}
<input type="radio" name="{{ entry.name }}" value="{{ entry.value }}"
{% if forloop.parentloop.first %}checked {% endif %}
>
<strong>{{ entry.label }}</strong>
<span class="info">{{ entry.attrs.description }}</span>
</label>
{% endfor %}
{% endfor %}

View file

@ -15,18 +15,18 @@
<img src="{% static 'django_ledger/logo/django-ledger-logo.png' %}" alt=""/>
</div>
</div>
{#
{#
<h1 class="title">
#}
{# Hero title#}
{#
{#
</h1>
#}
{#
{#
<h2 class="subtitle">
#}
{# Hero subtitle#}
{#
{#
</h2>
#}
<form action="{% url 'django_ledger:login' %}" method="post">

View file

@ -14,56 +14,56 @@
<h3 class="is-size-4 has-text-weight-light">
Status:
<span class="{% if po_model.po_status == 'draft' %}has-text-danger{% elif po_model.po_status == 'approved' %}has-text-success{% endif %}">
{{ po_model.get_po_status_display }}
</span>
</h3>
<h3 class="is-size-4 has-text-weight-light">
Inventory Purchase:
{% if po_model.for_inventory %}
<span class="icon has-text-success">{% icon 'ant-design:check-circle-filled' 24 %}</span>
{% else %}
<span class="icon is-small has-text-danger">
{% icon 'maki:roadblock-11' 24 %}
{{ po_model.get_po_status_display }}
</span>
{% endif %}
</h3>
<h3 class="is-size-4 has-text-weight-light">
Fulfilled:
{% if po_model.fulfilled %}
<span class="icon has-text-success">{% icon 'ant-design:check-circle-filled' 24 %}</span>
{{ po_model.fulfillment_date | date }}
{% else %}
<span class="icon is-small has-text-danger">
{% icon 'maki:roadblock-11' 24 %}
</span>
{% endif %}
</h3>
</h3>
<h3 class="is-size-4 has-text-weight-light">
Inventory Purchase:
{% if po_model.for_inventory %}
<span class="icon has-text-success">{% icon 'ant-design:check-circle-filled' 24 %}</span>
{% else %}
<span class="icon is-small has-text-danger">
{% icon 'maki:roadblock-11' 24 %}
</span>
{% endif %}
</h3>
<h3 class="is-size-4 has-text-weight-light">
Fulfilled:
{% if po_model.fulfilled %}
<span class="icon has-text-success">{% icon 'ant-design:check-circle-filled' 24 %}</span>
{{ po_model.fulfillment_date | date }}
{% else %}
<span class="icon is-small has-text-danger">
{% icon 'maki:roadblock-11' 24 %}
</span>
{% endif %}
</h3>
</div>
<footer class="card-footer">
<a href="{% url 'django_ledger:po-update' entity_slug=entity_slug po_pk=po_model.uuid %}"
class="card-footer-item has-text-primary has-text-centered">
{% trans 'Update' %}
</a>
<a onclick="djLedger.toggleModal('{{ po_model.get_html_id }}')"
class="card-footer-item has-text-info has-text-centered">
{% trans 'Mark as Fulfilled' %}
</a>
<a href="{% url 'django_ledger:po-delete' entity_slug=entity_slug po_pk=po_model.uuid %}"
class="card-footer-item has-text-danger has-text-centered">
{% trans 'Delete' %}
</a>
</footer>
</div>
<footer class="card-footer">
<a href="{% url 'django_ledger:po-update' entity_slug=entity_slug po_pk=po_model.uuid %}"
class="card-footer-item has-text-primary has-text-centered">
{% trans 'Update' %}
</a>
<a onclick="djLedger.toggleModal('{{ po_model.get_html_id }}')"
class="card-footer-item has-text-info has-text-centered">
{% trans 'Mark as Fulfilled' %}
</a>
<a href="{% url 'django_ledger:po-delete' entity_slug=entity_slug po_pk=po_model.uuid %}"
class="card-footer-item has-text-danger has-text-centered">
{% trans 'Delete' %}
</a>
</footer>
{% endif %}
{% else %}
<div class="box has-text-centered">
<a href="{% url 'django_ledger:po-create' entity_slug=entity_slug %}">
<span class="icon is-large has-text-grey">
{% icon "ic:baseline-add-circle-outline" 48 %}
</span>
</a>
<h2 class="is-size-3 has-text-grey">
{% trans 'New PO' %}
</h2>
</div>
{% endif %}
{% else %}
<div class="box has-text-centered">
<a href="{% url 'django_ledger:po-create' entity_slug=entity_slug %}">
<span class="icon is-large has-text-grey">
{% icon "ic:baseline-add-circle-outline" 48 %}
</span>
</a>
<h2 class="is-size-3 has-text-grey">
{% trans 'New PO' %}
</h2>
</div>
{% endif %}

View file

@ -8,32 +8,32 @@
<div class="navbar-brand">
<a class="navbar-item" href="{% url 'django_ledger:home' %}">
<img src="{% static 'django_ledger/logo/django-ledger-logo_1.png' %}" height="28">
</a>
<a role="button"
class="navbar-burger burger"
aria-label="menu"
aria-expanded="false"
data-target="djl-navbar-menu">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div id="djl-navbar-menu" class="navbar-menu">
{% navigation_menu 'mobile' %}
<div class="navbar-end">
<div class="navbar-item">
<a href="{% url 'django_ledger:logout' %}" class="button is-small is-danger is-outlined">
{% trans 'Logout' %}
</a>
</div>
<div class="navbar-item">
{% feedback_button %}
</div>
<div class="navbar-item">
v{% current_version %}
</div>
</a>
<a role="button"
class="navbar-burger burger"
aria-label="menu"
aria-expanded="false"
data-target="djl-navbar-menu">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div id="djl-navbar-menu" class="navbar-menu">
{% navigation_menu 'mobile' %}
<div class="navbar-end">
<div class="navbar-item">
<a href="{% url 'django_ledger:logout' %}" class="button is-small is-danger is-outlined">
{% trans 'Logout' %}
</a>
</div>
<div class="navbar-item">
{% feedback_button %}
</div>
<div class="navbar-item">
v{% current_version %}
</div>
</div>
</div>
</nav>
</div>
</nav>

View file

@ -69,43 +69,43 @@
<td>{{ item.quantity }}</td>
<td>{{ item.unit_cost }}</td>
<td class="{% if item.is_cancelled %}djl-is-strikethrough{% endif %}">
{% currency_symbol %}{{ item.total_amount | currency_format }}
</td>
<td class="has-text-weight-bold {% if item.is_cancelled %}has-text-danger{% endif %}">
{% if item.po_item_status %}{{ item.get_po_item_status_display }}{% endif %}
</td>
{% currency_symbol %}{{ item.total_amount | currency_format }}
</td>
<td class="has-text-weight-bold {% if item.is_cancelled %}has-text-danger{% endif %}">
{% if item.po_item_status %}{{ item.get_po_item_status_display }}{% endif %}
</td>
<td>
{% if item.bill_model_id %}
<a class="is-small is-light button"
href="{% url 'django_ledger:bill-detail' entity_slug=view.kwargs.entity_slug bill_pk=item.bill_model_id %}">
View Bill
</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td>
{% if item.bill_model_id %}
<a class="is-small is-light button"
href="{% url 'django_ledger:bill-detail' entity_slug=view.kwargs.entity_slug bill_pk=item.bill_model_id %}">
View Bill
</a>
{% endif %}
Total PO Amount
</td>
<td class="has-text-weight-bold">
{% currency_symbol %}{{ total_amount_due | currency_format }}
</td>
<td></td>
<td></td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td>
Total PO Amount
</td>
<td class="has-text-weight-bold">
{% currency_symbol %}{{ total_amount_due | currency_format }}
</td>
<td></td>
<td></td>
</tr>
</tfoot>
</table>
</tfoot>
</table>
</div>
</div>
<div class=" column is-12">
{% include 'django_ledger/includes/card_markdown.html' with style='card_1' title='PO Notes' notes_html=po_model.notes_html %}
</div>
</div>
</div>
<div class=" column is-12">
{% include 'django_ledger/includes/card_markdown.html' with style='card_1' title='PO Notes' notes_html=po_model.notes_html %}
</div>
</div>
</div>
</div>
{% endblock %}
{% endblock %}

View file

@ -16,17 +16,17 @@
<td>{{ imported_tx.date_posted }}</td>
<td>{{ imported_tx.name }}</td>
<td class="{% if imported_tx.amount < 0 %}has-text-danger{% endif %} has-text-centered">
${{ imported_tx.amount }}
</td>
<td>{{ imported_tx.earnings_account }}</td>
<td>{{ imported_tx.tx }}</td>
<td class="has-text-centered">
<a href="" class="button is-small is-primary">
View
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
${{ imported_tx.amount }}
</td>
<td>{{ imported_tx.earnings_account }}</td>
<td>{{ imported_tx.tx }}</td>
<td class="has-text-centered">
<a href="" class="button is-small is-primary">
View
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View file

@ -28,26 +28,26 @@
<td>{{ txf.date_posted.value }}</td>
<td>{{ txf.name.value }}</td>
<td class="{% if txf.amount.value < 0 %}has-text-danger{% endif %}">
${{ txf.amount.value }}
</td>
<td>{{ txf.earnings_account }}</td>
<td>{{ txf.tx_import }}</td>
</tr>
{% endfor %}
</tbody>
</table>
${{ txf.amount.value }}
</td>
<td>{{ txf.earnings_account }}</td>
<td>{{ txf.tx_import }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="columns is-centered">
<div class="column is-4 has-text-centered">
<button class="button is-primary is-small is-fullwidth">
{% trans 'Save/Import' %}
</button>
</div>
<div class="column is-4 has-text-centered">
<a class="button is-info is-small is-fullwidth"
href="{% url 'django_ledger:bank-account-update' entity_slug=view.kwargs.entity_slug bank_account_pk=bank_account_model.uuid %}">
{% trans 'Bank Account' %}
</a>
</div>
<div class="column is-4 has-text-centered">
<button class="button is-primary is-small is-fullwidth">
{% trans 'Save/Import' %}
</button>
</div>
<div class="column is-4 has-text-centered">
<a class="button is-info is-small is-fullwidth"
href="{% url 'django_ledger:bank-account-update' entity_slug=view.kwargs.entity_slug bank_account_pk=bank_account_model.uuid %}">
{% trans 'Bank Account' %}
</a>
</div>
</div>
</form>

View file

@ -26,7 +26,7 @@
</div>
<div class="dropdown-menu" id="dropdown-menu-{{ vendor.uuid }}" role="menu">
<div class="dropdown-content">
{#
{#
<a href="" class="dropdown-item has-text-success">
View
</a>

View file

@ -26,13 +26,13 @@
<div class="column is-4">
<div class="card">
<div class="card-content">
{#
{#
<p class="subtitle has-text-grey has-text-right">
#}
{#
{#
<span class="icon">{% icon "bi:cash-stack" 16 %}</span>
#}
{# {% trans 'Unit' %}
{# {% trans 'Unit' %}
</p>
#}
<p class="title">

View file

@ -2,46 +2,47 @@
{% load static %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE|default:"en-gb" }}" class="{% block html_class %}no-js{% endblock %}">
<head>
<title>
{% block title %}{{ shop_name }} - {{ shop_tagline }}{% endblock %}
</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="created" content="{% now "jS M Y h:i" %}" />
<meta name="description" content="{% block description %}{% endblock %}" />
<meta name="viewport" content="{% block viewport %}width=device-width{% endblock %}" />
{% block favicon %}
<link rel="shortcut icon" href="{% static "oscar/favicon.ico" %}" />
{% endblock %}
{# Block where global CSS will go. #}
{% block styles %}{% endblock %}
{# Additional CSS - specific to certain pages #}
{% block extrastyles %}{% endblock %}
{% block extrahead %}{% endblock %}
{% block tracking %}
{# Default to using Google analytics #}
{% include "oscar/partials/google_analytics.html" %}{% endblock %}
<head>
<title>
{% block title %}{{ shop_name }} - {{ shop_tagline }}{% endblock %}
</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="created" content="{% now "jS M Y h:i" %}" />
<meta name="description" content="{% block description %}{% endblock %}" />
<meta name="viewport" content="{% block viewport %}width=device-width{% endblock %}" />
{% block favicon %}
<link rel="shortcut icon" href="{% static "oscar/favicon.ico" %}" />
{% endblock %}
{# Block where global CSS will go. #}
{% block styles %}{% endblock %}
{# Additional CSS - specific to certain pages #}
{% block extrastyles %}{% endblock %}
{% block extrahead %}{% endblock %}
{% block tracking %}
{# Default to using Google analytics #}
{% include "oscar/partials/google_analytics.html" %}
{% endblock %}
</head>
<body id="{% block body_id %}default{% endblock %}" class="{% block body_class %}default{% endblock %}">
{# Main content goes in this 'layout' block #}
{% block layout %}{% endblock %}
{# Scripts loaded from a CDN. #}
{% block cdn_scripts %}
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{% static "oscar/js/jquery/jquery.min.js" %}"><\/script>')
</script>
{% endblock %}
{# Local scripts #}
{% block scripts %}{% endblock %}
{# Additional JS scripts #}
{% block extrascripts %}{% endblock %}
{# Block for body onload functions #}
<script>
{# Main content goes in this 'layout' block #}
{% block layout %}{% endblock %}
{# Scripts loaded from a CDN. #}
{% block cdn_scripts %}
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{% static "oscar/js/jquery/jquery.min.js" %}"><\/script>')
</script>
{% endblock %}
{# Local scripts #}
{% block scripts %}{% endblock %}
{# Additional JS scripts #}
{% block extrascripts %}{% endblock %}
{# Block for body onload functions #}
<script>
$(function() {
{% block onbodyload %}{% endblock %}
});
</script>
{# Page meta-data - this is populated by the 'metadata' template context processor #}
</body>
</script>
{# Page meta-data - this is populated by the 'metadata' template context processor #}
</body>
</html>

View file

@ -22,12 +22,13 @@
{% endblock %}
{% block content %}
{# Use a partial template so that AJAX can be used to re-render basket #}
{% include 'oscar/basket/partials/basket_content.html' %}{% endblock content %}
{% block onbodyload %}
{{ block.super }}
{# We pass in the URL to send AJAX requests to #}
var options = {
'basketURL': '{% url 'basket:summary' %}'
};
oscar.basket.init(options);
{% endblock %}
{% include 'oscar/basket/partials/basket_content.html' %}
{% endblock content %}
{% block onbodyload %}
{{ block.super }}
{# We pass in the URL to send AJAX requests to #}
var options = {
'basketURL': '{% url 'basket:summary' %}'
};
oscar.basket.init(options);
{% endblock %}

View file

@ -42,236 +42,236 @@
{{ formset.management_form }}
{% for form in formset %}
{% with line=form.instance product=form.instance.product %}
{% purchase_info_for_line request line as session %}
<div class="basket-items">
<div class="row">
<div class="col-md-2">
{{ form.id }}
{% with image=product.primary_image %}
{% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
<a href="{{ product.get_absolute_url }}">
<img class="img-thumbnail w-auto mx-auto my-0"
src="{{ thumb.url }}"
alt="{{ product.get_title }}"/>
</a>
{% endwith %}
</div>
<div class="col-md-4">
<h3>
<a href="{{ product.get_absolute_url }}">
{{ line.description }}
</a>
</h3>
<p class="availability {{ session.availability.code }}">
{{ session.availability.message }}
</p>
</div>
<div class="col-md-3">
<div class="checkout-quantity">
<div class="input-group {% if form.errors %}error{% endif %}">
{% render_field form.quantity class+="form-control" %}
<div class="input-group-append">
<button class="btn btn-secondary"
type="submit"
data-loading-text="{% trans 'Updating...' %}">
{% trans "Update" %}
</button>
{% purchase_info_for_line request line as session %}
<div class="basket-items">
<div class="row">
<div class="col-md-2">
{{ form.id }}
{% with image=product.primary_image %}
{% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
<a href="{{ product.get_absolute_url }}">
<img class="img-thumbnail w-auto mx-auto my-0"
src="{{ thumb.url }}"
alt="{{ product.get_title }}"/>
</a>
{% endwith %}
</div>
<div class="col-md-4">
<h3>
<a href="{{ product.get_absolute_url }}">
{{ line.description }}
</a>
</h3>
<p class="availability {{ session.availability.code }}">
{{ session.availability.message }}
</p>
</div>
<div class="col-md-3">
<div class="checkout-quantity">
<div class="input-group {% if form.errors %}error{% endif %}">
{% render_field form.quantity class+="form-control" %}
<div class="input-group-append">
<button class="btn btn-secondary"
type="submit"
data-loading-text="{% trans 'Updating...' %}">
{% trans "Update" %}
</button>
</div>
</div>
</div>
<div class="basket-line-actions">
<a href="#" data-id="{{ forloop.counter0 }}" data-behaviours="remove">
{% trans "Remove" %}
</a>
{% if user.is_authenticated %}
|
<a href="#" data-id="{{ forloop.counter0 }}" data-behaviours="save">
{% trans "Save for later" %}
</a>
{% endif %}
<div style="display:none">
{{ form.save_for_later }}
{{ form.DELETE }}
</div>
{% for field_errors in form.errors.values %}
{% for error in field_errors %}
<span class="error-block">
<i class="fas fa-exclamation"></i>
{{ error }}
</span>
{% endfor %}
{% endfor %}
</div>
</div>
<div class="col-md-1">
{% if not line.unit_price_incl_tax and not line.unit_tax_excl_tax %}
<p class="text-right">
&mdash;
</p>
{% else %}
<p class="price_color text-right">
<span class="price-title d-md-none">{% trans "Price" %}:</span>
{% if line.is_tax_known %}
{{ line.unit_price_incl_tax|currency:line.price_currency }}
{% else %}
{{ line.unit_price_excl_tax|currency:line.price_currency }}
{% endif %}
</p>
{% endif %}
</div>
<div class="col-md-2">
{% if not line.line_price_incl_tax and not line_price_excl_tax %}
<p class="text-right">
&mdash;
</p>
{% else %}
<p class="price_color text-right">
<span class="price-title d-md-none">{% trans "Total" %}:</span>
{% if line.is_tax_known %}
{{ line.line_price_incl_tax|currency:line.price_currency }}
{% else %}
{{ line.line_price_excl_tax|currency:line.price_currency }}
{% endif %}
</p>
{% endif %}
</div>
</div>
</div>
<div class="basket-line-actions">
<a href="#" data-id="{{ forloop.counter0 }}" data-behaviours="remove">
{% trans "Remove" %}
{% endwith %}
{% endfor %}
</form>
{% endblock %}
<div class="row">
{% block vouchers %}
{# Hide the entire section if a custom BasketView doesn't pass in a voucher form #}
{% if voucher_form %}
<div class="col-sm-6">
<div class="sub-header">
<h2>{% trans "Voucher/promo code" %}</h2>
</div>
<p id="voucher_form_link">
<a href="#voucher" class="btn btn-secondary btn-full">
{% trans "I have a voucher code..." %}
</a>
{% if user.is_authenticated %}
|
<a href="#" data-id="{{ forloop.counter0 }}" data-behaviours="save">
{% trans "Save for later" %}
</p>
<div id="voucher_form_container" style="display:none">
<form id="voucher_form" action="{% url 'basket:vouchers-add' %}" method="post">
{% csrf_token %}
{% include "oscar/partials/form_fields.html" with form=voucher_form %}
<button type="submit" class="btn btn-info" data-loading-text="{% trans 'Adding...' %}">
{% trans "Add voucher" %}
</button>
{% trans "or" %}
<a href="#" id="voucher_form_cancel">
{% trans "cancel" %}
</a>
{% endif %}
<div style="display:none">
{{ form.save_for_later }}
{{ form.DELETE }}
</div>
{% for field_errors in form.errors.values %}
{% for error in field_errors %}
<span class="error-block">
<i class="fas fa-exclamation"></i>
{{ error }}
</span>
{% endfor %}
{% endfor %}
</form>
</div>
</div>
<div class="col-md-1">
{% if not line.unit_price_incl_tax and not line.unit_tax_excl_tax %}
<p class="text-right">
&mdash;
</p>
{% else %}
<p class="price_color text-right">
<span class="price-title d-md-none">{% trans "Price" %}:</span>
{% if line.is_tax_known %}
{{ line.unit_price_incl_tax|currency:line.price_currency }}
{% else %}
{{ line.unit_price_excl_tax|currency:line.price_currency }}
{% endif %}
</p>
{% endif %}
{% endif %}
{% endblock vouchers %}
{% block baskettotals %}
<div class="col-sm-6">
<div class="sub-header">
<h2>{% trans "Totals" %}</h2>
</div>
<div class="col-md-2">
{% if not line.line_price_incl_tax and not line_price_excl_tax %}
<p class="text-right">
&mdash;
</p>
{% else %}
<p class="price_color text-right">
<span class="price-title d-md-none">{% trans "Total" %}:</span>
{% if line.is_tax_known %}
{{ line.line_price_incl_tax|currency:line.price_currency }}
{% else %}
{{ line.line_price_excl_tax|currency:line.price_currency }}
{% endif %}
</p>
{% endif %}
{% include 'oscar/basket/partials/basket_totals.html' with editable=1 %}
</div>
{% endblock baskettotals %}
</div>
{% block formactions %}
<div class="form-group clearfix">
<div class="row">
<div class="col-sm-4 offset-sm-8">
<a href="{% url 'checkout:index' %}" class="btn btn-lg btn-primary btn-block">
{% trans "Proceed to checkout" %}
</a>
</div>
</div>
</div>
{% endwith %}
{% endfor %}
</form>
{% endblock %}
<div class="row">
{% block vouchers %}
{# Hide the entire section if a custom BasketView doesn't pass in a voucher form #}
{% if voucher_form %}
<div class="col-sm-6">
<div class="sub-header">
<h2>{% trans "Voucher/promo code" %}</h2>
</div>
<p id="voucher_form_link">
<a href="#voucher" class="btn btn-secondary btn-full">
{% trans "I have a voucher code..." %}
</a>
</p>
<div id="voucher_form_container" style="display:none">
<form id="voucher_form" action="{% url 'basket:vouchers-add' %}" method="post">
{% csrf_token %}
{% include "oscar/partials/form_fields.html" with form=voucher_form %}
<button type="submit" class="btn btn-info" data-loading-text="{% trans 'Adding...' %}">
{% trans "Add voucher" %}
</button>
{% trans "or" %}
<a href="#" id="voucher_form_cancel">
{% trans "cancel" %}
</a>
</form>
</div>
</div>
{% endif %}
{% endblock vouchers %}
{% block baskettotals %}
<div class="col-sm-6">
<div class="sub-header">
<h2>{% trans "Totals" %}</h2>
</div>
{% include 'oscar/basket/partials/basket_totals.html' with editable=1 %}
</div>
{% endblock baskettotals %}
</div>
{% block formactions %}
<div class="form-group clearfix">
<div class="row">
<div class="col-sm-4 offset-sm-8">
<a href="{% url 'checkout:index' %}" class="btn btn-lg btn-primary btn-block">
{% trans "Proceed to checkout" %}
</a>
</div>
</div>
</div>
{% endblock formactions %}
{% endblock formactions %}
{% else %}
{% block emptybasket %}
<p>
{% trans "Your basket is empty." %}
<a href="{{ homepage_url }}">{% trans "Continue shopping" %}</a>
</p>
{% endblock %}
{% block emptybasket %}
<p>
{% trans "Your basket is empty." %}
<a href="{{ homepage_url }}">{% trans "Continue shopping" %}</a>
</p>
{% endblock %}
{% endif %}
{% block savedbasket %}
{% if user.is_authenticated and saved_formset %}
<div class="card card-body">
<div class="sub-header">
<h2>{% trans "Items to buy later" %}</h2>
</div>
<div class="row basket-title d-none d-md-flex">
<div class="col-md-8 h4">
{% trans "Items" %}
</div>
<div class="col-md-2 h4 text-center">
{% trans "Price" %}
</div>
<div class="col-md-2">
&nbsp;
</div>
</div>
<form action="{% url 'basket:saved' %}" method="post" id="saved_basket_formset">
{% csrf_token %}
{{ saved_formset.management_form }}
{% for form in saved_formset %}
{% purchase_info_for_product request form.instance.product as session %}
<div class="basket-items">
<div class="row">
<div class="col-md-2">
{{ form.id }}
{% with image=form.instance.product.primary_image %}
{% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
<a href="{{ form.instance.product.get_absolute_url }}">
<img class="card card-body mx-auto"
src="{{ thumb.url }}"
alt="{{ form.instance.product.get_title }}">
</a>
{% endwith %}
{% if user.is_authenticated and saved_formset %}
<div class="card card-body">
<div class="sub-header">
<h2>{% trans "Items to buy later" %}</h2>
</div>
<div class="row basket-title d-none d-md-flex">
<div class="col-md-8 h4">
{% trans "Items" %}
</div>
<div class="col-md-6">
<h3>
<a href="{{ form.instance.product.get_absolute_url }}">
{{ form.instance.description }}
</a>
</h3>
<p class="availability {{ session.availability.code }}">
{{ session.availability.message }}
</p>
<a href="#" data-id="{{ forloop.counter0 }}" data-behaviours="remove">
{% trans "Remove" %}
</a>
<div style="display:none">
{{ form.move_to_basket }}
{{ form.DELETE }}
</div>
</div>
{% purchase_info_for_product request form.instance.product as saved %}
<div class="col-md-2 text-center">
<p class="price_color">
{% if saved.price.is_tax_known %}
{{ saved.price.incl_tax|currency:saved.price.currency }}
{% else %}
{{ saved.price.excl_tax|currency:saved.price.currency }}
{% endif %}
</p>
<div class="col-md-2 h4 text-center">
{% trans "Price" %}
</div>
<div class="col-md-2">
<a href="#"
data-id="{{ forloop.counter0 }}"
class="btn float-right btn-block"
data-behaviours="move">
{% trans "Move to basket" %}
</a>
&nbsp;
</div>
</div>
<form action="{% url 'basket:saved' %}" method="post" id="saved_basket_formset">
{% csrf_token %}
{{ saved_formset.management_form }}
{% for form in saved_formset %}
{% purchase_info_for_product request form.instance.product as session %}
<div class="basket-items">
<div class="row">
<div class="col-md-2">
{{ form.id }}
{% with image=form.instance.product.primary_image %}
{% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
<a href="{{ form.instance.product.get_absolute_url }}">
<img class="card card-body mx-auto"
src="{{ thumb.url }}"
alt="{{ form.instance.product.get_title }}">
</a>
{% endwith %}
</div>
<div class="col-md-6">
<h3>
<a href="{{ form.instance.product.get_absolute_url }}">
{{ form.instance.description }}
</a>
</h3>
<p class="availability {{ session.availability.code }}">
{{ session.availability.message }}
</p>
<a href="#" data-id="{{ forloop.counter0 }}" data-behaviours="remove">
{% trans "Remove" %}
</a>
<div style="display:none">
{{ form.move_to_basket }}
{{ form.DELETE }}
</div>
</div>
{% purchase_info_for_product request form.instance.product as saved %}
<div class="col-md-2 text-center">
<p class="price_color">
{% if saved.price.is_tax_known %}
{{ saved.price.incl_tax|currency:saved.price.currency }}
{% else %}
{{ saved.price.excl_tax|currency:saved.price.currency }}
{% endif %}
</p>
</div>
<div class="col-md-2">
<a href="#"
data-id="{{ forloop.counter0 }}"
class="btn float-right btn-block"
data-behaviours="move">
{% trans "Move to basket" %}
</a>
</div>
</div>
</div>
{% endfor %}
</form>
</div>
{% endfor %}
</form>
</div>
{% endif %}
{% endif %}
{% endblock %}

View file

@ -11,11 +11,11 @@
<div class="col-sm-3">
<div class="image_container w-100">
{% with image=line.product.primary_image %}
{% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
<a href="{{ line.product.get_absolute_url }}">
<img src="{{ thumb.url }}"
alt="{{ line.product.get_title }}"
class="img-thumbnail w-auto mx-auto my-0">
{% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
<a href="{{ line.product.get_absolute_url }}">
<img src="{{ thumb.url }}"
alt="{{ line.product.get_title }}"
class="img-thumbnail w-auto mx-auto my-0">
</a>
{% endwith %}
</div>

View file

@ -12,280 +12,280 @@
</tr>
{% endblock %}
{% with offer_discounts=basket.offer_discounts voucher_discounts=basket.grouped_voucher_discounts %}
{% block discount_totals %}
{% if offer_discounts or voucher_discounts %}
{# Basket total will be discounted so we show a before and after version #}
<tr>
<td>{% trans "Basket total (before discounts)" %}</td>
<td class="text-right">
{% if basket.is_tax_known and not show_tax_separately %}
{{ basket.total_incl_tax_excl_discounts|currency:basket.currency }}
{% else %}
{{ basket.total_excl_tax_excl_discounts|currency:basket.currency }}
{% endif %}
</td>
</tr>
{% for discount in offer_discounts %}
{% block discount_totals %}
{% if offer_discounts or voucher_discounts %}
{# Basket total will be discounted so we show a before and after version #}
<tr>
<td class="basket-discount">
<span class="badge badge-success">{% trans "Discount" %}</span>
{{ discount.name }}
{% if discount.description %}
<br/>
<small>
{{ discount.description }}
</small>
<td>{% trans "Basket total (before discounts)" %}</td>
<td class="text-right">
{% if basket.is_tax_known and not show_tax_separately %}
{{ basket.total_incl_tax_excl_discounts|currency:basket.currency }}
{% else %}
{{ basket.total_excl_tax_excl_discounts|currency:basket.currency }}
{% endif %}
</td>
<td class="text-right">-{{ discount.discount|currency:basket.currency }}</td>
</tr>
{% endfor %}
{% if voucher_discounts %}
<tr>
<th colspan="2">
<h3>{% trans "Vouchers" %}</h3>
</th>
</tr>
{% for discount in voucher_discounts %}
{% for discount in offer_discounts %}
<tr>
<td>
{{ discount.voucher.name }} ({{ discount.voucher.code }})
{% if editable %}
<form action="{% url 'basket:vouchers-remove' pk=discount.voucher.id %}"
method="POST">
{% csrf_token %}
<input type="submit"
value="{% trans 'Remove' %}"
class="btn btn-sm btn-danger"/>
</form>
<td class="basket-discount">
<span class="badge badge-success">{% trans "Discount" %}</span>
{{ discount.name }}
{% if discount.description %}
<br/>
<small>
{{ discount.description }}
</small>
{% endif %}
</td>
<td class="text-right">-{{ discount.discount|currency:basket.currency }}</td>
</tr>
{% endfor %}
{% if voucher_discounts %}
<tr>
<th colspan="2">
<h3>{% trans "Vouchers" %}</h3>
</th>
</tr>
{% for discount in voucher_discounts %}
<tr>
<td>
{{ discount.voucher.name }} ({{ discount.voucher.code }})
{% if editable %}
<form action="{% url 'basket:vouchers-remove' pk=discount.voucher.id %}"
method="POST">
{% csrf_token %}
<input type="submit"
value="{% trans 'Remove' %}"
class="btn btn-sm btn-danger"/>
</form>
{% endif %}
</td>
<td class="text-right">-{{ discount.discount|currency:basket.currency }}</td>
</tr>
{% endfor %}
{% endif %}
{% endif %}
{% endif %}
{% endblock %}
{% block basket_total %}
{% if offer_discounts or voucher_discounts %}
<tr>
<th class="total">{% trans "Basket total (after discounts)" %}</th>
<th class="total text-right">
{% if not show_tax_separately and basket.is_tax_known %}
{{ basket.total_incl_tax|currency:basket.currency }}
{% else %}
{{ basket.total_excl_tax|currency:basket.currency }}
{% endif %}
</th>
</tr>
{% else %}
{# No discounts to basket #}
<tr>
<th class="total">{% trans "Basket total" %}</th>
<th class="total text-right">
{% if not show_tax_separately and basket.is_tax_known %}
{{ basket.total_incl_tax|currency:basket.currency }}
{% else %}
{{ basket.total_excl_tax|currency:basket.currency }}
{% endif %}
</th>
</tr>
{% endif %}
{% endblock %}
{% endwith %}
{% block shipping_totals %}
<tr>
<th>&nbsp;</th>
<td></td>
</tr>
<tr>
<th colspan="2">
<h3>{% trans "Shipping" %}</h3>
{% if shipping_methods|length > 1 and editable %}
<small>
{% trans "Alternative shipping methods can be chosen during checkout" %}
</small>
{% endblock %}
{% block basket_total %}
{% if offer_discounts or voucher_discounts %}
<tr>
<th class="total">{% trans "Basket total (after discounts)" %}</th>
<th class="total text-right">
{% if not show_tax_separately and basket.is_tax_known %}
{{ basket.total_incl_tax|currency:basket.currency }}
{% else %}
{{ basket.total_excl_tax|currency:basket.currency }}
{% endif %}
</th>
</tr>
{% else %}
{# No discounts to basket #}
<tr>
<th class="total">{% trans "Basket total" %}</th>
<th class="total text-right">
{% if not show_tax_separately and basket.is_tax_known %}
{{ basket.total_incl_tax|currency:basket.currency }}
{% else %}
{{ basket.total_excl_tax|currency:basket.currency }}
{% endif %}
</th>
</tr>
{% endif %}
</th>
</tr>
{% if not shipping_method.is_discounted %}
<tr>
<th class="total">{{ shipping_method.name }}</th>
<th class="total text-right">
{% if not show_tax_separately and shipping_charge.is_tax_known %}
{{ shipping_charge.incl_tax|currency:basket.currency }}
{% else %}
{{ shipping_charge.excl_tax|currency:basket.currency }}
{% endif %}
</th>
</tr>
{% else %}
{% shipping_charge_discount shipping_method basket as shipping_discount %}
{% shipping_charge_excl_discount shipping_method basket as shipping_charge_excl_discount %}
{# As shipping is discounted, we break it down into its original charge and a discount #}
<tr>
<th class="total">{% trans "Shipping method" %}</th>
<td class="total text-right">{{ shipping_method.name }}</td>
</tr>
<tr>
<td>{% trans "Shipping total (before discounts)" %}</td>
<td class="text-right">
{% if not show_tax_separately and shipping_charge_excl_discount.is_tax_known %}
{{ shipping_charge_excl_discount.incl_tax|currency:basket.currency }}
{% else %}
{{ shipping_charge_excl_discount.excl_tax|currency:basket.currency }}
{% endif %}
</td>
</tr>
{# This section needs adjustment to when taxes are shown separately #}
<tr>
<td class="basket-discount">
<span class="badge badge-success">{% trans "Discount" %}</span>
{{ shipping_method.discount_name }}
</td>
<td class="text-right">-{{ shipping_discount|currency:basket.currency }}</td>
</tr>
<tr>
<th class="total">
{% trans "Shipping total (after discounts)" %}
</th>
<th class="total text-right">
{% if not show_tax_separately and shipping_charge.is_tax_known %}
{{ shipping_charge.incl_tax|currency:basket.currency }}
{% else %}
{{ shipping_charge.excl_tax|currency:basket.currency }}
{% endif %}
</th>
</tr>
{% endif %}
{% endblock %}
{% block surcharges %}
{% if surcharges %}
{% endblock %}
{% endwith %}
{% block shipping_totals %}
<tr>
<th>&nbsp;</th>
<td></td>
</tr>
<tr>
<th colspan="2">
<h3>{% trans "Surcharges" %}</h3>
<h3>{% trans "Shipping" %}</h3>
{% if shipping_methods|length > 1 and editable %}
<small>
{% trans "Alternative shipping methods can be chosen during checkout" %}
</small>
{% endif %}
</th>
</tr>
{% for surcharge in surcharges %}
{% if not shipping_method.is_discounted %}
<tr>
<th class="total">
{{ surcharge.surcharge.name }}
</th>
<th class="total align-right">
{% if not show_tax_separately and surcharge.price.is_tax_known %}
{{ surcharge.price.incl_tax|currency:basket.currency }}
<th class="total">{{ shipping_method.name }}</th>
<th class="total text-right">
{% if not show_tax_separately and shipping_charge.is_tax_known %}
{{ shipping_charge.incl_tax|currency:basket.currency }}
{% else %}
{{ surcharge.price.excl_tax|currency:basket.currency }}
{{ shipping_charge.excl_tax|currency:basket.currency }}
{% endif %}
</th>
</tr>
{% endfor %}
{% endif %}
{% endblock %}
{% block tax_totals %}
{% if show_tax_separately %}
<tr>
<th>
&nbsp;
</th>
<td></td>
</tr>
<tr>
<th colspan="2">
<h3>
{% trans "Tax" %}
</h3>
</th>
</tr>
<tr>
<th class="total">
{% trans "Basket" %}
</th>
<th class="total text-right">
{{ basket.total_tax|currency:basket.currency }}
</th>
</tr>
<tr>
<th class="total">
{% trans "Shipping" %}
</th>
<th class="total text-right">
{{ shipping_charge.tax|currency:basket.currency }}
</th>
</tr>
{% endif %}
{% endblock %}
{% block post_order_action_totals %}
{% if basket.post_order_actions %}
<tr>
<th>
&nbsp;
</th>
<td></td>
</tr>
<tr>
<th>
<h3>
{% trans "Post order actions" %}
</h3>
<small>
{% trans "These will be applied once your order is placed." %}
</small>
</th>
<td></td>
</tr>
{% for discount in basket.post_order_actions %}
{% else %}
{% shipping_charge_discount shipping_method basket as shipping_discount %}
{% shipping_charge_excl_discount shipping_method basket as shipping_charge_excl_discount %}
{# As shipping is discounted, we break it down into its original charge and a discount #}
<tr>
<td class="total" colspan="2">
<span class="badge badge-success">
{{ discount.name }}
</span>
<br/>
<p>
{{ discount.description }}
</p>
<th class="total">{% trans "Shipping method" %}</th>
<td class="total text-right">{{ shipping_method.name }}</td>
</tr>
<tr>
<td>{% trans "Shipping total (before discounts)" %}</td>
<td class="text-right">
{% if not show_tax_separately and shipping_charge_excl_discount.is_tax_known %}
{{ shipping_charge_excl_discount.incl_tax|currency:basket.currency }}
{% else %}
{{ shipping_charge_excl_discount.excl_tax|currency:basket.currency }}
{% endif %}
</td>
</tr>
{% endfor %}
{% endif %}
{% endblock %}
{% block order_total %}
<tr>
<th>
&nbsp;
</th>
<td></td>
</tr>
<tr>
<th class="total">
<h3>
{% trans "Order total" %}
</h3>
</th>
<td class="total text-right">
<h3 class="price_color">
{% if order_total.is_tax_known %}
{{ order_total.incl_tax|currency:basket.currency }}
{% else %}
{{ order_total.excl_tax|currency:basket.currency }}
{% endif %}
</h3>
</td>
</tr>
{% if not order_total.is_tax_known %}
{# This section needs adjustment to when taxes are shown separately #}
<tr>
<td class="basket-discount">
<span class="badge badge-success">{% trans "Discount" %}</span>
{{ shipping_method.discount_name }}
</td>
<td class="text-right">-{{ shipping_discount|currency:basket.currency }}</td>
</tr>
<tr>
<th class="total">
{% trans "Shipping total (after discounts)" %}
</th>
<th class="total text-right">
{% if not show_tax_separately and shipping_charge.is_tax_known %}
{{ shipping_charge.incl_tax|currency:basket.currency }}
{% else %}
{{ shipping_charge.excl_tax|currency:basket.currency }}
{% endif %}
</th>
</tr>
{% endif %}
{% endblock %}
{% block surcharges %}
{% if surcharges %}
<tr>
<th>&nbsp;</th>
<td></td>
</tr>
<tr>
<th colspan="2">
<h3>{% trans "Surcharges" %}</h3>
</th>
</tr>
{% for surcharge in surcharges %}
<tr>
<th class="total">
{{ surcharge.surcharge.name }}
</th>
<th class="total align-right">
{% if not show_tax_separately and surcharge.price.is_tax_known %}
{{ surcharge.price.incl_tax|currency:basket.currency }}
{% else %}
{{ surcharge.price.excl_tax|currency:basket.currency }}
{% endif %}
</th>
</tr>
{% endfor %}
{% endif %}
{% endblock %}
{% block tax_totals %}
{% if show_tax_separately %}
<tr>
<th>
&nbsp;
</th>
<td></td>
</tr>
<tr>
<th colspan="2">
<h3>
{% trans "Tax" %}
</h3>
</th>
</tr>
<tr>
<th class="total">
{% trans "Basket" %}
</th>
<th class="total text-right">
{{ basket.total_tax|currency:basket.currency }}
</th>
</tr>
<tr>
<th class="total">
{% trans "Shipping" %}
</th>
<th class="total text-right">
{{ shipping_charge.tax|currency:basket.currency }}
</th>
</tr>
{% endif %}
{% endblock %}
{% block post_order_action_totals %}
{% if basket.post_order_actions %}
<tr>
<th>
&nbsp;
</th>
<td></td>
</tr>
<tr>
<th>
<h3>
{% trans "Post order actions" %}
</h3>
<small>
{% trans "These will be applied once your order is placed." %}
</small>
</th>
<td></td>
</tr>
{% for discount in basket.post_order_actions %}
<tr>
<td class="total" colspan="2">
<span class="badge badge-success">
{{ discount.name }}
</span>
<br/>
<p>
{{ discount.description }}
</p>
</td>
</tr>
{% endfor %}
{% endif %}
{% endblock %}
{% block order_total %}
<tr>
<td>
<small>
{% trans "Taxes will be added during checkout." %}
</small>
<th>
&nbsp;
</th>
<td></td>
</tr>
<tr>
<th class="total">
<h3>
{% trans "Order total" %}
</h3>
</th>
<td class="total text-right">
<h3 class="price_color">
{% if order_total.is_tax_known %}
{{ order_total.incl_tax|currency:basket.currency }}
{% else %}
{{ order_total.excl_tax|currency:basket.currency }}
{% endif %}
</h3>
</td>
</tr>
{% endif %}
{% endblock %}
</tbody>
</table>
{% if not order_total.is_tax_known %}
<tr>
<td>
<small>
{% trans "Taxes will be added during checkout." %}
</small>
</td>
</tr>
{% endif %}
{% endblock %}
</tbody>
</table>
</div>

View file

@ -53,81 +53,82 @@
<div class="side_categories card card-body bg-light">
{% for field, data in facet_data.items %}
{% if data.results %}
{% include 'oscar/search/partials/facet.html' with name=data.name items=data.results %}{% endif %}
{% endfor %}
</div>
{% endif %}
{% include 'oscar/search/partials/facet.html' with name=data.name items=data.results %}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% endblock %}
{% block content %}
<form method="get">
{# Render other search params as hidden inputs #}
{% for value in selected_facets %}
<input type="hidden" name="selected_facets" value="{{ value }}" />
{% endfor %}
<input type="hidden" name="q" value="{{ search_form.q.value|default_if_none:"" }}" />
{% if paginator.count %}
{% if paginator.num_pages > 1 %}
{% blocktrans with start=page_obj.start_index end=page_obj.end_index count num_results=paginator.count %}
<strong>{{ num_results }}</strong>
result - showing
<strong>{{ start }}</strong>
to
<strong>{{ end }}</strong>
.
{% plural %}
<strong>{{ num_results }}</strong>
results - showing
<strong>{{ start }}</strong>
to
<strong>{{ end }}</strong>
.
{% endblocktrans %}
{% else %}
{% blocktrans count num_results=paginator.count %}
<strong>{{ num_results }}</strong>
result.
{% plural %}
<strong>
{{ num_results }}
</strong>
results.
{% endblocktrans %}
{% endif %}
{% if form %}
<div class="float-right">
{% include "oscar/partials/form_field.html" with field=form.sort_by style='horizontal' %}
</div>
{% endif %}
<form method="get">
{# Render other search params as hidden inputs #}
{% for value in selected_facets %}
<input type="hidden" name="selected_facets" value="{{ value }}" />
{% endfor %}
<input type="hidden" name="q" value="{{ search_form.q.value|default_if_none:"" }}" />
{% if paginator.count %}
{% if paginator.num_pages > 1 %}
{% blocktrans with start=page_obj.start_index end=page_obj.end_index count num_results=paginator.count %}
<strong>{{ num_results }}</strong>
result - showing
<strong>{{ start }}</strong>
to
<strong>{{ end }}</strong>
.
{% plural %}
<strong>{{ num_results }}</strong>
results - showing
<strong>{{ start }}</strong>
to
<strong>{{ end }}</strong>
.
{% endblocktrans %}
{% else %}
<p>
{% trans "
{% blocktrans count num_results=paginator.count %}
<strong>{{ num_results }}</strong>
result.
{% plural %}
<strong>
0
{{ num_results }}
</strong>
results." %}
</p>
results.
{% endblocktrans %}
{% endif %}
</form>
{% if products %}
<section>
<div>
<ol class="row list-unstyled ml-0 pl-0">
{% for product in products %}
<li class="col-sm-6 col-md-4 col-lg-3">
{% render_product product %}
</li>
{% endfor %}
</ol>
{% include "oscar/partials/pagination.html" %}
{% if form %}
<div class="float-right">
{% include "oscar/partials/form_field.html" with field=form.sort_by style='horizontal' %}
</div>
</section>
{% endif %}
{% else %}
<p class="nonefound">
{% trans "No products found." %}
<p>
{% trans "
<strong>
0
</strong>
results." %}
</p>
{% endif %}
</form>
{% if products %}
<section>
<div>
<ol class="row list-unstyled ml-0 pl-0">
{% for product in products %}
<li class="col-sm-6 col-md-4 col-lg-3">
{% render_product product %}
</li>
{% endfor %}
</ol>
{% include "oscar/partials/pagination.html" %}
</div>
</section>
{% else %}
<p class="nonefound">
{% trans "No products found." %}
</p>
{% endif %}
{% endblock content %}
{% block onbodyload %}
{{ block.super }}
oscar.search.init();
{{ block.super }}
oscar.search.init();
{% endblock %}

View file

@ -15,28 +15,28 @@
<a href="{{ homepage_url }}">{% trans "Home" %}</a>
</li>
{% with category=product.get_categories.first %}
{% for c in category.get_ancestors_and_self %}
<li class="breadcrumb-item">
<a href="{{ c.get_absolute_url }}">
{{ c.name }}
</a>
{% for c in category.get_ancestors_and_self %}
<li class="breadcrumb-item">
<a href="{{ c.get_absolute_url }}">
{{ c.name }}
</a>
</li>
{% endfor %}
<li class="breadcrumb-item active" aria-current="page">
{{ product.get_title }}
</li>
{% endfor %}
<li class="breadcrumb-item active" aria-current="page">
{{ product.get_title }}
</li>
{% get_back_button as backbutton %}
{% if backbutton %}
<li class="float-right">
<a href="{{ backbutton.url }}">
<i class="fas fa-arrow-left"></i>
{{ backbutton.title }}
</a>
</li>
{% endif %}
{% endwith %}
</ol>
</nav>
{% get_back_button as backbutton %}
{% if backbutton %}
<li class="float-right">
<a href="{{ backbutton.url }}">
<i class="fas fa-arrow-left"></i>
{{ backbutton.title }}
</a>
</li>
{% endif %}
{% endwith %}
</ol>
</nav>
{% endblock %}
{% block header %}{% endblock header %}
{% block content %}
@ -65,171 +65,174 @@
{% endif %}
<h1>{{ product.get_title }}</h1>
{% block product_stock_record %}
{% include "oscar/catalogue/partials/stock_record.html" with verbose=1 %}{% endblock %}
{% iffeature "reviews" %}
{% include "oscar/catalogue/reviews/partials/review_stars.html" %}{% endiffeature %}
<hr/>
{% if not product.is_parent %}
{% block product_basket_form %}
{% include "oscar/catalogue/partials/add_to_basket_form.html" %}{% endblock %}
{% else %}
{% block variants %}
<h2>{% trans 'Variants:' %}</h2>
{% for child in product.children.public %}
{% purchase_info_for_product request child as child_session %}
{% if child_session.availability.is_available_to_buy %}
<a href="{{ child.get_absolute_url }}">
{{ child.get_title }}
</a>
<br>
{% endif %}
{% endfor %}
{% endblock %}
{% endif %}
</div>
<!-- /col-sm-6 -->
{% endblock %}
</div>
<!-- /row -->
{% block product_description %}
{% if product.description %}
<div id="product_description" class="sub-header">
<h2>{% trans "Product Description" %}</h2>
</div>
<p>
{{ product.description|safe }}
</p>
{% endif %}
{% endblock %}
{% block product_info %}
<div class="sub-header">
<h2>{% trans "Product Information" %}</h2>
</div>
<table class="table table-striped">
{% if product.upc %}
<tr>
<th>{% trans "UPC" %}</th>
<td>{{ product.upc }}</td>
</tr>
{% endif %}
<tr>
<th>{% trans "Product Type" %}</th>
<td>{{ product.get_product_class.name }}</td>
</tr>
{% purchase_info_for_product request product as session %}
{% if session.price.exists %}
<tr>
<th>{% trans "Price (excl. tax)" %}</th>
<td>{{ session.price.excl_tax|currency:session.price.currency }}</td>
</tr>
{% if session.price.is_tax_known %}
<tr>
<th>
{% trans "Price (incl. tax)" %}
</th>
<td>
{{ session.price.incl_tax|currency:session.price.currency }}
</td>
</tr>
<tr>
<th>
{% trans "Tax" %}
</th>
<td>
{{ session.price.tax|currency:session.price.currency }}
</td>
</tr>
{% endif %}
<tr>
<th>
{% trans "Availability" %}
</th>
<td>
{{ session.availability.message }}
</td>
</tr>
{% endif %}
{% for av in product.get_attribute_values %}
<tr>
<th>
{{ av.attribute.name }}
</th>
<td>
{{ av.value_as_html }}
</td>
</tr>
{% endfor %}
{% iffeature "reviews" %}
<tr>
<th>
{% trans "Number of reviews" %}
</th>
<td>
{{ product.num_approved_reviews }}
</td>
</tr>
{% endiffeature %}
</table>
{% include "oscar/catalogue/partials/stock_record.html" with verbose=1 %}
{% endblock %}
{% iffeature "reviews" %}
{% block product_review %}
<section>
<div id="reviews" class="sub-header">
{% if product.num_approved_reviews > 3 %}
<a href="{% url 'catalogue:reviews-list' product_slug=product.slug product_pk=product.id %}"
class="btn float-right">
{% trans "See all reviews" %}
</a>
{% endif %}
<h2>
{% trans "Customer Reviews" %}
</h2>
</div>
{% if product.num_approved_reviews == 0 %}
<p>
{% if product|is_review_permitted:user %}
{% url 'catalogue:reviews-add' product_slug=product.slug product_pk=product.id as add_review_url %}
{% blocktrans %}
This product does not have any reviews yet -
<a href="{{ add_review_url }}#addreview">
be the first to write one
</a>
.
{% endblocktrans %}
{% else %}
{% trans "This product does not have any reviews yet" %}.
{% endif %}
</p>
{% else %}
<ol class="list-unstyled review-list">
{% for review in product.reviews.approved.all|slice:":3" %}
<li>
{% include 'oscar/catalogue/partials/review.html' %}
</li>
{% endfor %}
</ol>
{% endif %}
</section>
{% endblock product_review %}
{% include "oscar/catalogue/reviews/partials/review_stars.html" %}
{% endiffeature %}
{% with recommended_products=product.sorted_recommended_products|slice:":6" %}
{% if recommended_products %}
<div class="sub-header">
<h2>
{% trans "Recommended items" %}
</h2>
</div>
<ul class="row list-unstyled mx-0">
{% for product in recommended_products %}
<li class="col-sm-4 col-md-3 col-lg-3">
{% render_product product %}
<hr/>
{% if not product.is_parent %}
{% block product_basket_form %}
{% include "oscar/catalogue/partials/add_to_basket_form.html" %}
{% endblock %}
{% else %}
{% block variants %}
<h2>{% trans 'Variants:' %}</h2>
{% for child in product.children.public %}
{% purchase_info_for_product request child as child_session %}
{% if child_session.availability.is_available_to_buy %}
<a href="{{ child.get_absolute_url }}">
{{ child.get_title }}
</a>
<br>
{% endif %}
{% endfor %}
{% endblock %}
{% endif %}
</div>
<!-- /col-sm-6 -->
{% endblock %}
</div>
<!-- /row -->
{% block product_description %}
{% if product.description %}
<div id="product_description" class="sub-header">
<h2>{% trans "Product Description" %}</h2>
</div>
<p>
{{ product.description|safe }}
</p>
{% endif %}
{% endblock %}
{% block product_info %}
<div class="sub-header">
<h2>{% trans "Product Information" %}</h2>
</div>
<table class="table table-striped">
{% if product.upc %}
<tr>
<th>{% trans "UPC" %}</th>
<td>{{ product.upc }}</td>
</tr>
{% endif %}
<tr>
<th>{% trans "Product Type" %}</th>
<td>{{ product.get_product_class.name }}</td>
</tr>
{% purchase_info_for_product request product as session %}
{% if session.price.exists %}
<tr>
<th>{% trans "Price (excl. tax)" %}</th>
<td>{{ session.price.excl_tax|currency:session.price.currency }}</td>
</tr>
{% if session.price.is_tax_known %}
<tr>
<th>
{% trans "Price (incl. tax)" %}
</th>
<td>
{{ session.price.incl_tax|currency:session.price.currency }}
</td>
</tr>
<tr>
<th>
{% trans "Tax" %}
</th>
<td>
{{ session.price.tax|currency:session.price.currency }}
</td>
</tr>
{% endif %}
<tr>
<th>
{% trans "Availability" %}
</th>
<td>
{{ session.availability.message }}
</td>
</tr>
{% endif %}
{% for av in product.get_attribute_values %}
<tr>
<th>
{{ av.attribute.name }}
</th>
<td>
{{ av.value_as_html }}
</td>
</tr>
{% endfor %}
{% iffeature "reviews" %}
<tr>
<th>
{% trans "Number of reviews" %}
</th>
<td>
{{ product.num_approved_reviews }}
</td>
</tr>
{% endiffeature %}
</table>
{% endblock %}
{% iffeature "reviews" %}
{% block product_review %}
<section>
<div id="reviews" class="sub-header">
{% if product.num_approved_reviews > 3 %}
<a href="{% url 'catalogue:reviews-list' product_slug=product.slug product_pk=product.id %}"
class="btn float-right">
{% trans "See all reviews" %}
</a>
{% endif %}
<h2>
{% trans "Customer Reviews" %}
</h2>
</div>
{% if product.num_approved_reviews == 0 %}
<p>
{% if product|is_review_permitted:user %}
{% url 'catalogue:reviews-add' product_slug=product.slug product_pk=product.id as add_review_url %}
{% blocktrans %}
This product does not have any reviews yet -
<a href="{{ add_review_url }}#addreview">
be the first to write one
</a>
.
{% endblocktrans %}
{% else %}
{% trans "This product does not have any reviews yet" %}.
{% endif %}
</p>
{% else %}
<ol class="list-unstyled review-list">
{% for review in product.reviews.approved.all|slice:":3" %}
<li>
{% include 'oscar/catalogue/partials/review.html' %}
</li>
{% endfor %}
</ul>
</ol>
{% endif %}
{% endwith %}
{% recently_viewed_products current_product=product %}
</article>
<!-- End of product page -->
{% endblock content %}
{% block extrascripts %}{{ block.super }}{% endblock %}
</section>
{% endblock product_review %}
{% endiffeature %}
{% with recommended_products=product.sorted_recommended_products|slice:":6" %}
{% if recommended_products %}
<div class="sub-header">
<h2>
{% trans "Recommended items" %}
</h2>
</div>
<ul class="row list-unstyled mx-0">
{% for product in recommended_products %}
<li class="col-sm-4 col-md-3 col-lg-3">
{% render_product product %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
{% recently_viewed_products current_product=product %}
</article>
<!-- End of product page -->
{% endblock content %}
{% block extrascripts %}{{ block.super }}{% endblock %}

View file

@ -19,29 +19,29 @@
</button>
</form>
{% iffeature "wishlists" %}
{% include "oscar/catalogue/partials/add_to_wishlist.html" %}{% endiffeature %}
{% include "oscar/catalogue/partials/add_to_wishlist.html" %}
{% endiffeature %}
{% else %}
{% if has_active_alert %}
<p>
{% trans "You have an active stock alert for this product." %}
</p>
{% else %}
{% if has_active_alert %}
<form id="alert_form"
method="post"
action="{% url 'customer:alert-create' pk=product.id %}"
class="add-to-basket mb-0">
{% csrf_token %}
<p>
{% trans "You have an active stock alert for this product." %}
{% trans "You can get an email alert when this product is back in stock." %}
</p>
{% else %}
<form id="alert_form"
method="post"
action="{% url 'customer:alert-create' pk=product.id %}"
class="add-to-basket mb-0">
{% csrf_token %}
<p>
{% trans "You can get an email alert when this product is back in stock." %}
</p>
{% include "oscar/partials/form_fields.html" with form=alert_form %}
<button type="submit"
class="btn btn-lg btn-info w-100"
data-loading-text="{% trans 'Submitting...' %}">
{% trans "Notify me" %}
</button>
</form>
{% endif %}
{% iffeature "wishlists" %}
{% include "oscar/catalogue/partials/add_to_wishlist.html" %}{% endiffeature %}
{% endif %}
{% include "oscar/partials/form_fields.html" with form=alert_form %}
<button type="submit" class="btn btn-lg btn-info w-100" data-loading-text="{% trans 'Submitting...' %}">
{% trans "Notify me" %}
</button>
</form>
{% endif %}
{% iffeature "wishlists" %}
{% include "oscar/catalogue/partials/add_to_wishlist.html" %}
{% endiffeature %}
{% endif %}

View file

@ -2,68 +2,68 @@
{% load wishlist_tags %}
{% if user.is_authenticated %}
{% with wishlists=user.wishlists.all %}
{# Select wishlists that contains product #}
{% wishlists_containing_product wishlists product as product_wishlists %}
{% if wishlists %}
<div class="btn-group btn-wishlist align-bottom">
<a class="btn btn-lg dropdown-toggle" data-toggle="dropdown" href="#">
{% trans "Add to wish list" %}
</a>
<ul class="dropdown-menu dropdown-menu-right">
{% for wishlist in wishlists %}
{% if wishlist not in product_wishlists %}
<li>
<a href="{% url 'customer:wishlists-add-product' key=wishlist.key product_pk=product.pk %}"
class="dropdown-item">
{% blocktrans with name=wishlist.name %}
Add to '{{ name }}' wish list
{% endblocktrans %}
</a>
</li>
{% endif %}
{% endfor %}
<li>
<a href="{% url 'customer:wishlists-create-with-product' product_pk=product.pk %}"
class="dropdown-item">
{% trans 'Create a new wishlist' %}
</a>
</li>
</ul>
</div>
{% else %}
{# 1 or no existing wishlists - show a simple button #}
<form id="add_to_wishlist_form"
action="{% url 'customer:wishlists-add-product' product_pk=product.pk %}"
method="post"
class="btn-wishlist align-bottom">
{% csrf_token %}
<button type="submit" class="btn btn-lg" data-loading-text="{% trans 'Adding...' %}">
{% trans "Add to wish list" %}
</button>
</form>
{% endif %}
{% for wishlist in product_wishlists %}
<form action="{% url 'customer:wishlists-remove-product' key=wishlist.key product_pk=product.id %}"
method="post">
{% csrf_token %}
{% blocktrans with name=wishlist.name url=wishlist.get_absolute_url %}
<span class="float-left">
Product is in
<a href="{{ url }}">'{{ name }}'</a>
wishlist.
</span>
{% endblocktrans %}
<button type="submit" class="btn btn-sm float-right" data-loading-text="{% trans 'Removing...' %}">
{% trans "Remove" %}
</button>
</form>
{% endfor %}
{% endwith %}
{# Select wishlists that contains product #}
{% wishlists_containing_product wishlists product as product_wishlists %}
{% if wishlists %}
<div class="btn-group btn-wishlist align-bottom">
<a class="btn btn-lg dropdown-toggle" data-toggle="dropdown" href="#">
{% trans "Add to wish list" %}
</a>
<ul class="dropdown-menu dropdown-menu-right">
{% for wishlist in wishlists %}
{% if wishlist not in product_wishlists %}
<li>
<a href="{% url 'customer:wishlists-add-product' key=wishlist.key product_pk=product.pk %}"
class="dropdown-item">
{% blocktrans with name=wishlist.name %}
Add to '{{ name }}' wish list
{% endblocktrans %}
</a>
</li>
{% endif %}
{% endfor %}
<li>
<a href="{% url 'customer:wishlists-create-with-product' product_pk=product.pk %}"
class="dropdown-item">
{% trans 'Create a new wishlist' %}
</a>
</li>
</ul>
</div>
{% else %}
{# 1 or no existing wishlists - show a simple button #}
<form id="add_to_wishlist_form"
action="{% url 'customer:wishlists-add-product' product_pk=product.pk %}"
method="post"
class="btn-wishlist align-bottom">
{% csrf_token %}
<button type="submit" class="btn btn-lg" data-loading-text="{% trans 'Adding...' %}">
{% trans "Add to wish list" %}
</button>
</form>
{% endif %}
{% for wishlist in product_wishlists %}
<form action="{% url 'customer:wishlists-remove-product' key=wishlist.key product_pk=product.id %}"
method="post">
{% csrf_token %}
{% blocktrans with name=wishlist.name url=wishlist.get_absolute_url %}
<span class="float-left">
Product is in
<a href="{{ url }}">'{{ name }}'</a>
wishlist.
</span>
{% endblocktrans %}
<button type="submit" class="btn btn-sm float-right" data-loading-text="{% trans 'Removing...' %}">
{% trans "Remove" %}
</button>
</form>
{% endfor %}
{% endwith %}
{% else %}
<button class="btn btn-lg btn-wishlist align-bottom"
disabled="disabled"
title="{% trans 'Please login to add products to a wish list.' %}">
{% trans 'Add to wish list' %}
</button>
<br/>
<button class="btn btn-lg btn-wishlist align-bottom"
disabled="disabled"
title="{% trans 'Please login to add products to a wish list.' %}">
{% trans 'Add to wish list' %}
</button>
<br/>
{% endif %}

View file

@ -1,51 +1,51 @@
{% load i18n %}
{% load image_tags %}
{% with all_images=product.get_all_images %}
{# use length rather then count as the images get queried anyways #}
{% if all_images|length > 1 %}
<div id="product_gallery" class="carousel slide">
<div class="img-thumbnail mb-3">
<div class="carousel-inner">
{% for image in all_images %}
<div class="carousel-item {% if forloop.first %}active{% endif %}">
{% oscar_thumbnail image.original "440x400" upscale=False as thumb %}
<img src="{{ thumb.url }}" alt="{{ product.get_title }}" />
{# use length rather then count as the images get queried anyways #}
{% if all_images|length > 1 %}
<div id="product_gallery" class="carousel slide">
<div class="img-thumbnail mb-3">
<div class="carousel-inner">
{% for image in all_images %}
<div class="carousel-item {% if forloop.first %}active{% endif %}">
{% oscar_thumbnail image.original "440x400" upscale=False as thumb %}
<img src="{{ thumb.url }}" alt="{{ product.get_title }}" />
</div>
{% endfor %}
</div>
{% endfor %}
<a class="carousel-control-prev" href="#product_gallery" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">{% trans "Previous" %}</span>
</a>
<a class="carousel-control-next" href="#product_gallery" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">{% trans "Next" %}</span>
</a>
</div>
<ol class="carousel-indicators img-thumbnail">
{% for image in all_images %}
<li data-target="#product_gallery"
data-slide-to="{{ forloop.counter0 }}"
class="{% if forloop.first %}active{% endif %}">
{% oscar_thumbnail image.original "65x55" crop="center" as thumb %}
<img src="{{ thumb.url }}" alt="{{ product.get_title }}" />
</li>
{% endfor %}
</ol>
</div>
<a class="carousel-control-prev" href="#product_gallery" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">{% trans "Previous" %}</span>
</a>
<a class="carousel-control-next" href="#product_gallery" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">{% trans "Next" %}</span>
</a>
</div>
<ol class="carousel-indicators img-thumbnail">
{% for image in all_images %}
<li data-target="#product_gallery"
data-slide-to="{{ forloop.counter0 }}"
class="{% if forloop.first %}active{% endif %}">
{% oscar_thumbnail image.original "65x55" crop="center" as thumb %}
<img src="{{ thumb.url }}" alt="{{ product.get_title }}" />
</li>
{% endfor %}
</ol>
</div>
{% else %}
{# Only one image to show #}
<div id="product_gallery" class="carousel">
<div class="img-thumbnail">
<div class="carousel-inner">
<div class="carousel-item active">
{% with image=product.primary_image %}
{% oscar_thumbnail image.original "440x400" upscale=False as thumb %}
<img src="{{ thumb.url }}" alt="{{ product.get_title }}" />
{% endwith %}
</div>
</div>
</div>
</div>
{% endif %}
{% else %}
{# Only one image to show #}
<div id="product_gallery" class="carousel">
<div class="img-thumbnail">
<div class="carousel-inner">
<div class="carousel-item active">
{% with image=product.primary_image %}
{% oscar_thumbnail image.original "440x400" upscale=False as thumb %}
<img src="{{ thumb.url }}" alt="{{ product.get_title }}" />
{% endwith %}
</div>
</div>
</div>
</div>
{% endif %}
{% endwith %}

View file

@ -7,9 +7,11 @@
{% block product_image %}
<div class="image_container w-100">
{% with image=product.primary_image %}
{% oscar_thumbnail image.original "x155" upscale=False as thumb %}
<a href="{{ product.get_absolute_url }}">
<img src="{{ thumb.url }}" alt="{{ product.get_title }}" class="img-thumbnail w-auto mx-auto my-0">
{% oscar_thumbnail image.original "x155" upscale=False as thumb %}
<a href="{{ product.get_absolute_url }}">
<img src="{{ thumb.url }}"
alt="{{ product.get_title }}"
class="img-thumbnail w-auto mx-auto my-0">
</a>
{% endwith %}
</div>
@ -36,8 +38,9 @@
<div class="product_price w-100">
{% include "oscar/catalogue/partials/stock_record.html" %}
{% if not product.is_parent and not product.has_options %}
{% include "oscar/catalogue/partials/add_to_basket_form_compact.html" %}{% endif %}
</div>
{% endblock %}
</article>
{% endblock %}
{% include "oscar/catalogue/partials/add_to_basket_form_compact.html" %}
{% endif %}
</div>
{% endblock %}
</article>
{% endblock %}

View file

@ -10,36 +10,36 @@
<a href="{{ homepage_url }}">{% trans "Home" %}</a>
</li>
{% with category=product.categories.all.0 %}
{% for c in category.get_ancestors_and_self %}
{% for c in category.get_ancestors_and_self %}
<li class="breadcrumb-item">
<a href="{{ c.get_absolute_url }}">
{{ c.name }}
</a>
</li>
{% endfor %}
<li class="breadcrumb-item">
<a href="{{ c.get_absolute_url }}">
{{ c.name }}
<a href="{{ product.get_absolute_url }}">
{{ product.title }}
</a>
</li>
{% endfor %}
<li class="breadcrumb-item">
<a href="{{ product.get_absolute_url }}">
{{ product.title }}
</a>
<li class="breadcrumb-item">
<a href="{% url 'catalogue:reviews-list' product_slug=product.slug product_pk=product.pk %}">
{% trans "Reviews" %}
</a>
</li>
{% endwith %}
<li class="breadcrumb-item active" aria-current="page">
{{ review.title }}
</li>
<li class="breadcrumb-item">
<a href="{% url 'catalogue:reviews-list' product_slug=product.slug product_pk=product.pk %}">
{% trans "Reviews" %}
</a>
</li>
{% endwith %}
<li class="breadcrumb-item active" aria-current="page">
{{ review.title }}
</li>
</ol>
</nav>
</ol>
</nav>
{% endblock %}
{% block headertext %}
{% trans "Customer reviews" %}
{% trans "Customer reviews" %}
{% endblock %}
{% block content %}
<section>
{% include 'oscar/catalogue/reviews/review_product.html' %}
{% include 'oscar/catalogue/partials/review.html' %}
</section>
<section>
{% include 'oscar/catalogue/reviews/review_product.html' %}
{% include 'oscar/catalogue/partials/review.html' %}
</section>
{% endblock %}

View file

@ -10,41 +10,44 @@
{% csrf_token %}
{% include 'oscar/partials/form_field.html' with field=form.title %}
<div class="reviewrating form-group {% if form.score.errors %}error{% endif %}">
<label for="{{ form.score.auto_id }}" class="col-form-label required">
{{ form.score.label|safe }}
</label>
<div class="controls">
{{ form.score }}
<div class="star-rating {% if form.score.value == '1' %}One{% elif form.score.value == '2' %}Two{% elif form.score.value == '3' %}Three{% elif form.score.value == '4' %}Four{% elif form.score.value == '5' %}Five{% endif %}">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
</div>
{% for error in form.score.errors %}
<span class="error-block">
<i class="fas fa-exclamation"></i>
{{ error }}
</span>
{% endfor %}
<label for="{{ form.score.auto_id }}" class="col-form-label required">
{{ form.score.label|safe }}
</label>
<div class="controls">
{{ form.score }}
<div class="star-rating {% if form.score.value == '1' %}One{% elif form.score.value == '2' %}Two{% elif form.score.value == '3' %}Three{% elif form.score.value == '4' %}Four{% elif form.score.value == '5' %}Five{% endif %}">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
</div>
{% for error in form.score.errors %}
<span class="error-block">
<i class="fas fa-exclamation"></i>
{{ error }}
</span>
{% endfor %}
</div>
{% comment %}
{% include 'oscar/partials/form_field.html' with field=form.score %}
{% endcomment %}
</div>
{% comment %}
{% include 'oscar/partials/form_field.html' with field=form.score %}{% endcomment %}
</div>
{% include 'oscar/partials/form_field.html' with field=form.body %}
{% if form.name %}
{% include 'oscar/partials/form_field.html' with field=form.name %}{% endif %}
{% include 'oscar/partials/form_field.html' with field=form.body %}
{% if form.name %}
{% include 'oscar/partials/form_field.html' with field=form.name %}
{% endif %}
{% if form.email %}
{% include 'oscar/partials/form_field.html' with field=form.email %}{% endif %}
<button type="submit" class="btn btn-primary btn-lg" data-loading-text="{% trans 'Saving...' %}">
{% trans "Save review" %}
</button>
{% trans "or" %}
<a href="{{ product.get_absolute_url }}">
{% trans "cancel" %}
</a>
</fieldset>
</form>
</div>
{% include 'oscar/partials/form_field.html' with field=form.email %}
{% endif %}
<button type="submit" class="btn btn-primary btn-lg" data-loading-text="{% trans 'Saving...' %}">
{% trans "Save review" %}
</button>
{% trans "or" %}
<a href="{{ product.get_absolute_url }}">
{% trans "cancel" %}
</a>
</fieldset>
</form>
</div>
{% endblock %}

View file

@ -11,41 +11,42 @@
<a href="{{ homepage_url }}">{% trans "Home" %}</a>
</li>
{% with category=product.categories.all.0 %}
{% for c in category.get_ancestors_and_self %}
{% for c in category.get_ancestors_and_self %}
<li class="breadcrumb-item">
<a href="{{ c.get_absolute_url }}">
{{ c.name }}
</a>
</li>
{% endfor %}
<li class="breadcrumb-item">
<a href="{{ c.get_absolute_url }}">
{{ c.name }}
<a href="{{ product.get_absolute_url }}">
{{ product.title }}
</a>
</li>
{% endfor %}
<li class="breadcrumb-item">
<a href="{{ product.get_absolute_url }}">
{{ product.title }}
</a>
{% endwith %}
<li class="breadcrumb-item active" aria-current="page">
{% trans "All reviews" %}
</li>
{% endwith %}
<li class="breadcrumb-item active" aria-current="page">
{% trans "All reviews" %}
</li>
</ol>
</nav>
</ol>
</nav>
{% endblock %}
{% block headertext %}
{% trans "Customer reviews" %}
{% trans "Customer reviews" %}
{% endblock %}
{% block content %}
<section>
{% include 'oscar/catalogue/reviews/review_product.html' %}
{% if reviews %}
<form method="get" class="form-inline">
{% include "oscar/partials/form_fields_inline.html" with form=form %}
<button type="submit" class="btn btn-secondary">
{% trans "Go" %}
</button>
</form>
<hr>
{% for review in reviews %}
{% include 'oscar/catalogue/partials/review.html' %}{% endfor %}
<section>
{% include 'oscar/catalogue/reviews/review_product.html' %}
{% if reviews %}
<form method="get" class="form-inline">
{% include "oscar/partials/form_fields_inline.html" with form=form %}
<button type="submit" class="btn btn-secondary">
{% trans "Go" %}
</button>
</form>
<hr>
{% for review in reviews %}
{% include 'oscar/catalogue/partials/review.html' %}
{% endfor %}
{% include 'oscar/partials/pagination.html' %}
{% else %}
<p>

View file

@ -3,9 +3,9 @@
<div class="col-sm-2">
<div class="image_container w-100">
{% with image=product.primary_image %}
{% oscar_thumbnail image.original "x155" upscale=False as thumb %}
<a href="{{ product.get_absolute_url }}">
<img src="{{ thumb.url }}" alt="{{ product.get_title }}" class="img-thumbnail w-auto mx-auto my-0">
{% oscar_thumbnail image.original "x155" upscale=False as thumb %}
<a href="{{ product.get_absolute_url }}">
<img src="{{ thumb.url }}" alt="{{ product.get_title }}" class="img-thumbnail w-auto mx-auto my-0">
</a>
{% endwith %}
</div>

View file

@ -7,167 +7,168 @@
{% trans "Checkout" %} | {{ block.super }}
{% endblock %}
{% block checkout_nav %}
{% include 'oscar/checkout/nav.html' %}{% endblock %}
{% block content %}
{% if error %}
<div class="alert alert-danger">
{{ error }}
</div>
{% endif %}
<div class="row shipping-payment">
{% block shipping_address %}
<div class="col-sm-6">
<div class="sub-header">
<h2>{% trans "Shipping" %}</h2>
</div>
{% if shipping_address %}
<div class="card card-body bg-light">
<h3>
{% trans "Address" %}
{% block shipping_address_actions %}
<a href="{% url 'checkout:shipping-address' %}" class="float-right">
{% trans "Change" %}
</a>
{% endblock %}
</h3>
<address>
{% for field in shipping_address.active_address_fields %}
{{ field }}
<br/>
{% endfor %}
</address>
{% if shipping_address.phone_number %}
<h4>{% trans "Contact" %}</h4>
<p>
{% trans "Phone" %}: {{ shipping_address.phone_number }}
{% if guest_email %}
<br/>
{% trans "Email" %}: {{ guest_email }}
{% endif %}
</p>
{% endif %}
{% if shipping_address.notes %}
<h4>{% trans "Instructions" %}</h4>
<p>
{{ shipping_address.notes|linebreaks }}
</p>
{% endif %}
</div>
{% endif %}
{% if shipping_method %}
<div class="card card-body bg-light card card-body bg-light-info">
<h3>
{% trans "Shipping method" %}
{% block shipping_method_actions %}
<a href="{% url 'checkout:shipping-method' %}" class="float-right">
{% trans "Change" %}
</a>
{% endblock %}
</h3>
<p>
{{ shipping_method.name }}
{% if shipping_method.description %}- {{ shipping_method.description|safe }}{% endif %}
</p>
</div>
{% endif %}
{% include 'oscar/checkout/nav.html' %}
{% endblock %}
{% block content %}
{% if error %}
<div class="alert alert-danger">
{{ error }}
</div>
{% endif %}
<div class="row shipping-payment">
{% block shipping_address %}
<div class="col-sm-6">
<div class="sub-header">
<h2>{% trans "Shipping" %}</h2>
</div>
{% endblock shipping_address %}
{# You will almost certainly want to override this block to provide a payment summary #}
{% block payment_method %}
<div class="col-sm-6">
<div class="sub-header">
<h2>{% trans "Payment" %}</h2>
</div>
<div class="card card-body bg-light card card-body bg-light-success">
{% if shipping_address %}
<div class="card card-body bg-light">
<h3>
{% trans "Payment" %}
<a href="{% url 'checkout:payment-details' %}" class="float-right">
{% trans "Change" %}
</a>
{% trans "Address" %}
{% block shipping_address_actions %}
<a href="{% url 'checkout:shipping-address' %}" class="float-right">
{% trans "Change" %}
</a>
{% endblock %}
</h3>
<address>
{% for field in shipping_address.active_address_fields %}
{{ field }}
<br/>
{% endfor %}
</address>
{% if shipping_address.phone_number %}
<h4>{% trans "Contact" %}</h4>
<p>
{% trans "Phone" %}: {{ shipping_address.phone_number }}
{% if guest_email %}
<br/>
{% trans "Email" %}: {{ guest_email }}
{% endif %}
</p>
{% endif %}
{% if shipping_address.notes %}
<h4>{% trans "Instructions" %}</h4>
<p>
{{ shipping_address.notes|linebreaks }}
</p>
{% endif %}
</div>
{% endif %}
{% if shipping_method %}
<div class="card card-body bg-light card card-body bg-light-info">
<h3>
{% trans "Shipping method" %}
{% block shipping_method_actions %}
<a href="{% url 'checkout:shipping-method' %}" class="float-right">
{% trans "Change" %}
</a>
{% endblock %}
</h3>
<p>
{% trans "Payment details to go here" %}
{{ shipping_method.name }}
{% if shipping_method.description %}- {{ shipping_method.description|safe }}{% endif %}
</p>
</div>
{% endif %}
</div>
{% endblock shipping_address %}
{# You will almost certainly want to override this block to provide a payment summary #}
{% block payment_method %}
<div class="col-sm-6">
<div class="sub-header">
<h2>{% trans "Payment" %}</h2>
</div>
{% endblock payment_method %}
<div class="card card-body bg-light card card-body bg-light-success">
<h3>
{% trans "Payment" %}
<a href="{% url 'checkout:payment-details' %}" class="float-right">
{% trans "Change" %}
</a>
</h3>
<p>
{% trans "Payment details to go here" %}
</p>
</div>
</div>
{% endblock payment_method %}
</div>
{% block order_contents %}
<div class="sub-header">
{% block order_contents_actions %}
<a href="{% url 'basket:summary' %}" class="float-right">
{% trans "Edit order contents" %}
</a>
{% endblock %}
<h2>{% trans "Order contents" %}</h2>
</div>
{% block order_contents %}
<div class="sub-header">
{% block order_contents_actions %}
<a href="{% url 'basket:summary' %}" class="float-right">
{% trans "Edit order contents" %}
</a>
{% endblock %}
<h2>{% trans "Order contents" %}</h2>
<div class="basket-title">
<div class="row">
<p class="col-sm-9 h4">
{% trans "Item" %}
</p>
<p class="col-sm-1 h4 text-center">
{% trans "Quantity" %}
</p>
<p class="col-sm-2 h4 text-right">
{% trans "Total" %}
</p>
</div>
<div class="basket-title">
</div>
{% for line in basket.all_lines %}
{% purchase_info_for_line request line as session %}
<div class="basket-items">
<div class="row">
<p class="col-sm-9 h4">
{% trans "Item" %}
</p>
<p class="col-sm-1 h4 text-center">
{% trans "Quantity" %}
</p>
<p class="col-sm-2 h4 text-right">
{% trans "Total" %}
</p>
</div>
</div>
{% for line in basket.all_lines %}
{% purchase_info_for_line request line as session %}
<div class="basket-items">
<div class="row">
<div class="col-sm-2">
<div class="image_container w-100">
{% with image=line.product.primary_image %}
<div class="col-sm-2">
<div class="image_container w-100">
{% with image=line.product.primary_image %}
{% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
<a href="{{ form.instance.product.get_absolute_url }}">
<img src="{{ thumb.url }}"
alt="{{ product.get_title }}"
class="img-thumbnail w-auto mx-auto my-0">
</a>
{% endwith %}
</div>
</div>
<div class="col-sm-7">
<h3>
<a href="{{ line.product.get_absolute_url }}">
{{ line.description }}
</a>
</h3>
<span class="availability {{ session.availability.code }}">
{{ session.availability.message }}
</span>
</div>
<div class="col-sm-1 text-center">
{{ line.quantity }}
</div>
<div class="col-sm-2 text-right">
<p class="price_color">
{% if not show_tax_separately and line.is_tax_known %}
{{ line.line_price_incl_tax|currency:basket.currency }}
{% else %}
{{ line.line_price_excl_tax|currency:basket.currency }}
{% endif %}
</p>
{% endwith %}
</div>
</div>
</div>
{% endfor %}
<div class="row">
<div class="col-sm-6">
&nbsp;
</div>
<div class="col-sm-6">
<div class="sub-header">
<h2>{% trans 'Totals' %}</h2>
<div class="col-sm-7">
<h3>
<a href="{{ line.product.get_absolute_url }}">
{{ line.description }}
</a>
</h3>
<span class="availability {{ session.availability.code }}">
{{ session.availability.message }}
</span>
</div>
<div class="col-sm-1 text-center">
{{ line.quantity }}
</div>
<div class="col-sm-2 text-right">
<p class="price_color">
{% if not show_tax_separately and line.is_tax_known %}
{{ line.line_price_incl_tax|currency:basket.currency }}
{% else %}
{{ line.line_price_excl_tax|currency:basket.currency }}
{% endif %}
</p>
</div>
{% include 'oscar/basket/partials/basket_totals.html' %}
</div>
</div>
{% endblock order_contents %}
{% block shipping_method %}{% endblock shipping_method %}
{% block payment_details %}{% endblock payment_details %}
{% block place_order %}{% endblock place_order %}
{% endblock content %}
{% endfor %}
<div class="row">
<div class="col-sm-6">
&nbsp;
</div>
<div class="col-sm-6">
<div class="sub-header">
<h2>{% trans 'Totals' %}</h2>
</div>
{% include 'oscar/basket/partials/basket_totals.html' %}
</div>
</div>
{% endblock order_contents %}
{% block shipping_method %}{% endblock shipping_method %}
{% block payment_details %}{% endblock payment_details %}
{% block place_order %}{% endblock place_order %}
{% endblock content %}

View file

@ -5,23 +5,24 @@
{% trans "Checkout gateway" %} | {{ block.super }}
{% endblock %}
{% block checkout_nav %}
{% include 'oscar/checkout/nav.html' with step=0 %}{% endblock %}
{% block checkout_title %}
{% trans "Who are you?" %}
{% endblock %}
{% block content %}
<form method="post" class="card card-body bg-light">
{% csrf_token %}
{{ form.non_field_errors }}
{% include "oscar/partials/form_field.html" with field=form.username %}
<div class="form-group">
<div class="controls">
<div class="radio">
{{ form.options.0 }}
</div>
{% include 'oscar/checkout/nav.html' with step=0 %}
{% endblock %}
{% block checkout_title %}
{% trans "Who are you?" %}
{% endblock %}
{% block content %}
<form method="post" class="card card-body bg-light">
{% csrf_token %}
{{ form.non_field_errors }}
{% include "oscar/partials/form_field.html" with field=form.username %}
<div class="form-group">
<div class="controls">
<div class="radio">
{{ form.options.0 }}
</div>
</div>
<div class="form-group {% if form.password.errors %}error{% endif %}">
</div>
<div class="form-group {% if form.password.errors %}error{% endif %}">
{{ form.options.errors }}
<div class="controls">
<div class="radio">

View file

@ -42,4 +42,5 @@
</div>
<!-- /page_inner -->
</div>
{% include "oscar/partials/footer_checkout.html" %}{% endblock %}
{% include "oscar/partials/footer_checkout.html" %}
{% endblock %}

View file

@ -39,7 +39,8 @@
<li >
3 %}visited
{% else %}
disabled{% endif %}
disabled
{% endif %}
{% endif %}
{% endif %}
">

View file

@ -4,43 +4,44 @@
{% trans "Payment details" %} | {{ block.super }}
{% endblock %}
{% block checkout_nav %}
{% include 'oscar/checkout/nav.html' with step=3 %}{% endblock %}
{% block checkout_title %}
{% trans "Enter payment details" %}
{% endblock %}
{% block order_contents %}{% endblock %}
{% block shipping_address %}{% endblock %}
{% block shipping_method %}{% endblock %}
{% block payment_method %}{% endblock %}
{% block payment_details %}
{% block payment_details_content %}
<p>
{% trans "This page needs implementing within your project. You may want to use one of Oscar's payment gateway libraries:" %}
</p>
<ul>
<li>
<a href="https://github.com/django-oscar/django-oscar-paypal">
django-oscar-paypal
</a>
</li>
<li>
<a href="https://github.com/django-oscar/django-oscar-adyen">
django-oscar-adyen
</a>
</li>
<li>
<a href="https://github.com/django-oscar/django-oscar-docdata">
django-oscar-docdata
</a>
</li>
<li>
<a href="https://github.com/django-oscar/django-oscar-accounts">
django-oscar-accounts
</a>
</li>
</ul>
<a id="view_preview" href="{% url 'checkout:preview' %}" class="btn btn-primary btn-lg">
{% trans "Continue" %}
</a>
{% endblock payment_details_content %}
{% endblock payment_details %}
{% include 'oscar/checkout/nav.html' with step=3 %}
{% endblock %}
{% block checkout_title %}
{% trans "Enter payment details" %}
{% endblock %}
{% block order_contents %}{% endblock %}
{% block shipping_address %}{% endblock %}
{% block shipping_method %}{% endblock %}
{% block payment_method %}{% endblock %}
{% block payment_details %}
{% block payment_details_content %}
<p>
{% trans "This page needs implementing within your project. You may want to use one of Oscar's payment gateway libraries:" %}
</p>
<ul>
<li>
<a href="https://github.com/django-oscar/django-oscar-paypal">
django-oscar-paypal
</a>
</li>
<li>
<a href="https://github.com/django-oscar/django-oscar-adyen">
django-oscar-adyen
</a>
</li>
<li>
<a href="https://github.com/django-oscar/django-oscar-docdata">
django-oscar-docdata
</a>
</li>
<li>
<a href="https://github.com/django-oscar/django-oscar-accounts">
django-oscar-accounts
</a>
</li>
</ul>
<a id="view_preview" href="{% url 'checkout:preview' %}" class="btn btn-primary btn-lg">
{% trans "Continue" %}
</a>
{% endblock payment_details_content %}
{% endblock payment_details %}

View file

@ -4,34 +4,35 @@
{% trans "Order preview" %} | {{ block.super }}
{% endblock %}
{% block checkout_nav %}
{% include 'oscar/checkout/nav.html' with step=4 %}{% endblock %}
{% block checkout_title %}
{% trans "Preview order" %}
{% endblock %}
{% block place_order %}
<form method="post" action="{% url 'checkout:preview' %}" id="place_order_form">
{% csrf_token %}
<input type="hidden" name="action" value="place_order" />
{% comment %}
When submitting sensitive data on the payment details page (eg a bankcard)
we don't want to save the data and so we pass the bound form to the preview
template and render it in a hidden div. Then the payment information will
get re-submitted when the user confirms the order.
{% endcomment %}
<div style="display:none">
{% block hiddenforms %}{% endblock %}
</div>
<div class="form-group clearfix">
<div class="row">
<div class="col-sm-3 offset-sm-9">
<button id='place-order'
type="submit"
class="btn btn-primary btn-lg btn-block"
data-loading-text="{% trans 'Submitting...' %}">
{% trans "Place order" %}
</button>
</div>
{% include 'oscar/checkout/nav.html' with step=4 %}
{% endblock %}
{% block checkout_title %}
{% trans "Preview order" %}
{% endblock %}
{% block place_order %}
<form method="post" action="{% url 'checkout:preview' %}" id="place_order_form">
{% csrf_token %}
<input type="hidden" name="action" value="place_order" />
{% comment %}
When submitting sensitive data on the payment details page (eg a bankcard)
we don't want to save the data and so we pass the bound form to the preview
template and render it in a hidden div. Then the payment information will
get re-submitted when the user confirms the order.
{% endcomment %}
<div style="display:none">
{% block hiddenforms %}{% endblock %}
</div>
<div class="form-group clearfix">
<div class="row">
<div class="col-sm-3 offset-sm-9">
<button id='place-order'
type="submit"
class="btn btn-primary btn-lg btn-block"
data-loading-text="{% trans 'Submitting...' %}">
{% trans "Place order" %}
</button>
</div>
</div>
</form>
</div>
</form>
{% endblock place_order %}

View file

@ -4,104 +4,105 @@
{% trans "Shipping address" %} | {{ block.super }}
{% endblock %}
{% block checkout_nav %}
{% include 'oscar/checkout/nav.html' with step=1 %}{% endblock %}
{% block checkout_title %}
{% trans "Shipping address" %}
{% endblock %}
{% block order_contents %}{% endblock %}
{% block shipping_address %}
<div class="col-sm-12">
<div class="sub-header">
<h2>{% trans "Where should we ship to?" %}</h2>
</div>
{% if user.is_authenticated %}
{% if addresses %}
<h3>{% trans "An address from your address book?" %}</h3>
<div class="choose-block">
<div class="row">
{% for address in addresses %}
{% block select_address_form %}
<div class="col-sm-6 d-flex">
<div class="card card-body bg-light">
<address>
{% block select_address_fields %}
{% for field in address.active_address_fields %}
<span>{{ field }}</span>
{% if not forloop.first %}<br/>{% endif %}
{% endfor %}
{% endblock %}
</address>
<form action="{% url 'checkout:shipping-address' %}"
method="post"
id="select_shipping_address_{{ address.id }}"
class="mb-0">
{% csrf_token %}
<input type="hidden" name="action" value="ship_to" />
<input type="hidden" name="address_id" value="{{ address.id }}" />
{% if address.is_default_for_shipping %}
<button type="submit"
class="btn btn-success btn-large ship-address"
data-loading-text="{% trans 'Saving...' %}">
<i class="fas fa-check-circle"></i>
{% trans "Ship to your default shipping address" %}
</button>
{% else %}
<button type="submit"
class="btn btn-primary btn-large ship-address"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Ship to this address" %}
</button>
{% endif %}
<div class="btn-group address-controls">
<a href="{% url 'checkout:user-address-update' pk=address.id %}"
class="btn btn-secondary">
{% trans "Edit address" %}
{% include 'oscar/checkout/nav.html' with step=1 %}
{% endblock %}
{% block checkout_title %}
{% trans "Shipping address" %}
{% endblock %}
{% block order_contents %}{% endblock %}
{% block shipping_address %}
<div class="col-sm-12">
<div class="sub-header">
<h2>{% trans "Where should we ship to?" %}</h2>
</div>
{% if user.is_authenticated %}
{% if addresses %}
<h3>{% trans "An address from your address book?" %}</h3>
<div class="choose-block">
<div class="row">
{% for address in addresses %}
{% block select_address_form %}
<div class="col-sm-6 d-flex">
<div class="card card-body bg-light">
<address>
{% block select_address_fields %}
{% for field in address.active_address_fields %}
<span>{{ field }}</span>
{% if not forloop.first %}<br/>{% endif %}
{% endfor %}
{% endblock %}
</address>
<form action="{% url 'checkout:shipping-address' %}"
method="post"
id="select_shipping_address_{{ address.id }}"
class="mb-0">
{% csrf_token %}
<input type="hidden" name="action" value="ship_to" />
<input type="hidden" name="address_id" value="{{ address.id }}" />
{% if address.is_default_for_shipping %}
<button type="submit"
class="btn btn-success btn-large ship-address"
data-loading-text="{% trans 'Saving...' %}">
<i class="fas fa-check-circle"></i>
{% trans "Ship to your default shipping address" %}
</button>
{% else %}
<button type="submit"
class="btn btn-primary btn-large ship-address"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Ship to this address" %}
</button>
{% endif %}
<div class="btn-group address-controls">
<a href="{% url 'checkout:user-address-update' pk=address.id %}"
class="btn btn-secondary">
{% trans "Edit address" %}
</a>
<button class="btn btn-secondary dropdown-toggle"
data-toggle="dropdown"></button>
<ul class="dropdown-menu">
<a href="{% url 'checkout:user-address-delete' pk=address.id %}"
class="btn-remove-address nav-link">
{% trans "Delete" %}
</a>
<button class="btn btn-secondary dropdown-toggle"
data-toggle="dropdown"></button>
<ul class="dropdown-menu">
<a href="{% url 'checkout:user-address-delete' pk=address.id %}"
class="btn-remove-address nav-link">
{% trans "Delete" %}
</a>
</ul>
</div>
</form>
</div>
</ul>
</div>
</form>
</div>
{% if forloop.counter|divisibleby:2 %}
</div>
<div class="row">
{% endif %}
{% endblock %}
{% endfor %}
</div>
{% if forloop.counter|divisibleby:2 %}
</div>
<div class="row">
{% endif %}
{% endblock %}
{% endfor %}
</div>
</div>
<h3>{% trans "Or a new address?" %}</h3>
{% endif %}
{% endif %}
{% block new_address_form %}
<div class="card card-body bg-light">
<form action="{% url 'checkout:shipping-address' %}" method="post" id="new_shipping_address">
{% csrf_token %}
{% include "oscar/partials/form_fields.html" with form=form style='horizontal' %}
<div class="form-group row">
<div class="offset-sm-4 col-sm-8">
<button type="submit"
class="btn btn-lg btn-primary"
data-loading-text="{% trans 'Continuing...' %}">
{% trans "Continue" %}
</button>
{% trans "or" %}
<a href="{% url 'basket:summary' %}">
{% trans "return to basket" %}
</a>
</div>
</div>
<h3>{% trans "Or a new address?" %}</h3>
{% endif %}
{% endif %}
{% block new_address_form %}
<div class="card card-body bg-light">
<form action="{% url 'checkout:shipping-address' %}" method="post" id="new_shipping_address">
{% csrf_token %}
{% include "oscar/partials/form_fields.html" with form=form style='horizontal' %}
<div class="form-group row">
<div class="offset-sm-4 col-sm-8">
<button type="submit"
class="btn btn-lg btn-primary"
data-loading-text="{% trans 'Continuing...' %}">
{% trans "Continue" %}
</button>
{% trans "or" %}
<a href="{% url 'basket:summary' %}">
{% trans "return to basket" %}
</a>
</div>
</div>
</form>
</div>
{% endblock %}
</div>
{% endblock shipping_address %}
{% block shipping_method %}{% endblock %}
{% block payment_method %}{% endblock %}
</form>
</div>
{% endblock %}
</div>
{% endblock shipping_address %}
{% block shipping_method %}{% endblock %}
{% block payment_method %}{% endblock %}

View file

@ -6,64 +6,65 @@
{% trans "Shipping method" %} | {{ block.super }}
{% endblock %}
{% block checkout_nav %}
{% include 'oscar/checkout/nav.html' with step=2 %}{% endblock %}
{% block checkout_title %}
{% trans "Shipping method" %}
{% endblock %}
{% block order_contents %}{% endblock %}
{% block shipping_address %}{% endblock %}
{% block payment_method %}{% endblock %}
{% block shipping_method %}
<div class="basket-title">
<div class="row">
<h4 class="col-sm-8 m-0">{% trans "Method" %}</h4>
<h4 class="col-sm-3 m-0">{% trans "Cost" %}</h4>
</div>
{% include 'oscar/checkout/nav.html' with step=2 %}
{% endblock %}
{% block checkout_title %}
{% trans "Shipping method" %}
{% endblock %}
{% block order_contents %}{% endblock %}
{% block shipping_address %}{% endblock %}
{% block payment_method %}{% endblock %}
{% block shipping_method %}
<div class="basket-title">
<div class="row">
<h4 class="col-sm-8 m-0">{% trans "Method" %}</h4>
<h4 class="col-sm-3 m-0">{% trans "Cost" %}</h4>
</div>
{% for method in methods %}
<div class="basket-items">
<div class="row">
<div class="col-sm-8">
<h4>{{ method.name }}</h4>
{% if method.description %}
<p>
{{ method.description|safe }}
</p>
{% endif %}
{% if method.is_discounted %}
<small>
{% shipping_charge_discount method basket as discount %}
{% blocktrans with amount=discount|currency:basket.currency name=method.discount_name %}
This includes a discount of
<strong>{{ amount }}</strong>
as
your basket qualifies for the
<strong>{{ name }}</strong>
offer.
{% endblocktrans %}
</small>
{% endif %}
</div>
<div class="col-sm-1">
{% shipping_charge method basket as charge %}
{% if charge.is_tax_known %}
{{ charge.incl_tax|currency:basket.currency }}
{% else %}
{{ charge.excl_tax|currency:basket.currency }}
{% endif %}
</div>
<div class="col-sm-3">
<form method="post" action="{% url 'checkout:shipping-method' %}">
{% csrf_token %}
<input type="hidden" name="method_code" value="{{ method.code }}" />
<button type="submit"
class="btn btn-lg btn-primary float-right"
data-loading-text="{% trans 'Submitting...' %}">
{% trans "Select option" %}
</button>
</form>
</div>
</div>
{% for method in methods %}
<div class="basket-items">
<div class="row">
<div class="col-sm-8">
<h4>{{ method.name }}</h4>
{% if method.description %}
<p>
{{ method.description|safe }}
</p>
{% endif %}
{% if method.is_discounted %}
<small>
{% shipping_charge_discount method basket as discount %}
{% blocktrans with amount=discount|currency:basket.currency name=method.discount_name %}
This includes a discount of
<strong>{{ amount }}</strong>
as
your basket qualifies for the
<strong>{{ name }}</strong>
offer.
{% endblocktrans %}
</small>
{% endif %}
</div>
<div class="col-sm-1">
{% shipping_charge method basket as charge %}
{% if charge.is_tax_known %}
{{ charge.incl_tax|currency:basket.currency }}
{% else %}
{{ charge.excl_tax|currency:basket.currency }}
{% endif %}
</div>
<div class="col-sm-3">
<form method="post" action="{% url 'checkout:shipping-method' %}">
{% csrf_token %}
<input type="hidden" name="method_code" value="{{ method.code }}" />
<button type="submit"
class="btn btn-lg btn-primary float-right"
data-loading-text="{% trans 'Submitting...' %}">
{% trans "Select option" %}
</button>
</form>
</div>
</div>
{% endfor %}
{% endblock shipping_method %}
</div>
{% endfor %}
{% endblock shipping_method %}

View file

@ -9,217 +9,219 @@
| {{ block.super }}
{% endblock title %}
{% block checkout_nav %}
{% include 'oscar/checkout/nav.html' with step=5 %}{% endblock %}
{% block checkout_title %}
{% include 'oscar/checkout/nav.html' with step=5 %}
{% endblock %}
{% block checkout_title %}
{% blocktrans with number=order.number %}
Order {{ number }}: confirmation
{% endblocktrans %}
{% endblock %}
{% block content %}
<p class="lead">
{% blocktrans with number=order.number %}
Order {{ number }}: confirmation
Your order has been placed and a confirmation email has been sent - your order number is
<strong>{{ number }}</strong>
.
{% endblocktrans %}
{% endblock %}
{% block content %}
<p class="lead">
{% blocktrans with number=order.number %}
Your order has been placed and a confirmation email has been sent - your order number is
<strong>{{ number }}</strong>
.
{% endblocktrans %}
{% trans "Please make a note of this reference or print this page and quote it in any communication with us regarding your order." %}
</p>
<div class="row shipping-payment">
<div class="col-sm-6">
{% block shipping_info %}
<div class="sub-header">
<h2>{% trans "Shipping" %}</h2>
</div>
<div class="card card-body bg-light">
<h3>{% trans "Address" %}</h3>
{% if order.shipping_address %}
<address>
{% for field in order.shipping_address.active_address_fields %}
{{ field }}
{% trans "Please make a note of this reference or print this page and quote it in any communication with us regarding your order." %}
</p>
<div class="row shipping-payment">
<div class="col-sm-6">
{% block shipping_info %}
<div class="sub-header">
<h2>{% trans "Shipping" %}</h2>
</div>
<div class="card card-body bg-light">
<h3>{% trans "Address" %}</h3>
{% if order.shipping_address %}
<address>
{% for field in order.shipping_address.active_address_fields %}
{{ field }}
<br/>
{% endfor %}
</address>
{% if order.shipping_address.phone_number %}
<h4>{% trans "Contact" %}</h4>
<p>
{% trans "Phone" %}: {{ order.shipping_address.phone_number }}
{% if order.guest_email %}
<br/>
{% endfor %}
</address>
{% if order.shipping_address.phone_number %}
<h4>{% trans "Contact" %}</h4>
<p>
{% trans "Phone" %}: {{ order.shipping_address.phone_number }}
{% if order.guest_email %}
<br/>
{% trans "Email" %}: {{ order.guest_email }}
{% endif %}
</p>
{% endif %}
{% if order.shipping_address.notes %}
<h4>{% trans "Instructions" %}</h4>
<p>
{{ order.shipping_address.notes|linebreaks }}
</p>
{% endif %}
{% else %}
<p>
{% trans "No shipping address required." %}
</p>
{% endif %}
</div>
<div class="card card-body bg-light">
<h3>{% trans "Shipping method" %}</h3>
<p>
{{ order.shipping_method }}
</p>
</div>
{% endblock %}
</div>
<div class="col-sm-6">
{% block payment_info %}
<div class="sub-header">
<h2>{% trans "Payment" %}</h2>
</div>
<div class="card card-body bg-light">
<h3>{% trans "Payment" %}</h3>
{% for source in order.sources.all %}
<p>
{% if source.reference %}
{% blocktrans with amount=source.amount_allocated|currency:source.currency type=source.source_type.name reference=source.reference %}
Allocation of {{ amount }} from type {{ type }} (reference: {{ reference }})
{% endblocktrans %}
{% else %}
{% blocktrans with amount=source.amount_allocated|currency:source.currency type=source.source_type.name %}
Allocation of {{ amount }} from type {{ type }}
{% endblocktrans %}
{% trans "Email" %}: {{ order.guest_email }}
{% endif %}
</p>
{% empty %}
<p>
{% trans "No payment was required for this order." %}
</p>
{% endfor %}
{% if order.billing_address %}
<h4>{% trans "Billing address" %}</h4>
<address>
{% for field in order.billing_address.active_address_fields %}
{{ field }}
<br/>
{% endfor %}
</address>
{% endif %}
</div>
{% endblock %}
</div>
</div>
{% block order_contents %}
<div class="sub-header">
<h2>{% trans "Order contents" %}</h2>
</div>
<div class="basket-title">
<div class="row">
<p class="col-sm-9 h4">
{% trans "Items purchased" %}
</p>
<p class="col-sm-1 h4 text-center">
{% trans "Quantity" %}
</p>
<p class="col-sm-2 h4 text-right">
{% trans "Total" %}
{% if order.shipping_address.notes %}
<h4>{% trans "Instructions" %}</h4>
<p>
{{ order.shipping_address.notes|linebreaks }}
</p>
{% endif %}
{% else %}
<p>
{% trans "No shipping address required." %}
</p>
{% endif %}
</div>
<div class="card card-body bg-light">
<h3>{% trans "Shipping method" %}</h3>
<p>
{{ order.shipping_method }}
</p>
</div>
{% endblock %}
</div>
<div class="col-sm-6">
{% block payment_info %}
<div class="sub-header">
<h2>{% trans "Payment" %}</h2>
</div>
<div class="card card-body bg-light">
<h3>{% trans "Payment" %}</h3>
{% for source in order.sources.all %}
<p>
{% if source.reference %}
{% blocktrans with amount=source.amount_allocated|currency:source.currency type=source.source_type.name reference=source.reference %}
Allocation of {{ amount }} from type {{ type }} (reference: {{ reference }})
{% endblocktrans %}
{% else %}
{% blocktrans with amount=source.amount_allocated|currency:source.currency type=source.source_type.name %}
Allocation of {{ amount }} from type {{ type }}
{% endblocktrans %}
{% endif %}
</p>
{% empty %}
<p>
{% trans "No payment was required for this order." %}
</p>
{% endfor %}
{% if order.billing_address %}
<h4>{% trans "Billing address" %}</h4>
<address>
{% for field in order.billing_address.active_address_fields %}
{{ field }}
<br/>
{% endfor %}
</address>
{% endif %}
</div>
{% endblock %}
</div>
</div>
{% block order_contents %}
<div class="sub-header">
<h2>{% trans "Order contents" %}</h2>
</div>
<div class="basket-title">
<div class="row">
<p class="col-sm-9 h4">
{% trans "Items purchased" %}
</p>
<p class="col-sm-1 h4 text-center">
{% trans "Quantity" %}
</p>
<p class="col-sm-2 h4 text-right">
{% trans "Total" %}
</p>
</div>
{% for line in order.lines.all %}
<div class="basket-items">
<div class="row">
<div class="col-sm-2">
<div class="image_container w-100">
{% with image=line.product.primary_image %}
</div>
{% for line in order.lines.all %}
<div class="basket-items">
<div class="row">
<div class="col-sm-2">
<div class="image_container w-100">
{% with image=line.product.primary_image %}
{% oscar_thumbnail image.original "200x200" upscale=False as thumb %}
<a href="{{ line.product.get_absolute_url }}">
<img src="{{ thumb.url }}"
alt="{{ product.get_title }}"
class="img-thumbnail w-auto mx-auto my-0">
</a>
{% endwith %}
</div>
</div>
<div class="col-sm-7">
<h3>
<a href="{{ line.product.get_absolute_url }}">
{{ line.description }}
</a>
</h3>
{% if line.upc %}
<p>
{{ line.upc }}
</p>
{% endif %}
{% endwith %}
</div>
<div class="col-sm-1 text-center">
{{ line.quantity }}
</div>
<div class="col-sm-2 text-right">
<p class="price_color">
{% if show_tax_separately %}
{{ line.line_price_before_discounts_excl_tax|currency:order.currency }}
{% else %}
{{ line.line_price_before_discounts_incl_tax|currency:order.currency }}
{% endif %}
</div>
<div class="col-sm-7">
<h3>
<a href="{{ line.product.get_absolute_url }}">
{{ line.description }}
</a>
</h3>
{% if line.upc %}
<p>
{{ line.upc }}
</p>
</div>
{% endif %}
</div>
</div>
{% endfor %}
{% block basket_totals %}
<div class="row">
<div class="col-sm-6">
&nbsp;
<div class="col-sm-1 text-center">
{{ line.quantity }}
</div>
<div class="col-sm-6">
<div class="sub-header">
<h2>
{% trans 'Totals' %}
</h2>
</div>
{% include 'oscar/order/partials/basket_totals.html' %}
</div>
</div>
{% endblock basket_totals %}
{% endblock order_contents %}
{% block order_tracking %}
{% if not order.user %}
<div class="sub-header">
<h2>
{% trans "Tracking your order" %}
</h2>
</div>
<p>
{% trans "You can track the status of your order" %}
<a class="btn btn-primary"
href="{% url 'customer:anon-order' order_number=order.number hash=order.verification_hash %}">
{% trans "View order status" %}
</a>
.
</p>
{% endif %}
{% endblock %}
{% block order_actions %}
<div class="form-group">
<div class="row">
<div class="col-sm-4">
<p>
<a onclick="window.print()" href="#" class="btn btn-primary btn-block btn-lg">
{% trans "Print this page" %}
</a>
</p>
</div>
<div class="col-sm-4 offset-sm-4">
<p>
<a href="{{ homepage_url }}" class="btn btn-primary btn-block btn-lg">
{% trans "Continue shopping" %}
</a>
<div class="col-sm-2 text-right">
<p class="price_color">
{% if show_tax_separately %}
{{ line.line_price_before_discounts_excl_tax|currency:order.currency }}
{% else %}
{{ line.line_price_before_discounts_incl_tax|currency:order.currency }}
{% endif %}
</p>
</div>
</div>
</div>
{% endblock order_actions %}
{% endblock content %}
{% block tracking %}
{% if send_analytics_event %}
{% include "oscar/partials/google_analytics_transaction.html" %}{% endif %}
{% endblock %}
{% endfor %}
{% block basket_totals %}
<div class="row">
<div class="col-sm-6">
&nbsp;
</div>
<div class="col-sm-6">
<div class="sub-header">
<h2>
{% trans 'Totals' %}
</h2>
</div>
{% include 'oscar/order/partials/basket_totals.html' %}
</div>
</div>
{% endblock basket_totals %}
{% endblock order_contents %}
{% block order_tracking %}
{% if not order.user %}
<div class="sub-header">
<h2>
{% trans "Tracking your order" %}
</h2>
</div>
<p>
{% trans "You can track the status of your order" %}
<a class="btn btn-primary"
href="{% url 'customer:anon-order' order_number=order.number hash=order.verification_hash %}">
{% trans "View order status" %}
</a>
.
</p>
{% endif %}
{% endblock %}
{% block order_actions %}
<div class="form-group">
<div class="row">
<div class="col-sm-4">
<p>
<a onclick="window.print()" href="#" class="btn btn-primary btn-block btn-lg">
{% trans "Print this page" %}
</a>
</p>
</div>
<div class="col-sm-4 offset-sm-4">
<p>
<a href="{{ homepage_url }}" class="btn btn-primary btn-block btn-lg">
{% trans "Continue shopping" %}
</a>
</p>
</div>
</div>
</div>
{% endblock order_actions %}
{% endblock content %}
{% block tracking %}
{% if send_analytics_event %}
{% include "oscar/partials/google_analytics_transaction.html" %}
{% endif %}
{% endblock %}

View file

@ -8,31 +8,32 @@
{% block payment_method %}{% endblock %}
{% block payment_details %}{% endblock %}
{% block checkout_nav %}
{% include 'oscar/checkout/nav.html' with step=1 %}{% endblock %}
{% block checkout_title %}
{% trans "Delete address?" %}
{% endblock %}
{% block shipping_address %}
<form method="post" id="delete_address_{{ object.id }}">
{% csrf_token %}
<div class="card card-body bg-light">
<address>
{% for field in object.active_address_fields %}
{{ field }}
<br/>
{% endfor %}
</address>
</div>
<p>
{% trans "Are you sure you want to delete this address?" %}
<button type="submit" class="btn btn-danger" data-loading-text="{% trans 'Submitting...' %}">
{% trans "Yes!" %}
</button>
{% trans "or" %}
<a href="{% url 'checkout:shipping-address' %}">
{% trans "cancel" %}
</a>
.
</p>
</form>
{% endblock shipping_address %}
{% include 'oscar/checkout/nav.html' with step=1 %}
{% endblock %}
{% block checkout_title %}
{% trans "Delete address?" %}
{% endblock %}
{% block shipping_address %}
<form method="post" id="delete_address_{{ object.id }}">
{% csrf_token %}
<div class="card card-body bg-light">
<address>
{% for field in object.active_address_fields %}
{{ field }}
<br/>
{% endfor %}
</address>
</div>
<p>
{% trans "Are you sure you want to delete this address?" %}
<button type="submit" class="btn btn-danger" data-loading-text="{% trans 'Submitting...' %}">
{% trans "Yes!" %}
</button>
{% trans "or" %}
<a href="{% url 'checkout:shipping-address' %}">
{% trans "cancel" %}
</a>
.
</p>
</form>
{% endblock shipping_address %}

View file

@ -8,29 +8,28 @@
{% block payment_method %}{% endblock %}
{% block payment_details %}{% endblock %}
{% block checkout_nav %}
{% include 'oscar/checkout/nav.html' with step=1 %}{% endblock %}
{% block checkout_title %}
{% trans "Edit address" %}
{% endblock %}
{% block shipping_address %}
<div class="card card-body bg-light">
<form id="update_user_address" method="post">
{% csrf_token %}
{% include "oscar/partials/form_fields.html" with form=form style='horizontal' %}
<div class="form-group row">
<div class="offset-sm-4 col-sm-8">
<button type="submit"
class="btn btn-lg btn-primary"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Save" %}
</button>
{% trans "or" %}
<a href="{% url 'checkout:shipping-address' %}">
{% trans "cancel" %}
</a>
.
</div>
{% include 'oscar/checkout/nav.html' with step=1 %}
{% endblock %}
{% block checkout_title %}
{% trans "Edit address" %}
{% endblock %}
{% block shipping_address %}
<div class="card card-body bg-light">
<form id="update_user_address" method="post">
{% csrf_token %}
{% include "oscar/partials/form_fields.html" with form=form style='horizontal' %}
<div class="form-group row">
<div class="offset-sm-4 col-sm-8">
<button type="submit" class="btn btn-lg btn-primary" data-loading-text="{% trans 'Saving...' %}">
{% trans "Save" %}
</button>
{% trans "or" %}
<a href="{% url 'checkout:shipping-address' %}">
{% trans "cancel" %}
</a>
.
</div>
</form>
</div>
{% endblock shipping_address %}
</div>
</form>
</div>
{% endblock shipping_address %}

View file

@ -5,87 +5,87 @@
<li class="nav-item">
<a href="{% url 'customer:notifications-inbox' %}"
class="nav-link{% if list_type == 'inbox' %}active{% endif %}">
{% trans 'Inbox' %}
</a>
</li>
<li class="nav-item">
<a href="{% url 'customer:notifications-archive' %}"
class="nav-link{% if list_type == 'archive' %}active{% endif %}">
{% trans 'Archive' context 'noun' %}
</a>
</li>
</ul>
{% if notifications %}
{% include "oscar/partials/pagination.html" %}
<form action="{% url 'customer:notifications-update' %}" method="post">
{% csrf_token %}
<table class="table table-striped table-bordered">
<tbody>
{% for notification in notifications %}
<tr>
<td>
<input type="checkbox" name="selected_notification" value="{{ notification.id }}"/>
</td>
<td>
{% if notification.is_read %}
<i class="fas fa-inbox"></i>
{% else %}
<i class="fas fa-envelope"></i>
{% endif %}
</td>
<td>
{% if notification.is_read %}
{{ notification.subject|safe }}
{% else %}
<strong>{{ notification.subject|safe }}</strong>
{% endif %}
<br/>
<em>{{ notification.date_sent }}</em>
</td>
<td>
<a href="{% url 'customer:notifications-detail' pk=notification.pk %}"
class="btn btn-info btn-sm">
{% trans 'View' %}
</a>
{% if list_type == 'inbox' %}
<a class="btn btn-success btn-sm" href="#" data-behaviours="archive">
{% trans 'Archive' context 'verb' %}
</a>
{% endif %}
<a class="btn btn-danger btn-sm" href="#" data-behaviours="delete">
{% trans 'Delete' %}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% trans "With selected items:" %}
{% if list_type == 'inbox' %}
<button type="submit"
class="btn btn-success"
name="action"
value="archive"
data-loading-text="{% trans 'Archiving...' %}">
{% trans "Archive" context 'verb' %}
</button>
{% trans 'Inbox' %}
</a>
</li>
<li class="nav-item">
<a href="{% url 'customer:notifications-archive' %}"
class="nav-link{% if list_type == 'archive' %}active{% endif %}">
{% trans 'Archive' context 'noun' %}
</a>
</li>
</ul>
{% if notifications %}
{% include "oscar/partials/pagination.html" %}
<form action="{% url 'customer:notifications-update' %}" method="post">
{% csrf_token %}
<table class="table table-striped table-bordered">
<tbody>
{% for notification in notifications %}
<tr>
<td>
<input type="checkbox" name="selected_notification" value="{{ notification.id }}"/>
</td>
<td>
{% if notification.is_read %}
<i class="fas fa-inbox"></i>
{% else %}
<i class="fas fa-envelope"></i>
{% endif %}
</td>
<td>
{% if notification.is_read %}
{{ notification.subject|safe }}
{% else %}
<strong>{{ notification.subject|safe }}</strong>
{% endif %}
<br/>
<em>{{ notification.date_sent }}</em>
</td>
<td>
<a href="{% url 'customer:notifications-detail' pk=notification.pk %}"
class="btn btn-info btn-sm">
{% trans 'View' %}
</a>
{% if list_type == 'inbox' %}
<a class="btn btn-success btn-sm" href="#" data-behaviours="archive">
{% trans 'Archive' context 'verb' %}
</a>
{% endif %}
<a class="btn btn-danger btn-sm" href="#" data-behaviours="delete">
{% trans 'Delete' %}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% trans "With selected items:" %}
{% if list_type == 'inbox' %}
<button type="submit"
class="btn btn-success"
name="action"
value="archive"
data-loading-text="{% trans 'Archiving...' %}">
{% trans "Archive" context 'verb' %}
</button>
{% endif %}
<button type="submit"
class="btn btn-danger"
name="action"
value="delete"
data-loading-text="{% trans 'Deleting...' %}">
{% trans "Delete" %}
</button>
</form>
{% include "oscar/partials/pagination.html" %}
{% else %}
<p class="mt-3">
{% trans "There are no notifications to display." %}
</p>
{% endif %}
<button type="submit"
class="btn btn-danger"
name="action"
value="delete"
data-loading-text="{% trans 'Deleting...' %}">
{% trans "Delete" %}
</button>
</form>
{% include "oscar/partials/pagination.html" %}
{% else %}
<p class="mt-3">
{% trans "There are no notifications to display." %}
</p>
{% endif %}
{% endblock tabcontent %}
{% block onbodyload %}
{{ block.super }}
oscar.notifications.init();
{{ block.super }}
oscar.notifications.init();
{% endblock %}

View file

@ -9,5 +9,6 @@
{% endblock %}
{% block tabcontent %}
{% with style='horizontal' %}
{% include "oscar/partials/form.html" %}{% endwith %}
{% include "oscar/partials/form.html" %}
{% endwith %}
{% endblock tabcontent %}

View file

@ -19,29 +19,29 @@
<tr>
<td>
{% with product=alert.product %}
{% if product.is_public %}
<a href="{{ product.get_absolute_url }}">
{% if product.is_public %}
<a href="{{ product.get_absolute_url }}">
{{ product.get_title }}
</a>
{% else %}
{{ product.get_title }}
{% endif %}
{% endwith %}
</td>
<td>{{ alert.status }}</td>
<td>{{ alert.date_created }}</td>
<td>
{% if alert.can_be_cancelled %}
<a href="{% url 'customer:alerts-cancel-by-pk' pk=alert.pk %}?next={% url 'customer:alerts-list' %}"
class="btn btn-danger">
{% trans "Cancel" %}
</a>
{% else %}
{{ product.get_title }}
{% endif %}
{% endwith %}
</td>
<td>{{ alert.status }}</td>
<td>{{ alert.date_created }}</td>
<td>
{% if alert.can_be_cancelled %}
<a href="{% url 'customer:alerts-cancel-by-pk' pk=alert.pk %}?next={% url 'customer:alerts-list' %}"
class="btn btn-danger">
{% trans "Cancel" %}
</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% include "oscar/partials/pagination.html" %}
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% include "oscar/partials/pagination.html" %}
</form>
{% endif %}
{% endblock tabcontent %}

View file

@ -18,134 +18,134 @@
</p>
{% endif %}
{% with address=order.shipping_address %}
<div class="sub-header">
<h3>{% trans 'Shipping address' %}</h3>
</div>
<table class="table table-striped table-bordered">
<tr>
<th>{% trans 'Address' %}</th>
<td>
{% for field in address.active_address_fields %}
{{ field }}
<br/>
{% endfor %}
</td>
</tr>
{% if address.phone_number %}
<tr>
<th>{% trans 'Contact number' %}</th>
<td>{{ address.phone_number }}</td>
</tr>
{% endif %}
{% if address.notes %}
<tr>
<th>{% trans 'Notes' %}</th>
<td>{{ address.notes|linebreaks }}</td>
</tr>
{% endif %}
</table>
{% endwith %}
<div class="sub-header">
<h3>{% trans 'Shipping address' %}</h3>
<h3>{% trans 'Shipping method' %}</h3>
</div>
<p>
{{ order.shipping_method }}
</p>
<div class="sub-header">
<h3>{% trans 'Order contents' %}</h3>
</div>
{% csrf_token %}
<table class="table table-striped table-bordered">
<tr>
<th>{% trans 'Address' %}</th>
<td>
{% for field in address.active_address_fields %}
{{ field }}
<br/>
{% endfor %}
</td>
</tr>
{% if address.phone_number %}
<tr>
<th>{% trans 'Contact number' %}</th>
<td>{{ address.phone_number }}</td>
</tr>
{% endif %}
{% if address.notes %}
<tr>
<th>{% trans 'Notes' %}</th>
<td>{{ address.notes|linebreaks }}</td>
</tr>
{% endif %}
</table>
{% endwith %}
<div class="sub-header">
<h3>{% trans 'Shipping method' %}</h3>
</div>
<p>
{{ order.shipping_method }}
</p>
<div class="sub-header">
<h3>{% trans 'Order contents' %}</h3>
</div>
{% csrf_token %}
<table class="table table-striped table-bordered">
<tr>
<th>{% trans 'Product' %}</th>
<th>
{% trans 'Status' %}
</th>
<th>
{% trans 'Quantity' %}
</th>
<th>
{% trans 'Line price excl. tax' %}
</th>
<th>
{% trans 'Line price incl. tax' %}
</th>
{% iffeature "reviews" %}
<th></th>
{% endiffeature %}
</tr>
{% for line in order.lines.all %}
<tr>
<td>
{% if product.is_public %}
<a href="{{ line.product.get_absolute_url }}">
{{ line.description }}
</a>
{% else %}
{{ line.description }}
{% endif %}
</td>
<td>
{{ line.shipping_status|default:"-" }}
</td>
<td>
{{ line.quantity }}
</td>
<td>
{{ line.line_price_before_discounts_excl_tax|currency:order.currency }}
</td>
<td>
{{ line.line_price_before_discounts_incl_tax|currency:order.currency }}
</td>
<th>{% trans 'Product' %}</th>
<th>
{% trans 'Status' %}
</th>
<th>
{% trans 'Quantity' %}
</th>
<th>
{% trans 'Line price excl. tax' %}
</th>
<th>
{% trans 'Line price incl. tax' %}
</th>
{% iffeature "reviews" %}
<td>
{% if line.product|is_review_permitted:user %}
<a href="{% url 'catalogue:reviews-add' product_slug=line.product.slug product_pk=line.product.id %}"
class="btn btn-primary">
{% trans 'Write a review' %}
</a>
{% endif %}
</td>
<th></th>
{% endiffeature %}
</tr>
{% endfor %}
{% for discount in order.discounts.all %}
{% for line in order.lines.all %}
<tr>
<td>
{% if product.is_public %}
<a href="{{ line.product.get_absolute_url }}">
{{ line.description }}
</a>
{% else %}
{{ line.description }}
{% endif %}
</td>
<td>
{{ line.shipping_status|default:"-" }}
</td>
<td>
{{ line.quantity }}
</td>
<td>
{{ line.line_price_before_discounts_excl_tax|currency:order.currency }}
</td>
<td>
{{ line.line_price_before_discounts_incl_tax|currency:order.currency }}
</td>
{% iffeature "reviews" %}
<td>
{% if line.product|is_review_permitted:user %}
<a href="{% url 'catalogue:reviews-add' product_slug=line.product.slug product_pk=line.product.id %}"
class="btn btn-primary">
{% trans 'Write a review' %}
</a>
{% endif %}
</td>
{% endiffeature %}
</tr>
{% endfor %}
{% for discount in order.discounts.all %}
<tr>
<td colspan="5">{{ discount.description }}</td>
<td>
-{{ discount.amount|currency:order.currency }}
</td>
<td colspan="1"></td>
</tr>
{% endfor %}
</table>
<table class="table table-striped table-bordered">
<caption>
{% trans 'Totals' %}
</caption>
<tr>
<td colspan="5">{{ discount.description }}</td>
<th>
{% trans 'Basket total (inc. tax)' %}
</th>
<td>
-{{ discount.amount|currency:order.currency }}
{{ order.basket_total_incl_tax|currency:order.currency }}
</td>
<td colspan="1"></td>
</tr>
{% endfor %}
</table>
<table class="table table-striped table-bordered">
<caption>
{% trans 'Totals' %}
</caption>
<tr>
<th>
{% trans 'Basket total (inc. tax)' %}
</th>
<td>
{{ order.basket_total_incl_tax|currency:order.currency }}
</td>
</tr>
<tr>
<th>
{% trans 'Shipping charge (inc. tax)' %}
</th>
<td>
{{ order.shipping_incl_tax|currency:order.currency }}
</td>
</tr>
<tr>
<th>
{% trans 'Order total' %}
</th>
<td>
{{ order.total_incl_tax|currency:order.currency }}
</td>
</tr>
</table>
<tr>
<th>
{% trans 'Shipping charge (inc. tax)' %}
</th>
<td>
{{ order.shipping_incl_tax|currency:order.currency }}
</td>
</tr>
<tr>
<th>
{% trans 'Order total' %}
</th>
<td>
{{ order.total_incl_tax|currency:order.currency }}
</td>
</tr>
</table>
{% endblock content %}

View file

@ -26,9 +26,10 @@
{% block column_left %}
<ul class="nav nav-pills flex-column">
{% block standard_tabs %}
{% include 'oscar/customer/partials/standard_tabs.html' %}{% endblock %}
</ul>
{% endblock %}
{% block content %}
{% block tabcontent %}{% endblock tabcontent %}
{% endblock content %}
{% include 'oscar/customer/partials/standard_tabs.html' %}
{% endblock %}
</ul>
{% endblock %}
{% block content %}
{% block tabcontent %}{% endblock tabcontent %}
{% endblock content %}

View file

@ -1,16 +1,16 @@
{% load i18n %}
{% load product_tags %}
{% with products_sliced=products|slice:":6" %}
{% if products_sliced %}
<div class="sub-header">
<h2>{% trans 'Products you recently viewed' %}</h2>
</div>
<ul class="row list-unstyled mx-0">
{% for product in products_sliced %}
<li class="col-sm-4 col-md-3 col-lg-3">
{% render_product product %}
</li>
{% endfor %}
</ul>
{% endif %}
{% if products_sliced %}
<div class="sub-header">
<h2>{% trans 'Products you recently viewed' %}</h2>
</div>
<ul class="row list-unstyled mx-0">
{% for product in products_sliced %}
<li class="col-sm-4 col-md-3 col-lg-3">
{% render_product product %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}

View file

@ -31,184 +31,188 @@
<tbody>
{% for line in order.lines.all %}
{% with product=line.product %}
<tr>
<td>
{% if product %}
{% if product.is_public %}
<p>
<a href="{{ product.get_absolute_url }}">
<tr>
<td>
{% if product %}
{% if product.is_public %}
<p>
<a href="{{ product.get_absolute_url }}">
{{ line.description }}
</a>
</p>
{% else %}
<p>
{{ line.description }}
</a>
</p>
</p>
{% endif %}
{% iffeature "reviews" %}
{% if product|is_review_permitted:user %}
<a class="btn btn-secondary"
href="{% url 'catalogue:reviews-add' product_slug=product.slug product_pk=product.id %}#addreview">
{% trans 'Write a review' %}
</a>
{% endif %}
{% endiffeature %}
{% else %}
<p>
{{ line.description }}
</p>
{% endif %}
{% iffeature "reviews" %}
{% if product|is_review_permitted:user %}
<a class="btn btn-secondary"
href="{% url 'catalogue:reviews-add' product_slug=product.slug product_pk=product.id %}#addreview">
{% trans 'Write a review' %}
</a>
{% endif %}
{% endiffeature %}
{% else %}
<p>
{{ line.description }}
</p>
{% endif %}
</td>
<td>{{ line.quantity }}</td>
<td>{{ line.line_price_before_discounts_excl_tax|currency:order.currency }}</td>
<td>{{ line.line_price_before_discounts_incl_tax|currency:order.currency }}</td>
<td width="90">
{% if product and product.is_public %}
<form id="line_form_{{ line.id }}"
action="{% url 'customer:order-line' order_number=order.number line_id=line.id %}"
method="POST">
{% csrf_token %}
<input type="hidden" name="action" value="reorder" />
<button id="reorder_line_{{ line.id }}"
class="btn btn-success"
type="submit"
data-loading-text="{% trans 'Re-ordering...' context 'Buy again' %}">
{% trans 'Re-order' context 'Buy again' %}
</button>
</form>
{% else %}
{% trans 'Not available anymore' %}
{% endif %}
</td>
</tr>
{% endwith %}
{% endfor %}
{% with discounts=order.basket_discounts %}
{% block discount_totals %}
{% if discounts %}
<tr>
<td colspan="4">{% trans "Basket total (excl. discounts)" %}</td>
<td colspan="2">
{{ order.basket_total_before_discounts_incl_tax|currency:order.currency }}
</td>
</tr>
{% for discount in discounts %}
<tr>
<td colspan="4">
<span class="badge badge-success">{% trans "Discount" %}</span>
{{ discount.offer_name }}
</td>
<td colspan="2">- {{ discount.amount|currency:order.currency }}</td>
<td>{{ line.quantity }}</td>
<td>{{ line.line_price_before_discounts_excl_tax|currency:order.currency }}</td>
<td>{{ line.line_price_before_discounts_incl_tax|currency:order.currency }}</td>
<td width="90">
{% if product and product.is_public %}
<form id="line_form_{{ line.id }}"
action="{% url 'customer:order-line' order_number=order.number line_id=line.id %}"
method="POST">
{% csrf_token %}
<input type="hidden" name="action" value="reorder" />
<button id="reorder_line_{{ line.id }}"
class="btn btn-success"
type="submit"
data-loading-text="{% trans 'Re-ordering...' context 'Buy again' %}">
{% trans 'Re-order' context 'Buy again' %}
</button>
</form>
{% else %}
{% trans 'Not available anymore' %}
{% endif %}
</td>
</tr>
{% endfor %}
{% endif %}
{% endblock discount_totals %}
{% block basket_total %}
{% if discounts %}
<tr>
<th colspan="4">{% trans "Basket total (inc. discounts)" %}</th>
<td colspan="2">
{{ order.basket_total_incl_tax|currency:order.currency }}
</td>
</tr>
{% else %}
<tr>
<th colspan="4">{% trans "Basket total" %}</th>
<td colspan="2">
{{ order.basket_total_incl_tax|currency:order.currency }}
</td>
</tr>
{% endif %}
{% endblock basket_total %}
{% endwith %}
{% block shipping_totals %}
{% if order.has_shipping_discounts %}
<tr>
<td colspan="4">{% trans "Shipping total (excl. discounts)" %}</td>
<td colspan="2">
{{ order.shipping_before_discounts_incl_tax|currency:order.currency }}
</td>
</tr>
{% for discount in order.shipping_discounts %}
<tr>
<td colspan="4">
<span class="badge badge-success">{% trans "Discount" %}</span>
{{ discount.offer_name }}
</td>
<td colspan="2">- {{ discount.amount|currency:order.currency }}</td>
</tr>
{% endwith %}
{% endfor %}
<tr>
<th colspan="4">{% trans "Shipping total (inc. discounts)" %}</th>
<td colspan="2">
{{ order.shipping_incl_tax|currency:order.currency }}
</td>
</tr>
{% else %}
<tr>
<th colspan="4">{% trans "Shipping total" %}</th>
<td colspan="2">
{{ order.shipping_incl_tax|currency:order.currency }}
</td>
</tr>
{% endif %}
{% endblock %}
{% block order_total %}
{% with discounts=order.basket_discounts %}
{% block discount_totals %}
{% if discounts %}
<tr>
<td colspan="4">{% trans "Basket total (excl. discounts)" %}</td>
<td colspan="2">
{{ order.basket_total_before_discounts_incl_tax|currency:order.currency }}
</td>
</tr>
{% for discount in discounts %}
<tr>
<td colspan="4">
<span class="badge badge-success">{% trans "Discount" %}</span>
{{ discount.offer_name }}
</td>
<td colspan="2">- {{ discount.amount|currency:order.currency }}</td>
</tr>
{% endfor %}
{% endif %}
{% endblock discount_totals %}
{% block basket_total %}
{% if discounts %}
<tr>
<th colspan="4">{% trans "Basket total (inc. discounts)" %}</th>
<td colspan="2">
{{ order.basket_total_incl_tax|currency:order.currency }}
</td>
</tr>
{% else %}
<tr>
<th colspan="4">{% trans "Basket total" %}</th>
<td colspan="2">
{{ order.basket_total_incl_tax|currency:order.currency }}
</td>
</tr>
{% endif %}
{% endblock basket_total %}
{% endwith %}
{% block shipping_totals %}
{% if order.has_shipping_discounts %}
<tr>
<td colspan="4">{% trans "Shipping total (excl. discounts)" %}</td>
<td colspan="2">
{{ order.shipping_before_discounts_incl_tax|currency:order.currency }}
</td>
</tr>
{% for discount in order.shipping_discounts %}
<tr>
<td colspan="4">
<span class="badge badge-success">{% trans "Discount" %}</span>
{{ discount.offer_name }}
</td>
<td colspan="2">- {{ discount.amount|currency:order.currency }}</td>
</tr>
{% endfor %}
<tr>
<th colspan="4">{% trans "Shipping total (inc. discounts)" %}</th>
<td colspan="2">
{{ order.shipping_incl_tax|currency:order.currency }}
</td>
</tr>
{% else %}
<tr>
<th colspan="4">{% trans "Shipping total" %}</th>
<td colspan="2">
{{ order.shipping_incl_tax|currency:order.currency }}
</td>
</tr>
{% endif %}
{% endblock %}
{% block order_total %}
<tr>
<th colspan="4">
{% trans 'Order total' %}
</th>
<td colspan="2">
{{ order.total_incl_tax|currency:order.currency }}
</td>
</tr>
{% endblock order_total %}
</tbody>
</table>
{% block order_actions %}
<form id="order_form_{{ order.id }}"
action="{% url 'customer:order' order_number=order.number %}"
method="post">
{% csrf_token %}
<input type="hidden" name="order_id" value="{{ order.id }}" />
<input type="hidden" name="action" value="reorder" />
<button type="submit"
class="btn btn-success"
data-loading-text="{% trans 'Re-ordering...' context 'Buy again' %}">
{% trans 'Re-order all items' context 'Buy again' %}
</button>
</form>
{% endblock order_actions %}
<hr>
<h2>{% trans 'Shipping Method' %}</h2>
<p>
{{ order.shipping_method }}
</p>
<hr>
<h2>
{% trans 'Shipping Address' %}
</h2>
<table class="table table-striped table-bordered">
<tr>
<th colspan="4">
{% trans 'Order total' %}
<th>
{% trans 'Address' %}
</th>
<td colspan="2">
{{ order.total_incl_tax|currency:order.currency }}
<th>
{% trans 'Contact Number' %}
</th>
<th>
{% trans 'Shipping Notes' %}
</th>
</tr>
<tr>
<td>
{% for field in order.shipping_address.active_address_fields %}
{{ field }}
<br/>
{% endfor %}
</td>
<td>
{{ order.shipping_address.phone_number|default:"-" }}
</td>
<td>
{{ order.shipping_address.notes|linebreaks }}
</td>
</tr>
{% endblock order_total %}
</tbody>
</table>
{% block order_actions %}
<form id="order_form_{{ order.id }}" action="{% url 'customer:order' order_number=order.number %}" method="post">
{% csrf_token %}
<input type="hidden" name="order_id" value="{{ order.id }}" />
<input type="hidden" name="action" value="reorder" />
<button type="submit" class="btn btn-success" data-loading-text="{% trans 'Re-ordering...' context 'Buy again' %}">
{% trans 'Re-order all items' context 'Buy again' %}
</button>
</form>
{% endblock order_actions %}
<hr>
<h2>{% trans 'Shipping Method' %}</h2>
<p>
{{ order.shipping_method }}
</p>
<hr>
<h2>
{% trans 'Shipping Address' %}
</h2>
<table class="table table-striped table-bordered">
<tr>
<th>
{% trans 'Address' %}
</th>
<th>
{% trans 'Contact Number' %}
</th>
<th>
{% trans 'Shipping Notes' %}
</th>
</tr>
<tr>
<td>
{% for field in order.shipping_address.active_address_fields %}
{{ field }}
<br/>
{% endfor %}
</td>
<td>
{{ order.shipping_address.phone_number|default:"-" }}
</td>
<td>
{{ order.shipping_address.notes|linebreaks }}
</td>
</tr>
</table>
</table>
{% endblock tabcontent %}

View file

@ -2,39 +2,40 @@
{% load display_tags %}
<li class="nav-item">
<a href="{% url 'customer:profile-view' %}" class="nav-link{% if active_tab == 'profile' %}active{% endif %}">
{% trans "Profile" %}
</a>
{% trans "Profile" %}
</a>
</li>
<li class="nav-item">
<a href="{% url 'customer:order-list' %}" class="nav-link{% if active_tab == 'orders' %}active{% endif %}">
{% trans "Order History" %}
</a>
<a href="{% url 'customer:order-list' %}" class="nav-link{% if active_tab == 'orders' %}active{% endif %}">
{% trans "Order History" %}
</a>
</li>
<li class="nav-item">
<a href="{% url 'customer:address-list' %}" class="nav-link{% if active_tab == 'addresses' %}active{% endif %}">
{% trans "Address Book" %}
</a>
<a href="{% url 'customer:address-list' %}" class="nav-link{% if active_tab == 'addresses' %}active{% endif %}">
{% trans "Address Book" %}
</a>
</li>
<li class="nav-item">
<a href="{% url 'customer:email-list' %}" class="nav-link{% if active_tab == 'emails' %}active{% endif %}">
{% trans "Email History" %}
</a>
<a href="{% url 'customer:email-list' %}" class="nav-link{% if active_tab == 'emails' %}active{% endif %}">
{% trans "Email History" %}
</a>
</li>
<li class="nav-item">
<a href="{% url 'customer:alerts-list' %}" class="nav-link{% if active_tab == 'alerts' %}active{% endif %}">
{% trans "Product Alerts" %}
</a>
<a href="{% url 'customer:alerts-list' %}" class="nav-link{% if active_tab == 'alerts' %}active{% endif %}">
{% trans "Product Alerts" %}
</a>
</li>
<li class="nav-item">
<a href="{% url 'customer:notifications-inbox' %}"
class="nav-link{% if active_tab == 'notifications' %}active{% endif %}">
{% trans "Notifications" %}
</a>
<a href="{% url 'customer:notifications-inbox' %}"
class="nav-link{% if active_tab == 'notifications' %}active{% endif %}">
{% trans "Notifications" %}
</a>
</li>
{% iffeature 'wishlists' %}
<li class="nav-item">
<a href="{% url 'customer:wishlists-list' %}" class="nav-link{% if active_tab == 'wishlists' %}active{% endif %}">
{% trans "Wish Lists" %}
</a>
</li>
<li class="nav-item">
<a href="{% url 'customer:wishlists-list' %}"
class="nav-link{% if active_tab == 'wishlists' %}active{% endif %}">
{% trans "Wish Lists" %}
</a>
</li>
{% endiffeature %}

View file

@ -1,4 +1,5 @@
{% extends "oscar/customer/baseaccountpage.html" %}
{% load i18n %}
{% block tabcontent %}
{% include 'oscar/partials/form.html' with form_id="change_password_form" %}{% endblock tabcontent %}
{% include 'oscar/partials/form.html' with form_id="change_password_form" %}
{% endblock tabcontent %}

View file

@ -1,4 +1,5 @@
{% extends "oscar/customer/baseaccountpage.html" %}
{% load i18n %}
{% block tabcontent %}
{% include 'oscar/partials/form.html' with form_id="profile_form" %}{% endblock tabcontent %}
{% include 'oscar/partials/form.html' with form_id="profile_form" %}
{% endblock tabcontent %}

View file

@ -38,94 +38,99 @@
</tr>
{% for subform in form %}
{% with line=subform.instance product=subform.instance.product %}
<tr>
<td>
{% if product %}
{% with image=product.primary_image %}
{% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
{% if product.is_public %}
<a href="{{ product.get_absolute_url }}">
<img class="img-thumbnail"
src="{{ thumb.url }}"
alt="{{ product.get_title }}"/>
<tr>
<td>
{% if product %}
{% with image=product.primary_image %}
{% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
{% if product.is_public %}
<a href="{{ product.get_absolute_url }}">
<img class="img-thumbnail"
src="{{ thumb.url }}"
alt="{{ product.get_title }}"/>
</a>
{% else %}
<img class="img-thumbnail"
src="{{ thumb.url }}"
alt="{{ product.get_title }}"/>
{% endif %}
{% endwith %}
{% endif %}
</td>
<td>
{% if product and product.is_public %}
<a href="{{ line.product.get_absolute_url }}">
{{ line.get_title }}
</a>
{% else %}
<img class="img-thumbnail"
src="{{ thumb.url }}"
alt="{{ product.get_title }}"/>
<em>{{ line.get_title }} ({% trans 'Not available anymore' %})</em>
{% endif %}
{% endwith %}
{% endif %}
</td>
<td>
{% if product and product.is_public %}
<a href="{{ line.product.get_absolute_url }}">
{{ line.get_title }}
</a>
{% else %}
<em>{{ line.get_title }} ({% trans 'Not available anymore' %})</em>
{% endif %}
</td>
<td>
{% for field in subform %}
{% render_field field class+="form-control" %}
{% for error in field.errors %}
<ul class="error-block">
<li>
{{ error }}
</li>
</ul>
{% endfor %}
{% endfor %}
</td>
<td>
<div class="btn-group">
{% if product %}
<a class="btn btn-secondary" href="{{ line.product.get_absolute_url }}">
{% trans 'View product' %}
</a>
<button class="btn btn-secondary dropdown-toggle" data-toggle="dropdown"></button>
{% else %}
<a class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" href="#">
{% trans 'Actions' %}
</a>
{% endif %}
<ul class="dropdown-menu dropdown-menu-right">
<li>
<a href="{% url 'customer:wishlists-remove-product' key=wishlist.key line_pk=line.pk %}"
class="dropdown-item">
{% trans 'Remove' %}
</a>
</li>
{% for other_wishlist in other_wishlists %}
<li>
<a href="{% url 'customer:wishlists-move-product-to-another' key=wishlist.key line_pk=line.pk to_key=other_wishlist.key %}"
class="dropdown-item">
{% blocktrans with name=other_wishlist.name %}
Move to '{{ name }}' wish list
{% endblocktrans %}
</a>
</li>
</td>
<td>
{% for field in subform %}
{% render_field field class+="form-control" %}
{% for error in field.errors %}
<ul class="error-block">
<li>
{{ error }}
</li>
</ul>
{% endfor %}
{% endfor %}
</ul>
</div>
</td>
<td>
<div class="btn-group">
{% if product %}
<a class="btn btn-secondary" href="{{ line.product.get_absolute_url }}">
{% trans 'View product' %}
</a>
<button class="btn btn-secondary dropdown-toggle"
data-toggle="dropdown"></button>
{% else %}
<a class="btn btn-secondary dropdown-toggle"
data-toggle="dropdown"
href="#">
{% trans 'Actions' %}
</a>
{% endif %}
<ul class="dropdown-menu dropdown-menu-right">
<li>
<a href="{% url 'customer:wishlists-remove-product' key=wishlist.key line_pk=line.pk %}"
class="dropdown-item">
{% trans 'Remove' %}
</a>
</li>
{% for other_wishlist in other_wishlists %}
<li>
<a href="{% url 'customer:wishlists-move-product-to-another' key=wishlist.key line_pk=line.pk to_key=other_wishlist.key %}"
class="dropdown-item">
{% blocktrans with name=other_wishlist.name %}
Move to '{{ name }}' wish list
{% endblocktrans %}
</a>
</li>
{% endfor %}
</ul>
</div>
</td>
</tr>
{% endwith %}
{% endfor %}
<tr>
<td colspan="2"></td>
<td>
<button class="btn btn-primary"
type="submit"
data-loading-text="{% trans 'Updating...' %}">
{% trans "Update quantities" %}
</button>
</td>
<td></td>
</tr>
{% endwith %}
{% endfor %}
<tr>
<td colspan="2"></td>
<td>
<button class="btn btn-primary" type="submit" data-loading-text="{% trans 'Updating...' %}">
{% trans "Update quantities" %}
</button>
</td>
<td></td>
</tr>
</tbody>
</table>
</form>
{% else %}
{% trans "Your wish list is empty." %}
{% endif %}
</tbody>
</table>
</form>
{% else %}
{% trans "Your wish list is empty." %}
{% endif %}
{% endblock tabcontent %}

View file

@ -95,74 +95,75 @@
{% endfor %}
{% endif %}
{% for field in form %}
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}{% endfor %}
</div>
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}
{% endfor %}
</div>
{% endblock %}
{% block attribute_options %}
<div class="tab-pane" id="attribute_options">
<div class="table-header">
<h3>{% trans "Attribute Options" %}</h3>
</div>
<div class="attribute-options">
<table class="table table-striped table-bordered">
{{ attribute_option_formset.management_form }}
{{ attribute_option_formset.non_form_errors }}
<col width="50%">
<col width="50%">
<thead>
</div>
{% endblock %}
{% block attribute_options %}
<div class="tab-pane" id="attribute_options">
<div class="table-header">
<h3>{% trans "Attribute Options" %}</h3>
</div>
<div class="attribute-options">
<table class="table table-striped table-bordered">
{{ attribute_option_formset.management_form }}
{{ attribute_option_formset.non_form_errors }}
<col width="50%">
<col width="50%">
<thead>
<tr>
<th>{% trans "Option" %}</th>
<th>{% trans "Delete?" %}</th>
</tr>
</thead>
<tbody>
{% for attribute_option_form in attribute_option_formset %}
<tr>
<th>{% trans "Option" %}</th>
<th>{% trans "Delete?" %}</th>
{% for hidden_field in attribute_option_form.hidden_fields %}
{{ hidden_field }}
{% endfor %}
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_option_form.option nolabel=True %}
</td>
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_option_form.DELETE nolabel=True %}
</td>
</tr>
</thead>
<tbody>
{% for attribute_option_form in attribute_option_formset %}
<tr>
{% for hidden_field in attribute_option_form.hidden_fields %}
{{ hidden_field }}
{% endfor %}
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_option_form.option nolabel=True %}
</td>
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_option_form.DELETE nolabel=True %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
{% endblock tab_content %}
</div>
{% endblock %}
{% endblock tab_content %}
</div>
</div>
</div>
{% block fixed_actions_group %}
<div class="fixed-actions-group">
<div class="form-actions">
<div class="float-right">
<a href="#"
{% if not is_popup %}
onclick="window.history.go(-1);return false"
{% else %}
onclick="window.close();return false;"
{% endif %}
>
{% trans "Cancel" %}
</a>
{% trans "or" %}
<button class="btn btn-primary" type="submit">
{% trans "Save" %}
</button>
</div>
</div>
</div>
{% block fixed_actions_group %}
<div class="fixed-actions-group">
<div class="form-actions">
<div class="float-right">
<a href="#"
{% if not is_popup %}
onclick="window.history.go(-1);return false"
{% else %}
onclick="window.close();return false;"
{% endif %}
>
{% trans "Cancel" %}
</a>
{% trans "or" %}
<button class="btn btn-primary" type="submit">
{% trans "Save" %}
</button>
</div>
</div>
</div>
{% endblock fixed_actions_group %}
</form>
{% endblock fixed_actions_group %}
</form>
{% endblock dashboard_content %}
{% block onbodyload %}
{{ block.super }}
oscar.dashboard.product_attributes.init();
{{ block.super }}
oscar.dashboard.product_attributes.init();
{% endblock %}

View file

@ -11,40 +11,40 @@
</li>
<li class="breadcrumb-item">
<a href="{% if parent %}{% url 'dashboard:catalogue-category-detail-list' pk=parent.pk %}{% else %}{% url 'dashboard:catalogue-category-list' %}{% endif %}">
{% trans "Categories" %}
</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
{% trans "Delete category?" %}
</li>
</ol>
</nav>
{% trans "Categories" %}
</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
{% trans "Delete category?" %}
</li>
</ol>
</nav>
{% endblock %}
{% block headertext %}
{% trans "Delete category?" %}
{% trans "Delete category?" %}
{% endblock %}
{% block dashboard_content %}
<div class="table-header">
<h2>{% trans "Delete category" %}</h2>
</div>
<form method="post" class="card card-body bg-light">
{% csrf_token %}
{{ form }}
{% blocktrans with name=object.name %}
<p>
Delete category
<strong>{{ name }}</strong>
- are you sure?
</p>
{% endblocktrans %}
<div class="form-actions">
<button type="submit" class="btn btn-danger" data-loading-text="{% trans 'Deleting...' %}">
{% trans "Delete" %}
</button>
{% trans "or" %}
<a href="{% if parent %}{% url 'dashboard:catalogue-category-detail-list' pk=parent.pk %}{% else %}{% url 'dashboard:catalogue-category-list' %}{% endif %}">
{% trans "cancel" %}
</a>
</div>
</form>
<div class="table-header">
<h2>{% trans "Delete category" %}</h2>
</div>
<form method="post" class="card card-body bg-light">
{% csrf_token %}
{{ form }}
{% blocktrans with name=object.name %}
<p>
Delete category
<strong>{{ name }}</strong>
- are you sure?
</p>
{% endblocktrans %}
<div class="form-actions">
<button type="submit" class="btn btn-danger" data-loading-text="{% trans 'Deleting...' %}">
{% trans "Delete" %}
</button>
{% trans "or" %}
<a href="{% if parent %}{% url 'dashboard:catalogue-category-detail-list' pk=parent.pk %}{% else %}{% url 'dashboard:catalogue-category-list' %}{% endif %}">
{% trans "cancel" %}
</a>
</div>
</form>
{% endblock %}

View file

@ -32,46 +32,47 @@
enctype="multipart/form-data"
data-behaviour="tab-nav-errors"
autocomplete="off">
{% csrf_token %}
<div class="row">
{% block tab_nav %}
<div class="col-md-3">
<div class="tab-nav sticky-top">
<div class="table-header">
<h3>{% trans "Sections" %}</h3>
{% csrf_token %}
<div class="row">
{% block tab_nav %}
<div class="col-md-3">
<div class="tab-nav sticky-top">
<div class="table-header">
<h3>{% trans "Sections" %}</h3>
</div>
<ul class="nav flex-column bs-docs-sidenav" id="category_update_tabs">
{% block tabs %}
<li class="nav-item">
<a class="nav-link active" href="#category_details" data-toggle="tab">
{% trans 'Category details' %}
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#seo" data-toggle="tab">
{% trans 'Search engine optimisation' %}
</a>
</li>
{% endblock tabs %}
</ul>
</div>
<ul class="nav flex-column bs-docs-sidenav" id="category_update_tabs">
{% block tabs %}
<li class="nav-item">
<a class="nav-link active" href="#category_details" data-toggle="tab">
{% trans 'Category details' %}
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#seo" data-toggle="tab">
{% trans 'Search engine optimisation' %}
</a>
</li>
{% endblock tabs %}
</ul>
</div>
</div>
{% endblock tab_nav %}
<div class="col-md-9">
<div class="tab-content">
{% block tab_content %}
{% block category_details %}
<div class="tab-pane active" id="category_details">
<div class="table-header">
<h3>{% trans "Category details" %}</h3>
</div>
<div class="card card-body category-details">
{% block category_details_content %}
<span class="error-block">{{ form.non_field_errors }}</span>
{% for field in form.hidden_fields %}{{ field }}{% endfor %}
{% for field in form.primary_form_fields %}
{% if 'attr' not in field.id_for_label %}
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}{% endif %}
{% endblock tab_nav %}
<div class="col-md-9">
<div class="tab-content">
{% block tab_content %}
{% block category_details %}
<div class="tab-pane active" id="category_details">
<div class="table-header">
<h3>{% trans "Category details" %}</h3>
</div>
<div class="card card-body category-details">
{% block category_details_content %}
<span class="error-block">{{ form.non_field_errors }}</span>
{% for field in form.hidden_fields %}{{ field }}{% endfor %}
{% for field in form.primary_form_fields %}
{% if 'attr' not in field.id_for_label %}
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}
{% endif %}
{% endfor %}
{% endblock category_details_content %}
</div>
@ -86,46 +87,47 @@
{% block seo_content %}
{% for field in form.seo_form_fields %}
{% if 'attr' not in field.id_for_label %}
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}{% endif %}
{% endfor %}
{% endblock seo_content %}
</div>
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}
{% endif %}
{% endfor %}
{% endblock seo_content %}
</div>
{% endblock seo %}
{% endblock tab_content %}
</div>
</div>
{% endblock seo %}
{% endblock tab_content %}
</div>
</div>
{% block fixed_actions_group %}
<div class="fixed-actions-group">
<div class="form-group">
<div class="float-right">
<a href="{% url 'dashboard:catalogue-category-list' %}">
{% trans "Cancel" %}
</a>
{% trans "or" %}
<button class="btn btn-secondary"
name="action"
type="submit"
value="continue"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Save and continue editing" %}
</button>
<button class="btn btn-primary"
name="action"
type="submit"
value="save"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Save" %}
</button>
</div>
{% if category %}
<a class="btn btn-success" href="{{ category.get_absolute_url }}">
{% trans "View on site" %}
</a>
{% endif %}
</div>
{% block fixed_actions_group %}
<div class="fixed-actions-group">
<div class="form-group">
<div class="float-right">
<a href="{% url 'dashboard:catalogue-category-list' %}">
{% trans "Cancel" %}
</a>
{% trans "or" %}
<button class="btn btn-secondary"
name="action"
type="submit"
value="continue"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Save and continue editing" %}
</button>
<button class="btn btn-primary"
name="action"
type="submit"
value="save"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Save" %}
</button>
</div>
{% if category %}
<a class="btn btn-success" href="{{ category.get_absolute_url }}">
{% trans "View on site" %}
</a>
{% endif %}
</div>
{% endblock fixed_actions_group %}
</form>
{% endblock dashboard_content %}
</div>
{% endblock fixed_actions_group %}
</form>
{% endblock dashboard_content %}

View file

@ -19,14 +19,14 @@
</a>
<a class="dropdown-item {% if not record.has_children %}disabled{% endif %}"
href="{% if not record.has_children %}#{% else %}{% url 'dashboard:catalogue-category-detail-list' pk=record.pk %}{% endif %}">
{% trans "Edit children" %}
</a>
<a class="dropdown-item" href="{{ record.get_absolute_url }}">
{% trans "View on site" %}
</a>
<a class="dropdown-item" href="{% url 'dashboard:catalogue-category-delete' pk=record.id %}">
{% trans "Delete" %}
</a>
{% trans "Edit children" %}
</a>
<a class="dropdown-item" href="{{ record.get_absolute_url }}">
{% trans "View on site" %}
</a>
<a class="dropdown-item" href="{% url 'dashboard:catalogue-category-delete' pk=record.id %}">
{% trans "Delete" %}
</a>
</div>
</div>
</div>
</div>

View file

@ -2,46 +2,46 @@
{% load django_tables2 %}
<p>
{% with name=product.title parent_name=product.parent.title %}
{% if product.is_child %}
{% if creating %}
{% if product.title %}
{% if product.is_child %}
{% if creating %}
{% if product.title %}
{% blocktrans %}
Created product variant '{{ name }}'.
{% endblocktrans %}
{% else %}
{% blocktrans %}
Created variant of '{{ parent_name }}'.
{% endblocktrans %}
{% endif %}
{% else %}
{% if product.title %}
{% blocktrans %}
Updated product variant '{{ name }}'.
{% endblocktrans %}
{% else %}
{% blocktrans %}
Updated a variant of '{{ parent_name }}'.
{% endblocktrans %}
{% endif %}
{% endif %}
{% else %}
{% if creating %}
{% blocktrans %}
Created product variant '{{ name }}'.
Created product '{{ name }}'.
{% endblocktrans %}
{% else %}
{% blocktrans %}
Created variant of '{{ parent_name }}'.
{% endblocktrans %}
{% endif %}
{% else %}
{% if product.title %}
{% blocktrans %}
Updated product variant '{{ name }}'.
{% endblocktrans %}
{% else %}
{% blocktrans %}
Updated a variant of '{{ parent_name }}'.
Updated product '{{ name }}'.
{% endblocktrans %}
{% endif %}
{% endif %}
{% else %}
{% if creating %}
{% blocktrans %}
Created product '{{ name }}'.
{% endblocktrans %}
{% else %}
{% blocktrans %}
Updated product '{{ name }}'.
{% endblocktrans %}
{% endif %}
{% endif %}
{% endwith %}
{% endwith %}
</p>
<p>
<a href="{% url 'dashboard:catalogue-product' pk=product.pk %}{% querystring %}" class="btn btn-success">
{% trans "Edit again" %}
</a>
<a href="{{ product.get_absolute_url }}" class="btn btn-success">
{% trans "View it on the site" %}
</a>
<a href="{% url 'dashboard:catalogue-product' pk=product.pk %}{% querystring %}" class="btn btn-success">
{% trans "Edit again" %}
</a>
<a href="{{ product.get_absolute_url }}" class="btn btn-success">
{% trans "View it on the site" %}
</a>
</p>

View file

@ -67,33 +67,34 @@
{% endfor %}
{% endif %}
{% for field in form %}
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}{% endfor %}
</div>
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}
{% endfor %}
</div>
{% endblock %}
</div>
{% endblock %}
</div>
</div>
</div>
{% block fixed_actions_group %}
<div class="fixed-actions-group">
<div class="form-actions">
<div class="float-right">
<a href="#"
{% if not is_popup %}
onclick="window.history.go(-1);return false"
{% else %}
onclick="window.close();return false;"
{% endif %}
>
{% trans "Cancel" %}
</a>
{% trans "or" %}
<button class="btn btn-primary" type="submit">
{% trans "Save" %}
</button>
</div>
</div>
</div>
{% block fixed_actions_group %}
<div class="fixed-actions-group">
<div class="form-actions">
<div class="float-right">
<a href="#"
{% if not is_popup %}
onclick="window.history.go(-1);return false"
{% else %}
onclick="window.close();return false;"
{% endif %}
>
{% trans "Cancel" %}
</a>
{% trans "or" %}
<button class="btn btn-primary" type="submit">
{% trans "Save" %}
</button>
</div>
</div>
</div>
{% endblock fixed_actions_group %}
</form>
{% endblock fixed_actions_group %}
</form>
{% endblock dashboard_content %}

View file

@ -79,82 +79,83 @@
{% endfor %}
{% endif %}
{% for field in form %}
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}{% endfor %}
</div>
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}
{% endfor %}
</div>
{% endblock %}
{% block product_attributes %}
<div class="tab-pane" id="product_attributes">
<div class="table-header">
<h3>{% trans "Product attributes" %}</h3>
</div>
<div class="product-attributes">
<table class="table table-striped table-bordered">
{{ attributes_formset.management_form }}
{{ attributes_formset.non_form_errors }}
<col width="20%">
<col width="20%">
<col width="20%">
<thead>
</div>
{% endblock %}
{% block product_attributes %}
<div class="tab-pane" id="product_attributes">
<div class="table-header">
<h3>{% trans "Product attributes" %}</h3>
</div>
<div class="product-attributes">
<table class="table table-striped table-bordered">
{{ attributes_formset.management_form }}
{{ attributes_formset.non_form_errors }}
<col width="20%">
<col width="20%">
<col width="20%">
<thead>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "Code" %}</th>
<th>{% trans "Type" %}</th>
<th>{% trans "Required" %}</th>
<th>{% trans "Delete?" %}</th>
</tr>
</thead>
<tbody>
{% for attribute_form in attributes_formset %}
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "Code" %}</th>
<th>{% trans "Type" %}</th>
<th>{% trans "Required" %}</th>
<th>{% trans "Delete?" %}</th>
{% for hidden_field in attribute_form.hidden_fields %}
{{ hidden_field }}
{% endfor %}
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.name nolabel=True %}
</td>
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.code nolabel=True %}
</td>
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.type nolabel=True %}
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.option_group nolabel=True %}
</td>
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.required nolabel=True %}
</td>
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.DELETE nolabel=True %}
</td>
</tr>
</thead>
<tbody>
{% for attribute_form in attributes_formset %}
<tr>
{% for hidden_field in attribute_form.hidden_fields %}
{{ hidden_field }}
{% endfor %}
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.name nolabel=True %}
</td>
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.code nolabel=True %}
</td>
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.type nolabel=True %}
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.option_group nolabel=True %}
</td>
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.required nolabel=True %}
</td>
<td>
{% include 'oscar/dashboard/partials/form_field.html' with field=attribute_form.DELETE nolabel=True %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
{% endblock tab_content %}
</div>
{% endblock %}
{% endblock tab_content %}
</div>
</div>
</div>
{% block fixed_actions_group %}
<div class="fixed-actions-group">
<div class="form-actions">
<div class="float-right">
<a href="#" onclick="window.history.go(-1);return false" >
{% trans "Cancel" %}
</a>
{% trans "or" %}
<button class="btn btn-primary" type="submit">
{% trans "Save" %}
</button>
</div>
</div>
</div>
{% block fixed_actions_group %}
<div class="fixed-actions-group">
<div class="form-actions">
<div class="float-right">
<a href="#" onclick="window.history.go(-1);return false" >
{% trans "Cancel" %}
</a>
{% trans "or" %}
<button class="btn btn-primary" type="submit">
{% trans "Save" %}
</button>
</div>
</div>
</div>
{% endblock fixed_actions_group %}
</form>
{% endblock fixed_actions_group %}
</form>
{% endblock dashboard_content %}
{% block onbodyload %}
{{ block.super }}
oscar.dashboard.product_attributes.init();
{{ block.super }}
oscar.dashboard.product_attributes.init();
{% endblock %}

View file

@ -85,18 +85,18 @@
</div>
<div class="modal-body text-center">
<img class="img-fluid mx-auto">
</div>
</div>
</div>
</div>
{% endblock product_list %}
{% else %}
<p>
{% trans "No products found." %}
</p>
{% endif %}
</div>
{% endblock product_list %}
{% else %}
<p>
{% trans "No products found." %}
</p>
{% endif %}
{% endblock dashboard_content %}
{% block onbodyload %}
{{ block.super }}
oscar.dashboard.product_lists.init();
{{ block.super }}
oscar.dashboard.product_lists.init();
{% endblock onbodyload %}

View file

@ -1,14 +1,14 @@
{% load image_tags %}
{% if record.primary_image.original.url %}
{% with image=record.primary_image %}
{% oscar_thumbnail image.original "70x70" upscale=False as thumb %}
<a href="#" data-original="{{ image.original.url }}" class="sub-image">
<img src="{{ thumb.url }}"
alt="{% if image.caption %}{{ image.caption }}{% else %}{{ record.get_title }}{% endif %}"
height="{{ thumb.height }}"
width="{{ thumb.width }}">
</a>
{% endwith %}
{% oscar_thumbnail image.original "70x70" upscale=False as thumb %}
<a href="#" data-original="{{ image.original.url }}" class="sub-image">
<img src="{{ thumb.url }}"
alt="{% if image.caption %}{{ image.caption }}{% else %}{{ record.get_title }}{% endif %}"
height="{{ thumb.height }}"
width="{{ thumb.width }}">
</a>
{% endwith %}
{% else %}
{% endif %}

View file

@ -39,107 +39,108 @@
enctype="multipart/form-data"
data-behaviour="tab-nav-errors"
autocomplete="off">
{% csrf_token %}
{% if parent %}
<div class="row">
<div class="col-md-12">
<div class="alert alert-info">
{% url 'dashboard:catalogue-product' pk=parent.id as parent_url %}
{% blocktrans with title=parent.title %}
You are currently editing a product variant of
<a href="{{ parent_url }}">{{ title }}</a>
.
{% endblocktrans %}
{% csrf_token %}
{% if parent %}
<div class="row">
<div class="col-md-12">
<div class="alert alert-info">
{% url 'dashboard:catalogue-product' pk=parent.id as parent_url %}
{% blocktrans with title=parent.title %}
You are currently editing a product variant of
<a href="{{ parent_url }}">{{ title }}</a>
.
{% endblocktrans %}
</div>
</div>
</div>
</div>
{% endif %}
<div class="row">
{% block tab_nav %}
<div class="col-md-3">
<div class="tab-nav sticky-top">
<div class="table-header">
<h3>{% trans "Sections" %}</h3>
</div>
<ul class="nav flex-column bs-docs-sidenav" id="product_update_tabs">
{% comment %}
The navigation below is filtered heavily on the product structure.
This intentionally is the only place where filtering is done, as
deployments are likely to want to override certain aspects of what
data is stored on products of a certain structure. This means that
only one template block (instead of all affected) has to be altered.
{% endcomment %}
{% block tabs %}
<li class="nav-item">
<a class="nav-link active" href="#product_details" data-toggle="tab">
{% trans 'Product details' %}
</a>
</li>
{% if not parent %}
<li class="nav-item">
<a class="nav-link" href="#product_category" data-toggle="tab">
{% trans 'Categories' %}
</a>
</li>
{% endif %}
{% if product_class.has_attributes %}
<li class="nav-item">
<a class="nav-link" href="#product_attributes" data-toggle="tab">
{% trans 'Attributes' %}
</a>
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link" href="#product_images" data-toggle="tab">
{% trans 'Images' %}
</a>
</li>
{% if not product.is_parent %}
<li class="nav-item">
<a class="nav-link" href="#product_stock" data-toggle="tab">
{% trans 'Stock and pricing' %}
</a>
</li>
{% endif %}
{% if user.is_staff and not parent %}
<li class="nav-item">
<a class="nav-link" href="#child_products" data-toggle="tab">
{% trans 'Variants' %}
</a>
</li>
{% endif %}
{% if not parent %}
<li class="nav-item">
<a class="nav-link" href="#product_recommended" data-toggle="tab">
{% trans 'Upselling' %}
</a>
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link" href="#seo" data-toggle="tab">
{% trans 'Search engine optimisation' %}
</a>
</li>
{% endblock tabs %}
</ul>
</div>
</div>
{% endblock tab_nav %}
<div class="col-md-9">
<div class="tab-content">
{% block tab_content %}
{% block product_details %}
<div class="tab-pane active" id="product_details">
{% endif %}
<div class="row">
{% block tab_nav %}
<div class="col-md-3">
<div class="tab-nav sticky-top">
<div class="table-header">
<h3>{% trans "Product details" %}</h3>
<h3>{% trans "Sections" %}</h3>
</div>
<div class="card card-body product-details">
{% block product_details_content %}
<span class="error-block">{{ form.non_field_errors }}</span>
{% for field in form.hidden_fields %}{{ field }}{% endfor %}
{% for field in form.primary_form_fields %}
{% if 'attr' not in field.id_for_label %}
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}{% endif %}
<ul class="nav flex-column bs-docs-sidenav" id="product_update_tabs">
{% comment %}
The navigation below is filtered heavily on the product structure.
This intentionally is the only place where filtering is done, as
deployments are likely to want to override certain aspects of what
data is stored on products of a certain structure. This means that
only one template block (instead of all affected) has to be altered.
{% endcomment %}
{% block tabs %}
<li class="nav-item">
<a class="nav-link active" href="#product_details" data-toggle="tab">
{% trans 'Product details' %}
</a>
</li>
{% if not parent %}
<li class="nav-item">
<a class="nav-link" href="#product_category" data-toggle="tab">
{% trans 'Categories' %}
</a>
</li>
{% endif %}
{% if product_class.has_attributes %}
<li class="nav-item">
<a class="nav-link" href="#product_attributes" data-toggle="tab">
{% trans 'Attributes' %}
</a>
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link" href="#product_images" data-toggle="tab">
{% trans 'Images' %}
</a>
</li>
{% if not product.is_parent %}
<li class="nav-item">
<a class="nav-link" href="#product_stock" data-toggle="tab">
{% trans 'Stock and pricing' %}
</a>
</li>
{% endif %}
{% if user.is_staff and not parent %}
<li class="nav-item">
<a class="nav-link" href="#child_products" data-toggle="tab">
{% trans 'Variants' %}
</a>
</li>
{% endif %}
{% if not parent %}
<li class="nav-item">
<a class="nav-link" href="#product_recommended" data-toggle="tab">
{% trans 'Upselling' %}
</a>
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link" href="#seo" data-toggle="tab">
{% trans 'Search engine optimisation' %}
</a>
</li>
{% endblock tabs %}
</ul>
</div>
</div>
{% endblock tab_nav %}
<div class="col-md-9">
<div class="tab-content">
{% block tab_content %}
{% block product_details %}
<div class="tab-pane active" id="product_details">
<div class="table-header">
<h3>{% trans "Product details" %}</h3>
</div>
<div class="card card-body product-details">
{% block product_details_content %}
<span class="error-block">{{ form.non_field_errors }}</span>
{% for field in form.hidden_fields %}{{ field }}{% endfor %}
{% for field in form.primary_form_fields %}
{% if 'attr' not in field.id_for_label %}
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}
{% endif %}
{% endfor %}
{% endblock product_details_content %}
</div>
@ -195,47 +196,48 @@
{{ image_formset.non_form_errors }}
<ol class='upload-image'>
{% for image_form in image_formset %}
{% include "oscar/dashboard/partials/product_images.html" with form=image_form %}{% endfor %}
</ol>
<p class="form-text">
{% trans 'Drag images to re-order them. Space for additional images will appear when images are added.' %}
</p>
</div>
{% endblock product_images_content %}
</div>
{% endblock product_images %}
{% block stockrecords %}
<div class="tab-pane" id="product_stock">
{% block stockrecords_content %}
<table class="table table-striped table-bordered">
<caption>
{% trans "Stock and pricing" %}
</caption>
{{ stockrecord_formset.management_form }}
{{ stockrecord_formset.non_form_errors }}
<thead>
<tr>
<th>{% trans "Partner" %}</th>
<th>{% trans "SKU" %}</th>
{% if product_class.track_stock %}
<th>{% trans "Num in stock" %}</th>
<th>{% trans "Num allocated" %}</th>
<th>{% trans "Low stock threshold" %}</th>
{% endif %}
<th>{% trans "Currency" %}</th>
<th>
{% trans "Price" %}
</th>
<th>
{% trans "Delete?" %}
</th>
</tr>
</thead>
<tbody>
{% for stockrecord_form in stockrecord_formset %}
{% if stockrecord_form.non_field_errors %}
<tr>
<td colspan="{% if product_class.track_stock %}10{% else %}7{% endif %}">
{% include "oscar/dashboard/partials/product_images.html" with form=image_form %}
{% endfor %}
</ol>
<p class="form-text">
{% trans 'Drag images to re-order them. Space for additional images will appear when images are added.' %}
</p>
</div>
{% endblock product_images_content %}
</div>
{% endblock product_images %}
{% block stockrecords %}
<div class="tab-pane" id="product_stock">
{% block stockrecords_content %}
<table class="table table-striped table-bordered">
<caption>
{% trans "Stock and pricing" %}
</caption>
{{ stockrecord_formset.management_form }}
{{ stockrecord_formset.non_form_errors }}
<thead>
<tr>
<th>{% trans "Partner" %}</th>
<th>{% trans "SKU" %}</th>
{% if product_class.track_stock %}
<th>{% trans "Num in stock" %}</th>
<th>{% trans "Num allocated" %}</th>
<th>{% trans "Low stock threshold" %}</th>
{% endif %}
<th>{% trans "Currency" %}</th>
<th>
{% trans "Price" %}
</th>
<th>
{% trans "Delete?" %}
</th>
</tr>
</thead>
<tbody>
{% for stockrecord_form in stockrecord_formset %}
{% if stockrecord_form.non_field_errors %}
<tr>
<td colspan="{% if product_class.track_stock %}10{% else %}7{% endif %}">
{% for error in stockrecord_form.non_field_errors %}
<span class="error-block errorlist">
<i class="fas fa-exclamation"></i>
@ -282,166 +284,167 @@
{% endblock stockrecords %}
{% block child_products %}
{% with children=product.children.all %}
<div class="tab-pane" id="child_products">
{% block child_products_content %}
<table class='table table-striped table-bordered'>
<div class="tab-pane" id="child_products">
{% block child_products_content %}
<table class='table table-striped table-bordered'>
<caption>
{% trans "Variants" %}
<button class="btn btn-primary float-right"
{% if not product.can_be_parent %}disabled{% endif %}
name="action" type="submit" value="create-child" data-loading-text="{% trans 'Adding...' %}">
<i class="fas fa-plus-circle"></i>
{% trans "Add variant" %}
</button>
</caption>
{% if children %}
<tr>
<th>
{% trans "Title" %}
</th>
<th>
{% trans "Attributes" %}
</th>
<th>
{% trans "Stock records" %}
</th>
<th>
{% trans "Is public?" %}
</th>
<th>
&nbsp;
</th>
</tr>
{% for child in children %}
<tr>
<td>
{{ child.get_title }}
</td>
<td>
{{ child.attribute_summary }}
</td>
<td>
{{ child.stockrecords.count }}
</td>
<td>
{% if child.is_public %}
<span class="true"></span>
{% else %}
<span class="false"></span>
{% endif %}
</td>
<td>
<a href="{% url 'dashboard:catalogue-product' pk=child.id %}"
class="btn btn-primary">
{% trans "Edit" %}
</a>
<a href="{% url 'dashboard:catalogue-product-delete' pk=child.id %}"
class="btn btn-danger">
{% trans "Delete" %}
</a>
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="5">
{% if product.can_be_parent %}
{% trans 'This product does not have any variants.' %}
{% else %}
{% trans "One can't add variants to this product at this point." %}
{% if product.pk is None %}
{% trans "Please save the product before trying to add variants." %}
{% elif product.has_stockrecords %}
{% trans 'This is likely because this product still has stock records.' %}
{% endif %}
{% endif %}
</td>
</tr>
{% endif %}
</table>
{% endblock child_products_content %}
</div>
{% endwith %}
{% endblock child_products %}
{% block recommended_products %}
<div class="tab-pane" id="product_recommended">
{% block recommended_products_content %}
<table class="table table-striped table-bordered">
<caption>
{% trans "Variants" %}
<button class="btn btn-primary float-right" {% if not product.can_be_parent %}disabled{% endif %}
name="action" type="submit" value="create-child" data-loading-text="{% trans 'Adding...' %}">
<i class="fas fa-plus-circle"></i>
{% trans "Add variant" %}
</button>
</caption>
{% if children %}
<tr>
<th>
{% trans "Title" %}
</th>
<th>
{% trans "Attributes" %}
</th>
<th>
{% trans "Stock records" %}
</th>
<th>
{% trans "Is public?" %}
</th>
<th>
&nbsp;
</th>
</tr>
{% for child in children %}
{% trans "Recommended products" %}
</caption>
{{ recommended_formset.management_form }}
{{ recommended_formset.non_form_errors }}
{% for recommended_form in recommended_formset %}
<tr>
<td>
{{ child.get_title }}
</td>
<td>
{{ child.attribute_summary }}
</td>
<td>
{{ child.stockrecords.count }}
</td>
<td>
{% if child.is_public %}
<span class="true"></span>
{% else %}
<span class="false"></span>
{% endif %}
</td>
<td>
<a href="{% url 'dashboard:catalogue-product' pk=child.id %}"
class="btn btn-primary">
{% trans "Edit" %}
</a>
<a href="{% url 'dashboard:catalogue-product-delete' pk=child.id %}"
class="btn btn-danger">
{% trans "Delete" %}
</a>
<td class="form-inline">
{% include "oscar/dashboard/partials/form_fields_inline.html" with form=recommended_form %}
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="5">
{% if product.can_be_parent %}
{% trans 'This product does not have any variants.' %}
{% else %}
{% trans "One can't add variants to this product at this point." %}
{% if product.pk is None %}
{% trans "Please save the product before trying to add variants." %}
{% elif product.has_stockrecords %}
{% trans 'This is likely because this product still has stock records.' %}
{% endif %}
{% endif %}
</td>
</tr>
{% endif %}
</table>
{% endblock child_products_content %}
</div>
{% endwith %}
{% endblock child_products %}
{% block recommended_products %}
<div class="tab-pane" id="product_recommended">
{% block recommended_products_content %}
<table class="table table-striped table-bordered">
<caption>
{% trans "Recommended products" %}
</caption>
{{ recommended_formset.management_form }}
{{ recommended_formset.non_form_errors }}
{% for recommended_form in recommended_formset %}
<tr>
<td class="form-inline">
{% include "oscar/dashboard/partials/form_fields_inline.html" with form=recommended_form %}
</td>
</tr>
{% endfor %}
</table>
{% endblock recommended_products_content %}
</div>
{% endblock recommended_products %}
{% block seo %}
<div class="tab-pane" id="seo">
<div class="table-header">
<h3>
{% trans "Search engine optimisation" %}
</h3>
</div>
<div class="card card-body">
{% block seo_content %}
{% for field in form.seo_form_fields %}
{% if 'attr' not in field.id_for_label %}
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}{% endif %}
{% endfor %}
{% endblock seo_content %}
</table>
{% endblock recommended_products_content %}
</div>
</div>
{% endblock seo %}
{% endblock tab_content %}
</div>
</div>
</div>
{% block fixed_actions_group %}
<div class="fixed-actions-group">
<div class="form-group">
<div class="float-right">
<a href="{% url 'dashboard:catalogue-product-list' %}">
{% trans "Cancel" %}
</a>
{% trans "or" %}
{% if parent %}
<button class="btn btn-secondary"
name="action"
type="submit"
value="create-another-child"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Save and add another variant" %}
</button>
{% endif %}
<button class="btn btn-secondary"
name="action"
type="submit"
value="continue"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Save and continue editing" %}
</button>
<button class="btn btn-primary"
name="action"
type="submit"
value="save"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Save" %}
</button>
{% endblock recommended_products %}
{% block seo %}
<div class="tab-pane" id="seo">
<div class="table-header">
<h3>
{% trans "Search engine optimisation" %}
</h3>
</div>
<div class="card card-body">
{% block seo_content %}
{% for field in form.seo_form_fields %}
{% if 'attr' not in field.id_for_label %}
{% include 'oscar/dashboard/partials/form_field.html' with field=field %}{% endif %}
{% endfor %}
{% endblock seo_content %}
</div>
</div>
{% endblock seo %}
{% endblock tab_content %}
</div>
</div>
{% if product %}
<a class="btn btn-success" href="{{ product.get_absolute_url }}">
{% trans "View on site" %}
</a>
{% endif %}
</div>
</div>
{% endblock fixed_actions_group %}
</form>
{% block fixed_actions_group %}
<div class="fixed-actions-group">
<div class="form-group">
<div class="float-right">
<a href="{% url 'dashboard:catalogue-product-list' %}">
{% trans "Cancel" %}
</a>
{% trans "or" %}
{% if parent %}
<button class="btn btn-secondary"
name="action"
type="submit"
value="create-another-child"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Save and add another variant" %}
</button>
{% endif %}
<button class="btn btn-secondary"
name="action"
type="submit"
value="continue"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Save and continue editing" %}
</button>
<button class="btn btn-primary"
name="action"
type="submit"
value="save"
data-loading-text="{% trans 'Saving...' %}">
{% trans "Save" %}
</button>
</div>
{% if product %}
<a class="btn btn-success" href="{{ product.get_absolute_url }}">
{% trans "View on site" %}
</a>
{% endif %}
</div>
</div>
{% endblock fixed_actions_group %}
</form>
{% endblock dashboard_content %}

View file

@ -68,34 +68,34 @@
<tr>
<td>
<a href="{% url 'dashboard:catalogue-product' alert.stockrecord.product.id %}{% if request.GET.urlencode %}?{{ request.GET.urlencode }}{% endif %}">
{{ alert.stockrecord.product.get_title }}
</a>
</td>
<td>{{ alert.stockrecord.partner.display_name }}</td>
<td>{{ alert.stockrecord.low_stock_threshold }}</td>
{{ alert.stockrecord.product.get_title }}
</a>
</td>
<td>{{ alert.stockrecord.partner.display_name }}</td>
<td>{{ alert.stockrecord.low_stock_threshold }}</td>
<td>
{{ alert.stockrecord.net_stock_level }}
</td>
<td>
{{ alert.date_created }}
</td>
<td>
{{ alert.status }}
</td>
<td>
<a class="btn btn-info"
href="{% url 'dashboard:catalogue-product' pk=alert.stockrecord.product.id %}">
{% trans "Update" %}
</a>
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td>
{{ alert.stockrecord.net_stock_level }}
</td>
<td>
{{ alert.date_created }}
</td>
<td>
{{ alert.status }}
</td>
<td>
<a class="btn btn-info"
href="{% url 'dashboard:catalogue-product' pk=alert.stockrecord.product.id %}">
{% trans "Update" %}
</a>
{% trans "No stock alerts found." %}
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td>
{% trans "No stock alerts found." %}
</td>
</tr>
{% endif %}
</table>
{% endif %}
</table>
{% endblock dashboard_content %}

View file

@ -51,133 +51,134 @@
</div>
{% endif %}
<div class="{% if preview %}tab-content{% else %}card card-body{% endif %}">
<div class="tab-pane {% if not preview %}active{% endif %}" id="email_form">
{% csrf_token %}
{% include 'oscar/dashboard/partials/form_field.html' with field=form.name %}
<div class="table-header">
<h3>{% trans "Email content" %}</h3>
</div>
<div class="card card-body">
<p>
{% trans "These fields are rendered using Django's template system." %}
</p>
<p>
{% trans "You can use the following variables:" %}
</p>
<dl>
<dt>
<code>
{% templatetag openvariable %} user.get_full_name {% templatetag closevariable %}
</code>
</dt>
<dd>
{% trans "The full name of the user (if they have one)" %}
</dd>
<dt>
<code>
{% templatetag openvariable %} user.email {% templatetag closevariable %}
</code>
</dt>
<dd>
{% trans "The user's email address" %}
</dd>
<dt>
<code>
{% templatetag openvariable %} site.name {% templatetag closevariable %}
</code>
</dt>
<dd>
{% trans "The name of the site (eg example.com)" %}
</dd>
{% if commtype.is_order_related %}
<dt>
<code>
{% templatetag openvariable %} order.number {% templatetag closevariable %}
</code>
</dt>
<dd>
{% trans "Order number" %}
</dd>
{% endif %}
</dl>
</div>
{% include 'oscar/dashboard/partials/form_field.html' with field=form.email_subject_template %}
{% include 'oscar/dashboard/partials/form_field.html' with field=form.email_body_template %}
{% include 'oscar/dashboard/partials/form_field.html' with field=form.email_body_html_template %}
<div class="table-header">
<h3>{% trans "Preview" %}</h3>
</div>
<div class="card card-body">
{% if commtype.is_order_related %}
<p>
{% trans "View a preview of this email using order:" %}
</p>
{% include 'oscar/dashboard/partials/form_field.html' with field=form.preview_order_number %}{% endif %}
<button type="submit"
class="btn btn-primary"
name="show_preview"
data-loading-text="{% trans 'Submitting...' %}">
{% trans "View preview" %}
</button>
<p>
{% trans "or send a preview to:" %}
</p>
{% include 'oscar/dashboard/partials/form_field.html' with field=form.preview_email %}
<button type="submit"
class="btn btn-secondary"
name="send_preview"
data-loading-text="{% trans 'Sending...' %}">
{% trans "Send preview email" %}
<div class="tab-pane {% if not preview %}active{% endif %}" id="email_form">
{% csrf_token %}
{% include 'oscar/dashboard/partials/form_field.html' with field=form.name %}
<div class="table-header">
<h3>{% trans "Email content" %}</h3>
</div>
<div class="card card-body">
<p>
{% trans "These fields are rendered using Django's template system." %}
</p>
<p>
{% trans "You can use the following variables:" %}
</p>
<dl>
<dt>
<code>
{% templatetag openvariable %} user.get_full_name {% templatetag closevariable %}
</code>
</dt>
<dd>
{% trans "The full name of the user (if they have one)" %}
</dd>
<dt>
<code>
{% templatetag openvariable %} user.email {% templatetag closevariable %}
</code>
</dt>
<dd>
{% trans "The user's email address" %}
</dd>
<dt>
<code>
{% templatetag openvariable %} site.name {% templatetag closevariable %}
</code>
</dt>
<dd>
{% trans "The name of the site (eg example.com)" %}
</dd>
{% if commtype.is_order_related %}
<dt>
<code>
{% templatetag openvariable %} order.number {% templatetag closevariable %}
</code>
</dt>
<dd>
{% trans "Order number" %}
</dd>
{% endif %}
</dl>
</div>
{% include 'oscar/dashboard/partials/form_field.html' with field=form.email_subject_template %}
{% include 'oscar/dashboard/partials/form_field.html' with field=form.email_body_template %}
{% include 'oscar/dashboard/partials/form_field.html' with field=form.email_body_html_template %}
<div class="table-header">
<h3>{% trans "Preview" %}</h3>
</div>
<div class="card card-body">
{% if commtype.is_order_related %}
<p>
{% trans "View a preview of this email using order:" %}
</p>
{% include 'oscar/dashboard/partials/form_field.html' with field=form.preview_order_number %}
{% endif %}
<button type="submit"
class="btn btn-primary"
name="show_preview"
data-loading-text="{% trans 'Submitting...' %}">
{% trans "View preview" %}
</button>
<p>
{% trans "or send a preview to:" %}
</p>
{% include 'oscar/dashboard/partials/form_field.html' with field=form.preview_email %}
<button type="submit"
class="btn btn-secondary"
name="send_preview"
data-loading-text="{% trans 'Sending...' %}">
{% trans "Send preview email" %}
</button>
</div>
</div>
<div class="tab-pane {% if preview %}active{% endif %}" id="email_preview">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>{% trans "Subject" %}</th>
<td>{{ preview.subject }}</td>
</tr>
<tr>
<th>{% trans "Body text" %}</th>
<td>
<pre>
{{ preview.body }}
</pre>
</td>
</tr>
<tr>
<th>{% trans "Body HTML" %}</th>
<td>
<iframe id="preview_box" width="100%" height="400">
{{ preview.html }}
</iframe>
</td>
</tr>
</table>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary" data-loading-text="{% trans 'Saving...' %}">
{% trans "Save" %}
</button>
{% trans "or" %}
<a href="{% url 'dashboard:comms-list' %}">
{% trans "cancel" %}
</a>
.
</div>
</div>
<div class="tab-pane {% if preview %}active{% endif %}" id="email_preview">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>{% trans "Subject" %}</th>
<td>{{ preview.subject }}</td>
</tr>
<tr>
<th>{% trans "Body text" %}</th>
<td>
<pre>
{{ preview.body }}
</pre>
</td>
</tr>
<tr>
<th>{% trans "Body HTML" %}</th>
<td>
<iframe id="preview_box" width="100%" height="400">
{{ preview.html }}
</iframe>
</td>
</tr>
</table>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary" data-loading-text="{% trans 'Saving...' %}">
{% trans "Save" %}
</button>
{% trans "or" %}
<a href="{% url 'dashboard:comms-list' %}">
{% trans "cancel" %}
</a>
.
</div>
</div>
</div>
</form>
</form>
{% endblock dashboard_content %}
{% block onbodyload %}
{{ block.super }}
$(function() {
// Sets the HTML email preview so it's css doesn't touch the page.
var el_preview_html = document.getElementById('preview_box');
var html = $(el_preview_html).text();
var doc = el_preview_html.contentWindow.document;
doc.open();
doc.write(html);
doc.close();
});
{{ block.super }}
$(function() {
// Sets the HTML email preview so it's css doesn't touch the page.
var el_preview_html = document.getElementById('preview_box');
var html = $(el_preview_html).text();
var doc = el_preview_html.contentWindow.document;
doc.open();
doc.write(html);
doc.close();
});
{% endblock %}

View file

@ -63,4 +63,5 @@
</tbody>
{% endif %}
</table>
{% include "oscar/dashboard/partials/pagination.html" %}{% endblock dashboard_content %}
{% include "oscar/dashboard/partials/pagination.html" %}
{% endblock dashboard_content %}

View file

@ -75,92 +75,92 @@
<ul class="navbar-nav">
{% for item in nav_items %}
<li class="nav-item {% if item.has_children %}dropdown{% endif %}">
<a class="nav-link {% if item.has_children %}dropdown-toggle{% endif %}" href="{% if item.is_heading %}#{% else %}{{ item.url }}{% endif %}"
{% if item.has_children %}
id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
{% endif %}
>
{% if item.icon %}<i class="{{ item.icon }}"></i>{% endif %}
{{ item.label }}
</a>
{% if item.has_children %}
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
{% for subitem in item.children %}
<a class="dropdown-item" href="{{ subitem.url }}">
{% if subitem.icon %}<i class="{{ subitem.icon }}"></i>{% endif %}
{{ subitem.label }}
</a>
{% endfor %}
</div>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</nav>
{% endblock %}
<div class="container-fluid">
{% block breadcrumbs %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page">
<a href="{% url 'dashboard:index' %}">
{% trans "Dashboard" %}
</a>
</li>
</ol>
</nav>
{% endblock %}
<div class="content">
{% include 'oscar/dashboard/partials/alert_messages.html' %}
{% block header %}
<div class="page-header">
<h1>{% block headertext %}{% endblock %}</h1>
</div>
<a class="nav-link {% if item.has_children %}dropdown-toggle{% endif %}" href="{% if item.is_heading %}#{% else %}{{ item.url }}{% endif %}"
{% if item.has_children %}
id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
{% endif %}
>
{% if item.icon %}<i class="{{ item.icon }}"></i>{% endif %}
{{ item.label }}
</a>
{% if item.has_children %}
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
{% for subitem in item.children %}
<a class="dropdown-item" href="{{ subitem.url }}">
{% if subitem.icon %}<i class="{{ subitem.icon }}"></i>{% endif %}
{{ subitem.label }}
</a>
{% endfor %}
</div>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</nav>
{% endblock %}
<div class="page-content">
{% block content %}
{% block dashboard_content %}{% endblock dashboard_content %}
{% endblock content %}
<div class="container-fluid">
{% block breadcrumbs %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page">
<a href="{% url 'dashboard:index' %}">
{% trans "Dashboard" %}
</a>
</li>
</ol>
</nav>
{% endblock %}
<div class="content">
{% include 'oscar/dashboard/partials/alert_messages.html' %}
{% block header %}
<div class="page-header">
<h1>{% block headertext %}{% endblock %}</h1>
</div>
{% endblock %}
<div class="page-content">
{% block content %}
{% block dashboard_content %}{% endblock dashboard_content %}
{% endblock content %}
</div>
</div>
</div>
</div>
<!-- /container -->
<!-- /container -->
{% endblock %}
{# Local scripts #}
{% block scripts %}
<!-- Twitter Bootstrap -->
<script src="{% static "oscar/js/bootstrap4/bootstrap.bundle.min.js" %}"></script>
<!-- Oscar -->
<script src="{% static "oscar/js/oscar/ui.js" %}"></script>
<!-- Twitter Bootstrap -->
<script src="{% static "oscar/js/bootstrap4/bootstrap.bundle.min.js" %}"></script>
<!-- Oscar -->
<script src="{% static "oscar/js/oscar/ui.js" %}"></script>
{% endblock %}
{% block extrascripts %}
{{ block.super }}
{# jQuery plugins #}
<script src="{% static "oscar/js/mousewheel/jquery.mousewheel.js" %}"></script>
<script src="{% static "oscar/js/bootstrap4-datetimepicker/moment-with-locales.min.js" %}"></script>
<script src="{% static "oscar/js/bootstrap4-datetimepicker/tempusdominus-bootstrap-4.min.js" %}"></script>
<script src="{% static "oscar/js/inputmask/jquery.inputmask.min.js" %}"></script>
<script src="{% static "oscar/js/select2/select2.min.js" %}"></script>
<script src="{% static "oscar/js/jquery-sortable/jquery-sortable-min.js" %}"></script>
<script src="{% static "oscar/js/oscar/dashboard.js" %}"></script>
<script src="{% static "oscar/js/oscar/RelatedObjectLookups.js" %}"></script>
<script src="{% static "oscar/js/tinymce/tinymce.min.js" %}"></script>
<script src="{% static "oscar/js/tinymce/jquery.tinymce.min.js" %}"></script>
{{ block.super }}
{# jQuery plugins #}
<script src="{% static "oscar/js/mousewheel/jquery.mousewheel.js" %}"></script>
<script src="{% static "oscar/js/bootstrap4-datetimepicker/moment-with-locales.min.js" %}"></script>
<script src="{% static "oscar/js/bootstrap4-datetimepicker/tempusdominus-bootstrap-4.min.js" %}"></script>
<script src="{% static "oscar/js/inputmask/jquery.inputmask.min.js" %}"></script>
<script src="{% static "oscar/js/select2/select2.min.js" %}"></script>
<script src="{% static "oscar/js/jquery-sortable/jquery-sortable-min.js" %}"></script>
<script src="{% static "oscar/js/oscar/dashboard.js" %}"></script>
<script src="{% static "oscar/js/oscar/RelatedObjectLookups.js" %}"></script>
<script src="{% static "oscar/js/tinymce/tinymce.min.js" %}"></script>
<script src="{% static "oscar/js/tinymce/jquery.tinymce.min.js" %}"></script>
{% endblock %}
{% block onbodyload %}
{{ block.super }}
// Javascript to enable link to tab
var url = document.location.toString();
if (url.match('#')) {
$('.nav-list a[href="#' + url.split('#')[1] + '"]').tab('show');
}
// Change hash for page-reload
$('.nav-list a').on('shown.bs.tab', function (e) {
window.location.hash = e.target.hash;
});
options = {
'languageCode': '{{ LANGUAGE_CODE }}'
};
oscar.dashboard.init(options);
{{ block.super }}
// Javascript to enable link to tab
var url = document.location.toString();
if (url.match('#')) {
$('.nav-list a[href="#' + url.split('#')[1] + '"]').tab('show');
}
// Change hash for page-reload
$('.nav-list a').on('shown.bs.tab', function (e) {
window.location.hash = e.target.hash;
});
options = {
'languageCode': '{{ LANGUAGE_CODE }}'
};
oscar.dashboard.init(options);
{% endblock %}

View file

@ -1,34 +1,36 @@
{% extends 'oscar/dashboard/offers/step_form.html' %}
{% load i18n %}
{% block progress %}
{% include 'oscar/dashboard/offers/progress.html' with step=2 %}{% endblock %}
{% block form_fields %}
<span class="error-block">{{ form.non_field_errors }}</span>
{% if form.fields.custom_benefit.choices %}
<h4>{% trans "Build a new incentive" %}</h4>
{% endif %}
{% include "oscar/dashboard/partials/form_field.html" with field=form.range %}
<p>
{% url 'dashboard:range-list' as range_list_url %}
{% blocktrans %}
Ranges can be created and edited from within the
<a href="{{ range_list_url }}" target="_blank">
range dashboard
</a>
.
{% endblocktrans %}
</p>
{% include "oscar/dashboard/partials/form_field.html" with field=form.type %}
{% include "oscar/dashboard/partials/form_field.html" with field=form.value %}
{% include "oscar/dashboard/partials/form_field.html" with field=form.max_affected_items %}
{% if form.fields.custom_benefit.choices %}
<h4>{% trans "...or choose a pre-defined one" %}</h4>
{% include "oscar/dashboard/partials/form_field.html" with field=form.custom_benefit %}{% endif %}
{% endblock %}
{% block submittext %}
{% trans "Continue to step 3" %}
{% endblock %}
{% block onbodyload %}
{{ block.super }}
oscar.dashboard.offers.init();
{% endblock %}
{% include 'oscar/dashboard/offers/progress.html' with step=2 %}
{% endblock %}
{% block form_fields %}
<span class="error-block">{{ form.non_field_errors }}</span>
{% if form.fields.custom_benefit.choices %}
<h4>{% trans "Build a new incentive" %}</h4>
{% endif %}
{% include "oscar/dashboard/partials/form_field.html" with field=form.range %}
<p>
{% url 'dashboard:range-list' as range_list_url %}
{% blocktrans %}
Ranges can be created and edited from within the
<a href="{{ range_list_url }}" target="_blank">
range dashboard
</a>
.
{% endblocktrans %}
</p>
{% include "oscar/dashboard/partials/form_field.html" with field=form.type %}
{% include "oscar/dashboard/partials/form_field.html" with field=form.value %}
{% include "oscar/dashboard/partials/form_field.html" with field=form.max_affected_items %}
{% if form.fields.custom_benefit.choices %}
<h4>{% trans "...or choose a pre-defined one" %}</h4>
{% include "oscar/dashboard/partials/form_field.html" with field=form.custom_benefit %}
{% endif %}
{% endblock %}
{% block submittext %}
{% trans "Continue to step 3" %}
{% endblock %}
{% block onbodyload %}
{{ block.super }}
oscar.dashboard.offers.init();
{% endblock %}

View file

@ -1,31 +1,34 @@
{% extends 'oscar/dashboard/offers/step_form.html' %}
{% load i18n %}
{% block summary %}
{% include 'oscar/dashboard/offers/summary.html' %}{% endblock %}
{% block progress %}
{% include 'oscar/dashboard/offers/progress.html' with step=3 %}{% endblock %}
{% block form_fields %}
<span class="error-block">{{ form.non_field_errors }}</span>
{% if form.fields.custom_condition.choices %}
<h4>{% trans "Build a new condition" %}</h4>
{% endif %}
{% include "oscar/dashboard/partials/form_field.html" with field=form.range %}
<p>
{% url 'dashboard:range-list' as range_list_url %}
{% blocktrans %}
Ranges can be created and edited from within the
<a href="{{ range_list_url }}" target="_blank">
range dashboard
</a>
.
{% endblocktrans %}
</p>
{% include "oscar/dashboard/partials/form_field.html" with field=form.type %}
{% include "oscar/dashboard/partials/form_field.html" with field=form.value %}
{% if form.fields.custom_condition.choices %}
<h4>{% trans "...or choose a pre-defined one" %}</h4>
{% include "oscar/dashboard/partials/form_field.html" with field=form.custom_condition %}{% endif %}
{% endblock %}
{% block submittext %}
{% trans "Continue to step 4" %}
{% endblock %}
{% include 'oscar/dashboard/offers/summary.html' %}
{% endblock %}
{% block progress %}
{% include 'oscar/dashboard/offers/progress.html' with step=3 %}
{% endblock %}
{% block form_fields %}
<span class="error-block">{{ form.non_field_errors }}</span>
{% if form.fields.custom_condition.choices %}
<h4>{% trans "Build a new condition" %}</h4>
{% endif %}
{% include "oscar/dashboard/partials/form_field.html" with field=form.range %}
<p>
{% url 'dashboard:range-list' as range_list_url %}
{% blocktrans %}
Ranges can be created and edited from within the
<a href="{{ range_list_url }}" target="_blank">
range dashboard
</a>
.
{% endblocktrans %}
</p>
{% include "oscar/dashboard/partials/form_field.html" with field=form.type %}
{% include "oscar/dashboard/partials/form_field.html" with field=form.value %}
{% if form.fields.custom_condition.choices %}
<h4>{% trans "...or choose a pre-defined one" %}</h4>
{% include "oscar/dashboard/partials/form_field.html" with field=form.custom_condition %}
{% endif %}
{% endblock %}
{% block submittext %}
{% trans "Continue to step 4" %}
{% endblock %}

View file

@ -1,7 +1,8 @@
{% extends 'oscar/dashboard/offers/step_form.html' %}
{% load i18n %}
{% block progress %}
{% include 'oscar/dashboard/offers/progress.html' with step=1 %}{% endblock %}
{% block submittext %}
{% trans "Continue to step 2" %}
{% endblock %}
{% include 'oscar/dashboard/offers/progress.html' with step=1 %}
{% endblock %}
{% block submittext %}
{% trans "Continue to step 2" %}
{% endblock %}

View file

@ -246,25 +246,26 @@
<tbody>
{% for discount in order_discounts %}
{% with order=discount.order %}
<tr>
<td>
<a href="{% url 'dashboard:order-detail' number=order.number %}">
{{ order.number }}
</a>
</td>
<td>
{{ order.date_placed }}
</td>
<td>
{{ order.total_incl_tax|currency }}
</td>
<td>
{{ discount.amount|currency }}
</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
{% include 'oscar/dashboard/partials/pagination.html' %}{% endif %}
<tr>
<td>
<a href="{% url 'dashboard:order-detail' number=order.number %}">
{{ order.number }}
</a>
</td>
<td>
{{ order.date_placed }}
</td>
<td>
{{ order.total_incl_tax|currency }}
</td>
<td>
{{ discount.amount|currency }}
</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
{% include 'oscar/dashboard/partials/pagination.html' %}
{% endif %}
{% endblock dashboard_content %}

View file

@ -44,183 +44,184 @@
{{ field }}
{% else %}
<div class="form-group mr-2{% if field.errors %}error{% endif %}">
{{ field.label_tag }}
{% render_field field class+='form-control' %}
{% for error in field.errors %}
<ul class="error-block">
<li>
{{ error }}
</li>
</ul>
{% endfor %}
{# No help text as it wraps #}
</div>
{% endif %}
{% else %}
<input type="hidden" name="{{ field.name }}" value="{{ field.value|default_if_none:'' }}">
{% endif %}
{% endfor %}
<button type="submit" class="btn btn-primary mr-2" data-loading-text="{% trans 'Searching...' %}">
{% trans "Search" %}
</button>
<a data-toggle="modal" data-target="#SearchModal" href="#" class="mr-2">
{% trans "Advanced Search" %}
</a>
<a href="{% url 'dashboard:offer-list' %}" class="btn btn-secondary">
{% trans "Reset" %}
</a>
</form>
{# Search modal, if there are form errors the form is automatically openend #}
{% include "oscar/dashboard/partials/advanced_search_modal.html" with form=advanced_form style='horizontal' %}
{% if search_filters %}
<div class="search-filter-list">
<label>
Filters:
</label>
{% for filter in search_filters %}
<span class="badge badge-success">{{ filter }}</span>
{% endfor %}
</div>
{% endif %}
</div>
<form method="post" class="order_table">
{% csrf_token %}
<table class="table table-striped table-bordered table-hover">
<caption>
<i class="fas fa-gift"></i>
{% if search_filters %}
{% trans "Offer Search Results" %}
{% else %}
{% trans "All Offers" %}
{% endif %}
</caption>
{% if offers %}
<tr>
<th>{% anchor 'name' _('Offer name') %}</th>
<th>{% anchor 'offer_type' _('Offer type') %}</th>
{% if form.is_bound %}
{% if form.is_voucher_offer_type or not form.cleaned_data.offer_type %}
<th>{% trans "Num of vouchers" %}</th>
{{ field.label_tag }}
{% render_field field class+='form-control' %}
{% for error in field.errors %}
<ul class="error-block">
<li>
{{ error }}
</li>
</ul>
{% endfor %}
{# No help text as it wraps #}
</div>
{% endif %}
{% else %}
<input type="hidden" name="{{ field.name }}" value="{{ field.value|default_if_none:'' }}">
{% endif %}
<th>{% anchor 'start_datetime' _('Start date') %}</th>
<th>{% anchor 'end_datetime' _('End date') %}</th>
<th>{% trans "Priority" %}</th>
<th>{% trans "Incentive" %}</th>
<th>{% trans "Condition" %}</th>
<th>{% trans "Is available?" %}</th>
<th>
{% trans "Restrictions" %}
</th>
<th>
{% anchor 'num_applications' _('Uses') %}
</th>
<th>
{% anchor 'total_discount' _('Cost') %}
</th>
<th></th>
</tr>
{% for offer in offers %}
{% endfor %}
<button type="submit" class="btn btn-primary mr-2" data-loading-text="{% trans 'Searching...' %}">
{% trans "Search" %}
</button>
<a data-toggle="modal" data-target="#SearchModal" href="#" class="mr-2">
{% trans "Advanced Search" %}
</a>
<a href="{% url 'dashboard:offer-list' %}" class="btn btn-secondary">
{% trans "Reset" %}
</a>
</form>
{# Search modal, if there are form errors the form is automatically openend #}
{% include "oscar/dashboard/partials/advanced_search_modal.html" with form=advanced_form style='horizontal' %}
{% if search_filters %}
<div class="search-filter-list">
<label>Filters:</label>
{% for filter in search_filters %}
<span class="badge badge-success">{{ filter }}</span>
{% endfor %}
</div>
{% endif %}
</div>
<form method="post" class="order_table">
{% csrf_token %}
<table class="table table-striped table-bordered table-hover">
<caption>
<i class="fas fa-gift"></i>
{% if search_filters %}
{% trans "Offer Search Results" %}
{% else %}
{% trans "All Offers" %}
{% endif %}
</caption>
{% if offers %}
<tr>
<td>
<a href="{% url 'dashboard:offer-detail' pk=offer.pk %}">
{{ offer.name }}
</a>
</td>
<td>
{{ offer.offer_type }}
</td>
<th>{% anchor 'name' _('Offer name') %}</th>
<th>{% anchor 'offer_type' _('Offer type') %}</th>
{% if form.is_bound %}
{% if form.is_voucher_offer_type or not form.cleaned_data.offer_type %}
<td>
{{ offer.vouchers.count }}
</td>
<th>{% trans "Num of vouchers" %}</th>
{% endif %}
{% endif %}
<td>
{{ offer.start_datetime|default:"-" }}
</td>
<td>
{{ offer.end_datetime|default:"-" }}
</td>
<td>
{{ offer.priority }}
</td>
<td>
{{ offer.benefit.description|safe }}
</td>
<td>
{{ offer.condition.description|safe }}
</td>
<td>
{% if offer.is_available %}
<span class="badge badge-success">{% trans "Yes" %}</span>
{% else %}
<span class="badge badge-danger">{% trans "No" %}</span>
{% endif %}
</td>
<td>
{% for restriction in offer.availability_restrictions %}
{% if not restriction.is_satisfied %}
<label class="badge badge-danger">
{{ restriction.description }}
</label>
{% else %}
{{ restriction.description }}
<br/>
<th>{% anchor 'start_datetime' _('Start date') %}</th>
<th>{% anchor 'end_datetime' _('End date') %}</th>
<th>{% trans "Priority" %}</th>
<th>{% trans "Incentive" %}</th>
<th>{% trans "Condition" %}</th>
<th>
{% trans "Is available?" %}
</th>
<th>
{% trans "Restrictions" %}
</th>
<th>
{% anchor 'num_applications' _('Uses') %}
</th>
<th>
{% anchor 'total_discount' _('Cost') %}
</th>
<th></th>
</tr>
{% for offer in offers %}
<tr>
<td>
<a href="{% url 'dashboard:offer-detail' pk=offer.pk %}">
{{ offer.name }}
</a>
</td>
<td>
{{ offer.offer_type }}
</td>
{% if form.is_bound %}
{% if form.is_voucher_offer_type or not form.cleaned_data.offer_type %}
<td>
{{ offer.vouchers.count }}
</td>
{% endif %}
{% endfor %}
</td>
<td>
{{ offer.num_applications }}
</td>
<td>
{{ offer.total_discount|currency }}
</td>
<td>
<div class="btn-toolbar">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle"
type="button"
id="dropdownMenuButton"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
{% trans "Actions" %}
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="{% url 'offer:detail' slug=offer.slug %}">
{% trans "Browse" %}
</a>
<a class="dropdown-item" href="{% url 'dashboard:offer-detail' pk=offer.pk %}">
{% trans "Stats" %}
</a>
<a class="dropdown-item" href="{% url 'dashboard:offer-metadata' pk=offer.pk %}">
{% trans "Edit" %}
</a>
{% if not offer.vouchers.exists %}
<a class="dropdown-item" href="{% url 'dashboard:offer-delete' pk=offer.pk %}">
{% trans "Delete" %}
{% endif %}
<td>
{{ offer.start_datetime|default:"-" }}
</td>
<td>
{{ offer.end_datetime|default:"-" }}
</td>
<td>
{{ offer.priority }}
</td>
<td>
{{ offer.benefit.description|safe }}
</td>
<td>
{{ offer.condition.description|safe }}
</td>
<td>
{% if offer.is_available %}
<span class="badge badge-success">{% trans "Yes" %}</span>
{% else %}
<span class="badge badge-danger">{% trans "No" %}</span>
{% endif %}
</td>
<td>
{% for restriction in offer.availability_restrictions %}
{% if not restriction.is_satisfied %}
<label class="badge badge-danger">{{ restriction.description }}</label>
{% else %}
{{ restriction.description }}
<br/>
{% endif %}
{% endfor %}
</td>
<td>
{{ offer.num_applications }}
</td>
<td>
{{ offer.total_discount|currency }}
</td>
<td>
<div class="btn-toolbar">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle"
type="button"
id="dropdownMenuButton"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
{% trans "Actions" %}
</button>
<div class="dropdown-menu dropdown-menu-right"
aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="{% url 'offer:detail' slug=offer.slug %}">
{% trans "Browse" %}
</a>
{% endif %}
<a class="dropdown-item" href="{% url 'dashboard:offer-detail' pk=offer.pk %}">
{% trans "Stats" %}
</a>
<a class="dropdown-item"
href="{% url 'dashboard:offer-metadata' pk=offer.pk %}">
{% trans "Edit" %}
</a>
{% if not offer.vouchers.exists %}
<a class="dropdown-item"
href="{% url 'dashboard:offer-delete' pk=offer.pk %}">
{% trans "Delete" %}
</a>
{% endif %}
</div>
</div>
</div>
</div>
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td>
{% trans "No offers found." %}
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td>
{% trans "No offers found." %}
</td>
</tr>
{% endif %}
</table>
{% include "oscar/dashboard/partials/pagination.html" %}
</form>
{% endif %}
</table>
{% include "oscar/dashboard/partials/pagination.html" %}
</form>
{% endblock dashboard_content %}
{% block onbodyload %}
{{ block.super }}
{% if advanced_form.errors %}$('#SearchModal').modal('show');{% endif %}
{{ block.super }}
{% if advanced_form.errors %}$('#SearchModal').modal('show');{% endif %}
{% endblock onbodyload %}

View file

@ -8,42 +8,42 @@
{% if step == 2 or step == 3 or step == 4 %}
<a href="{% if session_offer.pk %}{% url 'dashboard:offer-metadata' pk=session_offer.pk %}{% else %}{% url 'dashboard:offer-metadata' %}{% endif %}"
class="nav-link visited">
{% trans "1. Name, description and type" %}
{% trans "1. Name, description and type" %}
</a>
{% else %}
<a class="nav-link {% if step == 1 %}active{% else %}disabled text-reset{% endif %}">
{% trans "1. Name, description and type" %}
</a>
{% endif %}
</li>
<li class="nav-item step2">
{% if step == 3 or step == 4 %}
<a href="{% if session_offer.pk %}{% url 'dashboard:offer-benefit' pk=session_offer.pk %}{% else %}{% url 'dashboard:offer-benefit' %}{% endif %}"
class="nav-link visited">
{% trans "2. Incentive" %}
</a>
{% else %}
<a class="nav-link {% if step == 2 %}active{% else %}disabled text-reset{% endif %}">
{% trans "2. Incentive" %}
</a>
{% endif %}
</li>
<li class="nav-item step3">
{% if step == 4 %}
<a href="{% if session_offer.pk %}{% url 'dashboard:offer-condition' pk=session_offer.pk %}{% else %}{% url 'dashboard:offer-condition' %}{% endif %}"
class="nav-link visited">
{% trans "3. Condition" %}
</a>
{% else %}
<a class="nav-link {% if step == 3 %}active{% else %}disabled text-reset{% endif %}">
{% trans "3. Condition" %}
</a>
{% endif %}
</li>
<li class="nav-item step4">
<a class="nav-link {% if step == 4 %}active{% else %}disabled text-reset{% endif %}">
{% trans "4. Restrictions" %}
</a>
{% else %}
<a class="nav-link {% if step == 1 %}active{% else %}disabled text-reset{% endif %}">
{% trans "1. Name, description and type" %}
</a>
{% endif %}
</li>
<li class="nav-item step2">
{% if step == 3 or step == 4 %}
<a href="{% if session_offer.pk %}{% url 'dashboard:offer-benefit' pk=session_offer.pk %}{% else %}{% url 'dashboard:offer-benefit' %}{% endif %}"
class="nav-link visited">
{% trans "2. Incentive" %}
</a>
{% else %}
<a class="nav-link {% if step == 2 %}active{% else %}disabled text-reset{% endif %}">
{% trans "2. Incentive" %}
</a>
{% endif %}
</li>
<li class="nav-item step3">
{% if step == 4 %}
<a href="{% if session_offer.pk %}{% url 'dashboard:offer-condition' pk=session_offer.pk %}{% else %}{% url 'dashboard:offer-condition' %}{% endif %}"
class="nav-link visited">
{% trans "3. Condition" %}
</a>
{% else %}
<a class="nav-link {% if step == 3 %}active{% else %}disabled text-reset{% endif %}">
{% trans "3. Condition" %}
</a>
{% endif %}
</li>
<li class="nav-item step4">
<a class="nav-link {% if step == 4 %}active{% else %}disabled text-reset{% endif %}">
{% trans "4. Restrictions" %}
</a>
</li>
</ul>
</li>
</ul>
</div>

View file

@ -1,11 +1,13 @@
{% extends 'oscar/dashboard/offers/step_form.html' %}
{% load i18n %}
{% block summary %}
{% include 'oscar/dashboard/offers/summary.html' %}{% endblock %}
{% block progress %}
{% include 'oscar/dashboard/offers/progress.html' with step=4 %}{% endblock %}
{% block form_actions_buttons %}
<button class="btn btn-primary" type="submit" data-loading-text="{% trans 'Saving...' %}">
{% trans "Save this offer" %}
</button>
{% endblock %}
{% include 'oscar/dashboard/offers/summary.html' %}
{% endblock %}
{% block progress %}
{% include 'oscar/dashboard/offers/progress.html' with step=4 %}
{% endblock %}
{% block form_actions_buttons %}
<button class="btn btn-primary" type="submit" data-loading-text="{% trans 'Saving...' %}">
{% trans "Save this offer" %}
</button>
{% endblock %}

Some files were not shown because too many files have changed in this diff Show more