Merge branch 'develop' of github.com:ungleich/dynamicweb into develop

This commit is contained in:
Levi 2016-04-09 03:00:41 -05:00
commit 45aaec38cf
13 changed files with 171 additions and 43 deletions

View file

@ -60,6 +60,7 @@
{% cms_toolbar %}
<div class="brand">Digital Glarus</div>
<div class="address-bar">The Swiss IT Valley | Schwanden, 8762 GL Switzerland | From 2015.10.13</div>
<div>{% language_chooser "language_chooser.html" %}</div>
<!-- Navigation -->
<nav class="navbar navbar-default" role="navigation">
@ -79,11 +80,18 @@
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
{% show_menu 0 0 0 1 %}
{# <pre> {% filter force_escape %} {% debug %} {% endfilter %} </pre>#}
{# {% show_menu 0 0 0 1 %}#}
<li>
<a href="{% url 'pages-root' %}">Home</a>
</li>
{% show_menu_below_id "digital-glarus-page" 0 %}
<li>
<a href="{% url 'digitalglarus:supporters' %}">Supporters</a>
</li>
<li>
<a href="{% url 'digitalglarus:blog' %}">Blog</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->

View file

@ -1,32 +1,34 @@
{% load i18n thumbnail %}
<article id="post-{{ post.slug }}" class="post-item col-lg-12 text-center">
{% if post.main_image %}
<div class="blog-visual">
{% thumbnail post.main_image post.full_image_options.size crop=post.full_image_options.crop upscale=post.full_image_options.upscale subject_location=post.main_image.subject_location as thumb %}
<img src="{{ post.main_image.url }}" alt="{{ post.main_image.default_alt_text }}" class="img-responsive img-full" />
</div>
{% endif %}
<header>
<hr></hr>
<h2 class="text-center intro-text">
<a href="{% url 'djangocms_blog:post-detail' post.slug %}" class="post-title center-block">
<b>{{ post.title }}</b>
</a>
<small>
{{ post.date_created }}
</small>
</h2>
<hr></hr>
{% block blog_meta %}
{# include "glarus_blog/includes/blog_meta.html" #}
{% endblock %}
</header>
<div class="blog-lead text-center blog-abstract center-block">
<p>
{{ post.abstract| safe }}
</p>
</div>
<div class="read-more">
<a class="lead" href="{% url 'djangocms_blog:post-detail' post.slug %}">{% trans "read more" %} &raquo;</a>
</div>
{% if post.main_image %}
<div class="blog-visual">
{% thumbnail post.main_image post.full_image_options.size crop=post.full_image_options.crop upscale=post.full_image_options.upscale subject_location=post.main_image.subject_location as thumb %}
<img src="{{ post.main_image.url }}" alt="{{ post.main_image.default_alt_text }}"
class="img-responsive img-full"/>
</div>
{% endif %}
<header>
<hr>
<h2 class="text-center intro-text">
<a href="{{ post.slug }}" class="post-title center-block">
<b>{{ post.title }}</b>
</a>
<small>
{{ post.date_created }}
</small>
</h2>
<hr></hr>
{# {% block blog_meta %}#}
{# {% include "glarus_blog/includes/blog_meta.html" %}#}
{# {% endblock %}#}
</header>
<div class="blog-lead text-center blog-abstract center-block">
<p>
{{ post.abstract| safe }}
</p>
</div>
<div class="read-more">
<a class="lead"
href="{% url 'digitalglarus:blog-detail' post.slug %}">{% trans "read more" %} &raquo;</a>
</div>
</article>

View file

@ -1,4 +1,4 @@
{% extends "base_glarus.html" %}
{% extends "base.html" %}
{% load i18n thumbnail cms_tags %}
{% block meta_description %}{{ post.meta_description }}{% endblock meta_description %}

View file

@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "glarus_blog/base.html" %}
{% load i18n thumbnail %}{% spaceless %}
{% block canonical_url %}<link rel="canonical" href="{{ SITE.domain }}{{ view.get_view_url }}"/>{% endblock canonical_url %}

View file

@ -0,0 +1,13 @@
{% load i18n menu_tags %}
{% if languages|length > 1 %}
<div class="center-block"">
<ul class="list-inline center-block language-chooser-list">
{% for language in languages %}
<li class="lang{% if current_language == language.0 %} active{% endif %}">
<a href="{% page_language_url language.0 %}"
title="{% trans "Change to language:" %} {{ language.1 }}">{{ language.1 }}</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}

View file

@ -8,6 +8,6 @@ urlpatterns = [
url(_(r'contact/?$'), ContactView.as_view(), name='contact'),
url(_(r'supporters/?$'), views.supporters, name='supporters'),
url(_(r'support-us/?$'), views.support, name='support'),
url(r'blog/',views.blog,name='blog'),
url(r'^blog/(?P<slug>\w[-\w]*)/$', views.blog_detail, name='blog-detail'),
]
url(r'blog/$', views.blog, name='blog'),
]

View file

@ -64,11 +64,14 @@ def blog(request):
def blog_detail(request, slug):
post = Post.objects.filter_by_language(get_language()).filter(slug=slug).first()
# post = Post.objects.filter_by_language(get_language()).filter(slug=slug).first()
language = 'en-us' # currently nothing is translated to german so we give then en
post = Post.objects.translated(language, slug=slug).first()
context = {
'post': post,
}
return render(request, 'post_detail.html', context)
return render(request, 'glarus_blog/post_detail.html', context)
def support(request):