cleanup templates, reuse more blocks
This commit is contained in:
parent
068d9f4201
commit
f25482a3e1
19
content/templates/content.html
Normal file
19
content/templates/content.html
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% include "edit.html" %}
|
||||||
|
<div class="large-8 medium-8 columns special-column">
|
||||||
|
{% if content.image %}
|
||||||
|
<img src="{{ content.image_url }}">
|
||||||
|
{% endif %}
|
||||||
|
<div class="index-text">
|
||||||
|
<h4><a href="{{ content.get_absolute_url }}" class="big-title">{{content.title}}</a></h4>
|
||||||
|
<p> {{content.formatted_header|safe}} </p>
|
||||||
|
<p> {{content.formatted_body|safe}} </p>
|
||||||
|
{% include "opt.html" %}
|
||||||
|
{% include "links.html" %}
|
||||||
|
{% include "gallery.html" with gallery=content.gallery %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% include "latest_content.html" %}
|
||||||
|
{% endblock %}
|
|
@ -1,10 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% include "edit.html" with content=events %}
|
{% include "edit.html" with content=events %}
|
||||||
|
|
||||||
<div class="large-8 medium-8 columns special-column">
|
<div class="large-8 medium-8 columns special-column">
|
||||||
{% if events.image %}
|
{% if events.image %}
|
||||||
<img src="{{events.image_url}}">
|
<img src="{{events.image_url}}">
|
||||||
|
@ -18,37 +15,5 @@
|
||||||
{% include "gallery.html" with gallery=gallery %}
|
{% include "gallery.html" with gallery=gallery %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% include "latest_content.html" with content=events %}
|
||||||
|
|
||||||
|
|
||||||
<div class="large-4 medium-4 columns">
|
|
||||||
{% include "related.html" with related=events.children.all %}
|
|
||||||
<h4 class="sidebar-h4">Events </h4>
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
{% for events in latest_content_list %}
|
|
||||||
|
|
||||||
<div class="row right-items">
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<a href="{{ events.get_absolute_url }}/"> <img src="{{ events.image_url }}"> </a>
|
|
||||||
</div>
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<a href="{{ events.get_absolute_url }}/" class="sidebar-title" >{{ events.title }}</a>
|
|
||||||
<h6 class="sidebar-date">
|
|
||||||
<font color="#ef4e5c">
|
|
||||||
<b> {{ events.datestart }} {% if events.dateend %} - {{events.dateend}} {% endif %} </b>
|
|
||||||
</font>
|
|
||||||
{% if events.place %}<br/>{{events.place}}{% endif%}
|
|
||||||
</h6>
|
|
||||||
<p> {{ events.formatted_teaser }} </p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
<a href="{% url 'events_list' %}">more</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
18
content/templates/latest_content.html
Normal file
18
content/templates/latest_content.html
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{% if latest_content_list %}
|
||||||
|
<div class="large-4 medium-4 columns">
|
||||||
|
{% include "related.html" with related=content.children.all %}
|
||||||
|
<h4 class="sidebar-h4">{{section}}</h4>
|
||||||
|
<div class="row">
|
||||||
|
{% for content in latest_content_list %}
|
||||||
|
{% include "preview.html" with content=content %}
|
||||||
|
{% endfor %}
|
||||||
|
{% with section|lower|add:'_list' as section_list %}
|
||||||
|
{% if has_more_content %}
|
||||||
|
<a href="{% url section_list %}">more</a>
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<p>No content.</p>
|
||||||
|
{% endif %}
|
|
@ -1,4 +1,3 @@
|
||||||
<div class="row">
|
|
||||||
<div class="row right-items">
|
<div class="row right-items">
|
||||||
<div class="small-6 columns">
|
<div class="small-6 columns">
|
||||||
{% if content.image_url %}
|
{% if content.image_url %}
|
||||||
|
@ -18,4 +17,3 @@
|
||||||
<p> {{ content.formatted_teaser }} </p>
|
<p> {{ content.formatted_teaser }} </p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% include "edit.html" with content=projects %}
|
{% include "edit.html" with content=projects %}
|
||||||
|
|
||||||
<div class="large-8 medium-8 columns special-column">
|
<div class="large-8 medium-8 columns special-column">
|
||||||
{% if projects.image %}
|
{% if projects.image %}
|
||||||
<img src="{{ projects.image_url }}">
|
<img src="{{ projects.image_url }}">
|
||||||
|
@ -18,30 +15,5 @@
|
||||||
{% include "gallery.html" with gallery=gallery %}
|
{% include "gallery.html" with gallery=gallery %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% include "latest_content.html" with content=texts %}
|
||||||
{% if latest_content_list %}
|
|
||||||
|
|
||||||
<div class="large-4 medium-4 columns">
|
|
||||||
{% include "related.html" with related=projects.children.all %}
|
|
||||||
<h4 class="sidebar-h4">Projects </h4>
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
{% for projects in latest_content_list %}
|
|
||||||
<div class="row right-items">
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<a href="{{ projects.get_absolute_url }}"> <img src="{{ projects.image_url }}"> </a>
|
|
||||||
</div>
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<a href="{{ projects.get_absolute_url }}" class="sidebar-title">{{ projects.title }}</a>
|
|
||||||
<p> {{projects.formatted_teaser}} </p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
{% else %}
|
|
||||||
<p>No projects.</p>
|
|
||||||
{% endif %}
|
|
||||||
<a href="{% url 'projects_list' %}">more</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
{% if related %}
|
{% if related %}
|
||||||
<h4 class="sidebar-h4"> Related </h4>
|
<h4 class="sidebar-h4"> Related </h4>
|
||||||
{% for content in related %}
|
{% for content in related %}
|
||||||
|
<div class="row">
|
||||||
{% include "preview.html" %}
|
{% include "preview.html" %}
|
||||||
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
</h6>
|
</h6>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% elif row.type.name == 'events' %}
|
{% else %}
|
||||||
<div class="row results">
|
<div class="row results">
|
||||||
<div class="small-4 small-offset-2 columns">
|
<div class="small-4 small-offset-2 columns">
|
||||||
{% if row.image_url %}
|
{% if row.image_url %}
|
||||||
|
@ -31,59 +31,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="small-4 end columns">
|
<div class="small-4 end columns">
|
||||||
<a href="{{ row.get_absolute_url }}" class="sidebar-title">{{ row.title }}</a>
|
<a href="{{ row.get_absolute_url }}" class="sidebar-title">{{ row.title }}</a>
|
||||||
|
{% if row.type.name == 'events' %}
|
||||||
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ row.datestart }} {% if row.dateend %} - {{row.dateend}} {% endif %} </b></font>
|
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ row.datestart }} {% if row.dateend %} - {{row.dateend}} {% endif %} </b></font>
|
||||||
{% if row.place %}<br/> {{row.place}} {% endif%}</h6>
|
{% if row.place %}<br/> {{row.place}} {% endif%}</h6>
|
||||||
|
{% endif %}
|
||||||
<p> {{row.formatted_teaser}} </p>
|
<p> {{row.formatted_teaser}} </p>
|
||||||
<a href="{{ row.get_absolute_url }}">read more</a> </p>
|
<a href="{{ row.get_absolute_url }}">read more</a> </p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% elif row.type.name == 'projects' %}
|
|
||||||
<div class="row results">
|
|
||||||
<div class="small-4 small-offset-2 columns">
|
|
||||||
{% if row.image_url %}
|
|
||||||
<a href="{{ row.get_absolute_url }}"> <img src="{{ row.image_url }}"> </a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="small-4 end columns">
|
|
||||||
<a href="{{ row.get_absolute_url }}" class="sidebar-title">{{ row.title }}</a>
|
|
||||||
<p> {{row.formatted_teaser}} </p>
|
|
||||||
<a href="{{ row.get_absolute_url }}">read more</a> </p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% elif row.type.name == 'works' %}
|
|
||||||
<div class="row results">
|
|
||||||
<div class="small-4 small-offset-2 columns">
|
|
||||||
{% if row.image_url %}
|
|
||||||
<a href="{{ row.get_absolute_url }}"> <img src="{{ row.image_url }}"> </a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="small-4 end columns">
|
|
||||||
<a href="{{ row.get_absolute_url }}" class="sidebar-title">{{ row.title }}</a>
|
|
||||||
<p> {{row.formatted_teaser}} </p>
|
|
||||||
<a href="{{ row.get_absolute_url }}">read more</a> </p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% elif row.type.name == 'texts' %}
|
|
||||||
<div class="row results">
|
|
||||||
<div class="small-4 small-offset-2 columns">
|
|
||||||
{% if row.image_url %}
|
|
||||||
<a href="{{ row.get_absolute_url }}"> <img src="{{ row.image_url }}"> </a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="small-4 end columns">
|
|
||||||
<a href="{{ row.get_absolute_url }}" class="sidebar-title">{{ row.title }}</a>
|
|
||||||
<p> {{row.formatted_teaser}} </p>
|
|
||||||
<a href="{{ row.get_absolute_url }}">read more</a> </p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{% if request.user.is_staff %}
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-4 small-offset-2 columns">
|
|
||||||
Add view for content type: {{row.type}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<br>
|
<br>
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% include "edit.html" with content=texts %}
|
{% include "edit.html" with content=texts %}
|
||||||
|
|
||||||
<div class="large-8 medium-8 columns special-column">
|
<div class="large-8 medium-8 columns special-column">
|
||||||
{% if texts.image %}
|
{% if texts.image %}
|
||||||
<img src="{{ texts.image_url }}">
|
<img src="{{ texts.image_url }}">
|
||||||
|
@ -14,46 +13,5 @@
|
||||||
{% include "opt.html" with content=texts %}
|
{% include "opt.html" with content=texts %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% include "latest_content.html" with content=texts %}
|
||||||
{% if latest_content_list %}
|
|
||||||
|
|
||||||
<div class="large-4 medium-4 columns">
|
|
||||||
{% if texts.children.all %}
|
|
||||||
<h4 class="sidebar-h4"> Related </h4>
|
|
||||||
{% for child in texts.children.all %}
|
|
||||||
<div class="row related-row">
|
|
||||||
{% if child.image %}
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<a href="{{ child.get_absolute_url }}"> <img src="{{ child.image_url }}"> </a>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<h6><a href="{{ child.get_absolute_url }}" class="sidebar-title"> {{child}} </a> </h6>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
<h4 class="sidebar-h4"> Texts </h4>
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
{% for texts in latest_content_list %}
|
|
||||||
<div class="row right-items">
|
|
||||||
{% if texts.image %}
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<a href="{{ texts.get_absolute_url }}"> <img src="{{ texts.image_url }}"></a>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<a href="{{ texts.get_absolute_url }}" class="sidebar-title">{{ texts.title }}</a>
|
|
||||||
<p> {{ texts.formatted_teaser }} </p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
{% else %}
|
|
||||||
<p>No texts.</p>
|
|
||||||
{% endif %}
|
|
||||||
<a href="{% url 'texts_list' %}">more</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,53 +1,19 @@
|
||||||
|
|
||||||
|
|
||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
{% include "edit.html" with content=works %}
|
||||||
<div class="large-8 medium-8 columns special-column">
|
<div class="large-8 medium-8 columns special-column">
|
||||||
|
{% if works.image %}
|
||||||
<img src="{{ works.image_url }}">
|
<img src="{{ works.image_url }}">
|
||||||
|
{% endif %}
|
||||||
<div class="index-text">
|
<div class="index-text">
|
||||||
<h4><a href="{{ works.get_absolute_url }}" class="big-title">{{works.title}} </a></h4>
|
<h4><a href="{{ works.get_absolute_url }}" class="big-title">{{works.title}} </a></h4>
|
||||||
<p> {{works.formatted_header|safe}} </p>
|
<p> {{works.formatted_header|safe}} </p>
|
||||||
<p> {{works.formatted_body|safe}} </p>
|
<p> {{works.formatted_body|safe}} </p>
|
||||||
|
{% include "opt.html" with content=works %}
|
||||||
|
{% include "links.html" with content=projects %}
|
||||||
|
{% include "gallery.html" with gallery=gallery %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% include "latest_content.html" with content=works %}
|
||||||
{% if latest_content_list %}
|
|
||||||
|
|
||||||
<div class="large-4 medium-4 columns">
|
|
||||||
{% if works.children.all %}
|
|
||||||
<h4 class="sidebar-h4"> Related </h4>
|
|
||||||
{% for child in works.children.all %}
|
|
||||||
<div class="row related-row">
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<a href="{{ child.get_absolute_url }}"> <img src="{{ child.image_url }}"> </a>
|
|
||||||
</div>
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<h6><a href="{{ child.get_absolute_url }}" class="sidebar-title"> {{child}} </a> </h6>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
<h4 class="sidebar-h4"> Works </h4>
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
{% for works in latest_content_list %}
|
|
||||||
<div class="row right-items">
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<a href="{{ works.get_absolute_url }}"> <img src="{{ works.image_url }}"></a>
|
|
||||||
</div>
|
|
||||||
<div class="small-6 columns">
|
|
||||||
<a href="{{ works.get_absolute_url }}" class="sidebar-title">{{ works.title }}</a>
|
|
||||||
<p> {{ works.formatted_teaser }} </p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
{% else %}
|
|
||||||
<p>No works.</p>
|
|
||||||
{% endif %}
|
|
||||||
<a href="{% url 'works_list' %}">more</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -84,9 +84,9 @@ def section_list(request, section):
|
||||||
|
|
||||||
return render(request, 'results.html', {
|
return render(request, 'results.html', {
|
||||||
'base_query': base_query,
|
'base_query': base_query,
|
||||||
'section': section,
|
|
||||||
'content': content,
|
'content': content,
|
||||||
'query': q
|
'query': q,
|
||||||
|
'section': section,
|
||||||
})
|
})
|
||||||
|
|
||||||
def event(request):
|
def event(request):
|
||||||
|
@ -107,71 +107,53 @@ def event(request):
|
||||||
'ongoing_events': ongoing_events,
|
'ongoing_events': ongoing_events,
|
||||||
'past_events': past_events,
|
'past_events': past_events,
|
||||||
'featured': featured,
|
'featured': featured,
|
||||||
|
'section': 'Events',
|
||||||
}
|
}
|
||||||
return render(request, 'event.html', context)
|
return render(request, 'event.html', context)
|
||||||
|
|
||||||
|
|
||||||
def events(request, shortname=None):
|
def get_related_content(types, current=None, max_length=10):
|
||||||
|
latest_content_list = Content.objects.filter(type__name__in=types).order_by('-datestart')
|
||||||
|
if current:
|
||||||
|
latest_content_list = latest_content_list.exclude(pk=current.pk)
|
||||||
|
latest_content_list = latest_content_list.filter(published=True)
|
||||||
|
more = latest_content_list.count > max_length
|
||||||
|
latest_content_list = latest_content_list[:max_length]
|
||||||
|
return latest_content_list, more
|
||||||
|
|
||||||
|
|
||||||
|
def render_content(request, shortname, section, template, types):
|
||||||
if not shortname:
|
if not shortname:
|
||||||
|
if section == 'Events':
|
||||||
return event(request)
|
return event(request)
|
||||||
events = get_object_or_404(Content, shortname=shortname, type__name__in=['news', 'events'])
|
else:
|
||||||
if not events.published and not request.user.is_staff:
|
return section_index(request, section)
|
||||||
|
content = get_object_or_404(Content, shortname=shortname, type__name__in=types)
|
||||||
|
if not content.published and not request.user.is_staff:
|
||||||
raise Http404
|
raise Http404
|
||||||
gallery = get_or_none(Gallery, slug=shortname)
|
latest_content_list, more = get_related_content(types, content)
|
||||||
latest_content_list = Content.objects.filter(type__name__in=['events', 'news']).order_by('-datestart')
|
return render(request, template, {
|
||||||
latest_content_list = latest_content_list.exclude(pk=events.pk)
|
'content': content,
|
||||||
latest_content_list = latest_content_list[:10]
|
|
||||||
return render(request, 'events.html', {
|
|
||||||
'events': events,
|
|
||||||
'latest_content_list': latest_content_list,
|
'latest_content_list': latest_content_list,
|
||||||
'gallery': gallery
|
'has_more_content': more,
|
||||||
|
'section': section,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
def events(request, shortname=None):
|
||||||
|
return render_content(request, shortname, 'Events', 'content.html', ['events', 'news'])
|
||||||
|
|
||||||
|
|
||||||
def projects(request, shortname=None):
|
def projects(request, shortname=None):
|
||||||
if not shortname:
|
return render_content(request, shortname, 'Projects', 'content.html', ['projects'])
|
||||||
return section_index(request, 'Projects')
|
|
||||||
projects = get_object_or_404(Content, shortname=shortname, type__name='projects')
|
|
||||||
if not projects.published and not request.user.is_staff:
|
|
||||||
raise Http404
|
|
||||||
gallery = get_or_none(Gallery, slug=shortname)
|
|
||||||
latest_content_list = Content.objects.filter(type__name='projects').order_by('-datestart')
|
|
||||||
latest_content_list = latest_content_list.exclude(pk=projects.pk)
|
|
||||||
latest_content_list = latest_content_list[:10]
|
|
||||||
return render(request, 'projects.html', {
|
|
||||||
'projects': projects,
|
|
||||||
'latest_content_list': latest_content_list,
|
|
||||||
'gallery': gallery
|
|
||||||
})
|
|
||||||
|
|
||||||
def works(request, shortname=None):
|
def works(request, shortname=None):
|
||||||
if not shortname:
|
return render_content(request, shortname, 'Works', 'content.html', ['works'])
|
||||||
return section_index(request, 'Works')
|
|
||||||
works = get_object_or_404(Content, shortname=shortname, type__name='works')
|
|
||||||
if not works.published and not request.user.is_staff:
|
|
||||||
raise Http404
|
|
||||||
gallery = get_or_none(Gallery, slug=shortname)
|
|
||||||
latest_content_list = Content.objects.filter(type__name='works')
|
|
||||||
latest_content_list = latest_content_list.exclude(pk=works.pk)
|
|
||||||
latest_content_list = latest_content_list[:10]
|
|
||||||
return render(request, 'works.html', {
|
|
||||||
'works': works,
|
|
||||||
'latest_content_list': latest_content_list,
|
|
||||||
'gallery': gallery
|
|
||||||
})
|
|
||||||
|
|
||||||
def texts(request, shortname=None):
|
def texts(request, shortname=None):
|
||||||
if not shortname:
|
return render_content(requests, shortname, 'Texts', 'content.html', ['texts'])
|
||||||
return section_index(request, 'Texts')
|
|
||||||
texts = get_object_or_404(Content, shortname=shortname, type__name='texts')
|
|
||||||
gallery = get_or_none(Gallery, slug=shortname)
|
|
||||||
latest_content_list = Content.objects.filter(type__name='texts')
|
|
||||||
latest_content_list = latest_content_list.exclude(pk=texts.pk)
|
|
||||||
latest_content_list = latest_content_list[:10]
|
|
||||||
return render(request, 'texts.html', {
|
|
||||||
'texts': texts,
|
|
||||||
'latest_content_list': latest_content_list,
|
|
||||||
'gallery': gallery
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
def page(request, shortname):
|
def page(request, shortname):
|
||||||
|
@ -186,6 +168,7 @@ def limit_content(content, q):
|
||||||
content = content.filter(Q(body__icontains=q) | Q(title__icontains=q) | Q(header__icontains=q)).distinct()
|
content = content.filter(Q(body__icontains=q) | Q(title__icontains=q) | Q(header__icontains=q)).distinct()
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
||||||
def search(request):
|
def search(request):
|
||||||
content = Content.objects.filter(published=True).order_by('-datestart')
|
content = Content.objects.filter(published=True).order_by('-datestart')
|
||||||
content = content.exclude(type__name__in=['page', 'homepage'])
|
content = content.exclude(type__name__in=['page', 'homepage'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user