add 'custom_css' setting to model; check for 'custom_css' in template; create custom css dir in dockerfile

This commit is contained in:
Steffen Schwebel 2021-06-01 16:15:31 +02:00
parent 567f66fbde
commit c13dd2d835
3 changed files with 6 additions and 1 deletions

View File

@ -94,6 +94,8 @@ RUN apk add --no-cache mariadb-connector-c postgresql-client py3-gunicorn py3-ps
COPY --from=builder /usr/bin/flask /usr/bin/
COPY --from=builder /usr/lib/python3.8/site-packages /usr/lib/python3.8/site-packages/
COPY --from=builder --chown=root:${USER} /app /app/
# Create directory for custom css
RUN mkdir /app/powerdnsadmin/static/custom
COPY ./docker/entrypoint.sh /usr/bin/
WORKDIR /app

View File

@ -181,6 +181,7 @@ class Setting(db.Model):
},
'ttl_options': '1 minute,5 minutes,30 minutes,60 minutes,24 hours',
'otp_field_enabled': True,
'custom_css': '',
}
def __init__(self, id=None, name=None, value=None):

View File

@ -11,7 +11,9 @@
{% assets "css_login" -%}
<link rel="stylesheet" href="{{ ASSET_URL }}">
{%- endassets %}
{% if SETTING.get('custom_css') %}
<link rel="stylesheet" href="/static/custom/{{ custom_css }}">
{% endif %}
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>