2009-01-25 19:37:47 -07:00
|
|
|
<div>
|
2009-02-26 03:50:18 -07:00
|
|
|
<h1>Editing: <a href="%($req_path%)">%($req_path%)</a></h1>
|
2009-07-28 12:49:53 -06:00
|
|
|
<br>
|
|
|
|
<form action="" method="POST">
|
2009-01-25 19:37:47 -07:00
|
|
|
<textarea name="edit_text" id="edit_text" cols="80" rows="43">%{
|
2009-02-25 10:15:00 -07:00
|
|
|
# FIXME Extra trailing new lines get added to the content somehow, should avoid it.
|
2009-02-26 03:50:18 -07:00
|
|
|
if(~ $#post_arg_edit_text 0 && test -f $dirdir_file)
|
|
|
|
cat $dirdir_file | escape_html
|
2009-01-25 19:37:47 -07:00
|
|
|
if not
|
2009-02-26 03:50:18 -07:00
|
|
|
echo -n $post_arg_edit_text | escape_html
|
2009-01-25 19:37:47 -07:00
|
|
|
|
|
|
|
%}</textarea>
|
2009-07-28 12:49:53 -06:00
|
|
|
<br>
|
|
|
|
<input type="submit" name="dirdir_save" value="Save">
|
|
|
|
<input type="submit" name="dirdir_preview" value="Preview">
|
2009-01-25 19:37:47 -07:00
|
|
|
<small>DirDir documents are written using <a href="http://daringfireball.net/projects/markdown/syntax">Markdown syntax</a>.</small>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
2009-02-26 03:50:18 -07:00
|
|
|
% if(! ~ $"post_arg_dirdir_preview '') {
|
2009-07-28 12:49:53 -06:00
|
|
|
<h2>Preview:</h2>
|
2009-01-25 19:37:47 -07:00
|
|
|
<div id="preview">
|
2009-02-26 03:50:18 -07:00
|
|
|
% echo $post_arg_edit_text | $formatter
|
2009-01-25 19:37:47 -07:00
|
|
|
</div>
|
|
|
|
% }
|