Compare commits
No commits in common. "25db5b28683eb22f9ee9225d4eef5b4c21f82fbc" and "f26ddd3a41d45ded985247676a55b955ee8414e5" have entirely different histories.
25db5b2868
...
f26ddd3a41
|
@ -145,69 +145,7 @@ 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,11 +21,7 @@ import lxml.html
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
|
|
||||||
def sanitize_html(string):
|
def sanitize_html(string):
|
||||||
try:
|
return '\n'.join(lxml.html.tostring(x) for x in lxml.html.fragment_fromstring(string).iterchildren())
|
||||||
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)
|
||||||
|
@ -103,7 +99,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', null=True, blank=True, related_name='reverse_related_content')
|
related_content = SortedManyToManyField('Content', 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")
|
||||||
|
@ -146,7 +142,7 @@ class Content(models.Model):
|
||||||
@property
|
@property
|
||||||
def image_url(self):
|
def image_url(self):
|
||||||
if self.photo:
|
if self.photo:
|
||||||
return self.photo.get_display_url()
|
return self.photo.image.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,7 +47,8 @@
|
||||||
<br>
|
<br>
|
||||||
{% if years %}
|
{% if years %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<ul class="years">
|
<div class="medium-8 medium-offset-2 end columns">
|
||||||
|
<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,6 +58,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if content.has_other_pages %}
|
{% if content.has_other_pages %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -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__gte=now)[:12]
|
upcoming_events = base.filter(datestart__gt=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