This repository has been archived by the owner on Oct 25, 2018. It is now read-only.
/
edit.html
97 lines (83 loc) · 4.01 KB
/
edit.html
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
88
89
90
91
92
93
94
95
96
97
{% extends "admin_template.html" %}
{% block css %}
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet" media="screen">
<link href="{{ url_for('static', filename='css/layout.css') }}" type="text/css" media="screen" rel="stylesheet">
<link href="/style.css" type="text/css" media="screen" rel="stylesheet">
<script src="https://raw.github.com/coreyti/showdown/master/compressed/showdown.js" type="text/javascript"></script>
<style>
.sidebar-nav-fixed {
position:fixed;
}
</style>
{% endblock %}
{% block head %}
{% if post.draft %}
<script type="text/javascript">
function SaveTick(){
issueSaveAjax({{ post.id }}, false);
setTimeout("SaveTick()", 10000)
}
$(document).ready(function(){
setTimeout("SaveTick();", 10000);
})
</script>
{% endif %}
{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="row-fluid">
<form accept-charset="UTF-8" action="" class="edit_post" id="edit_post" method="post">
<div class="span2 sidebar-nav-fixed" style="padding: 60px 0;">
<p><a class="btn btn-inverse" href="{{ url_for("admin") }}">Admin</a></p>
<p><a class="btn btn-inverse" href="{{ url_for('delete', post_id=post.id, next="admin") }}">Delete</a> </p>
<p>
<label for="post_draft">Draft</label>
<input name="post_draft" type="hidden" value="0" /><input id="post_draft" name="post_draft" type="checkbox" value="1" {% if post.draft %}checked{% endif %} />
</p>
<p>
{% if post.draft %}
<a class="btn btn-inverse" href="#" onclick="issueSaveAjax({{ post.id }}, true); return false;" target="_blank">Preview</a>
{% else %}
<a class="btn btn-inverse" href="{{ url_for('view_post_slug', slug=post.slug) }}" target="_blank">View live</a>
{% endif %}
</p>
<p>
<button class="btn btn-inverse" onclick="$('#edit_post').submit()">Save</button>
</p>
</div>
<div class="span1">
</div>
<div class="span9" style="padding: 60px 0;">
<div class="row">
<div class="span7 offset3">
<div class="expandingArea text-title">
<pre><span></span><br></pre>
<textarea class="post_title" id="post_title" name="post_title" placeholder="Title here" rows="1">{{ post.title }}</textarea>
</div>
</div>
</div>
<div class="row">
<div class="span7 offset3">
<div class="expandingArea text-content" id="edit_post_area">
<pre><span></span><br></pre>
<textarea cols="40" id="post_content" name="post_content" placeholder="Write post here" rows="20">{{ post.text }}</textarea>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
{% endblock %}
{% block content2 %}
<div id="publish-bar">
<div class="contain">
<div>
<a href="{{ url_for('admin') }}">Admin</a>
</div>
<div>
<a href="{{ url_for('delete', post_id=post.id, next="admin" ) }}" class="delete-bar" data-confirm="Are you sure?" rel="nofollow">Delete</a>
</div>
</div>
</div>
{% endblock %}