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

View File

@ -1,12 +1,13 @@
{% extends '../global.html' %}
{% load i18n %}
{% load responsive_images %}
{% block content %}
{% if gallery.title %}
<h1>{{gallery.title}}</h1>
{% 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">
<li class="RV-Images__list">
{% for image in gallery.images.all %}
@ -17,9 +18,9 @@
</li>
{% if gallery.private and gallery.visitors.all|length > 0 and gallery.created_by == visitor %}
<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 %}
{{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 %}
</div>
{% endif %}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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