improve editing operation wrt attachments and places
This commit is contained in:
parent
eafb6203df
commit
b572c29ba7
|
@ -9,10 +9,19 @@
|
||||||
<details>
|
<details>
|
||||||
<summary>more options</summary>
|
<summary>more options</summary>
|
||||||
<p>
|
<p>
|
||||||
<label class=button id="donker">attach: {{ if .SavedFile }} {{ .SavedFile }} {{ else }} <input onchange="updatedonker();" type="file" name="donk"><span></span> {{ end }}</label>
|
<label class=button id="donker">attach: <input onchange="updatedonker();" type="file" name="donk"><span>{{ .SavedFile }}</span></label>
|
||||||
<input type="hidden" name="donkxid" value="{{ .SavedFile }}">
|
<input type="hidden" id="saveddonkxid" name="donkxid" value="{{ .SavedFile }}">
|
||||||
<p id="donkdescriptor"><label for=donkdesc>description:</label><br>
|
<p id="donkdescriptor"><label for=donkdesc>description:</label><br>
|
||||||
<input type="text" name="donkdesc" value="{{ .DonkDesc }}" autocomplete=off>
|
<input type="text" name="donkdesc" value="{{ .DonkDesc }}" autocomplete=off>
|
||||||
|
{{ with .SavedPlace }}
|
||||||
|
<p><button id=checkinbutton type=button onclick="fillcheckin()">checkin</button>
|
||||||
|
<div id=placedescriptor>
|
||||||
|
<p><label>name:</label><br><input type="text" name="placename" id=placenameinput value="{{ .Name }}">
|
||||||
|
<p><label>url:</label><br><input type="text" name="placeurl" id=placeurlinput value="{{ .Url }}">
|
||||||
|
<p><label>lat: </label><input type="text" size=9 name="placelat" id=placelatinput value="{{ .Latitude}}">
|
||||||
|
<label>lon: </label><input type="text" size=9 name="placelong" id=placelonginput value="{{ .Longitude }}">
|
||||||
|
</div>
|
||||||
|
{{ else }}
|
||||||
<p><button id=checkinbutton type=button onclick="fillcheckin()">checkin</button>
|
<p><button id=checkinbutton type=button onclick="fillcheckin()">checkin</button>
|
||||||
<div id=placedescriptor style="display: none">
|
<div id=placedescriptor style="display: none">
|
||||||
<p><label>name:</label><br><input type="text" name="placename" id=placenameinput value="">
|
<p><label>name:</label><br><input type="text" name="placename" id=placenameinput value="">
|
||||||
|
@ -20,6 +29,7 @@
|
||||||
<p><label>lat: </label><input type="text" size=9 name="placelat" id=placelatinput value="">
|
<p><label>lat: </label><input type="text" size=9 name="placelat" id=placelatinput value="">
|
||||||
<label>lon: </label><input type="text" size=9 name="placelong" id=placelonginput value="">
|
<label>lon: </label><input type="text" size=9 name="placelong" id=placelonginput value="">
|
||||||
</div>
|
</div>
|
||||||
|
{{ end }}
|
||||||
<p><button id=addtimebutton type=button onclick="showelement('timedescriptor')">add time</button>
|
<p><button id=addtimebutton type=button onclick="showelement('timedescriptor')">add time</button>
|
||||||
<div id=timedescriptor style="display: none">
|
<div id=timedescriptor style="display: none">
|
||||||
<p><label for=timestart>start:</label><br>
|
<p><label for=timestart>start:</label><br>
|
||||||
|
|
|
@ -270,6 +270,8 @@ function updatedonker() {
|
||||||
el.children[1].textContent = el.children[0].value.slice(-20)
|
el.children[1].textContent = el.children[0].value.slice(-20)
|
||||||
var el = document.getElementById("donkdescriptor")
|
var el = document.getElementById("donkdescriptor")
|
||||||
el.style.display = ""
|
el.style.display = ""
|
||||||
|
var el = document.getElementById("saveddonkxid")
|
||||||
|
el.value = ""
|
||||||
}
|
}
|
||||||
var checkinprec = 100.0
|
var checkinprec = 100.0
|
||||||
var gpsoptions = {
|
var gpsoptions = {
|
||||||
|
|
1
web.go
1
web.go
|
@ -980,6 +980,7 @@ func edithonkpage(w http.ResponseWriter, r *http.Request) {
|
||||||
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
||||||
templinfo["Honks"] = honks
|
templinfo["Honks"] = honks
|
||||||
templinfo["Noise"] = noise
|
templinfo["Noise"] = noise
|
||||||
|
templinfo["SavedPlace"] = honk.Place
|
||||||
templinfo["ServerMessage"] = "honk edit"
|
templinfo["ServerMessage"] = "honk edit"
|
||||||
templinfo["IsPreview"] = true
|
templinfo["IsPreview"] = true
|
||||||
templinfo["UpdateXID"] = honk.XID
|
templinfo["UpdateXID"] = honk.XID
|
||||||
|
|
Loading…
Reference in New Issue