New Year revamp #40
@ -53,13 +53,3 @@ class LoginManager(object):
|
|||||||
not current_app.config['LOGIN_DISABLED'] and
|
not current_app.config['LOGIN_DISABLED'] and
|
||||||
not current_user.is_authenticated
|
not current_user.is_authenticated
|
||||||
)
|
)
|
||||||
|
|
||||||
# Tell whether we are in read-only, meaning:
|
|
||||||
# - Authentication enabled
|
|
||||||
# - and User not authenticated
|
|
||||||
@staticmethod
|
|
||||||
def is_readonly() -> bool:
|
|
||||||
return (
|
|
||||||
not current_app.config['LOGIN_DISABLED'] and
|
|
||||||
not current_user.is_authenticated
|
|
||||||
)
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
{% macro checkbox(kind, id, text, url, checked, delete=false) %}
|
{% macro checkbox(kind, id, text, url, checked, delete=false) %}
|
||||||
{% if g.login.is_readonly() %}
|
{% if g.login.is_authenticated() %}
|
||||||
<input class="form-check-input text-reset" type="checkbox" {% if checked %}checked{% endif %} disabled>
|
|
||||||
{{ text }}
|
|
||||||
{% else %}
|
|
||||||
<input class="form-check-input" type="checkbox" id="{{ kind }}-{{ id }}" {% if checked %}checked{% endif %}
|
<input class="form-check-input" type="checkbox" id="{{ kind }}-{{ id }}" {% if checked %}checked{% endif %}
|
||||||
{% if not delete %}onchange="change_set_checkbox_status(this, '{{ kind }}', '{{ id }}', '{{ url }}')"{% else %}disabled{% endif %}
|
{% if not delete %}onchange="change_set_checkbox_status(this, '{{ kind }}', '{{ id }}', '{{ url }}')"{% else %}disabled{% endif %}
|
||||||
autocomplete="off">
|
autocomplete="off">
|
||||||
<label class="form-check-label" for="{{ kind }}-{{ id }}">
|
<label class="form-check-label" for="{{ kind }}-{{ id }}">
|
||||||
{{ text }} <i id="status-{{ kind }}-{{ id }}" class="mb-1"></i>
|
{{ text }} <i id="status-{{ kind }}-{{ id }}" class="mb-1"></i>
|
||||||
</label>
|
</label>
|
||||||
|
{% else %}
|
||||||
|
<input class="form-check-input text-reset" type="checkbox" {% if checked %}checked{% endif %} disabled>
|
||||||
|
{{ text }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
@ -25,14 +25,14 @@
|
|||||||
{{ item.fields.total_missing }}
|
{{ item.fields.total_missing }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
{% if g.login.is_readonly() %}
|
{% if g.login.is_authenticated() %}
|
||||||
|
<input class="form-control form-control-sm flex-shrink-1" type="text" {% if item.fields.total_missing %}value="{{ item.fields.total_missing }}"{% endif %}
|
||||||
|
onchange="change_part_missing_amount(this, '{{ item.fields.u_id }}', '{{ item.fields.id }}', '{{ item.url_for_missing() }}')" autocomplete="off">
|
||||||
|
<span id="status-part-{{ item.fields.u_id }}-{{ item.fields.id }}" class="input-group-text ri-save-line"></span>
|
||||||
|
{% else %}
|
||||||
<input class="form-control form-control-sm" type="text" {% if item.fields.total_missing %}value="{{ item.fields.total_missing }}"{% endif %}
|
<input class="form-control form-control-sm" type="text" {% if item.fields.total_missing %}value="{{ item.fields.total_missing }}"{% endif %}
|
||||||
disabled autocomplete="off">
|
disabled autocomplete="off">
|
||||||
<span class="input-group-text ri-prohibited-line"></span>
|
<span class="input-group-text ri-prohibited-line"></span>
|
||||||
{% else %}
|
|
||||||
<input class="form-control form-control-sm flex-shrink-1" type="text" {% if item.fields.total_missing %}value="{{ item.fields.total_missing }}"{% endif %}
|
|
||||||
onchange="change_part_missing_amount(this, '{{ item.fields.u_id }}', '{{ item.fields.id }}', '{{ item.url_for_missing() }}')" autocomplete="off">
|
|
||||||
<span id="status-item-{{ item.fields.u_id }}-{{ item.fields.id }}" class="input-group-text ri-save-line"></span>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user