Add link url to AboutItem

This commit is contained in:
pcoder 2017-10-20 08:50:30 +02:00
parent c20e9372f9
commit c4975f0f9b
3 changed files with 23 additions and 0 deletions

View file

@ -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),
),
]

View file

@ -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"

View file

@ -1,7 +1,9 @@
<li {% if instance.inverted %}class="timeline-inverted"{% endif %}>
{% if instance.link_url %}<a href="{{ instance.link_url }}" target="_blank">{% endif %}
<div class="timeline-image">
<img class="img-circle img-responsive" src="{{ instance.image.url }}" alt="">
</div>
{% if instance.link_url %}</a>{% endif %}
<div class="timeline-panel wow {% if instance.inverted %}slideInRight{% else %}slideInLeft{% endif %}">
<div class="timeline-body">
<p>{{ instance.title }}</p>