Fitting Templates with translate tag

This commit is contained in:
reverend 2022-12-29 21:31:11 +01:00
parent c38ab9a9b4
commit e483084846
10 changed files with 42 additions and 25 deletions

View File

@ -1,5 +1,7 @@
{% extends '../global.html' %} {% extends '../global.html' %}
{% load i18n %}
{% block content %} {% block content %}
<form method="POST" enctype="multipart/form-data"> <form method="POST" enctype="multipart/form-data">
{% csrf_token %} {% csrf_token %}
@ -9,7 +11,7 @@
{% include 'partials/form_input.html' with field=form.images %} {% include 'partials/form_input.html' with field=form.images %}
</div> </div>
<div class="RV-Fieldset"> <div class="RV-Fieldset">
<button type="submit">Create</button> <button type="submit">{% translate 'Create' %}</button>
</div> </div>
</form> </form>
{% endblock content %} {% endblock content %}

View File

@ -1,12 +1,13 @@
{% extends '../global.html' %} {% extends '../global.html' %}
{% load i18n %}
{% load responsive_images %} {% load responsive_images %}
{% block content %} {% block content %}
{% if gallery.title %} {% if gallery.title %}
<h1>{{gallery.title}}</h1> <h1>{{gallery.title}}</h1>
{% endif %} {% endif %}
<a href="{% url 'gallery_upload' gallery_id=gallery.id %}">Upload image to this gallery</a> <a href="{% url 'gallery_upload' gallery_id=gallery.id %}">{% translate 'Upload image to this gallery' %}</a>
<section class="RV-Images"> <section class="RV-Images">
<li class="RV-Images__list"> <li class="RV-Images__list">
{% for image in gallery.images.all %} {% for image in gallery.images.all %}
@ -17,9 +18,9 @@
</li> </li>
{% if gallery.private and gallery.visitors.all|length > 0 and gallery.created_by == visitor %} {% if gallery.private and gallery.visitors.all|length > 0 and gallery.created_by == visitor %}
<div> <div>
<h2>You have gained access to the following people</h2> <h2>{% translate 'You have gained access to the following people' %}</h2>
{% for visitor in gallery.visitors.all %} {% for visitor in gallery.visitors.all %}
{{visitor.name}} <a href="{% url 'gallery_revoke_access' gallery_id=gallery.id visitor_id=visitor.id %}">Revoke access</a> {{visitor.name}} <a href="{% url 'gallery_revoke_access' gallery_id=gallery.id visitor_id=visitor.id %}">{% translate 'Revoke access' %}</a>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}

View File

@ -1,17 +1,19 @@
{% extends '../global.html' %} {% extends '../global.html' %}
{% load i18n %}
{% block content %} {% block content %}
<form method="POST"> <form method="POST">
{% csrf_token %} {% csrf_token %}
<div class="RV-Fieldset"> <div class="RV-Fieldset">
<h1>You do not have access to this private gallery</h1> <h1>{% translate 'You do not have access to this private gallery' %}</h1>
But you can gain access by entering the access code below: {% translate 'But you can gain access by entering the access code below:' %}'
</div> </div>
<div class="RV-Fieldset"> <div class="RV-Fieldset">
{% include 'partials/form_input.html' with field=form.access_code %} {% include 'partials/form_input.html' with field=form.access_code %}
</div> </div>
<div class="RV-Fieldset"> <div class="RV-Fieldset">
<button type="submit">Enter</button> <button type="submit">{% translate 'Enter' %}</button>
</div> </div>
</form> </form>
{% endblock content %} {% endblock content %}

View File

@ -1,5 +1,6 @@
{% extends '../global.html' %} {% extends '../global.html' %}
{% load i18n %}
{% load responsive_images %} {% load responsive_images %}
{% block content %} {% block content %}
@ -8,7 +9,7 @@
{% for gallery in galleries %} {% for gallery in galleries %}
<a href="{% url 'gallery' pk=gallery.pk %}" class="RV-Image__link RV-Image__link--detail"> <a href="{% url 'gallery' pk=gallery.pk %}" class="RV-Image__link RV-Image__link--detail">
{% if gallery.images.all|length <= 0 %} {% if gallery.images.all|length <= 0 %}
no images {% translate 'no images' %}
{% endif %} {% endif %}
{% if gallery.images.all|length == 1 %} {% if gallery.images.all|length == 1 %}
{% for image in gallery.images.all %} {% for image in gallery.images.all %}

