#50 Replaced photo albums with external links in templates.

This commit is contained in:
Marcus Scholz 2021-10-02 03:41:31 +02:00
parent 4dbd8ae82d
commit 961d28e336
3 changed files with 23 additions and 17 deletions

View File

@ -104,16 +104,16 @@
</section>
<section class=" LP-Section">
<h1 class="LP-Headline">{% translate 'Photo albums submitted by' %} {{explorer.user.username}}</h1>
<h1 class="LP-Headline">{% translate 'External links submitted by' %} {{explorer.user.username}}</h1>
<div class="LP-LinkList">
<ul class="LP-LinkList__Container">
{% for photo_album in assets.photoalbums.all %}
{% for external_link in assets.externallinks.all %}
<li class="LP-LinkList__Item">
<a target="_blank" href="{{photo_album.url}}" class="LP-Link">
<span class="LP-Text">{{photo_album.label}}</span>
<a target="_blank" href="{{external_link.url}}" class="LP-Link">
<span class="LP-Text">{{external_link.label}}</span>
</a>
{% if user.explorer == photo_album.submitted_by%}
<a href="{% url 'photo_album_delete' pk=photo_album.pk%}" class="LP-Link LP-LinkList__ItemHover" title="Delete Photo Album">
{% if user.explorer == external_link.submitted_by%}
<a href="{% url 'external_link_delete' pk=external_link.pk%}" class="LP-Link LP-LinkList__ItemHover" title="Delete Photo Album">
<div class="RV-Iconized__Container RV-Iconized__Container--small">
{% icon 'trash' className="RV-Iconized__Icon" %}
</div>

View File

@ -1,7 +1,7 @@
{% extends 'global.html'%}
{% load i18n %}
{% block title %}{% translate 'Submit a photo album' %}{% endblock %}
{% block title %}{% translate 'Submit an external link' %}{% endblock %}
{% block additional_menu_items %}
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_edit' pk=place.pk %}" class="LP-Link"><span
@ -13,7 +13,7 @@
{% block maincontent %}
<form class="LP-Form" method="POST">
<fieldset class="LP-Form__Fieldset">
<legend class="LP-Form__Legend">{% translate 'Submit a photo album for' %} {{place.name}}</legend>
<legend class="LP-Form__Legend">{% translate 'Submit an external link for' %} {{place.name}}</legend>
{% csrf_token %}
<div class="LP-Form__Composition">
<div class="LP-Form__Field">
@ -27,9 +27,15 @@
</div>
</div>
<div class="LP-Form__Composition">
<div class="LP-Form__Field">
{% include 'partials/form/inputField.html' with field=form.linktype %}
</div>
</div>
<div class="LP-Form__Composition LP-Form__Composition--buttons">
{% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER %}
</div>
</fieldset>
</form>
{% endblock maincontent %}
{% endblock maincontent %}

View File

@ -62,16 +62,16 @@
</section>
<section class=" LP-Section">
<h1 class="LP-Headline">{% translate 'Photo albums' %}</h1>
<h2 class="LP-Headline">{% translate 'External links' %}</h2>
<div class="LP-LinkList">
<ul class="LP-LinkList__Container">
{% for photo_album in place.photoalbums.all %}
{% for external_link in place.externallinks.all %}
<li class="LP-LinkList__Item">
<a target="_blank" href="{{photo_album.url}}" class="LP-Link">
<span class="LP-Text">{{photo_album.label}}</span>
<a target="_blank" href="{{external_link.url}}" class="LP-Link">
<span class="LP-Text">{{external_link.label}}</span>
</a>
{% if user.explorer == photo_album.submitted_by or user.explorer == place.submitted_by %}
<a href="{% url 'photo_album_delete' pk=photo_album.pk%}" class="LP-Link LP-LinkList__ItemHover" title="Delete Photo Album">
{% if user.explorer == external_link.submitted_by or user.explorer == place.submitted_by %}
<a href="{% url 'external_link_delete' pk=external_link.pk%}" class="LP-Link LP-LinkList__ItemHover" title="Delete external link">
<div class="RV-Iconized__Container RV-Iconized__Container--small">
{% icon 'trash' className="RV-Iconized__Icon" %}
</div>
@ -80,7 +80,7 @@
</li>
{% endfor %}
<li class="LP-LinkList__Item">
<a href="{% url 'photo_album_create' place_id=place.id %}" class="LP-Link">
<a href="{% url 'external_link_create' place_id=place.id %}" class="LP-Link">
<div class="RV-Iconized__Container RV-Iconized__Container--small">
<svg class="RV-Iconized__Icon" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve">
<g>
@ -88,7 +88,7 @@
v216c0,11.046,8.954,20,20,20s20-8.954,20-20V276h216c11.046,0,20-8.954,20-20C512,244.954,503.046,236,492,236z" />
</g>
</svg>
<span class="RV-Iconized__Text">{% translate 'Add photo album' %}</span>
<span class="RV-Iconized__Text">{% translate 'Add external link' %}</span>
</div>
</a>
</li>