Add some text and styling
[txt.house] / txt_house / templates / edit.html
1 {% extends "base.html" %}
2
3 {% block body %}
4
5 <style>
6   .copy-area {
7     display: flex;
8     flex-direction: row;
9     align-items: center;
10     flex-wrap: wrap;
11     justify-content: center;
12
13     margin-top: 1.5rem;
14   }
15
16   .copy-area label {
17     font-weight: bold;
18     margin-right: 1rem;
19   }
20
21   small {
22     margin-top: 0.5rem;
23   }
24
25   .error {
26     color: #bb0000;
27     text-align: center;
28     font-weight: bold;
29   }
30 </style>
31
32 <nav>
33   <a href='{% url "index" %}' title='Home'>Home</a>
34   <a href='{{ text_file.get_view_url }}' title='View'>View</a>
35 </nav>
36
37 <form class='editor' action='{{ text_file.get_edit_url }}' method='post'>
38   {% csrf_token %}
39   <div class='edit-key-area'>
40     {% if edit_key %}
41       <span class='copy-area'>
42         <label for='edit-key-display'>Edit key:</label>
43         <span id='edit-key-display'>{{ edit_key }}</span>
44       </span>
45       <small>Save this key in order to edit this file in the future.</small>
46       <input id='edit_key' name='edit_key' type='hidden' value='{{ edit_key }}'></input>
47     {% else %}
48       <span class='field'>
49         <label for='edit_key'>Edit key:</label>
50         <input id='edit_key' name='edit_key' type='text'></input>
51       </span>
52
53       {% if incorrect_key %}
54       <span class='error'>You must enter the correct edit key to save your changes.</span>
55       {% endif %}
56     {% endif %}
57   </div>
58
59   <textarea name='text'>{{ text }}</textarea>
60   <input type='submit'></input>
61 </form>
62
63 {% endblock %}