mlmym/templates/create_comment.html

46 lines
1.8 KiB
HTML
Raw Normal View History

2023-07-27 01:30:19 +00:00
<form class="savecomment" method="POST" enctype="multipart/form-data"
{{- if .CommentID }} action="/{{.Host}}/comment/{{.CommentID}}"
{{- else }} action="/{{.Host}}/post/{{.PostID}}"
{{- end -}}
>
2024-05-12 04:09:05 +00:00
<div class="upload">
<label title="upload photo"><div>📷</div>
<input class="imgupload" type="file" name="file" accept="image/*">
</label>
</div>
<div>
<textarea name="content" {{ if .XHR }}autofocus{{ end }}>
{{- if .Content }}
{{- .Content -}}
{{ else if and (eq .Op "edit") .Comments }}
{{- (index .Comments 0).P.Comment.Content -}}
{{ end -}}
</textarea>
</div>
{{- if eq .Op "edit" }}
<input type="hidden" name="op" value="edit_comment">
<input type="hidden" name="commentid" value="{{.CommentID}}">
{{- else }}
<input type="hidden" name="op" value="create_comment">
{{- end }}
<input type="hidden" name="parentid" value="{{.CommentID}}">
<input type="submit" name="submit" value="save">
{{- if or .Op .Content }}
<input type="submit" name="submit" value="cancel">
{{- end }}
<div class="right">
<a href="https://join-lemmy.org/docs/users/02-media.html" target="_blank">formatting help</a>
<input name="submit" type="submit" value="preview">
</div>
2023-07-27 01:30:19 +00:00
{{- if .Content }}
2024-05-12 04:09:05 +00:00
<div class="preview">
<div class="comment">
<h3>Preview</h3>
<div class="content">
{{ markdown .Host .Content }}
</div>
2023-07-27 01:30:19 +00:00
</div>
</div>
2024-05-12 04:09:05 +00:00
{{- end }}
</form>