View File

@ -1,16 +1,17 @@
{% extends '../global.html' %} {% extends '../global.html' %}
{% load i18n %}
{% load responsive_images %} {% load responsive_images %}
{% block content %} {% block content %}
{% if created_galleries|length > 0 %} {% if created_galleries|length > 0 %}
<section class="RV-Images"> <section class="RV-Images">
<h2>Your galleries</h2> <h2>{% translate 'Your galleries '%}</h2>
<li class="RV-Images__list"> <li class="RV-Images__list">
{% for gallery in created_galleries %} {% for gallery in created_galleries %}
<a href="{% url 'gallery' pk=gallery.pk %}" class="RV-Image__link RV-Image__link--detail"> <a href="{% url 'gallery' pk=gallery.pk %}" class="RV-Image__link RV-Image__link--detail">
{% if gallery.images.all|length <= 0 %} {% if gallery.images.all|length <= 0 %}
no images {% translate 'no images' %}
{% endif %} {% endif %}
{% if gallery.images.all|length == 1 %} {% if gallery.images.all|length == 1 %}
{% for image in gallery.images.all %} {% for image in gallery.images.all %}
@ -42,12 +43,12 @@
{% endif %} {% endif %}
{% if invited_galleries|length > 0 %} {% if invited_galleries|length > 0 %}
<section class="RV-Images"> <section class="RV-Images">
<h2>Galleries you were invited to</h2> <h2>{% translate 'Galleries you were invited to' %}</h2>
<li class="RV-Images__list"> <li class="RV-Images__list">
{% for gallery in invited_galleries %} {% for gallery in invited_galleries %}
<a href="{% url 'gallery' pk=gallery.pk %}" class="RV-Image__link RV-Image__link--detail"> <a href="{% url 'gallery' pk=gallery.pk %}" class="RV-Image__link RV-Image__link--detail">
{% if gallery.images.all|length <= 0 %} {% if gallery.images.all|length <= 0 %}
no images {% translate 'no images' %}
{% endif %} {% endif %}
{% if gallery.images.all|length == 1 %} {% if gallery.images.all|length == 1 %}
{% for image in gallery.images.all %} {% for image in gallery.images.all %}

View File

@ -1,14 +1,16 @@
{% extends '../global.html' %} {% extends '../global.html' %}
{% load i18n %}
{% block content %} {% block content %}
<form method="POST" enctype="multipart/form-data"> <form method="POST" enctype="multipart/form-data">
{% csrf_token %} {% csrf_token %}
<h2>Upload image to "{{gallery.title}}"</h2> <h2>{% translate 'Upload image to' %} "{{gallery.title}}"</h2>
<div class="RV-Fieldset"> <div class="RV-Fieldset">
{% include 'partials/form_input.html' with field=form.images %} {% include 'partials/form_input.html' with field=form.images %}
</div> </div>
<div class="RV-Fieldset"> <div class="RV-Fieldset">
<button type="submit">Upload</button> <button type="submit">{% translate 'Upload' %}</button>
</div> </div>
</form> </form>
{% endblock content %} {% endblock content %}

View File

