{#
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
#}
{% extends 'forgewiki:templates/wiki/master.html' %}
{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / {{page.title}}{% endblock %}
{% block header %}Edit {{page.title}}{% endblock %}
{% block extra_css %}
<style type="text/css">
textarea[name="text"]{
height: 600px;
}
</style>
{% endblock %}
{% block actions %}
<a href="." title="View Page"><b data-icon="{{g.icons['search'].char}}" class="ico {{g.icons['search'].css}}" title="View Page"></b></a>
{% if page_exists and h.has_access(page, 'delete')() %}
<a class="post-link" href="./delete" title="Delete"><b data-icon="{{g.icons['delete'].char}}" class="ico {{g.icons['delete'].css}}" title="Delete"></b></a>
{% endif %}
{% endblock %}
{% block wiki_content %}
<form method="POST" class="can-retry" action="update" id="page_edit_form">
<label class="grid-4">Name:</label>
<div class="grid-14">
<input type="text" name="title" id="title" value="{{page.title}}" placeholder="Page name" required="required" autofocus="autofocus"/>
</div>
<label class="grid-20">Content:</label>
<div style="clear:both;"></div>
<div class="grid-20">
{{c.markdown_editor.display(id='text', name='text',value=page.text)}}
</div>
<div style="clear:both;"></div>
<label class="grid-4">Labels:</label>
<div class="grid-14" style="margin-left:0">
{{c.label_edit.display(id='labels', name='labels', value=page.labels)}}
</div>
<div class="grid-19">
<input type="submit" value="Save">
<input type="reset" value="Cancel">
</div>
</form>
<div class="grid-19">
{{c.attachment_list.display(attachments=page.attachments, edit_mode=page_exists and h.has_access(page, 'edit')())}}
{% if page_exists and h.has_access(page, 'edit')() %}
{{c.attachment_add.display(action=page.url() + 'attach', name='file_info')}}
{% endif %}
</div>
{% endblock %}
{% block wiki_extra_js %}
<script type="text/javascript">
/*<![CDATA[*/
$('textarea.auto_resize').autosize();
$('span.removable').click(function(e){
var vals = $('#page_edit_form').serialize();
var del_name = $('input', this)[0].name.replace('.id','.delete');
$.post($('#page_edit_form')[0].action, vals+'&'+del_name+'=Del', function(){
e.target.parentNode.removeChild(e.target);
});
});
$('#page_edit_form input[type=reset]').click(function(){
{% if page_exists %}
window.location.href = "{{page.url()}}";
{% else %}
window.location.href = "{{c.app.url}}";
{% endif %}
});
/*]]>*/
</script>
{% endblock %}