From: Drew Fisher <drew.m.fisher@gmail.com>
Date: Thu, 14 Apr 2011 19:13:56 +0000 (-0500)
Subject: Add a checkbox to not receive follow-up emails.
X-Git-Url: http://git.zarvox.org/dispatcher.js?a=commitdiff_plain;h=b55717e4371efdd7d0c36b0b1359963632aa8b24;p=shortlog.git

Add a checkbox to not receive follow-up emails.

If the user clicks the checkbox, the text " noreply" will be appended to
the email address line in the pending comment written out to disk.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
---

diff --git a/shortlog.py b/shortlog.py
index 122553d..aa45f10 100644
--- a/shortlog.py
+++ b/shortlog.py
@@ -153,6 +153,9 @@ class day:
 			return
 		name = i.name.strip()
 		email = i.email.strip()
+		wantsreply = True
+		if 'wantsreply' in i:
+			wantsreply = False
 		website = i.website.strip()
 		if website != "" and not website.startswith("http"):
 			website = "http://" + website
@@ -166,7 +169,10 @@ class day:
 				break
 		f = open(fname, "a+")
 		f.write(name + "\n")
-		f.write(email + "\n")
+		if wantsreply:
+			f.write(email + "\n")
+		else:
+			f.write(email + " noreply\n")
 		f.write(website + "\n")
 		f.write(timestamp + "\n")
 		f.write(comment + "\n")
diff --git a/templates/day.html b/templates/day.html
index cf931b2..2c9afb4 100644
--- a/templates/day.html
+++ b/templates/day.html
@@ -37,6 +37,7 @@ $for c in comments:
 	<p><input name="website" type="text" size="30" aria-required="false" />Website (optional)</p>
 	<p><input name="bottest" type="text" size="30" aria-required="true" />Antispam: enter a four digit number</p>
 	<p><textarea name="comment" cols="45" rows="8" aria-required="true"></textarea></p>
+	<p><input name="wantsreply" type="checkbox" value="No" />Don't email me updates to comments</p>
 	<input name="submit" type="submit" id="submit" value="Post Comment" />
 </form>
 </div>