@ -1,5 +1,7 @@
{% load static %} {% load static %}
{% load i18n %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -7,6 +9,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Web Gallery</title> <title>Web Gallery</title>
<link rel="stylesheet" href="{% static 'bootstrap.min.css' %}">
<link rel="stylesheet" href="{% static 'web-galleries.css' %}"> <link rel="stylesheet" href="{% static 'web-galleries.css' %}">
</head> </head>
<body> <body>
@ -16,38 +19,38 @@
<ul class="RV-Navigation__list"> <ul class="RV-Navigation__list">
<li class="RV-Navigation__item"> <li class="RV-Navigation__item">
<a href="{% url 'home' %}" class="RV-Navigation__link"> <a href="{% url 'home' %}" class="RV-Navigation__link">
Home {% translate 'Home' %}
</a> </a>
</li> </li>
<li class="RV-Navigation__item"> <li class="RV-Navigation__item">
<a href="{% url 'upload_image' %}" class="RV-Navigation__link"> <a href="{% url 'upload_image' %}" class="RV-Navigation__link">
Upload image {% translate 'Upload image' %}
</a> </a>
</li> </li>
<li class="RV-Navigation__item"> <li class="RV-Navigation__item">
<a href="{% url 'my_images' %}" class="RV-Navigation__link"> <a href="{% url 'my_images' %}" class="RV-Navigation__link">
My images {% translate 'My images' %}
</a> </a>
</li> </li>
<li class="RV-Navigation__item"> <li class="RV-Navigation__item">
<a href="{% url 'my_galleries' %}" class="RV-Navigation__link"> <a href="{% url 'my_galleries' %}" class="RV-Navigation__link">
My galleries {% translate 'My galleries' %}
</a> </a>
</li> </li>
<li class="RV-Navigation__item"> <li class="RV-Navigation__item">
<a href="{% url 'create_gallery' %}" class="RV-Navigation__link"> <a href="{% url 'create_gallery' %}" class="RV-Navigation__link">
Create gallery {% translate 'Create gallery' %}
</a> </a>
</li> </li>
</ul> </ul>
<div class="RV-UserInfo"> <div class="RV-UserInfo">
<div class="RV-UserInfo__name"> <div class="RV-UserInfo__name">
Hello there, {{ visitor.name }} {% translate 'Hello there' %}, {{ visitor.name }}
</div> </div>
<ul class="RV-UserInfo__links"> <ul class="RV-UserInfo__links">
<li class="RV-UserInfo__link"> <li class="RV-UserInfo__link">
<a href="{% url 'visitor_profile' %}"> <a href="{% url 'visitor_profile' %}">
My Profile {% translate 'My Profile' %}
</a> </a>
</li> </li>
</ul> </ul>

View File

@ -1,11 +1,12 @@
{% extends '../global.html' %} {% extends '../global.html' %}
{% load i18n %}
{% load responsive_images %} {% load responsive_images %}
{% block content %} {% block content %}
{% if uploaded_images|length > 0 %} {% if uploaded_images|length > 0 %}
<section class="RV-Images"> <section class="RV-Images">
<h2>Images you uploaded</h2> <h2>{% translate 'Images you uploaded' %}</h2>
<li class="RV-Images__list"> <li class="RV-Images__list">
{% for image in uploaded_images %} {% for image in uploaded_images %}
<a href="{% url 'image' pk=image.id %}" class="RV-Image__link RV-Image__link--detail"> <a href="{% url 'image' pk=image.id %}" class="RV-Image__link RV-Image__link--detail">
@ -17,7 +18,7 @@
{% endif %} {% endif %}
{% if shared_images|length > 0 %} {% if shared_images|length > 0 %}
<section class="RV-Images"> <section class="RV-Images">
<h2>Images shared with you</h2> <h2>{% translate 'Images shared with you' %}</h2>
<li class="RV-Images__list"> <li class="RV-Images__list">
{% for image in shared_images %} {% for image in shared_images %}
<a href="{% url 'image' pk=image.id %}" class="RV-Image__link RV-Image__link--detail"> <a href="{% url 'image' pk=image.id %}" class="RV-Image__link RV-Image__link--detail">

View File

@ -1,5 +1,7 @@
{% extends '../global.html' %} {% extends '../global.html' %}
{% load i18n %}
{% block content %} {% block content %}
<form method="POST" enctype="multipart/form-data"> <form method="POST" enctype="multipart/form-data">
{% csrf_token %} {% csrf_token %}
@ -11,7 +13,7 @@
</div> </div>
<div class="RV-Fieldset"> <div class="RV-Fieldset">
<button type="submit">Upload</button> <button type="submit">{% translate 'Upload' %}</button>
</div> </div>
</form> </form>
{% endblock content %} {% endblock content %}

View File

@ -1,5 +1,7 @@
{% extends '../global.html' %} {% extends '../global.html' %}
{% load i18n %}
{% block content %} {% block content %}
<form method="POST"> <form method="POST">
{% csrf_token %} {% csrf_token %}
@ -7,7 +9,7 @@
{% include 'partials/form_input.html' with field=name_form.name %} {% include 'partials/form_input.html' with field=name_form.name %}
</div> </div>
<div class="RV-Fieldset"> <div class="RV-Fieldset">
<button type="submit">Save</button> <button type="submit">{% translate 'Save' %}</button>
</div> </div>
</form> </form>
{% endblock content %} {% endblock content %}