Skip to content

Commit

Permalink
Add create page template with language hints
Browse files Browse the repository at this point in the history
We've added some styling to wagtamiladmin/pages/edit:

- monospace fonts for markdown
- flag icons for languag fields
- language dependend background for stream files (sidebar and content)

Add the same to wagtamiladmin/pages/create.
  • Loading branch information
donald committed Mar 8, 2020
1 parent 9d3a325 commit 64be8bf
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions mpicms/templates/wagtailadmin/pages/create.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% extends "wagtailadmin/pages/create.html" %}
{% load static %}
{% block extra_css %}
{{ block.super }}
<style>
.fieldname-markdown textarea {
font-family: monospace;
}

li.object.stream-field.english {
background-image: url("{% static "images/en.png" %}");
background-repeat: no-repeat
}
li.object.stream-field.german {
background: #cfe2e2;
background-image: url("{% static "images/de.png" %}");
background-repeat: no-repeat
}
</style>
{% endblock %}

{% block extra_js %}
{{ block.super }}
<script type="text/javascript">
$(document).ready(function() {
$("div#body_de-list, div#sidebar_de-list").
closest("li.object.stream-field").
addClass("german");
$("div#body_en-list, div#sidebar_en-list").
closest("li.object.stream-field").
addClass("english");
$("label:contains('[de]')").append(" 🇩🇪");
$("label:contains('[en]')").append(" 🇬🇧");
});
</script>
{% endblock %}

0 comments on commit 64be8bf

Please sign in to comment.