From c4975f0f9be745489ab2b086d4b579f67e161623 Mon Sep 17 00:00:00 2001 From: pcoder Date: Fri, 20 Oct 2017 08:50:30 +0200 Subject: [PATCH] Add link url to AboutItem --- .../migrations/0006_aboutitem_link_url.py | 20 +++++++++++++++++++ ungleich_page/models.py | 1 + .../ungleich_page/glasfaser/_about_item.html | 2 ++ 3 files changed, 23 insertions(+) create mode 100644 ungleich_page/migrations/0006_aboutitem_link_url.py diff --git a/ungleich_page/migrations/0006_aboutitem_link_url.py b/ungleich_page/migrations/0006_aboutitem_link_url.py new file mode 100644 index 00000000..ebb20e79 --- /dev/null +++ b/ungleich_page/migrations/0006_aboutitem_link_url.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2017-10-20 06:42 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('ungleich_page', '0005_auto_20171019_1517'), + ] + + operations = [ + migrations.AddField( + model_name='aboutitem', + name='link_url', + field=models.URLField(blank=True, default='', max_length=300), + ), + ] diff --git a/ungleich_page/models.py b/ungleich_page/models.py index f32c7414..3759ee25 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -80,6 +80,7 @@ class About(Service): class AboutItem(UngelichPicture): inverted = models.BooleanField(default=False) + link_url = models.URLField(max_length=300, default="", blank=True) def __str__(self): alignment = "Right" if self.inverted else "Left" diff --git a/ungleich_page/templates/ungleich_page/glasfaser/_about_item.html b/ungleich_page/templates/ungleich_page/glasfaser/_about_item.html index fee322d4..0ccdff9a 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/_about_item.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/_about_item.html @@ -1,7 +1,9 @@
  • + {% if instance.link_url %}{% endif %}
    + {% if instance.link_url %}
    {% endif %}

    {{ instance.title }}