Update web/templates/entry_view.html
This commit is contained in:
parent
ff69969ea8
commit
5c664232be
@ -14,29 +14,19 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="rt-right">
|
||||
<form method="get" action="{% url 'nav_prev' %}" class="inline" style="display:inline;">
|
||||
<form method="get" action="{% url 'nav_prev' %}" class="inline">
|
||||
<!-- send current zero-based index (position-1); view will subtract 1 -->
|
||||
<input type="hidden" name="i" value="{{ position|add:'-1' }}">
|
||||
<button class="btn btn-lg" {% if position <= 1 %}disabled{% endif %}>‹ Prev</button>
|
||||
</form>
|
||||
|
||||
<form method="get" action="{% url 'nav_next' %}" class="inline" style="display:inline;">
|
||||
<form method="get" action="{% url 'nav_next' %}" class="inline">
|
||||
<!-- send current zero-based index (position-1); view will add 1 -->
|
||||
<input type="hidden" name="i" value="{{ position|add:'-1' }}">
|
||||
<button class="btn btn-lg btn-primary" {% if position >= count %}disabled{% endif %}>Next ›</button>
|
||||
</form>
|
||||
|
||||
<!-- Share Button -->
|
||||
<button id="shareBtn" class="btn btn-lg" title="Share this illustration" style="margin-left:6px;">
|
||||
<span style="display:inline-flex;align-items:center;gap:6px;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
viewBox="0 0 16 16">
|
||||
<path d="M11 2a2 2 0 1 1 1.414 3.414l-6.657 3.89a2.005 2.005 0 0 1 0 .392l6.657 3.89A2 2 0 1 1 11 14a2 2 0 0 1-.723-.138l-6.657-3.89a2 2 0 1 1 0-4l6.657-3.89A2 2 0 0 1 11 2z"/>
|
||||
</svg>
|
||||
Share
|
||||
</span>
|
||||
</button>
|
||||
|
||||
{% if user.is_authenticated and user.is_staff %}
|
||||
<a class="btn btn-outline" href="{% url 'entry_edit' entry.id %}">Edit</a>
|
||||
<a class="btn btn-outline" href="{% url 'entry_edit' entry.id %}">Unlock / Edit</a>
|
||||
<a class="btn btn-danger" href="{% url 'entry_delete' entry.id %}">Delete</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
@ -63,7 +53,7 @@
|
||||
<!-- ILLUSTRATION -->
|
||||
<div class="section">
|
||||
<div class="section-label">Illustration</div>
|
||||
<div id="illustrationText" class="section-body lead-text">
|
||||
<div class="section-body lead-text">
|
||||
{{ entry.illustration|linebreaksbr|default:"—" }}
|
||||
</div>
|
||||
</div>
|
||||
@ -71,7 +61,7 @@
|
||||
<!-- APPLICATION -->
|
||||
<div class="section">
|
||||
<div class="section-label">Application</div>
|
||||
<div id="applicationText" class="section-body lead-text">
|
||||
<div class="section-body lead-text">
|
||||
{{ entry.application|linebreaksbr|default:"—" }}
|
||||
</div>
|
||||
</div>
|
||||
@ -137,27 +127,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Toast -->
|
||||
<div id="toast" style="visibility:hidden;min-width:200px;margin-left:-100px;background:#333;color:#fff;text-align:center;border-radius:4px;padding:10px;position:fixed;z-index:1;left:50%;bottom:30px;font-size:14px;">
|
||||
The Illustration was copied to the clipboard
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById("shareBtn").addEventListener("click", function() {
|
||||
const ill = document.getElementById("illustrationText").innerText.trim();
|
||||
const app = document.getElementById("applicationText").innerText.trim();
|
||||
const textToCopy = ill + " " + app;
|
||||
|
||||
navigator.clipboard.writeText(textToCopy).then(function() {
|
||||
const toast = document.getElementById("toast");
|
||||
toast.style.visibility = "visible";
|
||||
setTimeout(() => { toast.style.visibility = "hidden"; }, 5000);
|
||||
}).catch(function(err) {
|
||||
console.error("Failed to copy: ", err);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.subject-pills{
|
||||
display:flex;
|
||||
@ -174,7 +143,7 @@ document.getElementById("shareBtn").addEventListener("click", function() {
|
||||
border:1px solid #d7e6f7;
|
||||
color:#0f172a;
|
||||
text-decoration:none;
|
||||
text-transform: capitalize;
|
||||
text-transform: capitalize; /* Capitalize each word */
|
||||
}
|
||||
.chip-subject:hover{
|
||||
background:#e2effc;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user