summaryrefslogtreecommitdiffstats
path: root/templates/logbookform.html
blob: 5286ecfd172794ff54a53bbb3e70b9dca7ee6ce5 (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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{% extends "base.html" %}

{% block title %}New Logbook Entry form{% endblock %}

{% block content %}

{% if date %}
<h2 title="id = {{slug}}">Edit Existing Logbook Entry on {{date}}</h2>
{% else %}
<h2>New Logbook Entry in {{year}}</h2>
{% endif %}
<div align=center>
{% if date %}<p>Link to <em><a href="/logbookentry/{{date}}/{{slug}}#">this entry</a></em> &nbsp;&nbsp;{% endif %}
<a href="/handbook/logbooks.html#form">How to use this form</a>
</div>
    {% if save_bad %}
    <p style="font-family: monospace; font-weight: bold; color: red; font-size: 130%; text-align: center">

    Cannot save to '{{save_bad}}' as a file of that name already exists here.
    </p>
    {% endif %}
    <style>
    input, textarea, pre {font-family: monospace; font-weight: bold; text-align:center; font-size: 100%; padding: 0.5em;  }
    textarea {text-align:left }
    pre {text-align:left; font-size: 120%  }
    textarea {text-align:left }
    </style>  
    <div style = "max-width:100%; margin-left:15%; font-family: monospace; font-weight: bold; font-size: 150%; text-align: right; " >
    
    <form method ='post' >
       {% csrf_token %}              
    <br />                 
           <input name="prev_slug" id="prev_slug" value="{{slug}}" type=hidden>

           <span {% if dateflag %}style="color:red"{% endif %}>
           <span {% if yesterday%}style="color:blue"{% endif %}>
           <label for="date">Date of the activity{% if dateflag %} (cannot change year on an existing entry){% endif %}</label>
           <input {% if not user.username %} disabled{% endif %} 
		{% if dateflag %}style="color:red"{% endif %}
		{% if yesterday%}style="color:blue"{% endif %}
           label = "Date" name = "date" size="12"
           title="Date of the activity, a single day,  in ISO format: 2020-08-17"
             {% if date %}value="{{date}}"{% else %}
		{% if yesterday %} value="{{yesterday}}"{% else %}
		placeholder="2025-08-12"{% endif %}{% endif %}
           required /> 
           </span>
          
    <br /><br />     
           <span {% if authorflag %}style="color:red"{% endif %}>    
           <label for="author">Your name (author) <a href="/aliases/{{year}}">[valid authors]</a></label>
           <input {% if not user.username %} disabled{% endif %} 
		{% if authorflag %}style="color:red"{% endif %}
           label = "author" name = "author" size="20"
           title="The person writing the logbook entry"
           {% if author %}value="{{author}}"{% else %}placeholder="Animal"{% endif %}
           required /> 
          </span>
    <br /><br />        
           <label for="others">Other names (comma separated) <a href="/aliases/{{year}}">[valid aliases]</a></label>
           <input {% if not user.username %} disabled{% endif %} 
           label = "others" name = "others" size="{% if lenothers %}{{lenothers}}{% else %}20{% endif %}"
           title="Everyone else involved"
           {% if others %}value="{{others}}"{% else %}placeholder="Phil T, Chas, Planc" {% endif %}
           /> 
    <br /><br />         
           <label for="place">Place: cave name, or 'plateau', 'topcamp' etc.</label>
           <input {% if not user.username %} disabled{% endif %} 
           label = "Place" name = "place" size="15"
           title="Place: cave name, or 'plateau', 'topcamp'  "
           {% if place %}value="{{place}}"{% else %}placeholder="basecamp" {% endif %}
           required /> 
    <br /><br />        
           <label for="title">Title</label>
           <input {% if not user.username %} disabled{% endif %} 
           label = "Title" name = "title" size="30"
           title="Title of your activity"
           {% if place %}value="{{title}}"{% else %}placeholder="What we did on our holidays" {% endif %}
           required /> 
    <br /><br /> 
           <textarea {% if not user.username %} disabled{% endif %} 
           rows="{% if textrows%}{{textrows}}{% else %}5{% endif %}" cols="70"
           label = "" name = "text" 
           required />{% if entry %}{{entry}}{% else %}We had a lot of fun...{% endif %}
           </textarea>
           <br>
           [Type in text in <a href="/handbook/logbooks.html#form">Logbook HTML format</a>.]
    <br /><br />         
           <label for="tu">Time underground (hours)</label>
           <input {% if not user.username %} disabled{% endif %} 
           label = "tu" name = "tu" size="5"
           title="Time underground (hours)"
           {% if tu %}value="{{tu}}"{% else %}placeholder="0.1" {% endif %}
           /> 
    <br /><br /> 
		   <label for="who_are_you">Who are you, editing this logbook entry?</label>
           <input {% if not user.username %} disabled{% endif %} 
           label = "Who are you" name = "who_are_you" size ="70"
           title="Who are you"
           placeholder="editor's name for version control e.g. 'Animal <mta@gasthof.expo>'" value="{{who_are_you}}" required/>
   <br /><br /> 
       <input  type="hidden" value="{{slug}}" name="slug">
       <button  class="fancybutton2"  style="padding: 0.5em 25px; margin-left: 110px" type = "submit" value = "save" >
          {% if title %}Update this entry<em>"{{title}}"</em>{% else %} Save this entry{% endif %}
       </button>
    </form>

    <br /><br /><br />
	{% if date %}<p>Link to <em><a href="/logbookentry/{{date}}/{{slug}}#">this entry</a></em> &nbsp;&nbsp;{% endif %}
        Full logbook: <a href="/years/{{year}}/logbook.html"><em>Logbook {{year}}</em></a>
&nbsp;&nbsp;&nbsp;&nbsp;{{year}} <a href="/logreport/{{year}}">Logbook report</a>
			
 
</div>

<br />

<hr />

{% if output %}
<details><summary>
Click this triangle to see the HTML which has been put into logbook.html, and below that is the rendered logbook entry.
</summary>
<pre>
{{output}}
</pre>
</details>
<hr>
<style>
.tripdate, .trippeople {
	background-color: #C6E4E3;
	float: left;
	margin: 2px 1px 1px 1px;
	padding: 10px;
	border-bottom-right-radius: 1em;
	}
.trippeople {
	background-color: #fff;
	float: right;
	font-style: italic;
	}
.triptitle {
	border: 1px solid #99CCCC;
	border-top-width: 2px;
	color: #008787;
	font-size: 120%;
	font-weight: bold;
	padding: 45px 10px 20px;
	text-align: center;
	}
.timeug	{
	text-align: right;
	font-weight: bold;
	margin-bottom: 10px;}
    </style>
{{output|safe}}
{% endif %}
{% endblock %}