Currently moving from Gitlab to Gitea at https://labs.phundrak.com. Some features may not work anymore on this Gitlab instance.

some more styling

parent db02e4f7
Pipeline #125 passed with stage
in 1 minute
content {
display: grid;
grid-auto-rows: min-content;
grid-template-areas:
'word fromlang'
'wclass gender'
'translations translations'
'details details'
'etymology etymology';
padding: 40px;
}
word {
grid-area: word;
font-size: 3em;
}
fromlang {
grid-area: fromlang;
align-self: end;
}
wordclass {
grid-area: wclass;
}
listtrans {
grid-area: translations;
}
transdetails {
grid-area: details;
}
etymology {
grid-area: etymology;
}
etymology::before {
content: "Etymology: ";
}
gender {
grid-area: gender;
}
......@@ -70,5 +70,17 @@ message {
}
sidebar {
display: block;
}
sidebar > ul {
padding-inline-start: 0;
margin: 40px;
display: block;
list-style: none;
}
sidebar > ul >li {
font-size: 1.1em;
margin: 20px;
}
......@@ -58,3 +58,16 @@ errormessage {
font-size: 1.5em;
font-family: "DoulosSIL","Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;
}
sidebar {
color: #fcfcfc;
}
sidebar > h1 {
background: #2980b9;
padding: 15px;
margin-block-start: 0;
margin-block-end: 0;
text-align: center;
font-size: 1.5em;
}
......@@ -13,11 +13,7 @@
<body>
<sidebar>{% block sidebarcontent %}{% endblock %}</sidebar>
<content>
<errormessage>
{% if error_message %}
<p><strong>{{ error_message }}</strong></p>
{% endif %}
</errormessage>
<errormessage>{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}</errormessage>
{% block body %}
{% endblock %}
</content>
......
......@@ -16,18 +16,17 @@
<link rel="stylesheet" href="{% static 'dictionary/details.css' %}" type="text/css" media="screen" />
{% endblock %}
<!-- SIDEBAR ----------------------------------------------------------------->
{% block sidebarcontent %}
<h1>Detailed Translation</h1>
{% endblock %}
<!-- BODY -------------------------------------------------------------------->
{% block body %}
<word>{{ word.word }}</word>
<fromlang>Language: {{ from_lang.name }}</fromlang>
<gender>
Gender:
{% if word.gender %}
{{ word.gender }}
{% endif %}
</gender>
<gender>{% if word.gender %}Gender: {{ word.gender }}{% endif %}</gender>
<wordclass>Word class: {{word.wordclass}} </wordclass>
<listtrans>
{% if translations %}
<p>Translations of “{{ word.word }}” in {{ to_lang.name }}:</p>
......@@ -39,19 +38,17 @@
</ul>
{% endif %}
</listtrans>
<transdetails>{% if word.details %}{{ word.details }}{% endif %}</transdetails>
<etymology>
{% if word.etymology %}
<p>{{word.etymology}}</p>
{% if word.roots.all %}
<roots>
<p>Etymological roots:</p>
<ul>
{% for root in word.roots.all %}
<li>{{ root.word }}</li>
<!--TODO: Link to the word's page-->
<!-- <li>{{ root.word }}</li> -->
<li><a href="{% url 'dictionary:details' from_lang.code to_lang.code root.slug %}">{{root.word}}</a></li>
{% endfor %}
</ul>
</roots>
......
......@@ -11,6 +11,15 @@
<link rel="stylesheet" href="{% static 'dictionary/index.css' %}" type="text/css" media="screen" />
{% endblock %}
{% block sidebarcontent %}
<h1>List of available languages</h1>
<ul>
{% for lang in all_languages %}
<li>{{lang}}</li>
{% endfor %}
</ul>
{% endblock %}
{% block body %}
<message class="h1">Please select the languages you want to translate from and to</message>
<form method="post" id="langselect" action="/dictionary/" enctype="multipart/form-data">
......
{% extends 'dictionary/base.html' %}
{% load staticfiles %}
<!-- TITLE ------------------------------------------------------------------->
{% block title %}{{from_lang.name}} -> {{to_lang.name}}{% endblock %}
<!-- HEADERS ----------------------------------------------------------------->
{% block addhead %}
<link rel="stylesheet" href="{% static 'dictionary/language.css' %}" type="text/css" media="screen" />
{% endblock %}
{% block body %}
<!-- SIDEBAR ----------------------------------------------------------------->
{% block sidebarcontent %}
<h1>Translating from {{from_lang.name}} to {{to_lang.name}}</h1>
{% endblock %}
<!-- BODY -------------------------------------------------------------------->
{% block body %}
<wordlist>
{% for word in words %}
<a href="{% url 'dictionary:details' from_lang.code to_lang.code word.slug %}" class="wordblock">
......@@ -23,5 +30,4 @@
</a>
{% endfor %}
</wordlist>
{% endblock %}
......@@ -81,7 +81,8 @@ def details(request, from_lang, to_lang, word):
to_lang = Language.objects.get(code=to_lang)
word = get_object_or_404(Word, language=from_lang, slug=word)
translations = word.translation.filter(language=to_lang)
return render(request, 'dictionary/details.html', {
return render(
request, 'dictionary/details.html', {
'word': word,
'translations': translations,
'from_lang': from_lang,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment