Compare commits
No commits in common. "f4f6b440b872b75720a41939eb36d50c19602a84" and "8b280a33b63a8cd03ef0d0a21e2e052d406c64c6" have entirely different histories.
f4f6b440b8
...
8b280a33b6
|
@ -25,7 +25,6 @@ body, h1, h2, h3, h4, h5, h6 {
|
|||
text-transform: uppercase;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.sidebar-title {
|
||||
|
@ -115,7 +114,7 @@ ul.clearing-thumbs li {
|
|||
|
||||
.page-header {
|
||||
margin-top: 30px;
|
||||
line-height: 0.4em !important;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.thumbnail {
|
||||
|
@ -156,30 +155,3 @@ ul.clearing-thumbs li {
|
|||
table thead, table tbody, table tfoot {
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
|
||||
.search-form[type=search] {
|
||||
width: 15rem;
|
||||
border: 0.125rem solid #e6e6e6;
|
||||
box-shadow: 0 0 3.125rem rgba(0, 0, 0, 0.18);
|
||||
border-radius: 0;
|
||||
background-image: url("http://media.yardhouse.com/images/site/searchicon.png");
|
||||
background-position: 4px center;
|
||||
background-repeat: no-repeat;
|
||||
background-color: #111111;
|
||||
padding-left: 30px;
|
||||
position: absolute;
|
||||
color: #ffffff !important;
|
||||
font-size: 10px !important;
|
||||
top: 13px;
|
||||
right: 110px;
|
||||
height: 25px;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -36,11 +36,6 @@ urlpatterns = [
|
|||
url(r'directions.html', RedirectView.as_view(url='/directions/')),
|
||||
url(r'campstudio.html', RedirectView.as_view(url='/directions/')),
|
||||
|
||||
url(r'^texts/index/$', views.section_list, {'section': 'Texts'}, name='texts_list'),
|
||||
url(r'^events/index/$', views.section_list, {'section': 'Events'}, name='events_list'),
|
||||
url(r'^projects/index/$', views.section_list, {'section': 'Projects'}, name='projects_list'),
|
||||
url(r'^works/index/$', views.section_list, {'section': 'Works'}, name='works_list'),
|
||||
|
||||
url(r'^texts/(?P<shortname>.+)/$', views.texts, name='texts'),
|
||||
url(r'^events/(?P<shortname>.+)/$', views.events, name='events'),
|
||||
url(r'^projects/(?P<shortname>.+)/$', views.projects, name='projects'),
|
||||
|
|
|
@ -35,10 +35,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form method="get" action='/search/'>
|
||||
<input type="search" name="q" class="search-form" value="{{query|default:""}}">
|
||||
<input type="submit" style="visibility: hidden;" />
|
||||
</form>
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -51,38 +48,25 @@
|
|||
<script src="{% static "js/jquery.bxslider.js" %}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
slider = $('.slider1').bxSlider({
|
||||
var slider = $('.slider1').bxSlider({
|
||||
adaptiveHeight : true,
|
||||
pager : false,
|
||||
});
|
||||
|
||||
document.querySelectorAll('.select-image').forEach(function(a) {
|
||||
a.onclick = function(event) {
|
||||
event.preventDefault();
|
||||
slider.goToSlide(parseInt(this.dataset.id) - 1)
|
||||
document.location.hash = '#' + this.dataset.id;
|
||||
};
|
||||
});
|
||||
if (document.querySelectorAll('.select-image').length && document.location.hash.length) {
|
||||
var slide = parseInt(document.location.hash.slice(1))
|
||||
if (slide) {
|
||||
slider.goToSlide(slide - 1)
|
||||
}
|
||||
}
|
||||
|
||||
$(document).keydown(function(e){
|
||||
if (e.keyCode == 39) // Right arrow
|
||||
{
|
||||
slider && slider.goToNextSlide();
|
||||
return false;
|
||||
}
|
||||
else if (e.keyCode == 37) // left arrow
|
||||
{
|
||||
slider && slider.goToPrevSlide();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$(document).keydown(function(e){
|
||||
if (e.keyCode == 39) // Right arrow
|
||||
{
|
||||
slider.goToNextSlide();
|
||||
return false;
|
||||
}
|
||||
else if (e.keyCode == 37) // left arrow
|
||||
{
|
||||
slider.goToPrevSlide();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
{% 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,19 +1,53 @@
|
|||
|
||||
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
{% include "edit.html" with content=events %}
|
||||
<div class="large-8 medium-8 columns special-column">
|
||||
{% if events.image %}
|
||||
<img src="{{events.image_url}}">
|
||||
{% endif %}
|
||||
<div class="index-text">
|
||||
<h4><a href="{{ events.get_absolute_url }}/" class="big-title">{{events.title}} </a></h4>
|
||||
<p> {{events.formatted_header|safe}} </p>
|
||||
<p> {{events.formatted_body|safe}} </p>
|
||||
{% include "opt.html" with content=events %}
|
||||
{% include "links.html" with content=events %}
|
||||
{% include "gallery.html" with gallery=gallery %}
|
||||
</div>
|
||||
</div>
|
||||
{% include "latest_content.html" with content=events %}
|
||||
|
||||
<div class="large-8 medium-8 columns special-column">
|
||||
{% if events.image %}
|
||||
<img src="{{events.image_url}}">
|
||||
{% endif %}
|
||||
<div class="index-text">
|
||||
<h4><a href="{{ events.get_absolute_url }}/" class="big-title">{{events.title}} </a></h4>
|
||||
<p> {{events.formatted_header|safe}} </p>
|
||||
<p> {{events.formatted_body|safe}} </p>
|
||||
{% include "opt.html" with content=events %}
|
||||
{% include "links.html" with content=events %}
|
||||
{% include "gallery.html" with gallery=gallery %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<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 %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{% for content in featured %}
|
||||
<div class="large-8 medium-8 columns special-column">
|
||||
{% if content.image %}
|
||||
<a href="{{ content.get_absolute_url }}"><img src="{{ content.image_url }}"> </a>
|
||||
<img src="{{ content.image_url }}">
|
||||
{% endif %}
|
||||
<div class="index-text">
|
||||
<h4><a href="{{ content.get_absolute_url }}" class="big-title">{{content.title}} </a></h4>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<h6><strong>Gallery: {{gallery.title}}</strong></h6>
|
||||
<ul class="clearing-thumbs" data-clearing>
|
||||
{% for photo in gallery.public %}
|
||||
<li><a href="{{ gallery.get_absolute_url }}#{{forloop.counter}}"><img src="{{ photo.get_thumbnail_url }}"></a></li>
|
||||
<li><a href="{{ photo.get_absolute_url }}"><img src="{{ photo.get_thumbnail_url }}"></a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
<div class="large-4 medium-4 columns">
|
||||
{% include "related.html" with related=content.children.all %}
|
||||
{% if latest_content_list %}
|
||||
<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>
|
||||
{% else %}
|
||||
{% if 0 %}<p>No content.</p>{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
|
@ -1,16 +1,12 @@
|
|||
{% if content.opttext2 %}
|
||||
{% if content.optbtn2 and content.opttext2 %}
|
||||
<div class="part2">
|
||||
{% if content.optbtn2 %}
|
||||
<h4>{{ content.optbtn2|safe }} </h4>
|
||||
{% endif %}
|
||||
<p>{{ content.opttext2|safe|linebreaks }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if content.opttext3 %}
|
||||
{% if content.optbtn3 and content.opttext3 %}
|
||||
<div class="part3">
|
||||
{% if content.optbtn3 %}
|
||||
<h4>{{ content.optbtn3|safe }} </h4>
|
||||
{% endif %}
|
||||
<p>{{ content.opttext3|safe|linebreaks }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
{% include "edit.html" with content=content %}
|
||||
<div class="large-8 medium-8 columns special-column">
|
||||
<div class="index-text">
|
||||
<h4>{{content.title}}</h4>
|
||||
|
@ -13,7 +12,6 @@
|
|||
<p>
|
||||
{{content.formatted_body|safe}}
|
||||
</p>
|
||||
{% include "opt.html" with content=content %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -4,39 +4,16 @@
|
|||
{% block title %}{{ gallery.title }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="medium-9 columns">
|
||||
{% if gallery.content.exists %}
|
||||
<h6 class="page-header"><a href="{{ gallery.content.all.0.get_absolute_url }}">Back to {{ gallery.content.all.0.title }}</a></h6>
|
||||
{% endif %}
|
||||
<h5>{{ gallery.title }}</h5>
|
||||
<ul class="slider1">
|
||||
{% for photo in gallery.public %}
|
||||
<li id="slide-{{photo.slug}}">
|
||||
<img src="{{ photo.get_display_url }}" alt="{{ photo.title }}">
|
||||
<p>
|
||||
{{ photo.caption|safe }}
|
||||
{% if photo.caption %}<br>{%endif%}
|
||||
<a href="{{ photo.image.url }}" target="_blank" >Link to original file</a>
|
||||
</p>
|
||||
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="medium-3 columns">
|
||||
<br>
|
||||
<p>{% trans "Other photos" %}:</p>
|
||||
<div>
|
||||
{% for photo in gallery.public %}
|
||||
<div style="float: left; padding: 4px">
|
||||
<a href="{{ photo.get_absolute_url }}" class="select-image" data-id="{{forloop.counter}}">
|
||||
<img src="{{ photo.get_thumbnail_url }}" class="thumbnail" alt="{{ photo.title }}">
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row col-lg-12">
|
||||
<h1 class="page-header">{{ gallery.title }}</h1>
|
||||
<p class="muted"><small>{% trans "Published" %} {{ gallery.date_added }}</small></p>
|
||||
{% if gallery.description %}{{ gallery.description|safe }}{% endif %}
|
||||
{% for photo in gallery.public %}
|
||||
<a href="{{ photo.get_absolute_url }}">
|
||||
<img src="{{ photo.get_thumbnail_url }}" class="thumbnail" alt="{{ photo.title }}">
|
||||
</a>
|
||||
{% endfor %}
|
||||
<div><a href="{% url 'photologue:gallery-list' %}" class="btn btn-default">{% trans "View all galleries" %}</a></div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -4,21 +4,42 @@
|
|||
{% block title %}{{ object.title }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="medium-9 columns">
|
||||
<img src="{{ object.get_display_url }}" alt="{{ object.title }}">
|
||||
<p>
|
||||
{{ object.caption|safe }}
|
||||
{% if object.caption %}<br>{%endif%}
|
||||
<a href="{{ object.image.url }}" target="_blank" >Link to original file</a>
|
||||
</p>
|
||||
<ul>
|
||||
{% for gallery in object.public_galleries %}
|
||||
{% if gallery.content.exists %}
|
||||
<li><a href="{{ gallery.content.all.0.get_absolute_url }}">{{ gallery.content.all.0.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% for gallery in object.public_galleries %}
|
||||
<div class="row">
|
||||
<div class="medium-9 columns">
|
||||
<h5 class="page-header">From gallery {{ gallery.title }}</h5>
|
||||
<ul class="slider1">
|
||||
{% for photo.pk in gallery.public %}
|
||||
<li>
|
||||
<img src="{{ photo.get_display_url }}" alt="{{ photo.title }}">
|
||||
<br /> <p>{{ photo.caption|safe }} <a href="{{ photo.image.url }}"> Link to original file </a> </p>
|
||||
</li>
|
||||
{% for photo in gallery.public %}
|
||||
<li>
|
||||
<img src="{{ photo.get_display_url }}" alt="{{ photo.title }}">
|
||||
<br /> <p>{{ photo.caption|safe }} <a href="{{ photo.image.url }}" target="_blank" > Link to original file </a> </p>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="medium-3 columns">
|
||||
{% if object.public_galleries %}
|
||||
<p>{% trans "Other photos in the gallery" %}:</p>
|
||||
<table>
|
||||
{% for photo in gallery.public %}
|
||||
<tr>
|
||||
<td><a href="{{ photo.get_absolute_url }}">
|
||||
<img src="{{ photo.get_thumbnail_url }}" class="thumbnail" alt="{{ photo.title }}"></a></td>
|
||||
<td>
|
||||
<p>{{ photo.caption|safe }} {{ photo.count }} </p>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,30 +1,21 @@
|
|||
<div class="row right-items">
|
||||
{% if content.type.name == 'news' %}
|
||||
<div class= "small-12 columns">
|
||||
<h6 class="sidebar-date">
|
||||
<font color="#ef4e5c"> <b> {{content.datestart}} </b>
|
||||
{{ content.title }} <br />
|
||||
{{ content.formatted_header }}
|
||||
</font>
|
||||
</h6>
|
||||
<div class="row">
|
||||
<div class="row right-items">
|
||||
<div class="small-6 columns">
|
||||
{% if content.image_url %}
|
||||
<img src="{{ content.image_url }}">
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="small-6 columns">
|
||||
<a href="{{ content.get_absolute_url }}" class="sidebar-title"> {{content.title}} </a>
|
||||
{% if content.type.name == 'events' %}
|
||||
<h6 class="sidebar-date">
|
||||
<font color="#ef4e5c">
|
||||
<b> {{ content.datestart }} {% if content.dateend %} - {{content.dateend}} {% endif %} </b>
|
||||
</font>
|
||||
{% if content.place %}<br/>{{content.place}}{% endif%}
|
||||
</h6>
|
||||
{% endif %}
|
||||
<p> {{ content.formatted_teaser }} </p>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="small-6 columns">
|
||||
{% if content.image_url %}
|
||||
<a href="{{ content.get_absolute_url }}"><img src="{{ content.image_url }}"></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="small-6 columns">
|
||||
<a href="{{ content.get_absolute_url }}" class="sidebar-title"> {{content.title}} </a>
|
||||
{% if content.type.name == 'events' %}
|
||||
<h6 class="sidebar-date">
|
||||
<font color="#ef4e5c">
|
||||
<b> {{ content.datestart }} {% if content.dateend %} - {{content.dateend}} {% endif %} </b>
|
||||
</font>
|
||||
{% if content.place %}<br/>{{content.place}}{% endif%}
|
||||
</h6>
|
||||
{% endif %}
|
||||
<p> {{ content.formatted_teaser }} </p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
|
@ -1,19 +1,46 @@
|
|||
|
||||
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
{% include "edit.html" with content=projects %}
|
||||
<div class="large-8 medium-8 columns special-column">
|
||||
{% if projects.image %}
|
||||
<img src="{{ projects.image_url }}">
|
||||
|
||||
<div class="large-8 medium-8 columns special-column">
|
||||
{% if projects.image %}
|
||||
<img src="{{ projects.image_url }}">
|
||||
{% endif %}
|
||||
<div class="index-text">
|
||||
<h4><a href="{{ projects.get_absolute_url }}/" class="big-title">{{projects.title}} </a></h4>
|
||||
<p> {{projects.formatted_header|safe}} </p>
|
||||
<p> {{projects.formatted_body|safe}} </p>
|
||||
{% include "opt.html" with content=projects %}
|
||||
{% include "links.html" with content=projects %}
|
||||
{% include "gallery.html" with gallery=gallery %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% 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 %}
|
||||
<div class="index-text">
|
||||
<h4><a href="{{ projects.get_absolute_url }}/" class="big-title">{{projects.title}} </a></h4>
|
||||
<p> {{projects.formatted_header|safe}} </p>
|
||||
<p> {{projects.formatted_body|safe}} </p>
|
||||
{% include "opt.html" with content=projects %}
|
||||
{% include "links.html" with content=projects %}
|
||||
{% include "gallery.html" with gallery=gallery %}
|
||||
</div>
|
||||
</div>
|
||||
{% include "latest_content.html" with content=texts %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
{% if related %}
|
||||
<h4 class="sidebar-h4"> Related </h4>
|
||||
{% for content in related %}
|
||||
<div class="row">
|
||||
{% include "preview.html" %}
|
||||
</div>
|
||||
{% include "preview.html" %}
|
||||
{% endfor %}
|
||||
<br>
|
||||
<br>
|
||||
|
|
|
@ -5,62 +5,61 @@
|
|||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="small-4 small-offset-2 columns results-title">
|
||||
{% if section %}
|
||||
<h3> {{section }}</h3>
|
||||
{% else %}
|
||||
<h3> Search results </h3>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% for row in content %}
|
||||
{% if row.type.name == 'news' %}
|
||||
{% for content in results %}
|
||||
{% if content.type.name == 'news' %}
|
||||
<div class="row">
|
||||
<div class= "small-4 small-offset-2 columns">
|
||||
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{row.datestart}} </b>
|
||||
{{ row.title }} <br />
|
||||
{{ row.formatted_header|striptags|safe }} </font>
|
||||
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{content.datestart}} </b>
|
||||
{{ content.title }} <br />
|
||||
{{ content.formatted_header|striptags|safe }} </font>
|
||||
</h6>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% elif content.type.name == 'events' %}
|
||||
<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 %}
|
||||
<img src="{{ content.image_url }}">
|
||||
</div>
|
||||
<div class="small-4 end columns">
|
||||
<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>
|
||||
{% if row.place %}<br/> {{row.place}} {% endif%}</h6>
|
||||
{% endif %}
|
||||
<p> {{row.formatted_teaser}} </p>
|
||||
<a href="{{ row.get_absolute_url }}">read more</a> </p>
|
||||
<a href="{{ content.get_absolute_url }}" class="sidebar-title">{{ content.title }}</a>
|
||||
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ content.datestart }} {% if content.dateend %} - {{content.dateend}} {% endif %} </b></font>
|
||||
{% if content.place %}<br/> {{content.place}} {% endif%}</h6>
|
||||
<p> {{content.header|striptags|safe}} </p>
|
||||
<a href="{{ content.get_absolute_url }}">read more</a> </p>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="row">
|
||||
<div class="small-4 small-offset-2 columns">
|
||||
Add view for content type: {{content.type}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<br>
|
||||
<br>
|
||||
{% if content.has_other_pages %}
|
||||
{% if results.has_other_pages %}
|
||||
<div class="row">
|
||||
<div class="small-4 small-offset-4 columns">
|
||||
<ul class="pagination">
|
||||
{% if content.has_previous %}
|
||||
<li><a href="?{{ base_query }}&page={{ content.previous_page_number }}">«</a></li>
|
||||
{% if results.has_previous %}
|
||||
<li><a href="?q={{ query }}&page={{ results.previous_page_number }}">«</a></li>
|
||||
{% else %}
|
||||
<li class="disabled"><span>«</span></li>
|
||||
{% endif %}
|
||||
{% for i in content.paginator.page_range %}
|
||||
{% if content.number == i %}
|
||||
{% for i in results.paginator.page_range %}
|
||||
{% if results.number == i %}
|
||||
<li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
|
||||
{% else %}
|
||||
<li><a href="?{{ base_query }}page={{ i }}">{{ i }}</a></li>
|
||||
<li><a href="?q={{ query }}&page={{ i }}">{{ i }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if content.has_next %}
|
||||
<li><a href="?{{ base_query }}page={{ content.next_page_number }}">»</a></li>
|
||||
{% if results.has_next %}
|
||||
<li><a href="?q={{ query }}&page={{ results.next_page_number }}">»</a></li>
|
||||
{% else %}
|
||||
<li class="disabled"><span>»</span></li>
|
||||
{% endif %}
|
||||
|
|
|
@ -4,27 +4,22 @@
|
|||
{% include "featured.html" %}
|
||||
|
||||
<div class="large-4 medium-4 columns">
|
||||
{% if content %}
|
||||
<h4 class="sidebar-h4"> {{ section }} </h4>
|
||||
<div class="row">
|
||||
{% for content in content %}
|
||||
<div class="row right-items">
|
||||
<div class="row">
|
||||
{% for content in content %}
|
||||
<div class="row right-items">
|
||||
{% if content.image_url %}
|
||||
<div class="small-6 columns">
|
||||
<img src="{{ content.image_url }}">
|
||||
</div>
|
||||
<div class="small-6 columns">
|
||||
<img src="{{ content.image_url }}">
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="small-6 columns">
|
||||
<a href="{{ content.get_absolute_url }}/" class="sidebar-title">{{ content.title }}</a>
|
||||
<div class="small-6 columns">
|
||||
<a href="{{ content.get_absolute_url }}/" class="sidebar-title">{{ content.title }}</a>
|
||||
<p> {{content.formatted_teaser}} </p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if more_content %}
|
||||
<a href="index/">more</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,17 +1,57 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
{% include "edit.html" with content=texts %}
|
||||
<div class="large-8 medium-8 columns special-column">
|
||||
{% if texts.image %}
|
||||
<img src="{{ texts.image_url }}">
|
||||
|
||||
<div class="large-8 medium-8 columns special-column">
|
||||
{% if texts.image %}
|
||||
<img src="{{ texts.image_url }}">
|
||||
{% endif %}
|
||||
<div class="index-text">
|
||||
<h4><a href="{{ texts.get_absolute_url }}/" class="big-title">{{texts.title}} </a></h4>
|
||||
<p> {{texts.formatted_header|safe}} </p>
|
||||
<p> {{texts.formatted_body|safe}} </p>
|
||||
{% include "opt.html" with content=texts %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% 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="index-text">
|
||||
<h4><a href="{{ texts.get_absolute_url }}/" class="big-title">{{texts.title}} </a></h4>
|
||||
<p> {{texts.formatted_header|safe}} </p>
|
||||
<p> {{texts.formatted_body|safe}} </p>
|
||||
{% include "opt.html" with content=texts %}
|
||||
</div>
|
||||
</div>
|
||||
{% include "latest_content.html" with content=texts %}
|
||||
<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.header|striptags|truncatechars:100}} </p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>No texts.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,52 @@
|
|||
|
||||
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
{% include "edit.html" with content=works %}
|
||||
<div class="large-8 medium-8 columns special-column">
|
||||
{% if works.image %}
|
||||
<img src="{{ works.image_url }}">
|
||||
{% endif %}
|
||||
<div class="index-text">
|
||||
<h4><a href="{{ works.get_absolute_url }}" class="big-title">{{works.title}} </a></h4>
|
||||
<p> {{works.formatted_header|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>
|
||||
{% include "latest_content.html" with content=works %}
|
||||
|
||||
<div class="large-8 medium-8 columns special-column">
|
||||
<img src="{{ works.image_url }}">
|
||||
<div class="index-text">
|
||||
<h4><a href="{{ works.get_absolute_url }}" class="big-title">{{works.title}} </a></h4>
|
||||
<p> {{works.formatted_header|safe}} </p>
|
||||
<p> {{works.formatted_body|safe}} </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% 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.header|striptags|truncatechars:100}} </p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>No works.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
160
content/views.py
160
content/views.py
|
@ -1,6 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
@ -25,7 +24,7 @@ def index(request):
|
|||
base = base.filter(published=True)
|
||||
upcoming_events = base.filter(datestart__gt=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]
|
||||
|
||||
homepage = Content.objects.filter(type__name='homepage').order_by('-datestart')[:1]
|
||||
context = {
|
||||
|
@ -36,65 +35,21 @@ def index(request):
|
|||
return render(request, 'index.html', context)
|
||||
|
||||
|
||||
SECTION_TYPE = {
|
||||
'Projects': ['projects'],
|
||||
'Works': ['works'],
|
||||
'Texts': ['texts'],
|
||||
'Events': ['events', 'news'],
|
||||
}
|
||||
|
||||
def section_content(section):
|
||||
types = SECTION_TYPE.get(section, [section.lower()])
|
||||
content = Content.objects.filter(type__name__in=types).order_by('-datestart')
|
||||
content = content.filter(published=True)
|
||||
return content
|
||||
|
||||
|
||||
def section_index(request, section, max_length=10):
|
||||
types = SECTION_TYPE.get(section, [section.lower()])
|
||||
def section_index(request, types, section):
|
||||
featured = Content.objects.filter(type__name__in=types, featured=True).order_by('-datestart')[:1]
|
||||
content = section_content(section)
|
||||
content = Content.objects.filter(type__name__in=types).order_by('-datestart')
|
||||
if featured:
|
||||
content = content.exclude(pk=featured[0].pk)
|
||||
more_content = content.count() > max_length
|
||||
content = content[:max_length]
|
||||
content = content.filter(published=True)
|
||||
return render(request, 'section_index.html', {
|
||||
'section': section,
|
||||
'featured': featured,
|
||||
'content': content,
|
||||
'more_content': more_content,
|
||||
})
|
||||
|
||||
|
||||
def section_list(request, section):
|
||||
content = section_content(section)
|
||||
|
||||
q = request.GET.get('q')
|
||||
content = limit_content(content, q)
|
||||
|
||||
page = request.GET.get('page', 1)
|
||||
paginator = Paginator(content, 5)
|
||||
try:
|
||||
content = paginator.page(page)
|
||||
except PageNotAnInteger:
|
||||
content = paginator.page(1)
|
||||
except EmptyPage:
|
||||
content = paginator.page(paginator.num_pages)
|
||||
|
||||
base_query = ''
|
||||
if q:
|
||||
base_query = 'q=%s&' % q
|
||||
|
||||
return render(request, 'results.html', {
|
||||
'base_query': base_query,
|
||||
'content': content,
|
||||
'query': q,
|
||||
'section': section,
|
||||
'content': content
|
||||
})
|
||||
|
||||
def event(request):
|
||||
now = datetime.now()
|
||||
display_events = ['events', 'news']
|
||||
display_events = ['events']
|
||||
featured = Content.objects.filter(type__name='events', featured=True).order_by('-datestart')[:1]
|
||||
base = Content.objects.filter(type__name__in=display_events).order_by('-datestart')
|
||||
base = base.filter(published=True)
|
||||
|
@ -103,60 +58,62 @@ def event(request):
|
|||
|
||||
upcoming_events = base.filter(datestart__gt=now).order_by('-datestart')
|
||||
ongoing_events = base.filter(datestart__lt=now, dateend__gte=now).order_by('-datestart')
|
||||
past_events = base.filter(Q(dateend__lt=now) | Q(dateend=None, datestart__lt=now))[:10]
|
||||
past_events = base.filter(Q(dateend__lt=now)|Q(dateend=None, datestart__lt=now))[:10]
|
||||
|
||||
context = {
|
||||
'upcoming_events': upcoming_events,
|
||||
'ongoing_events': ongoing_events,
|
||||
'past_events': past_events,
|
||||
'featured': featured,
|
||||
'section': 'Events',
|
||||
}
|
||||
return render(request, 'event.html', context)
|
||||
|
||||
|
||||
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 section == 'Events':
|
||||
return event(request)
|
||||
else:
|
||||
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
|
||||
latest_content_list, more = get_related_content(types, content)
|
||||
return render(request, template, {
|
||||
'content': content,
|
||||
'latest_content_list': latest_content_list,
|
||||
'has_more_content': more,
|
||||
'section': section,
|
||||
})
|
||||
|
||||
|
||||
def events(request, shortname=None):
|
||||
return render_content(request, shortname, 'Events', 'content.html', ['events', 'news'])
|
||||
|
||||
if not shortname:
|
||||
return event(request)
|
||||
events = get_object_or_404(Content, shortname=shortname, type__name__in=['news', 'events'])
|
||||
if not events.published and not request.user.is_staff:
|
||||
raise Http404
|
||||
gallery = get_or_none(Gallery, slug=shortname)
|
||||
latest_content_list = Content.objects.filter(type__name='events').order_by('-datestart')[:10]
|
||||
return render(request, 'events.html', {'events': events, 'latest_content_list': latest_content_list, 'gallery': gallery})
|
||||
|
||||
def projects(request, shortname=None):
|
||||
return render_content(request, shortname, 'Projects', 'content.html', ['projects'])
|
||||
|
||||
if not shortname:
|
||||
return section_index(request, ['projects'], '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')
|
||||
return render(request, 'projects.html', {
|
||||
'projects': projects,
|
||||
'latest_content_list': latest_content_list,
|
||||
'gallery': gallery
|
||||
})
|
||||
|
||||
def works(request, shortname=None):
|
||||
return render_content(request, shortname, 'Works', 'content.html', ['works'])
|
||||
|
||||
if not shortname:
|
||||
return section_index(request, ['works'], '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')
|
||||
return render(request, 'works.html', {'works': works, 'latest_content_list': latest_content_list, 'gallery':gallery})
|
||||
|
||||
def texts(request, shortname=None):
|
||||
return render_content(request, shortname, 'Texts', 'content.html', ['texts'])
|
||||
if not shortname:
|
||||
return section_index(request, ['texts'], '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')
|
||||
return render(request, 'texts.html', {
|
||||
'texts': texts,
|
||||
'latest_content_list': latest_content_list,
|
||||
'gallery': gallery
|
||||
})
|
||||
|
||||
|
||||
def page(request, shortname):
|
||||
|
@ -166,33 +123,22 @@ def page(request, shortname):
|
|||
return render(request, 'page.html', {'content': content})
|
||||
|
||||
|
||||
def limit_content(content, q):
|
||||
if q:
|
||||
content = content.filter(Q(body__icontains=q) | Q(title__icontains=q) | Q(header__icontains=q)).distinct()
|
||||
return content
|
||||
|
||||
|
||||
def search(request):
|
||||
content = Content.objects.filter(published=True).order_by('-datestart')
|
||||
content = content.exclude(type__name__in=['page', 'homepage'])
|
||||
q = request.GET.get('q')
|
||||
content = limit_content(content, q)
|
||||
results = Content.objects.filter(Q(body__icontains=q) | Q(title__icontains=q) | Q(header__icontains=q)).distinct()
|
||||
results = results.filter(published=True)
|
||||
results = results.order_by('-datestart')
|
||||
page = request.GET.get('page', 1)
|
||||
paginator = Paginator(content, 5)
|
||||
paginator = Paginator(results, 5)
|
||||
try:
|
||||
content = paginator.page(page)
|
||||
results = paginator.page(page)
|
||||
except PageNotAnInteger:
|
||||
content = paginator.page(1)
|
||||
results = paginator.page(1)
|
||||
except EmptyPage:
|
||||
content = paginator.page(paginator.num_pages)
|
||||
|
||||
base_query = ''
|
||||
if q:
|
||||
base_query = 'q=%s&' % q
|
||||
results = paginator.page(paginator.num_pages)
|
||||
|
||||
return render(request, 'results.html', {
|
||||
'base_query': base_query,
|
||||
'content': content,
|
||||
'results': results,
|
||||
'query': q
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user