lib.itmens/journal/templates/comment.html

110 lines
4.1 KiB
HTML
Raw Normal View History

2023-01-31 21:21:50 -05:00
{% load static %}
{% load i18n %}
{% load l10n %}
{% load humanize %}
{% load mastodon %}
{% load thumb %}
2024-01-27 12:25:06 -05:00
<dialog open
class="mark-editor"
_="on close_dialog add .closing then wait for animationend then remove me">
<article>
<header>
<link to="#"
aria-label="Close"
class="close"
_="on click trigger close_dialog" />
2024-05-23 11:27:03 -04:00
<strong>{% trans 'Comment' %} - {{ item.parent_item.title }}: {{ item.title }}</strong>
2024-01-27 12:25:06 -05:00
</header>
<div>
<form action="{% url 'journal:comment' item.uuid %}" method="post">
{% csrf_token %}
<textarea name="text"
cols="40"
rows="10"
2024-05-23 11:27:03 -04:00
placeholder="{% trans "Tips: use &gt;!text!&lt; for spoilers; some instances may not be able to show posts longer than 360 charactors." %}"
id="id_text">{% if comment.text %}{{ comment.text }}{% endif %}</textarea>
2024-01-27 12:25:06 -05:00
<div class="grid">
<div>
<fieldset>
<input type="radio"
name="visibility"
value="0"
required=""
id="id_visibility_0"
{% if comment.visibility == 0 or not comment %}checked{% endif %}>
2024-05-23 11:27:03 -04:00
<label for="id_visibility_0">{% trans "Public" %}</label>
2024-01-27 12:25:06 -05:00
<input type="radio"
name="visibility"
value="1"
required=""
id="id_visibility_1"
{% if comment.visibility == 1 %}checked{% endif %}>
2024-05-23 11:27:03 -04:00
<label for="id_visibility_1">{% trans "Followers Only" %}</label>
2024-01-27 12:25:06 -05:00
<input type="radio"
name="visibility"
value="2"
required=""
id="id_visibility_2"
{% if comment.visibility == 2 %}checked{% endif %}>
2024-05-23 11:27:03 -04:00
<label for="id_visibility_2">{% trans "Mentioned Only" %}</label>
2024-01-27 12:25:06 -05:00
</fieldset>
</div>
2024-01-27 12:25:06 -05:00
<div>
<fieldset>
{% if request.user.mastodon_acct %}
<label for="id_share_to_mastodon">
<input role="switch"
type="checkbox"
name="share_to_mastodon"
id="id_share_to_mastodon"
value="1"
{% if request.user.preference.mastodon_default_repost %}checked{% endif %}>
2024-06-16 21:54:20 -04:00
{% trans "Crosspost to timeline" %}
2024-01-27 12:25:06 -05:00
</label>
{% endif %}
</fieldset>
</div>
2023-01-31 21:21:50 -05:00
</div>
2024-01-27 12:25:06 -05:00
<div>
2024-05-26 22:57:49 -04:00
<input type="submit" class="button float-right" value="{% trans "Save" %}">
</div>
<div {% if item.class_name != "podcastepisode" %}style="display:none;"{% endif %}>
2024-01-27 12:25:06 -05:00
<div role="group">
<div>
<input type="checkbox" name="share_position" value="1" id="share_position">
2024-05-23 11:27:03 -04:00
<label for="share_position">{% trans "share with playback position" %}</label>
</div>
<div>
<input type="input"
name="position"
id="position"
value="00:00:00"
class="html-duration-picker"
pattern="[0-9]{2}:[0-9]{2}:[0-9]{2}"
title="hh:mm:ss"
style="display: none;
padding: 0px 2px;
height: unset">
</div>
</div>
2023-01-31 21:21:50 -05:00
</div>
</form>
</div>
2024-01-27 12:25:06 -05:00
</article>
</dialog>
2023-01-31 21:21:50 -05:00
<script type="text/javascript">
if (window.player && window.current_item_uuid == "{{ focus_item.uuid }}"){
$('#share_position').prop('checked', true);
$("#position").show()
var t = ~~ window.player.currentTime;
$('#position').val(('0' + ~~(t/3600)).substr(-2) + ':' + ('0' + ~~(t%3600/60)).substr(-2) + ':' + ("0" + t%60).substr(-2))
}
$('#share_position').on('click', ()=>{
if ($('#share_position').prop('checked')) {
$("#position").show()
} else {
$("#position").hide()
}
})
</script>