Skip to content
Snippets Groups Projects
Commit 59891d41 authored by jan.bednarik's avatar jan.bednarik
Browse files

majak: Distinguish run environment with admin logo

parent 231d1c2d
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,12 @@ V produkci musí být navíc nastaveno:
| `DJANGO_SECRET_KEY` | | tajný šifrovací klíč |
| `DJANGO_ALLOWED_HOSTS` | | allowed hosts (více hodnot odděleno čárkami) |
Různé:
| proměnná | default | popis |
| --- | --- | --- |
| `MAJAK_ENV` | prod | `prod`/`test`/`dev` prostředí kde Maják běží (má vliv jen na logo) |
Settings pro appky na weby:
| proměnná | default | popis |
......@@ -164,6 +170,7 @@ Pro lokální vývoj obsahují settings tyto výchozí hodnoty:
DEBUG = True
ALLOWED_HOSTS = ["*"]
MAJAK_ENV = "dev"
### Management projektu
......
......@@ -130,6 +130,7 @@ TEMPLATES = [
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"wagtailmenus.context_processors.wagtailmenus",
"django_settings_export.settings_export",
],
},
},
......@@ -204,6 +205,12 @@ WAGTAIL_EMAIL_MANAGEMENT_ENABLED = False
# e.g. in notification emails. Don't include '/admin' or a trailing slash
BASE_URL = env.str("BASE_URL", default="https://majak.pirati.cz")
# CUSTOM SETTINGS
# ------------------------------------------------------------------------------
MAJAK_ENV = env.str("MAJAK_ENV", default="prod")
SETTINGS_EXPORT = ["MAJAK_ENV"]
# CUSTOM APPS SETTINGS
# ------------------------------------------------------------------------------
DONATE_PORTAL_REDIRECT_URL = env.str("DONATE_PORTAL_REDIRECT_URL", default="")
......
......@@ -7,3 +7,4 @@ DEBUG = env.bool("DJANGO_DEBUG", default=True)
SECRET_KEY = env("DJANGO_SECRET_KEY", default="58asda4d6nasd*jkj!dbska83asd54")
ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS", default=["*"])
INSTALLED_APPS += ["wagtail.contrib.styleguide"]
MAJAK_ENV = env.str("MAJAK_ENV", default="dev")
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="100.00003mm"
height="99.999924mm"
viewBox="0 0 100.00003 99.999924"
version="1.1"
id="svg133"
inkscape:version="1.0 (4035a4f, 2020-05-01)"
sodipodi:docname="majak-dev.svg">
<defs
id="defs127">
<rect
id="rect97"
height="36.348656"
width="93.009796"
y="81.285567"
x="49.388729" />
</defs>
<sodipodi:namedview
inkscape:bbox-nodes="true"
inkscape:snap-bbox="false"
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.49497475"
inkscape:cx="118.28812"
inkscape:cy="114.7914"
inkscape:document-units="mm"
inkscape:current-layer="text103"
inkscape:document-rotation="0"
showgrid="false"
inkscape:window-width="1580"
inkscape:window-height="1035"
inkscape:window-x="1731"
inkscape:window-y="23"
inkscape:window-maximized="0" />
<metadata
id="metadata130">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Vrstva 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-47.517842,-46.005989)">
<path
transform="matrix(0.26458333,0,0,0.26458333,47.517842,46.005989)"
id="path131"
style="fill:#4d4d4d;stroke-width:0"
d="M 187.54492 26.154297 C 183.8216 26.143543 180.08856 26.866723 177.10156 29.025391 C 173.21742 31.830934 171.24426 36.489984 168.95508 40.701172 C 166.67164 44.912359 163.43507 49.208375 158.73047 50.097656 C 158.73047 50.315667 158.58008 50.281845 158.58008 50.494141 L 158.58203 53.730469 C 167.01015 53.730469 189.0625 53.804687 189.0625 53.804688 L 189.21289 53.804688 C 189.21289 53.804688 211.26719 53.730469 219.69531 53.730469 L 219.69531 50.494141 C 219.69531 50.281875 219.54492 50.315659 219.54492 50.097656 C 214.83461 49.208375 211.59985 44.912359 209.31641 40.701172 C 207.03297 36.489984 205.05407 31.830934 201.16992 29.025391 C 197.75622 26.558304 193.3728 25.968038 189.13867 26.203125 C 188.6094 26.17372 188.07682 26.155833 187.54492 26.154297 z M 63.371094 50.322266 A 187.08662 187.08662 0 0 0 29.640625 90.929688 L 154.12305 77.775391 L 154.12305 64.171875 L 63.371094 50.322266 z M 315.09375 50.789062 L 223.94531 63.958984 L 223.94531 78.009766 L 348.0625 90.523438 A 187.08662 187.08662 0 0 0 315.09375 50.789062 z M 165.60938 62.232422 L 165.60938 83.597656 L 213.20117 83.597656 L 213.20117 62.232422 L 165.60938 62.232422 z M 146.18359 91.183594 L 146.18359 105.93945 L 233.60156 105.93945 L 233.60156 91.183594 L 146.18359 91.183594 z M 154.12305 113.58789 L 154.92578 117.71289 L 223.88867 117.71289 L 223.0918 113.58789 L 154.12305 113.58789 z M 159.83789 125.36523 L 145.97656 279.65234 C 104.94615 285.1141 48.073976 281.30191 8.8964844 239.69531 A 187.08662 187.08662 0 0 0 43.619141 306.75781 C 51.895278 309.62073 60.683626 311.52639 69.158203 312.9668 C 93.006946 317.02692 117.36919 316.98289 141.28906 313.3457 C 163.85757 309.91635 185.30545 303.68857 206.75781 295.88672 C 228.21018 288.08487 250.4228 281.03356 273.25391 281.12109 C 295.81038 281.20216 319.93142 289.52658 334.07031 307.08203 A 187.08662 187.08662 0 0 0 341.41406 297.4375 C 324.85716 278.69564 299.8073 268.6944 274.83008 266.10156 C 260.75644 264.64546 246.63648 265.32956 232.58008 267.10352 L 219.08594 125.36523 L 159.83789 125.36523 z M 212.28125 137.02148 L 212.28125 169.09961 L 164.68945 190.4668 L 164.68945 156.44727 L 212.28125 137.02148 z M 217.14062 206.46484 L 217.14062 239.00391 L 159.83398 265.10742 L 159.83398 229.29297 L 217.14062 206.46484 z M 243.22852 303.73047 C 200.85711 303.8006 150.40713 345.01281 86.349609 345.40039 A 187.08662 187.08662 0 0 0 116.60156 361.49609 C 136.91285 355.93793 156.72244 348.17122 174.66406 337.17773 C 213.17548 313.57795 243.51843 305.35926 254.01758 304.68359 C 250.47928 304.02475 246.8835 303.72442 243.22852 303.73047 z M 284.19336 316.44336 C 261.42684 316.16882 232.3631 322.15293 207.92773 347.26172 C 227.30654 339.26125 246.83885 331.19014 267.79883 330.63867 C 279.95311 330.32439 292.37854 332.28822 303.60742 336.82812 A 187.08662 187.08662 0 0 0 320.28906 322.23438 C 315.01065 320.43639 301.4237 316.65114 284.19336 316.44336 z " />
<g
transform="matrix(1.1036222,0,0,1.1036222,-10.203868,-12.874029)"
style="font-style:normal;font-weight:normal;font-size:35.27779999999999916px;line-height:1.25;font-family:sans-serif;fill:#e6e6e6;fill-opacity:1;stroke:none;stroke-width:0.90610718;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;paint-order:normal"
id="text103"
aria-label="TEST">
<text
id="text957"
y="29.134125"
x="95.893524"
style="font-style:normal;font-weight:normal;font-size:9.58963px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.217231"
xml:space="preserve"><tspan
style="stroke-width:0.217231"
y="29.134125"
x="95.893524"
id="tspan955"
sodipodi:role="line"></tspan></text>
<text
id="text979"
y="111.31044"
x="60.325066"
style="font-style:normal;font-weight:normal;font-size:35.162px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.217231"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.162px;font-family:Helvetica;-inkscape-font-specification:'Helvetica Bold';fill:#e6e6e6;stroke-width:0.217231"
y="111.31044"
x="60.325066"
id="tspan977"
sodipodi:role="line">DEV</tspan></text>
</g>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="100.00003mm"
height="99.999924mm"
viewBox="0 0 100.00003 99.999924"
version="1.1"
id="svg133"
inkscape:version="1.0 (4035a4f, 2020-05-01)"
sodipodi:docname="majak-test.svg">
<defs
id="defs127">
<rect
id="rect97"
height="36.348656"
width="93.009796"
y="81.285567"
x="49.388729" />
</defs>
<sodipodi:namedview
inkscape:bbox-nodes="true"
inkscape:snap-bbox="false"
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.49497475"
inkscape:cx="118.28812"
inkscape:cy="114.7914"
inkscape:document-units="mm"
inkscape:current-layer="text103"
inkscape:document-rotation="0"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1035"
inkscape:window-x="1536"
inkscape:window-y="23"
inkscape:window-maximized="1" />
<metadata
id="metadata130">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Vrstva 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-47.517842,-46.005989)">
<path
transform="matrix(0.26458333,0,0,0.26458333,47.517842,46.005989)"
id="path131"
style="fill:#4d4d4d;stroke-width:0"
d="M 187.54492 26.154297 C 183.8216 26.143543 180.08856 26.866723 177.10156 29.025391 C 173.21742 31.830934 171.24426 36.489984 168.95508 40.701172 C 166.67164 44.912359 163.43507 49.208375 158.73047 50.097656 C 158.73047 50.315667 158.58008 50.281845 158.58008 50.494141 L 158.58203 53.730469 C 167.01015 53.730469 189.0625 53.804687 189.0625 53.804688 L 189.21289 53.804688 C 189.21289 53.804688 211.26719 53.730469 219.69531 53.730469 L 219.69531 50.494141 C 219.69531 50.281875 219.54492 50.315659 219.54492 50.097656 C 214.83461 49.208375 211.59985 44.912359 209.31641 40.701172 C 207.03297 36.489984 205.05407 31.830934 201.16992 29.025391 C 197.75622 26.558304 193.3728 25.968038 189.13867 26.203125 C 188.6094 26.17372 188.07682 26.155833 187.54492 26.154297 z M 63.371094 50.322266 A 187.08662 187.08662 0 0 0 29.640625 90.929688 L 154.12305 77.775391 L 154.12305 64.171875 L 63.371094 50.322266 z M 315.09375 50.789062 L 223.94531 63.958984 L 223.94531 78.009766 L 348.0625 90.523438 A 187.08662 187.08662 0 0 0 315.09375 50.789062 z M 165.60938 62.232422 L 165.60938 83.597656 L 213.20117 83.597656 L 213.20117 62.232422 L 165.60938 62.232422 z M 146.18359 91.183594 L 146.18359 105.93945 L 233.60156 105.93945 L 233.60156 91.183594 L 146.18359 91.183594 z M 154.12305 113.58789 L 154.92578 117.71289 L 223.88867 117.71289 L 223.0918 113.58789 L 154.12305 113.58789 z M 159.83789 125.36523 L 145.97656 279.65234 C 104.94615 285.1141 48.073976 281.30191 8.8964844 239.69531 A 187.08662 187.08662 0 0 0 43.619141 306.75781 C 51.895278 309.62073 60.683626 311.52639 69.158203 312.9668 C 93.006946 317.02692 117.36919 316.98289 141.28906 313.3457 C 163.85757 309.91635 185.30545 303.68857 206.75781 295.88672 C 228.21018 288.08487 250.4228 281.03356 273.25391 281.12109 C 295.81038 281.20216 319.93142 289.52658 334.07031 307.08203 A 187.08662 187.08662 0 0 0 341.41406 297.4375 C 324.85716 278.69564 299.8073 268.6944 274.83008 266.10156 C 260.75644 264.64546 246.63648 265.32956 232.58008 267.10352 L 219.08594 125.36523 L 159.83789 125.36523 z M 212.28125 137.02148 L 212.28125 169.09961 L 164.68945 190.4668 L 164.68945 156.44727 L 212.28125 137.02148 z M 217.14062 206.46484 L 217.14062 239.00391 L 159.83398 265.10742 L 159.83398 229.29297 L 217.14062 206.46484 z M 243.22852 303.73047 C 200.85711 303.8006 150.40713 345.01281 86.349609 345.40039 A 187.08662 187.08662 0 0 0 116.60156 361.49609 C 136.91285 355.93793 156.72244 348.17122 174.66406 337.17773 C 213.17548 313.57795 243.51843 305.35926 254.01758 304.68359 C 250.47928 304.02475 246.8835 303.72442 243.22852 303.73047 z M 284.19336 316.44336 C 261.42684 316.16882 232.3631 322.15293 207.92773 347.26172 C 227.30654 339.26125 246.83885 331.19014 267.79883 330.63867 C 279.95311 330.32439 292.37854 332.28822 303.60742 336.82812 A 187.08662 187.08662 0 0 0 320.28906 322.23438 C 315.01065 320.43639 301.4237 316.65114 284.19336 316.44336 z " />
<g
transform="matrix(1.1036222,0,0,1.1036222,-10.203868,-12.874029)"
style="font-style:normal;font-weight:normal;font-size:35.27779999999999916px;line-height:1.25;font-family:sans-serif;fill:#e6e6e6;fill-opacity:1;stroke:none;stroke-width:0.90610718;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;paint-order:normal"
id="text103"
aria-label="TEST">
<path
id="path928"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.27779999999999916px;font-family:Helvetica;-inkscape-font-specification:'Helvetica Bold';text-align:center;text-anchor:middle;fill:#e6e6e6;stroke:none;stroke-width:0.90610718;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;paint-order:normal"
d="m 73.543422,86.004809 v 4.495853 h -7.59644 V 111.39518 H 60.60708 V 90.500662 h -7.630892 v -4.495853 z" />
<path
id="path930"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.27779999999999916px;font-family:Helvetica;-inkscape-font-specification:'Helvetica Bold';text-align:center;text-anchor:middle;fill:#e6e6e6;stroke:none;stroke-width:0.90610718;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;paint-order:normal"
d="M 95.437019,90.500662 H 82.001138 v 5.391578 h 12.33345 v 4.40972 h -12.33345 v 6.52847 h 14.055999 v 4.56475 H 76.816266 V 86.004809 h 18.620753 z" />
<path
id="path932"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.27779999999999916px;font-family:Helvetica;-inkscape-font-specification:'Helvetica Bold';text-align:center;text-anchor:middle;fill:#e6e6e6;stroke:none;stroke-width:0.90610718;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;paint-order:normal"
d="m 104.06699,103.55758 q 0.24116,1.73978 0.9474,2.60105 1.29191,1.56752 4.42695,1.56752 1.87758,0 3.04891,-0.41341 2.22209,-0.79237 2.22209,-2.94556 0,-1.25746 -1.10243,-1.94648 -1.10243,-0.67179 -3.46232,-1.18856 l -2.68718,-0.60289 q -3.96186,-0.895726 -5.4777,-1.946481 -2.566601,-1.757 -2.566601,-5.494931 0,-3.410647 2.480471,-5.667186 2.48047,-2.256539 7.28638,-2.256539 4.01354,0 6.83852,2.135961 2.84221,2.118735 2.98001,6.166725 h -5.09875 q -0.1378,-2.29099 -1.99815,-3.255618 -1.24024,-0.637343 -3.08336,-0.637343 -2.04984,0 -3.27285,0.826824 -1.22301,0.826823 -1.22301,2.308215 0,1.360814 1.20579,2.032608 0.77514,0.447863 3.30729,1.050755 l 4.37528,1.050754 q 2.87665,0.68902 4.34082,1.843128 2.27376,1.791448 2.27376,5.184868 0,3.47955 -2.66995,5.78777 -2.65272,2.29099 -7.51031,2.29099 -4.96094,0 -7.80315,-2.25654 -2.842203,-2.27377 -2.842203,-6.23563 z m 5.15042,-18.327918 z" />
<path
id="path934"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:35.27779999999999916px;font-family:Helvetica;-inkscape-font-specification:'Helvetica Bold';text-align:center;text-anchor:middle;fill:#e6e6e6;stroke:none;stroke-width:0.90610718;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;paint-order:normal"
d="m 142.23867,86.004809 v 4.495853 h -7.59644 v 20.894518 h -5.3399 V 90.500662 h -7.63089 v -4.495853 z" />
<text
id="text957"
y="29.134125"
x="95.893524"
style="font-style:normal;font-weight:normal;font-size:9.58963px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.217231"
xml:space="preserve"><tspan
style="stroke-width:0.217231"
y="29.134125"
x="95.893524"
id="tspan955"
sodipodi:role="line"></tspan></text>
</g>
</g>
</svg>
......@@ -4,6 +4,7 @@ wagtail-metadata
django-environ
django-extensions
django-redis
django-settings-export
psycopg2-binary
pirates<=0.4
whitenoise
......
......@@ -16,9 +16,10 @@ django-environ==0.4.5 # via -r base.in
django-extensions==3.0.2 # via -r base.in
django-modelcluster==5.0.2 # via wagtail
django-redis==4.12.1 # via -r base.in
django-settings-export==1.2.1 # via -r base.in
django-taggit==1.3.0 # via wagtail
django-treebeard==4.3.1 # via wagtail
django==3.0.8 # via django-redis, django-taggit, django-treebeard, djangorestframework, mozilla-django-oidc, wagtail
django==3.0.8 # via django-redis, django-settings-export, django-taggit, django-treebeard, djangorestframework, mozilla-django-oidc, wagtail
djangorestframework==3.11.0 # via wagtail
draftjs-exporter==2.1.7 # via wagtail
html5lib==1.1 # via wagtail
......
......@@ -2,5 +2,11 @@
{% load static %}
{% block branding_logo %}
<img src="{% static "majak/img/majak-pruhledny.svg" %}" alt="Maják" width="80" />
{% if settings.MAJAK_ENV == "dev" %}
<img src="{% static "majak/img/majak-dev.svg" %}" alt="Maják" width="80" />
{% elif settings.MAJAK_ENV == "test" %}
<img src="{% static "majak/img/majak-test.svg" %}" alt="Maják" width="80" />
{% else %}
<img src="{% static "majak/img/majak-pruhledny.svg" %}" alt="Maják" width="80" />
{% endif %}
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment