changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > werc / lib/_apps/brag/post_form.tpl

changeset 316: a8c8620f7ff7
parent: c4e0e8024ea0
author: uriel@engel.se.cat-v.org
date: Mon, 12 Jan 2009 02:07:31 +0100
permissions: -rw-r--r--
description: Various small cleanups: remove unused code, clarity and reliability fixes here and here, move code to more appropriate locations, improve some comments.
1 %{
2 get_post_args target_blog_dir post_title post_body
3 
4 if(~ $REQUEST_METHOD POST && ! ~ $#target_blog_dir 0 && ! ~ $#post_title 0) {
5 
6  # XXX Need a generic way to load the complete config hierarchy for a given path
7  if(test -f $sitedir/$target_blog_dir/_werc/config)
8  . $sitedir/$target_blog_dir/_werc/config
9 
10  if(~ $#blog_editors_group 0)
11  echo Cant post to $target_blog_dir, no editors group set.
12  if not if(! check_user $blog_editors_group)
13  echo Post to $target_blog_dir denied, user $logged_user not in group $blog_editors_group
14  if not if(! make_blog_post $target_blog_dir $post_title $post_body)
15  echo Posting to $target_blog_dir failed: $status
16  if not
17  echo Posted to $target_blog_dir.
18 }
19 %}
20 <form method="POST">
21  Submit a new blog post
22  Post title: <input type="text" name="post_title" /><br />
23  <textarea name="post_body"></textarea><br />
24  <input type="text" name="target_blog_dir" value="%($target_blog_dir%)" /><br />
25  <input type="submit" value="Post" />
26 </form>