Parent: [3e2648] (diff)

Child: [caf8f4] (diff)

Download this file

page_edit.html    87 lines (81 with data), 2.8 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{% extends '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="." class="btn ico-l"><b class="ui-icon ui-icon-search"></b> <span>View Page</span></a>
{% if page_exists and has_artifact_access('delete', page)() %}
<a href="./delete" class="btn ico-l"><b class="ui-icon ui-icon-minusthick"></b> <span>Delete</span></a>
{% endif %}
{% endblock %}
{% block wiki_content %}
<form method="POST" class="can-retry" action="update" id="page_edit_form">
<ol>
<li>
<label for="title">Name:</label>
<input type="text" name="title" id="title" value="{{page.title}}" placeholder="Page name" required="required" autofocus="autofocus"/>
</li>
<li>
<label for="text">Content:</label>
<div style="clear:both"></div>
{{c.markdown_editor.display(name='text',value=page.text)}}
</li>
<li>
<div class="row dual">
<div class="column" style="margin-right:0">
<label for="labels">Labels:</label>
</div>
<div class="column" style="margin-left:0">
{{c.label_edit.display(name='labels', value=page.labels)}}
</div>
</div>
</li>
{% if not page_exists or has_artifact_access('edit_page_permissions', page)() %}
<li>
<label>Viewable by:</label>
{% set j = 0 %}
{% for u in page.viewable_by %}
<span class="removable">
{{u}}
<input type="hidden" name="viewable_by-{{j}}.id" value="{{u}}"/>
</span>
{% set j = j + 1 %}
{% endfor %}
</li>
<li>
<label for="new_viewable_by">Add Viewer:</label>
{{c.user_select.display(name='new_viewable_by', value='')}}
</li>
{% endif %}
<li>
<label>&nbsp;</label>
<input type="submit" value="Save"/>
<input type="reset" value="Cancel"/>
</li>
</ol>
</form>
<hr class="clear clearfix" />
{{c.attachment_list.display(attachments=page.attachments, edit_mode=page_exists and has_artifact_access('edit', page)())}}
{% if page_exists and has_artifact_access('edit', page)() %}
{{c.attachment_add.display(action=page.url() + 'attach', name='file_info')}}
{% endif %}
{% endblock %}
{% block wiki_extra_js %}
<script type="text/javascript">
/*<![CDATA[*/
$('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);
});
});
/*]]>*/
</script>
{% endblock %}