Swap editor and viewer tab states in editor fragment for improved UX; integrate editor in inventory template for notes and comments.
This commit is contained in:
parent
b19d5d33f7
commit
f7570a0938
2 changed files with 13 additions and 5 deletions
|
@ -9,17 +9,17 @@
|
||||||
<a class="nav-link text-black">{{ title }}</a>
|
<a class="nav-link text-black">{{ title }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link{% if mode == 'edit' %} active{% endif %}" data-bs-toggle="tab" data-bs-target="#editor{{ id }}" id="editTab{{ id }}">{{ icons.render_icon('pencil', 16) }}</a>
|
<a class="nav-link{% if mode == 'view' %} active{% endif %}" data-bs-toggle="tab" data-bs-target="#viewer{{ id }}">{{ icons.render_icon('file-earmark-richtext', 16) }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link{% if mode == 'view' %} active{% endif %}" data-bs-toggle="tab" data-bs-target="#viewer{{ id }}">{{ icons.render_icon('file-earmark-richtext', 16) }}</a>
|
<a class="nav-link{% if mode == 'edit' %} active{% endif %}" data-bs-toggle="tab" data-bs-target="#editor{{ id }}" id="editTab{{ id }}">{{ icons.render_icon('pencil', 16) }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content" id="tabContent{{ id }}">
|
<div class="tab-content" id="tabContent{{ id }}">
|
||||||
|
<div class="tab-pane fade{% if mode == 'view' %} show active border border-top-0{% endif %} p-2 markdown-body" id="viewer{{ id }}"></div>
|
||||||
<div class="tab-pane fade{% if mode == 'edit' %} show active border border-top-0{% endif %}" id="editor{{ id }}">
|
<div class="tab-pane fade{% if mode == 'edit' %} show active border border-top-0{% endif %}" id="editor{{ id }}">
|
||||||
<textarea id="textEditor{{ id }}" name="update{{ id }}" class="form-control border-top-0 rounded-top-0" data-note-id="{{ id }}">{{ content if content }}</textarea>
|
<textarea id="textEditor{{ id }}" name="update{{ id }}" class="form-control border-top-0 rounded-top-0" data-note-id="{{ id }}">{{ content if content }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade{% if mode == 'view' %} show active border border-top-0{% endif %} p-2 markdown-body" id="viewer{{ id }}"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -114,10 +114,18 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col p-3">
|
||||||
<label for="notes" class="form-label">Notes & Comments</label>
|
{#
|
||||||
|
<label for="notes" class="form-label">Notes & Comments</label>
|
||||||
<textarea name="notes" id="notes" class="form-control"
|
<textarea name="notes" id="notes" class="form-control"
|
||||||
rows="10">{{ item.notes if item.notes else '' }}</textarea>
|
rows="10">{{ item.notes if item.notes else '' }}</textarea>
|
||||||
|
#}
|
||||||
|
{{ editor.render_editor(
|
||||||
|
id = "notes",
|
||||||
|
title = "Notes & Comments",
|
||||||
|
mode = 'view' if item.id else 'edit',
|
||||||
|
content = item.notes if item.notes else ''
|
||||||
|
) }}
|
||||||
</div>
|
</div>
|
||||||
{% if worklog %}
|
{% if worklog %}
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue