diff --git a/core/static/core/style.scss b/core/static/core/style.scss index 01ab8787..d1e193dd 100644 --- a/core/static/core/style.scss +++ b/core/static/core/style.scss @@ -263,7 +263,13 @@ a:not(.button) { &.btn-red { background-color: #fc8181; color: black; - border: #fc8181 1px solid; + &:not(:disabled):hover { + background-color: darken(#fc8181, 15%); + } + &:disabled { + background-color: lighten(#fc8181, 15%); + color: grey; + } } i { diff --git a/core/templates/core/user_edit.jinja b/core/templates/core/user_edit.jinja index 88038d11..69df1778 100644 --- a/core/templates/core/user_edit.jinja +++ b/core/templates/core/user_edit.jinja @@ -49,11 +49,14 @@ {%- if form[field_name] -%}
{{ form[field_name] }} - {%- if user.is_root and form.instance[field_name] -%} - - {%- endif -%} +

{{ form[field_name].label }} @@ -107,6 +110,28 @@ {%- endif -%} }, + delete_picture() { + + {# Only remove currently displayed picture #} + if (this.picture != null){ + let list = new DataTransfer(); + this.picture_form.files = list.files; + this.picture_form.dispatchEvent(new Event("change")); + return; + } + + {# Remove user picture if correct rights are available #} + {%- if user.is_root and form.instance[field_name] -%} + window.open( + '{{ url( + 'core:file_delete', + file_id=form.instance[field_name].id, + popup='' + ) }}', + '_self'); + {%- endif -%} + }, + enable_camera() { this.picture = null; this.loading = true;