Refactor button and style indentation in primary answer display for improved readability
This commit is contained in:
@@ -1,27 +1,27 @@
|
|||||||
<div id="primary-answer-container" class="position-relative primary-answer-wrap py-1">
|
<div id="primary-answer-container" class="position-relative primary-answer-wrap py-1">
|
||||||
<strong>{{ question.get_primary_answer }}</strong>
|
<strong>{{ question.get_primary_answer }}</strong>
|
||||||
{% if can_edit %}
|
{% if can_edit %}
|
||||||
<button
|
<button
|
||||||
class="edit-primary-btn btn btn-sm btn-outline-secondary position-absolute"
|
class="edit-primary-btn btn btn-sm btn-outline-secondary position-absolute"
|
||||||
style="right:0; top:0;"
|
style="right:0; top:0;"
|
||||||
hx-get="{% url 'anatomy:primary_answer_htmx' pk=question.pk %}"
|
hx-get="{% url 'anatomy:primary_answer_htmx' pk=question.pk %}"
|
||||||
hx-target="#primary-answer-container"
|
hx-target="#primary-answer-container"
|
||||||
hx-swap="outerHTML"
|
hx-swap="outerHTML"
|
||||||
aria-label="Edit primary answer"
|
aria-label="Edit primary answer"
|
||||||
>
|
>
|
||||||
Edit primary answer
|
Edit primary answer
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* Scoped styles for primary answer edit control: match outline-secondary look */
|
/* Scoped styles for primary answer edit control: match outline-secondary look */
|
||||||
.primary-answer-wrap .edit-primary-btn {
|
.primary-answer-wrap .edit-primary-btn {
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
transition: opacity 120ms ease, transform 120ms ease;
|
transition: opacity 120ms ease, transform 120ms ease;
|
||||||
}
|
}
|
||||||
.primary-answer-wrap:hover .edit-primary-btn {
|
.primary-answer-wrap:hover .edit-primary-btn {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: none;
|
transform: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
<h6 class="mb-0">Answers</h6>
|
<h6 class="mb-0">Answers</h6>
|
||||||
<div>
|
<div>
|
||||||
{% if can_edit %}
|
{% if can_edit %}
|
||||||
<a class="btn btn-sm btn-outline-secondary" href="{% url 'anatomy:question_answer_update' pk=question.pk %}">Edit answers</a>
|
<a class="btn btn-sm btn-outline-secondary" href="{% url 'anatomy:question_answer_update' pk=question.pk %}">Edit answers</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user