]> git.zarvox.org Git - shortlog.git/commitdiff
Add a checkbox to not receive follow-up emails.
authorDrew Fisher <drew.m.fisher@gmail.com>
Thu, 14 Apr 2011 19:13:56 +0000 (14:13 -0500)
committerDrew Fisher <drew.m.fisher@gmail.com>
Thu, 14 Apr 2011 19:13:56 +0000 (14:13 -0500)
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>
shortlog.py
templates/day.html

index 122553d8f6b33956ee9e6a5806339bb0d0e968c4..aa45f10a9e2db2ddc270a54f13ed64c46b121ff0 100644 (file)
@@ -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")
index cf931b2eed1ff533ac165df6ecb5de7ff19b9513..2c9afb4b52f4a3970290ee47bb3ae5cedb07169d 100644 (file)
@@ -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>