Add owner edit tooltip
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
6bf80cf820
commit
816d4fc8ce
@ -165,6 +165,8 @@ def check_edit_permission(item_id):
|
|||||||
@page_inventory.route("/m/inventory/<clone_item_id>/clone-by-slug/<slug>", methods=['GET'])
|
@page_inventory.route("/m/inventory/<clone_item_id>/clone-by-slug/<slug>", methods=['GET'])
|
||||||
@login_required
|
@login_required
|
||||||
def view_inventory_edit(item_id=None, slug=None, clone_item_id=None):
|
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
|
item = None
|
||||||
if item_id:
|
if item_id:
|
||||||
if not check_edit_permission(item_id):
|
if not check_edit_permission(item_id):
|
||||||
|
@ -63,6 +63,10 @@ body {
|
|||||||
.unclickable {
|
.unclickable {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
span.tooltipped {
|
||||||
|
text-decoration-line: underline;
|
||||||
|
text-decoration-style: dotted;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
@ -65,7 +65,15 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>{{ form.inventory.owner.username }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user