Add owner edit tooltip
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Madis Mägi 2024-08-24 18:09:53 +03:00
parent 6bf80cf820
commit 816d4fc8ce
3 changed files with 15 additions and 1 deletions

View File

@ -165,6 +165,8 @@ def check_edit_permission(item_id):
@page_inventory.route("/m/inventory/<clone_item_id>/clone-by-slug/<slug>", methods=['GET'])
@login_required
def view_inventory_edit(item_id=None, slug=None, clone_item_id=None):
user = read_user()
has_board = user and "k-space:board" in user.get("groups", [])
item = None
if item_id:
if not check_edit_permission(item_id):

View File

@ -63,6 +63,10 @@ body {
.unclickable {
pointer-events: none;
}
span.tooltipped {
text-decoration-line: underline;
text-decoration-style: dotted;
}
</style>
</head>

View File

@ -65,7 +65,15 @@
</tr>
<tr>
<td>Owner</td>
<td>
<span
{% if not has_board %}
class="tooltipped" data-position="right" data-tooltip="You can only edit items where you are the owner"
{% endif %}
>
Owner
<span>
</td>
<td>{{ form.inventory.owner.username }}</td>
</tr>