- {% for entry in newsfeed %}
+ {% for entry in blogentries %}
{% if entry.header_image %}
@@ -15,7 +15,7 @@
{% if entry.excerpt %}
{{ entry.excerpt|striptags }}
{% else %}
- {{ entry.body|striptags|truncatewords_html:70 }}
+ {{ entry.body|striptags|truncatewords_html:40 }}
{% endif %}
Mehr erfahren
diff --git a/publichealth/home/templates/puput/blog_page.html b/publichealth/home/templates/puput/blog_page.html
index 38d342f..7a2ccbc 100644
--- a/publichealth/home/templates/puput/blog_page.html
+++ b/publichealth/home/templates/puput/blog_page.html
@@ -20,6 +20,7 @@
+
{% endblock social_share %}
{% block content %}
@@ -56,4 +57,8 @@
{% endwith %}
+
+
+ RSS Feed
+
{% endblock content %}
diff --git a/publichealth/home/templatetags/navigation.py b/publichealth/home/templatetags/navigation.py
index 7ea6d0f..78e1ebd 100644
--- a/publichealth/home/templatetags/navigation.py
+++ b/publichealth/home/templatetags/navigation.py
@@ -39,7 +39,10 @@ def top_menu(context, parent, calling_page=None):
menuitem.show_dropdown = has_menu_children(menuitem)
menuitem.active = (calling_page.url.startswith(menuitem.url)
if calling_page else False)
- menuitem.title = menuitem.trans_title
+ try:
+ menuitem.title = menuitem.trans_title
+ except AttributeError:
+ pass
return {
'calling_page': calling_page,
'menuitems': menuitems,
@@ -49,7 +52,10 @@ def top_menu(context, parent, calling_page=None):
def menuitems_children(parent):
menuitems_children = parent.get_children().live().in_menu().specific()
for menuitem in menuitems_children:
- menuitem.title = menuitem.trans_title
+ try:
+ menuitem.title = menuitem.trans_title
+ except AttributeError:
+ pass
return menuitems_children
# Retrieves the children of the top menu items for the drop downs
diff --git a/publichealth/settings/base.py b/publichealth/settings/base.py
index 0aa5702..13a16c0 100644
--- a/publichealth/settings/base.py
+++ b/publichealth/settings/base.py
@@ -28,6 +28,7 @@ INSTALLED_APPS = [
'wagtail.contrib.wagtailsearchpromotions',
'wagtail.contrib.wagtailroutablepage',
'wagtail.contrib.wagtailsitemaps',
+ 'wagtail.contrib.modeladmin',
'wagtail.contrib.settings',
'wagtail.wagtailforms',
'wagtail.wagtailredirects',
@@ -41,11 +42,15 @@ INSTALLED_APPS = [
'wagtail.wagtailadmin',
'wagtail.wagtailcore',
+ 'wagtail.api.v2',
+ 'rest_framework',
+
'modelcluster',
'compressor',
'taggit',
'puput',
'anymail',
+ 'feedler',
'django.contrib.admin',
'django.contrib.auth',
diff --git a/publichealth/static/css/modules/_news.scss b/publichealth/static/css/modules/_news.scss
index ea71ef4..b3edf6a 100644
--- a/publichealth/static/css/modules/_news.scss
+++ b/publichealth/static/css/modules/_news.scss
@@ -2,21 +2,13 @@
// News overview
#news {
- .panel-default {
+ .panel-default, .panel-fulltext {
font-size: 90%;
padding-top: 75%; /* 1:1 Aspect Ratio */
position: relative; /* If you want text inside of it */
overflow: hidden;
background: lighten($brand-primary, 10%);
- img {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- }
-
.panel-body {
position: absolute;
top: 0;
@@ -24,10 +16,7 @@
width: 100%;
height: 100%;
padding: 0;
- transform: translateY(60%);
background-color: rgba($brand-primary, .8);
- transition: transform .65s;
-
h3, p {
color: white;
}
@@ -58,9 +47,6 @@
text-align: center;
}
}
- &:hover .panel-body {
- transform: rotateY(0);
- }
// expand link over the thumbnail
a.fill {
@@ -72,6 +58,23 @@
font-size: 0;
}
}
+
+ .panel-default {
+ img {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: auto;
+ }
+ .panel-body {
+ transform: translateY(60%);
+ transition: transform .65s;
+ }
+ &:hover .panel-body {
+ transform: rotateY(0);
+ }
+ }
}
// News detail article
diff --git a/publichealth/static/js/main.js b/publichealth/static/js/main.js
index 1eafc03..3c51033 100644
--- a/publichealth/static/js/main.js
+++ b/publichealth/static/js/main.js
@@ -1,5 +1,11 @@
$(document).ready(function() {
+ // All external links in a new window
+ $('a[href^="http"]').filter(function() {
+ return this.hostname && this.hostname !== location.hostname;
+ }).attr('target', '_blank');
+
+ // Initialise front page carousel component
$('.carousel-inner.slick').slick({
autoplay: true,
autoplaySpeed: '10000',
@@ -12,4 +18,11 @@ $(document).ready(function() {
nextArrow: '
Next',
});
+ // Formatting of live news
+ $('.feedpage-body .panel').each(function() {
+ var hue = Math.floor(Math.random() * 360);
+ var pastel = 'hsl(' + hue + ', 100%, 87.5%)';
+ $(this).css('border-top', '3px solid ' + pastel);
+ });
+
});
diff --git a/publichealth/urls.py b/publichealth/urls.py
index 1b7d87a..b7d6cbb 100644
--- a/publichealth/urls.py
+++ b/publichealth/urls.py
@@ -6,13 +6,16 @@ from django.conf.urls.i18n import i18n_patterns
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtaildocs import urls as wagtaildocs_urls
from wagtail.wagtailcore import urls as wagtail_urls
+
from puput import urls as puput_urls
+from feedler import urls as feedler_urls
from publichealth.search import views as search_views
-
urlpatterns = [
url(r'', include(puput_urls)),
+ url(r'', include(feedler_urls)),
+
url(r'^django-admin/', include(admin.site.urls)),
url(r'^admin/', include(wagtailadmin_urls)),
diff --git a/requirements.txt b/requirements.txt
index 1f5a1a5..2fb4de8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,8 +1,8 @@
# Updated: 30.5.2017
# Core
-wagtail==1.10.1
-Django==1.11.1
+wagtail==1.11
+Django==1.11.3
# Database
psycopg2==2.7.1
@@ -19,8 +19,8 @@ django-redis==4.8.0
# Frontend
django-libsass==0.7
-libsass==0.12.3
-Pillow==4.1.1
+libsass==0.13.2
+Pillow==4.2.0
# Development tools
stellar==0.4.3
diff --git a/tests/testapp/settings.py b/tests/testapp/settings.py
index 91bc60b..603a7f6 100644
--- a/tests/testapp/settings.py
+++ b/tests/testapp/settings.py
@@ -1,5 +1,6 @@
import os
from puput import PUPUT_APPS
+from feedler import FEEDLER_APPS
WAGTAIL_SITE_NAME = 'Public Health'
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -16,6 +17,7 @@ INSTALLED_APPS = (
'django.contrib.staticfiles',
)
INSTALLED_APPS += PUPUT_APPS
+INSTALLED_APPS += FEEDLER_APPS
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',