summaryrefslogtreecommitdiff
path: root/app/lttr
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf>2021-01-30 09:45:14 -0500
committerluxagraf <sng@luxagraf>2021-01-30 09:45:14 -0500
commitd4b9ac9de532cd8a139e7cab22d6137de4ccae7d (patch)
tree34a53e7f3a1737aefdf18f957cfe8746e0b38cd5 /app/lttr
parentdc6802d6e94f7ec9e9924072cc48714b4cb25f18 (diff)
lttr: Cleaned up template code and fixed some bugs with multiple
newsletter subscriptions.
Diffstat (limited to 'app/lttr')
-rw-r--r--app/lttr/admin.py2
-rw-r--r--app/lttr/forms.py2
-rw-r--r--app/lttr/templates/lttr/confirm_activate.html23
-rw-r--r--app/lttr/templates/lttr/message/subscribe.txt3
-rw-r--r--app/lttr/templates/lttr/subscribe.html (renamed from app/lttr/templates/lttr/friends_subscribe.html)0
-rw-r--r--app/lttr/templates/lttr/subscribed.html23
-rw-r--r--app/lttr/validators.py15
-rw-r--r--app/lttr/views.py2
8 files changed, 42 insertions, 28 deletions
diff --git a/app/lttr/admin.py b/app/lttr/admin.py
index b406613..b4c223a 100644
--- a/app/lttr/admin.py
+++ b/app/lttr/admin.py
@@ -6,7 +6,7 @@ from .models import NewsletterMailing, Subscriber, Newsletter, MailingStatus
@admin.register(Subscriber)
class SubscriberAdmin(admin.ModelAdmin):
- list_display = ('email_field', 'user', 'date_created', 'subscribed', 'subscribe_date', 'unsubscribed')
+ list_display = ('email_field', 'user', 'newsletter', 'date_created', 'subscribed', 'subscribe_date', 'unsubscribed')
search_fields = ['email_field']
list_filter = ['unsubscribed']
diff --git a/app/lttr/forms.py b/app/lttr/forms.py
index ad41d66..e3fb272 100644
--- a/app/lttr/forms.py
+++ b/app/lttr/forms.py
@@ -62,7 +62,7 @@ class SubscribeRequestForm(NewsletterForm):
if subscription.subscribed and not subscription.unsubscribed:
raise ValidationError(
- "Your e-mail address has already been subscribed to."
+ "I appreciate the effort, but you're already subscribed. (if you're not receiving newsletters, email me at sng@luxagraf.net and I will see what's going on)"
)
else:
self.instance = subscription
diff --git a/app/lttr/templates/lttr/confirm_activate.html b/app/lttr/templates/lttr/confirm_activate.html
index b283adb..533d93f 100644
--- a/app/lttr/templates/lttr/confirm_activate.html
+++ b/app/lttr/templates/lttr/confirm_activate.html
@@ -1,15 +1,22 @@
{% extends 'base.html' %}
{% load typogrify_tags %}
-{% block pagetitle %}Luxagraf | Friends of a Long Year {% endblock %}
-{% block metadescription %}An infrequesnt mailing list about travel, photography, tools, walking, the natural world and other ephemera.{% endblock %}
+{% block pagetitle %}Your subscription is active, thank you! | luxagraf.net {% endblock %}
+{% block metadescription %}Thank you, I appreciate you joining the club{% endblock %}
-{% block primary %}<ul class="bl" id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
- <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> &rarr; </li>
- <li>Lttr</li>
- </ul>
- <main role="main" id="essay-archive" class="essay-archive archive-list">
- <div class="essay-intro">
+{% block primary %}
+ <nav class="breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList">
+ <span class="nav-item" itemprop="item">
+ <a href="/" itemprop="name">Home</a>
+ <meta itemprop="position" content="1" />
+ </span>
+ <span class="nav-item" itemprop="item">
+ <span itemprop="name">lttr</span>
+ <meta itemprop="position" content="2" />
+ </span>
+ </nav>
+ <main role="main" id="essay-archive" class="archive-wrapper">
+ <div class="archive-intro">
<h2>You're confirmed, thanks for joining.</h2>
<p>If you'd like you can <a href="{% url 'lttr:list' slug=newsletter %}">visit the archives</a> of past mailings.</p>
</div>
diff --git a/app/lttr/templates/lttr/message/subscribe.txt b/app/lttr/templates/lttr/message/subscribe.txt
index 2af5378..6869d5f 100644
--- a/app/lttr/templates/lttr/message/subscribe.txt
+++ b/app/lttr/templates/lttr/message/subscribe.txt
@@ -5,5 +5,4 @@ Someone, hopefully you, asked to subscribe to {{ newsletter.title }}, a luxagraf
If you would like to confirm your subscription, please follow this activation link:
https://{{ site.domain }}{{ subscription.subscribe_activate_url }}
-cheers
-Scott
+-Scott
diff --git a/app/lttr/templates/lttr/friends_subscribe.html b/app/lttr/templates/lttr/subscribe.html
index e73ca73..e73ca73 100644
--- a/app/lttr/templates/lttr/friends_subscribe.html
+++ b/app/lttr/templates/lttr/subscribe.html
diff --git a/app/lttr/templates/lttr/subscribed.html b/app/lttr/templates/lttr/subscribed.html
index 18ad151..7139d24 100644
--- a/app/lttr/templates/lttr/subscribed.html
+++ b/app/lttr/templates/lttr/subscribed.html
@@ -1,15 +1,22 @@
{% extends 'base.html' %}
{% load typogrify_tags %}
-{% block pagetitle %}Luxagraf | Friends of a Long Year {% endblock %}
-{% block metadescription %}An infrequesnt mailing list about travel, photography, tools, walking, the natural world and other ephemera.{% endblock %}
+{% block pagetitle %}Thanks for subscribing! | luxagraf.net {% endblock %}
+{% block metadescription %}Thank you, I appreciate you joining the club{% endblock %}
-{% block primary %}<ul class="bl" id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
- <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> &rarr; </li>
- <li>Lttr</li>
- </ul>
- <main role="main" id="essay-archive" class="essay-archive archive-list">
- <div class="essay-intro">
+{% block primary %}
+ <nav class="breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList">
+ <span class="nav-item" itemprop="item">
+ <a href="/" itemprop="name">Home</a>
+ <meta itemprop="position" content="1" />
+ </span>
+ <span class="nav-item" itemprop="item">
+ <span itemprop="name">lttr</span>
+ <meta itemprop="position" content="2" />
+ </span>
+ </nav>
+ <main role="main" id="essay-archive" class="archive-wrapper">
+ <div class="archive-intro">
<h2>Thanks for joining.</h2>
<p>Check your email for a link to confirm your subscription</p>
</div>
diff --git a/app/lttr/validators.py b/app/lttr/validators.py
index 754df3b..a6355bf 100644
--- a/app/lttr/validators.py
+++ b/app/lttr/validators.py
@@ -8,11 +8,12 @@ def validate_email_nouser(email):
Check if the email address does not belong to an existing user.
"""
# Check whether we should be subscribed to as a user
- User = get_user_model()
+ #User = get_user_model()
- if User.objects.filter(email__exact=email).exists():
- raise ValidationError(_(
- "The e-mail address '%(email)s' belongs to a user with an "
- "account on this site. Please log in as that user "
- "and try again."
- ) % {'email': email})
+ #if User.objects.filter(email__exact=email).exists():
+ # raise ValidationError(_(
+ # "The e-mail address '%(email)s' belongs to a user with an "
+ # "account on this site. Please log in as that user "
+ # "and try again."
+ # ) % {'email': email})
+ pass
diff --git a/app/lttr/views.py b/app/lttr/views.py
index 9b739a1..7a8b596 100644
--- a/app/lttr/views.py
+++ b/app/lttr/views.py
@@ -86,7 +86,7 @@ class NewsletterSubscribeView(CreateView):
def get_template_names(self):
- return "lttr/%s_subscribe.html" % self.kwargs['slug']
+ return ["lttr/%s_subscribe.html" % self.kwargs['slug'], 'lttr/subscribe.html']
def get_form_kwargs(self):
kwargs = super(NewsletterSubscribeView, self).get_form_kwargs()