Add initial templates for user login and blog post entry.
This commit is contained in:
parent
cb1cd1f2f9
commit
d5e9b2dcb0
25
lib/_apps/blog/post_form.tpl
Normal file
25
lib/_apps/blog/post_form.tpl
Normal file
@ -0,0 +1,25 @@
|
||||
%{
|
||||
get_post_args target_blog_dir post_title post_body
|
||||
|
||||
if(~ $REQUEST_METHOD POST && ! ~ $#target_blog_dir 0 && ! ~ $#post_title 0) {
|
||||
get_user
|
||||
if(test -f $sitedir/$target_blog_dir/_werc/config)
|
||||
. $sitedir/$target_blog_dir/_werc/config
|
||||
|
||||
if(~ $#blog_editors_group 0)
|
||||
echo Cant post to $target_blog_dir, no editors group set.
|
||||
if not if (! user_in_group $blog_editors_group)
|
||||
echo Permission to post to $target_blog_dir denied, user $logged_user not in group $blog_editors_group
|
||||
if not if(! make_blog_post $target_blog_dir $post_title $post_body)
|
||||
echo Posting to $target_blog_dir failed: $status
|
||||
if not
|
||||
echo Posted to $target_blog_dir.
|
||||
}
|
||||
%}
|
||||
<form method="POST">
|
||||
Submit a new blog post
|
||||
Post title: <input type="text" name="post_title" /><br />
|
||||
<textarea name="post_body"></textarea><br />
|
||||
% echo '<input type="text" name="target_blog_dir" value="'^$target_blog_dir^'" /><br />'
|
||||
<input type="submit" />
|
||||
</form>
|
13
lib/_users/login.tpl
Normal file
13
lib/_users/login.tpl
Normal file
@ -0,0 +1,13 @@
|
||||
%{
|
||||
get_user
|
||||
if(! ~ $#logged_user 0)
|
||||
echo 'You are logged in as' $logged_user
|
||||
if not if (~ $REQUEST_METHOD POST)
|
||||
echo 'Login failed!'
|
||||
|
||||
%}
|
||||
<form method="POST">
|
||||
User name: <input type="text" name="user_name" /><br />
|
||||
User password: <input type="password" name="user_password" /><br />
|
||||
<input name="s" type="submit" value="Login" />
|
||||
</form>
|
Loading…
Reference in New Issue
Block a user