Compare commits
5 Commits
f26ddd3a41
...
25db5b2868
Author | SHA1 | Date | |
---|---|---|---|
|
25db5b2868 | ||
|
5f0c52aeae | ||
|
6ccd7b8e1a | ||
|
48083b09eb | ||
|
9c02e2913e |
|
@ -145,7 +145,69 @@ ul.clearing-thumbs li {
|
||||||
.pagination button:hover,
|
.pagination button:hover,
|
||||||
.pagination span.current
|
.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 {
|
.admin-menu {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
@ -21,7 +21,11 @@ import lxml.html
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
|
|
||||||
def sanitize_html(string):
|
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):
|
class Acrolike(models.Model):
|
||||||
title = models.CharField(max_length=255)
|
title = models.CharField(max_length=255)
|
||||||
|
@ -99,7 +103,7 @@ class Content(models.Model):
|
||||||
place = models.CharField(max_length=255, null=True, blank=True)
|
place = models.CharField(max_length=255, null=True, blank=True)
|
||||||
parents = models.ManyToManyField('Content', through='ContentContent', related_name="children")
|
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")
|
resources = models.ManyToManyField('Resources', through='ContentResource', related_name="content")
|
||||||
gallery = models.ForeignKey(Gallery, null=True, blank=True, related_name="content")
|
gallery = models.ForeignKey(Gallery, null=True, blank=True, related_name="content")
|
||||||
|
@ -142,7 +146,7 @@ class Content(models.Model):
|
||||||
@property
|
@property
|
||||||
def image_url(self):
|
def image_url(self):
|
||||||
if self.photo:
|
if self.photo:
|
||||||
return self.photo.image.url
|
return self.photo.get_display_url()
|
||||||
if self.image:
|
if self.image:
|
||||||
if self.image.startswith('http') or self.image.startswith('/'):
|
if self.image.startswith('http') or self.image.startswith('/'):
|
||||||
return self.image
|
return self.image
|
||||||
|
|
|
@ -47,8 +47,7 @@
|
||||||
<br>
|
<br>
|
||||||
{% if years %}
|
{% if years %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="medium-8 medium-offset-2 end columns">
|
<ul class="years">
|
||||||
<ul class="pagination">
|
|
||||||
{% for y in years %}
|
{% for y in years %}
|
||||||
{% if year == y %}
|
{% if year == y %}
|
||||||
<li><span class="current">{{y}}</a></li>
|
<li><span class="current">{{y}}</a></li>
|
||||||
|
@ -57,7 +56,6 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if content.has_other_pages %}
|
{% if content.has_other_pages %}
|
||||||
|
|
|
@ -28,7 +28,7 @@ def index(request):
|
||||||
display_events = ['news', 'events']
|
display_events = ['news', 'events']
|
||||||
base = Content.objects.filter(type__name__in=display_events).order_by('-datestart')
|
base = Content.objects.filter(type__name__in=display_events).order_by('-datestart')
|
||||||
base = base.filter(published=True)
|
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]
|
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]
|
past_events = base.filter(Q(dateend__lt=now) | Q(dateend=None, datestart__lt=now))[:12]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user