summaryrefslogtreecommitdiff
path: root/pastepy/templates/paste.html
blob: 6504e9e437a9e7fdcf97404d99dc80c21644dc42 (plain)
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
{% extends "base.html" %}
{% block head %}
	<script src="{{ url_for('static', filename='js/edit.js') }}" type="text/javascript"></script>
{% endblock %}
{% block nav %}
<ul class="navbar-nav mr-auto">
	<li class="nav-item active"><a href="{{ url_for('.paste') }}" class="nav-link">{{ title }}</a></li>
</ul>
{% endblock %}
{% block content %}
<h1>New paste</h1>
<form action="/paste" method="post" id="pasteform">
	<div class="form-row mb-3">
		<div class="col-auto">
			<select name="syntax" id="syntax" class="custom-select">
				{% for cat, ls in config.LEXERS %}
				<optgroup label="{{ cat }}">
					{% for k, v in ls %}
					<option value="{{ v }}"{% if v == (session.syntax or config.DEFAULT_SYNTAX) %} selected="selected"{% endif %}>{{ k }}</option>
					{% endfor %}
				</optgroup>
				{% endfor %}
			</select>
		</div>
		<div class="col-auto">
			<div class="custom-control custom-checkbox">
				<input type="checkbox" name="remember_syntax" id="remember_syntax"{% if session.syntax %} checked{% endif %} class="custom-control-input">
				<label for="remember_syntax" class="custom-control-label">Remember syntax</label>
			</div>
		</div>
	</div>
	<div class="form-row mb-3">
		<div class="col-auto">
			<input type="text" name="nick" id="nick" value="{{ session.nick }}" class="form-control" placeholder="Name">
		</div>
		<div class="col-auto">
			<div class="custom-control custom-checkbox">
				<input type="checkbox" name="remember_me" id="remember_me"{% if session.nick %} checked{% endif %} class="custom-control-input">
				<label for="remember_me" class="custom-control-label">Remember me</label>
			</div>
		</div>
	</div>
	<div class="form-row mb-3">
		<div class="col-auto">
			<input type="text" name="title" id="title" class="form-control" placeholder="Title">
		</div>
	</div>
	<div class="form-row mb-3">
		<div class="col">
			<textarea rows="15" name="text" id="text" class="form-control text-monospace"></textarea>
		</div>
	</div>
	<div class="form-row mb-3">
		<button type="submit" id="pastesubmit" name="type" class="btn btn-primary" value="Paste">Paste</button>
		<button type="submit" id="pastesubmit2" name="type" class="btn btn-secondary" value="Preview">Preview</button>
	</div>
</form>
{% endblock %}