diff --git a/src/personalisation/admin_urls.py b/src/personalisation/admin_urls.py index 518fd1f..1cf26ff 100644 --- a/src/personalisation/admin_urls.py +++ b/src/personalisation/admin_urls.py @@ -12,13 +12,6 @@ urlpatterns = [ name='enable'), url(r'^segment/(?P[0-9]+)/disable/$', views.disable, name='disable'), - # TODO: These might no longer be needed when using a modal - url(r'^segment/time-rule/$', views.time_rule_embed, - name="time_rule_embed"), - url(r'^segment/referral-rule/$', views.referral_rule_embed, - name="refferal_rule_embed"), - url(r'^segment/visit-count-rule/$', views.visit_count_rule_embed, - name="visit_count_rule_embed"), url(r'^variations/(?P\d+)/add/(?P[^/]+)/$', views.AddVariation.as_view(), name='add') ] diff --git a/src/personalisation/templates/wagtailadmin/embeds/referral_rule.html b/src/personalisation/templates/wagtailadmin/embeds/referral_rule.html deleted file mode 100644 index 66d406f..0000000 --- a/src/personalisation/templates/wagtailadmin/embeds/referral_rule.html +++ /dev/null @@ -1,23 +0,0 @@ -{% extends "wagtailadmin/base.html" %} -{% load i18n staticfiles %} -{% block titletag %}{% trans "Referral Rule" %}{% endblock %} - - -{% block content %} -
-

Referral

-

Choose the number of visits the user has to have made.

-
- -
-
- {% csrf_token %} -
    - {% for field in form %} - {% include "wagtailadmin/shared/field_as_li.html" with field=field %} - {% endfor %} -
  • -
-
-
-{% endblock %} diff --git a/src/personalisation/templates/wagtailadmin/embeds/time_rule.html b/src/personalisation/templates/wagtailadmin/embeds/time_rule.html deleted file mode 100644 index feb1557..0000000 --- a/src/personalisation/templates/wagtailadmin/embeds/time_rule.html +++ /dev/null @@ -1,23 +0,0 @@ -{% extends "wagtailadmin/base.html" %} -{% load i18n staticfiles %} -{% block titletag %}{% trans "Time Rule" %}{% endblock %} - - -{% block content %} -
-

Time

-

Choose a time segment in which the user visits the site.

-
- -
-
- {% csrf_token %} -
    - {% for field in form %} - {% include "wagtailadmin/shared/field_as_li.html" with field=field %} - {% endfor %} -
  • -
-
-
-{% endblock %} diff --git a/src/personalisation/templates/wagtailadmin/embeds/visit_count_rule.html b/src/personalisation/templates/wagtailadmin/embeds/visit_count_rule.html deleted file mode 100644 index 857e295..0000000 --- a/src/personalisation/templates/wagtailadmin/embeds/visit_count_rule.html +++ /dev/null @@ -1,23 +0,0 @@ -{% extends "wagtailadmin/base.html" %} -{% load i18n staticfiles %} -{% block titletag %}{% trans "Visit Coint Rule" %}{% endblock %} - - -{% block content %} -
-

Visit count

-

Define a referring page, domain or query the user has to come from.

-
- -
-
- {% csrf_token %} -
    - {% for field in form %} - {% include "wagtailadmin/shared/field_as_li.html" with field=field %} - {% endfor %} -
  • -
-
-
-{% endblock %} diff --git a/src/personalisation/views.py b/src/personalisation/views.py index 981080f..ac127e5 100644 --- a/src/personalisation/views.py +++ b/src/personalisation/views.py @@ -39,31 +39,6 @@ def disable(request, segment_id): return HttpResponseRedirect(request.META.get('HTTP_REFERER', '/')) -# TODO: Make these requestable from an existing page (the create page) -# This code might become obsolete. - - -def time_rule_embed(request): - """Show the content of the time rule modal.""" - return render(request, 'wagtailadmin/embeds/time_rule.html', { - 'form': TimeRuleForm, - }) - - -def referral_rule_embed(request): - """Show the content of the referral rule modal.""" - return render(request, 'wagtailadmin/embeds/referral_rule.html', { - 'form': ReferralRuleForm, - }) - - -def visit_count_rule_embed(request): - """Show the content of the visit count rule modal.""" - return render(request, 'wagtailadmin/embeds/visit_count_rule.html', { - 'form': VisitCountRuleForm, - }) - - class CreateSegmentView(CreateView): page_title = _("Add segment") form_class = SegmentForm