Compare commits

..

5 Commits

Author SHA1 Message Date
root
25db5b2868 include now 2019-05-24 10:29:11 +00:00
root
5f0c52aeae smaller images 2019-05-24 10:29:06 +00:00
root
6ccd7b8e1a related fix 2018-08-27 11:21:18 +00:00
root
48083b09eb years 2018-08-27 10:51:26 +00:00
root
9c02e2913e sanitze fallback 2018-08-27 10:51:18 +00:00
4 changed files with 72 additions and 8 deletions

View File

@ -145,7 +145,69 @@ ul.clearing-thumbs li {
.pagination button:hover,
.pagination span.current
{
background: #1779ba !important; }
background: #1779ba !important;
}
.years {
text-align: center;
margin-left: 16px;
margin-right: 16px;
padding-bottom: 20px;
}
.years::before, .years::after {
display: table;
content: ' ';
}
.years::after {
clear: both;
}
.years li {
margin-right: 0.0625rem;
border-radius: 0;
font-size: 0.875rem;
display: inline-block;
}
.years a,
.years button {
display: block;
padding: 0.1875rem 0.625rem;
border-radius: 0;
color: #0a0a0a; }
.years a:hover,
.years button:hover {
background: #e6e6e6; }
.years .current {
padding: 0.1875rem 0.625rem;
background: #1779ba;
color: #fefefe;
cursor: default; }
.years .disabled {
padding: 0.1875rem 0.625rem;
color: #cacaca;
cursor: not-allowed; }
.years .disabled:hover {
background: transparent; }
.years .ellipsis::after {
padding: 0.1875rem 0.625rem;
content: '\2026';
color: #0a0a0a;
}
.years {
}
.years a, .years button {
color: #ffffff !important;
}
.years a:hover,
.years button:hover,
.years span.current
{
background: #1779ba !important;
}
.admin-menu {
position: absolute;

View File

@ -21,7 +21,11 @@ import lxml.html
# Create your models here.
def sanitize_html(string):
return '\n'.join(lxml.html.tostring(x) for x in lxml.html.fragment_fromstring(string).iterchildren())
try:
html = '\n'.join(lxml.html.tostring(x) for x in lxml.html.fragment_fromstring(string).iterchildren())
except:
html = ox.strip_tags(string.replace('<br>', '\n')).replace('\n\n', '\n').replace('\n', '<br>')
return html
class Acrolike(models.Model):
title = models.CharField(max_length=255)
@ -99,7 +103,7 @@ class Content(models.Model):
place = models.CharField(max_length=255, null=True, blank=True)
parents = models.ManyToManyField('Content', through='ContentContent', related_name="children")
related_content = SortedManyToManyField('Content', related_name='reverse_related_content')
related_content = SortedManyToManyField('Content', null=True, blank=True, related_name='reverse_related_content')
resources = models.ManyToManyField('Resources', through='ContentResource', related_name="content")
gallery = models.ForeignKey(Gallery, null=True, blank=True, related_name="content")
@ -142,7 +146,7 @@ class Content(models.Model):
@property
def image_url(self):
if self.photo:
return self.photo.image.url
return self.photo.get_display_url()
if self.image:
if self.image.startswith('http') or self.image.startswith('/'):
return self.image

View File

@ -47,8 +47,7 @@
<br>
{% if years %}
<div class="row">
<div class="medium-8 medium-offset-2 end columns">
<ul class="pagination">
<ul class="years">
{% for y in years %}
{% if year == y %}
<li><span class="current">{{y}}</a></li>
@ -57,7 +56,6 @@
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if content.has_other_pages %}

View File

@ -28,7 +28,7 @@ def index(request):
display_events = ['news', 'events']
base = Content.objects.filter(type__name__in=display_events).order_by('-datestart')
base = base.filter(published=True)
upcoming_events = base.filter(datestart__gt=now)[:12]
upcoming_events = base.filter(datestart__gte=now)[:12]
ongoing_events = base.filter(datestart__lt=now, dateend__gte=now)[:12]
past_events = base.filter(Q(dateend__lt=now) | Q(dateend=None, datestart__lt=now))[:12]