home added and assigned right template
This commit is contained in:
parent
b411479283
commit
36b99b93ef
12 changed files with 156 additions and 42 deletions
|
|
@ -80,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 -->
|
||||
|
|
|
|||
|
|
@ -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" %} »</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" %} »</a>
|
||||
</div>
|
||||
</article>
|
||||
|
|
@ -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 %}
|
||||
|
|
|
|||
|
|
@ -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 %}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ urlpatterns = [
|
|||
url(r'old_contact$', views.contact, name='contact'),
|
||||
url(r'supporters/$', views.supporters, name='supporters'),
|
||||
# url(r'', views.index, name='index'),
|
||||
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'),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -70,11 +70,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 supporters(request):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue