Skip to content

Commit

Permalink
allow hiding while composing
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Golub committed Feb 8, 2010
1 parent ce59abd commit 074c5d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blog.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ def post(self):
self.get_argument("tags", "").split(",")])
tags = [db.Category(tag) for tag in tags if tag]
entry.tags = tags
entry.hidden = bool(self.get_argument("hidden", False))
entry.put()
if not key:
if not key and not entry.hidden:
self.ping()
self.redirect("/e/" + entry.slug)

Expand Down
4 changes: 4 additions & 0 deletions templates/compose.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<div class="field">
<input name="tags" type="text" class="tags" value="{{ escape(", ".join(sorted(entry.tags))) if entry else "" }}" title="{{ _("Tags (comma-separated):") }}"/>
</div>
<div class="field">
<input type="checkbox" name="hidden" id="hidden"{% if entry and entry.hidden %} checked="checked"{% end %}/>
<label for="hidden">{{ _("Hidden") }}</label>
</div>
<div>
<input type="submit" class="submit" value="{{ _("Save changes") if entry else _("Publish") }}"/>
<a href="{{ "/e/" + entry.slug if entry else "/" }}">{{ _("Cancel") }}</a>
Expand Down

0 comments on commit 074c5d2

Please sign in to comment.