mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-04 18:25:04 +02:00
Removed field permissions from Part edit page
This commit is contained in:
parent
fc1af24ef9
commit
5e06557cf0
12 changed files with 29 additions and 87 deletions
|
@ -11,7 +11,7 @@
|
|||
</table>
|
||||
|
||||
<button type="button" class="btn btn-success" {{ collection.create_btn() }}
|
||||
{% if not is_granted('lots.create', part) %}disabled{% endif %}>
|
||||
{% if not is_granted('edit', part) %}disabled{% endif %}>
|
||||
<i class="fas fa-plus-square fa-fw"></i>
|
||||
{% trans %}part_lot.create{% endtrans %}
|
||||
</button>
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
<table class="table table-striped table-sm table-responsive-md" id="orderdetails_table" {{ collection.target() }}>
|
||||
<tbody>
|
||||
{% for detail in form.orderdetails %}
|
||||
{{ form_widget(detail, {'disable_delete' : not is_granted('orderdetails.delete', part)}) }}
|
||||
{{ form_widget(detail) }}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<button type="button" class="btn btn-success" {{ collection.create_btn() }} {% if not is_granted('orderdetails.create', part) %}disabled{% endif %}>
|
||||
<button type="button" class="btn btn-success" {{ collection.create_btn() }}>
|
||||
<i class="fas fa-plus-square fa-fw"></i>
|
||||
{% trans %}orderdetail.create{% endtrans %}
|
||||
</button>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
<button type="button" class="btn btn-success" {% if not is_granted('parameters.create', part) %}disabled{% endif %} {{ collection.create_btn() }}>
|
||||
<button type="button" class="btn btn-success" {% if not is_granted('edit', part) %}disabled{% endif %} {{ collection.create_btn() }}>
|
||||
<i class="fas fa-plus-square fa-fw"></i>
|
||||
{% trans %}specification.create{% endtrans %}
|
||||
</button>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<td>{{ form_widget(form.price_related_quantity, {'attr': {'class': 'form-control-sm'}}) }} {{ form_errors(form.price_related_quantity) }}</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-danger order_btn_delete btn-sm" title="{% trans %}orderdetail.delete{% endtrans %}"
|
||||
{{ collection.delete_btn() }} {% if not is_granted('@parts_prices.delete') %}disabled{% endif %}>
|
||||
{{ collection.delete_btn() }}>
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
</button>
|
||||
{{ form_errors(form) }}
|
||||
|
@ -50,15 +50,14 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
<button type="button" class="btn btn-success" {{ collection.create_pricedetail_btn() }} {% if not is_granted('@parts_prices.create') %}disabled{% endif %}>
|
||||
<button type="button" class="btn btn-success" {{ collection.create_pricedetail_btn() }}>
|
||||
<i class="fas fa-plus-square fa-fw"></i>
|
||||
{% trans %}pricedetail.create{% endtrans %}
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-danger order_btn_delete" {{ collection.delete_btn() }} title="{% trans %}orderdetail.delete{% endtrans %}"
|
||||
{% if not is_granted('@parts_orderdetails.delete') %}disabled{% endif %}>
|
||||
<button type="button" class="btn btn-danger order_btn_delete" {{ collection.delete_btn() }} title="{% trans %}orderdetail.delete{% endtrans %}">
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
</button>
|
||||
{{ form_errors(form) }}
|
||||
|
@ -93,8 +92,7 @@
|
|||
{{ form_widget(form) }}
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-danger lot_btn_delete" {{ collection.delete_btn() }}
|
||||
{% if not is_granted('lots.delete', form.parent.parent.vars.data) %}disabled{% endif %}>
|
||||
<button type="button" class="btn btn-danger lot_btn_delete" {{ collection.delete_btn() }}>
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
{% trans %}part_lot.delete{% endtrans %}
|
||||
</button>
|
||||
|
@ -111,7 +109,7 @@
|
|||
{{ form_widget(form) }}
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-danger lot_btn_delete" {{ collection.delete_btn() }} {# {% if not is_granted('attachments.delete', part) %}disabled{% endif %}#}>
|
||||
<button type="button" class="btn btn-danger lot_btn_delete" {{ collection.delete_btn() }}>
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
{% trans %}attachment.delete{% endtrans %}
|
||||
</button>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
<tr>
|
||||
<td>{% trans %}user.creating_user{% endtrans %}</td>
|
||||
<td>{% if is_granted('show_users', part) %}
|
||||
<td>{% if is_granted('show_history', part) %}
|
||||
{{ creating_user(part).fullName(true) ?? 'Unknown'|trans }}
|
||||
{% else %}
|
||||
{% trans %}accessDenied{% endtrans %}
|
||||
|
@ -24,7 +24,7 @@
|
|||
|
||||
<tr>
|
||||
<td>{% trans %}user.last_editing_user{% endtrans %}</td>
|
||||
<td>{% if is_granted('show_users', part) %}
|
||||
<td>{% if is_granted('show_history', part) %}
|
||||
{{ last_editing_user(part).fullName(true) ?? 'Unknown'|trans }}
|
||||
{% else %}
|
||||
{% trans %}accessDenied{% endtrans %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue