banner for translation (#55)

Creates a banner on translated page as requested in Disroot/Disroot-Project#147

To used a banner, you simply need to modify `modular.en.md` in the website repo, so for example `pages/05.community/modular.en.md` and add:

```
translation_banner:
    set: true
    last_modified: December 2021
    language: German
```
`Set`: you can disable it, for example on English page.
`last_modified`: pretty obvious...
`language`: set the language of the banner text, so here the German version would appear.

See attached preview

What has to be done:

- [ ] Agree on text

- [ ] Agree on design / colors

- [ ] Translate agreed text

While I was working on this, I also found some not related errors that I corrected.

Co-authored-by: meaz <meaz@disroot.org>
Reviewed-on: Disroot/grav-theme-disroot#55
Reviewed-by: antilopa <antilopa@no-reply@disroot.org>
This commit is contained in:
meaz 2022-03-18 14:38:44 +00:00
parent d5d2edc37d
commit 14264695a8
5 changed files with 64 additions and 18 deletions

View File

@ -356,8 +356,6 @@ div#nav-logo {
}
}
/* Goals
------------------------------------*/

View File

@ -196,7 +196,17 @@ figcaption {
line-height: 1;
}
/***** Banner for translation ********************/
.translation_banner {
color: black;
background-color: #CACAC8;
padding-top: 1em;
padding-bottom: 4em;
padding-left: 2em;
padding-right: 2em;
text-align: center;
}
/************************************************/
@ -221,7 +231,6 @@ figcaption {
background-position: right bottom;
background-size: cover !important;
-webkit-background-size: cover !important;
-moz-background-size: cover;
-o-background-size: cover;
-webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
filter: grayscale(100%);
@ -908,18 +917,6 @@ img.transparent {
/* Goals
------------------------------------*/
#.goal {
# color: #555;
# background-color: #FFF;
# /*border: 5px double #8EB726;*/
# border: none;
# border-radius: 10px;
# padding-bottom: 5px;
# box-shadow: 10px 10px 38px 0px rgba(0, 0, 0, 0.25);
# margin-bottom: 20%;
#}
.goals {
position: relative;
display: flex;
@ -1133,7 +1130,7 @@ textarea {
}
#accordion hr {
border-top: 1 solid #E3E3E3;
border-top: 1px solid #E3E3E3;
}
.vertical ol {
@ -1429,7 +1426,6 @@ footer a:hover, footer a:focus { color: #1F5C60; }
cursor: pointer;
text-indent: -9999px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
-o-border-radius: 20px;
border-radius: 20px;
box-shadow: inset 0 0 3px rgba(255, 255, 255, .3);

View File

@ -4,10 +4,14 @@
{% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %}
{% block content %}
{{ page.content|raw }}
<div id="content" style="background-color: {{ page.header.bgcolor }}">
{% include 'partials/banner.html.twig' %}
{% for module in page.collection() %}
{{ module.content|raw }}
{% endfor %}
</div>
{% endblock %}

View File

@ -6,7 +6,7 @@
<section id="{{ page.slug }}">
{% endif %}
<div class="fullbar" style="background-color:{{ page.header.bgcolor }}; padding:{{ page.header.padding }};">
<div class="fullbar" style="background-color:{{ page.header.bgcolor }}; {% if page.header.padding %} padding:{{ page.header.padding }}; {% endif %}">
<div class="fullbar-content" style="color:{{ page.header.fontcolor }}; text-align:{{ page.header.text_align }};">
{{ page.content|raw }}
</div>

View File

@ -0,0 +1,48 @@
{% if page.header.translation_banner.set == "true" %}
<div class="translation_banner narrow">
{% if page.header.translation_banner.language == "French" %}
<p>FRENCH This page was last updated on <b>{{ page.header.translation_banner.last_modified }}</b></br>
Disroot's website translation is a community driven procces. We try to keep it as updated as we can.</br>
If you want to help, check our <a href="https://git.disroot.org/Disroot/Website" target="_blank"> website's git repository</a></p>
</p>
{% elseif page.header.translation_banner.language == "Spanish" %}
<p>SPANISH This page was last updated on <b>{{ page.header.translation_banner.last_modified }}</b></br>
Disroot's website translation is a community driven procces. We try to keep it as updated as we can.</br>
If you want to help, check our <a href="https://git.disroot.org/Disroot/Website" target="_blank"> website's git repository</a></p>
</p>
{% elseif page.header.translation_banner.language == "Italian" %}
<p>ITALIAN This page was last updated on <b>{{ page.header.translation_banner.last_modified }}</b></br>
Disroot's website translation is a community driven procces. We try to keep it as updated as we can.</br>
If you want to help, check our <a href="https://git.disroot.org/Disroot/Website" target="_blank"> website's git repository</a></p>
</p>
{% elseif page.header.translation_banner.language == "German" %}
<p>GERMAN This page was last updated on <b>{{ page.header.translation_banner.last_modified }}</b></br>
Disroot's website translation is a community driven procces. We try to keep it as updated as we can.</br>
If you want to help, check our <a href="https://git.disroot.org/Disroot/Website" target="_blank"> website's git repository</a></p>
</p>
{% elseif page.header.translation_banner.language == "Russian" %}
<p>RUSSIAN This page was last updated on <b>{{ page.header.translation_banner.last_modified }}</b></br>
Disroot's website translation is a community driven procces. We try to keep it as updated as we can.</br>
If you want to help, check our <a href="https://git.disroot.org/Disroot/Website" target="_blank"> website's git repository</a></p>
</p>
{% elseif page.header.translation_banner.language == "Portuguese" %}
<p>PORTUGUESE This page was last updated on <b>{{ page.header.translation_banner.last_modified }}</b></br>
Disroot's website translation is a community driven procces. We try to keep it as updated as we can.</br>
If you want to help, check our <a href="https://git.disroot.org/Disroot/Website" target="_blank"> website's git repository</a></p>
</p>
{% else %}
<p>This page was last updated on <b>{{ page.header.translation_banner.last_modified }}</b></br>
Disroot's website translation is a community driven procces. We try to keep it as updated as we can.</br>
If you want to help, check our <a href="https://git.disroot.org/Disroot/Website" target="_blank"> website's git repository</a></p>
</p>
{% endif %}
</div>
{% endif %}