From 5fd427504699f726d15967cf5c0680c38d5623dc Mon Sep 17 00:00:00 2001 From: Tomislav R Date: Fri, 1 Apr 2016 12:37:01 +0200 Subject: [PATCH 1/3] updated main pages links --- .../cms => cms_templates}/__init__.py | 0 .../detail.html | 0 .../djangocms_blog/_header_post_detail.html | 4 +- cms_templates/djangocms_blog/base.html | 19 ++++ cms_templates/djangocms_blog/post_detail.html | 35 ++++++ cms_templates/djangocms_blog/post_list.html | 47 ++++++++ .../gallery.html | 0 cms_templates/includes/blog_item.html | 33 ++++++ cms_templates/includes/blog_meta.html | 23 ++++ .../letscowork.html | 2 +- .../one_column.html | 2 +- .../supporters_plugin.html | 0 .../two_columns.html | 2 +- digitalglarus/admin.py | 20 ++-- digitalglarus/cms_plugins.py | 66 +++++------ ..._dgpicture_dgsupportersplugin_supporter.py | 68 +++++++++++ digitalglarus/models.py | 70 ++++++------ .../{cms/digitalglarus => }/about.html | 4 +- .../base.html => base_glarus.html} | 0 .../templates/cms/digitalglarus/__init__.py | 10 -- .../templates/cms/digitalglarus/base.html | 96 ---------------- .../templates/cms/digitalglarus/index.html | 106 ------------------ .../partials/language-chooser.html | 9 -- .../cms/digitalglarus/partials/menu.html | 26 ----- .../{cms/digitalglarus => }/contact.html | 4 +- .../templates/digitalglarus/about.html | 72 ------------ .../templates/digitalglarus/contact.html | 76 ------------- .../templates/digitalglarus/detail.html | 11 -- .../templates/digitalglarus/index.html | 106 ------------------ digitalglarus/templates/glarus_blog/base.html | 4 +- .../glarus_blog/includes/blog_item.html | 2 +- .../glarus_blog/includes/blog_meta.html | 2 +- .../templates/glarus_blog/post_detail.html | 9 +- .../templates/glarus_blog/post_list.html | 4 +- digitalglarus/templates/index.html | 99 ++++++++++++++++ .../{digitalglarus => }/letscowork.html | 24 ++-- .../{digitalglarus => }/supporters.html | 2 +- digitalglarus/urls.py | 6 +- digitalglarus/views.py | 13 +-- dynamicweb/settings/base.py | 26 +++-- membership/models.py | 1 - templates/__init__.py | 20 ++-- templates/djangocms_blog/base.html | 11 -- .../djangocms_blog/includes/blog_item.html | 31 ----- templates/djangocms_blog/post_detail.html | 37 ------ templates/djangocms_blog/post_list.html | 35 ------ 46 files changed, 467 insertions(+), 770 deletions(-) rename {digitalglarus/templates/cms => cms_templates}/__init__.py (100%) rename {digitalglarus/templates/cms/digitalglarus => cms_templates}/detail.html (100%) rename {templates => cms_templates}/djangocms_blog/_header_post_detail.html (90%) create mode 100644 cms_templates/djangocms_blog/base.html create mode 100644 cms_templates/djangocms_blog/post_detail.html create mode 100644 cms_templates/djangocms_blog/post_list.html rename {digitalglarus/templates/digitalglarus => cms_templates}/gallery.html (100%) create mode 100644 cms_templates/includes/blog_item.html create mode 100644 cms_templates/includes/blog_meta.html rename {digitalglarus/templates/cms/digitalglarus => cms_templates}/letscowork.html (97%) rename {digitalglarus/templates/cms/digitalglarus => cms_templates}/one_column.html (88%) rename {digitalglarus/templates/digitalglarus => cms_templates}/supporters_plugin.html (100%) rename {digitalglarus/templates/cms/digitalglarus => cms_templates}/two_columns.html (89%) create mode 100644 digitalglarus/migrations/0004_dggallery_dggalleryplugin_dgpicture_dgsupportersplugin_supporter.py rename digitalglarus/templates/{cms/digitalglarus => }/about.html (96%) rename digitalglarus/templates/{digitalglarus/base.html => base_glarus.html} (100%) delete mode 100644 digitalglarus/templates/cms/digitalglarus/__init__.py delete mode 100644 digitalglarus/templates/cms/digitalglarus/base.html delete mode 100644 digitalglarus/templates/cms/digitalglarus/index.html delete mode 100644 digitalglarus/templates/cms/digitalglarus/partials/language-chooser.html delete mode 100644 digitalglarus/templates/cms/digitalglarus/partials/menu.html rename digitalglarus/templates/{cms/digitalglarus => }/contact.html (96%) delete mode 100755 digitalglarus/templates/digitalglarus/about.html delete mode 100755 digitalglarus/templates/digitalglarus/contact.html delete mode 100644 digitalglarus/templates/digitalglarus/detail.html delete mode 100644 digitalglarus/templates/digitalglarus/index.html create mode 100644 digitalglarus/templates/index.html rename digitalglarus/templates/{digitalglarus => }/letscowork.html (74%) rename digitalglarus/templates/{digitalglarus => }/supporters.html (94%) delete mode 100644 templates/djangocms_blog/base.html delete mode 100644 templates/djangocms_blog/includes/blog_item.html delete mode 100644 templates/djangocms_blog/post_detail.html delete mode 100644 templates/djangocms_blog/post_list.html diff --git a/digitalglarus/templates/cms/__init__.py b/cms_templates/__init__.py similarity index 100% rename from digitalglarus/templates/cms/__init__.py rename to cms_templates/__init__.py diff --git a/digitalglarus/templates/cms/digitalglarus/detail.html b/cms_templates/detail.html similarity index 100% rename from digitalglarus/templates/cms/digitalglarus/detail.html rename to cms_templates/detail.html diff --git a/templates/djangocms_blog/_header_post_detail.html b/cms_templates/djangocms_blog/_header_post_detail.html similarity index 90% rename from templates/djangocms_blog/_header_post_detail.html rename to cms_templates/djangocms_blog/_header_post_detail.html index 961e07d8..669de5bc 100644 --- a/templates/djangocms_blog/_header_post_detail.html +++ b/cms_templates/djangocms_blog/_header_post_detail.html @@ -4,6 +4,8 @@
@@ -32,4 +34,4 @@
-
+ \ No newline at end of file diff --git a/cms_templates/djangocms_blog/base.html b/cms_templates/djangocms_blog/base.html new file mode 100644 index 00000000..bbaceb61 --- /dev/null +++ b/cms_templates/djangocms_blog/base.html @@ -0,0 +1,19 @@ +{% extends 'base_glarus.html' %} + +{% block meta %} + {% if meta %} + {% include "meta_mixin/meta.html" %} + {% endif %} +{% endblock meta %} + +
+ {% block content %} +
+
+
+ {% block content_blog %}{% endblock %} +
+
+
+ {% endblock content %} +
diff --git a/cms_templates/djangocms_blog/post_detail.html b/cms_templates/djangocms_blog/post_detail.html new file mode 100644 index 00000000..197bab96 --- /dev/null +++ b/cms_templates/djangocms_blog/post_detail.html @@ -0,0 +1,35 @@ +{% extends "djangocms_blog/base.html" %} +{% load i18n thumbnail cms_tags %} + +{% block meta_description %}{{ post.meta_description }}{% endblock meta_description %} +{% block meta_keywords %}{{ post.meta_keywords }}{% endblock meta_keywords %} +{% block canonical_url %}{% endblock canonical_url %} +{% block title %}{{ post.get_title }}{% endblock %} + +{% block content_blog %}{% spaceless %} +
+ {% if post.main_image_id %} +
+ {% 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 %} + {{ post.main_image.default_alt_text }} +
+ {% endif %} +
+
+

+ + {{ post.title }} + + + {{ post.date_created }} + +

+
+ {% block blog_meta %} + {# include "glarus_blog/includes/blog_meta.html" #} + {% endblock %} +
+ {% endspaceless %} +
{% render_placeholder post.content %}
+
+{% endblock content_blog %} \ No newline at end of file diff --git a/cms_templates/djangocms_blog/post_list.html b/cms_templates/djangocms_blog/post_list.html new file mode 100644 index 00000000..eb1ce71b --- /dev/null +++ b/cms_templates/djangocms_blog/post_list.html @@ -0,0 +1,47 @@ +{% extends "djangocms_blog/base.html" %} +{% load i18n thumbnail %}{% spaceless %} + +{% block canonical_url %}{% endblock canonical_url %} + +{% block content_blog %} +
+ {% block blog_title %} +
+

+ {% if author %}{% trans "Articles by" %} {{ author.get_full_name }} + {% elif archive_date %}{% trans "Archive" %} – {% if month %}{{ archive_date|date:'F' }} {% endif %}{{ year }} + {% elif tagged_entries %}{% trans "Tag" %} – {{ tagged_entries|capfirst }} + {% elif category %}{% trans "Category" %} – {{ category }}{% endif %} +

+
+ {% endblock %} + {% for post in post_list %} + {% include "djangocms_blog/includes/blog_item.html" with post=post image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %} + {% empty %} +

{% trans "No article found." %}

+ {% endfor %} + {% if author or archive_date or tagged_entries %} +

{% trans "Back" %}

+ {% endif %} + {% if is_paginated %} + + + {% endif %} +
+{% endblock %} +{% endspaceless %} \ No newline at end of file diff --git a/digitalglarus/templates/digitalglarus/gallery.html b/cms_templates/gallery.html similarity index 100% rename from digitalglarus/templates/digitalglarus/gallery.html rename to cms_templates/gallery.html diff --git a/cms_templates/includes/blog_item.html b/cms_templates/includes/blog_item.html new file mode 100644 index 00000000..4a23f701 --- /dev/null +++ b/cms_templates/includes/blog_item.html @@ -0,0 +1,33 @@ +{% load i18n thumbnail %} +{% get_current_language as LANGUAGE_CODE %} +
+ {% if post.main_image %} +
+ {% 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 %} + {{ post.main_image.default_alt_text }} +
+ {% endif %} +
+
+

+ + {{ post.title }} + + + {{ post.date_created }} + +

+
+ {% block blog_meta %} + {# include "glarus_blog/includes/blog_meta.html" #} + {% endblock %} +
+
+

+ {{ post.abstract| safe }} +

+
+ +
\ No newline at end of file diff --git a/cms_templates/includes/blog_meta.html b/cms_templates/includes/blog_meta.html new file mode 100644 index 00000000..253dbaa7 --- /dev/null +++ b/cms_templates/includes/blog_meta.html @@ -0,0 +1,23 @@ +{% load i18n thumbnail %} + + + \ No newline at end of file diff --git a/digitalglarus/templates/cms/digitalglarus/letscowork.html b/cms_templates/letscowork.html similarity index 97% rename from digitalglarus/templates/cms/digitalglarus/letscowork.html rename to cms_templates/letscowork.html index 71b0aae7..76a5c0d4 100644 --- a/digitalglarus/templates/cms/digitalglarus/letscowork.html +++ b/cms_templates/letscowork.html @@ -1,4 +1,4 @@ -{% extends "digitalglarus/base.html" %} +{% extends "base_glarus.html" %} {% load staticfiles cms_tags %} {% block title %}crowdfunding{% endblock %} diff --git a/digitalglarus/templates/cms/digitalglarus/one_column.html b/cms_templates/one_column.html similarity index 88% rename from digitalglarus/templates/cms/digitalglarus/one_column.html rename to cms_templates/one_column.html index a808028e..b6d6495a 100644 --- a/digitalglarus/templates/cms/digitalglarus/one_column.html +++ b/cms_templates/one_column.html @@ -1,4 +1,4 @@ -{% extends "digitalglarus/base.html" %} +{% extends "base_glarus.html" %} {% load staticfiles cms_tags %} {% block title %}About{% endblock %} diff --git a/digitalglarus/templates/digitalglarus/supporters_plugin.html b/cms_templates/supporters_plugin.html similarity index 100% rename from digitalglarus/templates/digitalglarus/supporters_plugin.html rename to cms_templates/supporters_plugin.html diff --git a/digitalglarus/templates/cms/digitalglarus/two_columns.html b/cms_templates/two_columns.html similarity index 89% rename from digitalglarus/templates/cms/digitalglarus/two_columns.html rename to cms_templates/two_columns.html index 6893b5de..83f30927 100644 --- a/digitalglarus/templates/cms/digitalglarus/two_columns.html +++ b/cms_templates/two_columns.html @@ -1,4 +1,4 @@ -{% extends "cms/digitalglarus/base.html" %} +{% extends "base_glarus.html" %} {% load staticfiles cms_tags %} {% block title %}About{% endblock %} diff --git a/digitalglarus/admin.py b/digitalglarus/admin.py index 14f5af7a..92dea7a0 100644 --- a/digitalglarus/admin.py +++ b/digitalglarus/admin.py @@ -1,12 +1,12 @@ from django.contrib import admin -# from .models import Message, Supporter, DGGallery, DGPicture +from .models import Message, Supporter, DGGallery, DGPicture +# +class DGPictureInline(admin.StackedInline): + model = DGPicture -# class DGPictureInline(admin.StackedInline): -# model = DGPicture -# -# class DGGalleryAdmin(admin.ModelAdmin): -# inlines = [DGPictureInline] -# -# admin.site.register(DGGallery, DGGalleryAdmin) -# admin.site.register(Message) -# admin.site.register(Supporter) +class DGGalleryAdmin(admin.ModelAdmin): + inlines = [DGPictureInline] + +admin.site.register(DGGallery, DGGalleryAdmin) +admin.site.register(Message) +admin.site.register(Supporter) \ No newline at end of file diff --git a/digitalglarus/cms_plugins.py b/digitalglarus/cms_plugins.py index 10989df9..e58dffb9 100644 --- a/digitalglarus/cms_plugins.py +++ b/digitalglarus/cms_plugins.py @@ -1,36 +1,36 @@ -# from cms.plugin_base import CMSPluginBase -# from cms.plugin_pool import plugin_pool -# from cms.wizards import wizard_base -# from .models import DGGalleryPlugin, DGSupportersPlugin, Supporter -# from django.utils.translation import ugettext as _ - -# class CMSGalleryPlugin(CMSPluginBase): -# model = DGGalleryPlugin -# name = _("Digital Glarus Gallery") -# render_template = "digitalglarus/gallery.html" +from cms.plugin_base import CMSPluginBase +from cms.plugin_pool import plugin_pool +from cms.wizards import wizard_base +from .models import DGGalleryPlugin, DGSupportersPlugin, Supporter +from django.utils.translation import ugettext as _ # -# def render(self, context, instance, placeholder): -# context.update({ -# 'gallery':instance.dgGallery, -# 'object':instance, -# 'placeholder':placeholder -# }) -# return context +class CMSGalleryPlugin(CMSPluginBase): + model = DGGalleryPlugin + name = _("Digital Glarus Gallery") + render_template = "gallery.html" + + def render(self, context, instance, placeholder): + context.update({ + 'gallery':instance.dgGallery, + 'object':instance, + 'placeholder':placeholder + }) + return context + +class CMSSupportersPlugin(CMSPluginBase): + name = _("Digital Glarus Supporters") + model = DGSupportersPlugin + render_template = "supporters_plugin.html" + + def render(self, context, instance, placeholder): + context.update({ + 'supporters': Supporter.objects.all().order_by('name'), + 'object': instance, + 'placeholder':placeholder + }) + return context # -# class CMSSupportersPlugin(CMSPluginBase): -# name = _("Digital Glarus Supporters") -# model = DGSupportersPlugin -# render_template = "digitalglarus/supporters_plugin.html" # -# def render(self, context, instance, placeholder): -# context.update({ -# 'supporters': Supporter.objects.all().order_by('name'), -# 'object': instance, -# 'placeholder':placeholder -# }) -# return context - - - -# plugin_pool.register_plugin(CMSGalleryPlugin) -# plugin_pool.register_plugin(CMSSupportersPlugin) +# +plugin_pool.register_plugin(CMSGalleryPlugin) +plugin_pool.register_plugin(CMSSupportersPlugin) diff --git a/digitalglarus/migrations/0004_dggallery_dggalleryplugin_dgpicture_dgsupportersplugin_supporter.py b/digitalglarus/migrations/0004_dggallery_dggalleryplugin_dgpicture_dgsupportersplugin_supporter.py new file mode 100644 index 00000000..fdcb3155 --- /dev/null +++ b/digitalglarus/migrations/0004_dggallery_dggalleryplugin_dgpicture_dgsupportersplugin_supporter.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2016-03-30 22:23 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import filer.fields.image + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0013_urlconfrevision'), + ('filer', '0002_auto_20150606_2003'), + ('digitalglarus', '0003_auto_20160325_1659'), + ] + + operations = [ + migrations.CreateModel( + name='DGGallery', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=30)), + ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='digitalglarus.DGGallery')), + ], + options={ + 'verbose_name_plural': 'dgGallery', + }, + ), + migrations.CreateModel( + name='DGGalleryPlugin', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('dgGallery', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='digitalglarus.DGGallery')), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + migrations.CreateModel( + name='DGPicture', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('description', models.CharField(max_length=60)), + ('gallery', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='digitalglarus.DGGallery')), + ('image', filer.fields.image.FilerImageField(on_delete=django.db.models.deletion.CASCADE, related_name='dg_gallery', to='filer.Image')), + ], + ), + migrations.CreateModel( + name='DGSupportersPlugin', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + migrations.CreateModel( + name='Supporter', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=200)), + ('description', models.TextField(blank=True, null=True)), + ], + ), + ] diff --git a/digitalglarus/models.py b/digitalglarus/models.py index 0cc7e9fa..08e5636a 100644 --- a/digitalglarus/models.py +++ b/digitalglarus/models.py @@ -15,40 +15,40 @@ class Message(models.Model): return "%s - %s - %s" % (self.name, self.email, self.received_date) -# class Supporter(models.Model): -# name = models.CharField(max_length=200) -# description = models.TextField(null=True, blank=True) -# -# def __str__(self): -# return "%s" % (self.name) -# -# def get_absolute_url(self): -# return reverse('dgSupporters_view', args=[self.pk]) -# -# -# class DGGallery(models.Model): -# parent = models.ForeignKey('self', blank=True, null=True) -# name = models.CharField(max_length=30) -# -# def __str__(self): -# return "%s" % (self.name) -# -# def get_absolute_url(self): -# return reverse('dgGallery_view', args=[self.pk]) -# -# class Meta: -# verbose_name_plural = 'dgGallery' +class Supporter(models.Model): + name = models.CharField(max_length=200) + description = models.TextField(null=True, blank=True) -# class DGPicture(models.Model): -# gallery = models.ForeignKey(DGGallery) -# image = FilerImageField(related_name='dg_gallery') -# description = models.CharField(max_length=60) + def __str__(self): + return "%s" % (self.name) + + def get_absolute_url(self): + return reverse('dgSupporters_view', args=[self.pk]) + + +class DGGallery(models.Model): + parent = models.ForeignKey('self', blank=True, null=True) + name = models.CharField(max_length=30) + + def __str__(self): + return "%s" % (self.name) + + def get_absolute_url(self): + return reverse('dgGallery_view', args=[self.pk]) + + class Meta: + verbose_name_plural = 'dgGallery' # -# def __str__(self): -# return "%s" % (self.image.name) -# -# class DGGalleryPlugin(CMSPlugin): -# dgGallery = models.ForeignKey(DGGallery) -# -# class DGSupportersPlugin(CMSPlugin): -# pass +class DGPicture(models.Model): + gallery = models.ForeignKey(DGGallery) + image = FilerImageField(related_name='dg_gallery') + description = models.CharField(max_length=60) + + def __str__(self): + return "%s" % (self.image.name) + +class DGGalleryPlugin(CMSPlugin): + dgGallery = models.ForeignKey(DGGallery) + +class DGSupportersPlugin(CMSPlugin): + pass diff --git a/digitalglarus/templates/cms/digitalglarus/about.html b/digitalglarus/templates/about.html similarity index 96% rename from digitalglarus/templates/cms/digitalglarus/about.html rename to digitalglarus/templates/about.html index 8a0da727..a63a58ac 100755 --- a/digitalglarus/templates/cms/digitalglarus/about.html +++ b/digitalglarus/templates/about.html @@ -1,4 +1,4 @@ -{% extends "digitalglarus/base.html" %} +{% extends "base_glarus.html" %} {% load staticfiles cms_tags %} {% block title %}About{% endblock %} @@ -54,4 +54,4 @@ -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/digitalglarus/templates/digitalglarus/base.html b/digitalglarus/templates/base_glarus.html similarity index 100% rename from digitalglarus/templates/digitalglarus/base.html rename to digitalglarus/templates/base_glarus.html diff --git a/digitalglarus/templates/cms/digitalglarus/__init__.py b/digitalglarus/templates/cms/digitalglarus/__init__.py deleted file mode 100644 index 986404f9..00000000 --- a/digitalglarus/templates/cms/digitalglarus/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# -*- coding: utf-8 -*- -from django.utils.translation import ugettext_lazy as _ -TEMPLATES = { - 'about.html': _('DG.About'), - 'contact.html': _('DG.Contact'), - 'index.html': _('DG.Home'), - 'letscowork.html': _('DG.CoWork'), - 'detail.html': _('DG.Detail'), - 'one_column.html': _('DG.OneColumn'), -} diff --git a/digitalglarus/templates/cms/digitalglarus/base.html b/digitalglarus/templates/cms/digitalglarus/base.html deleted file mode 100644 index 684e92bb..00000000 --- a/digitalglarus/templates/cms/digitalglarus/base.html +++ /dev/null @@ -1,96 +0,0 @@ -{% load staticfiles cms_tags menu_tags sekizai_tags menu_tags %} - - - - - - - - - - - - - {% page_attribute "page_title" %} - - - - - - - - - - - - - - - - - - - {% render_block "css" postprocessor "compressor.contrib.sekizai.compress" %} - {% render_block "js" postprocessor "compressor.contrib.sekizai.compress" %} - - - - - {% cms_toolbar %} -
Digital Glarus
-
-{# {% placeholder 'digital_glarus_legend' %}#} -
-
- -
- - - {% include "cms/digitalglarus/partials/menu.html" %} - -
- {% block content %} {% endblock %} -
- - - - - - - - - - - - - - - - - diff --git a/digitalglarus/templates/cms/digitalglarus/index.html b/digitalglarus/templates/cms/digitalglarus/index.html deleted file mode 100644 index 22d6a2a6..00000000 --- a/digitalglarus/templates/cms/digitalglarus/index.html +++ /dev/null @@ -1,106 +0,0 @@ -{% extends "digitalglarus/base.html" %} -{% load staticfiles %} - -{% block content %} -
-
-
- -

- WELCOME TO -

-

Digital Glarus

-
-

- By - ungleich gmbh - -

-
-
-
- -
-
-
-
-

Build a tech valley in the heart of switzerland

-
- -
-

Digital Glarus, this is how we call the new home for high tech companies. Located south of Zurich, it has unique features you can not find anywhere else in Switzerland.

-

The combination of beautiful landscape, recreational areas as well as having high speed Internet connections and huge variety of great food offers forms what we call "Digital Glarus".

-

The valley also known as "Glarnerland" has many gorgeous, eye-catching buildings from former industrial area.

-

In fact, Glarnerland may be the valley to contain most well preserved antique houses equipped with high quality old age furniture (those you always look at in expensive stores, but never buy - this is how people live here).

-

 

-
-
-
- -
-
-
-
-

a new area -

-
-

While you can imagine that the old factories, many of them being weaving mills, are not running anymore, their heritage suits exactly what the tech society of Switzerland requires: Great and affordable place for computer scientists.

-

We are building the new tech centre of Switzerland by converting old, abandoned buidings into attractive co-working spaces.

-

But what is attractive to a computer scientist? Pizza, Coke and fast Internet? The latter is a still true, though computer scientists in Switzerland are more orientated on living healthy, which is exactly what Glarnerland can provide.

-
-
-
- -
-
-
-
-

Why would anyone be interested in it?

-
-

The current de-facto tech centre of Switzerland, Zurich, is overpopulated with an average of less than 0.1% free apartments.Crowded, expensive and loud, to be exact.. Although the density of population is helpful for businesses in finding customers, most tech companies are making their business on the Internet and are flexible in change of location. Why not start from beautiful, empty buildings so many available in Glarus? We are aware of the fact that some investment of time, money and passion will be required to be actually attractive for tech companies to come here. Nonetheless, the overall cost required will be significantly lower than staying in an already overcrowded city.

-
-
-
-
-
-
-
-

Wherewe are

-
-

At the moment we at ungleich are talking to authorities and  sponsors. It is crucial to build up some basic infrastructure and  attract early adopters. Building a community (meetup alike)  can be helpful, but competitive pricing as well as superior infrastructure are crucial for success.

-

The great first step we (ungleich) took is purchasing a charming old house in Schwanden, Glarus. This is our prototype for reviving Glarus and bringing in talents here. We plan to open this place up for Tech companies as a co-working space. We are working tightly with local authorities and supporters. It is crucial to build up some basic infrastructure, and also welcome early adopters. We want Glarus and the IT communities in Switzerland to get on this train, to a great journey we plan through the beautiful valley of Glarus.

-

Have you become interested in the project? -

Contact us at
-
- - digitalglarus@ungleich.ch - // +41 (0) 44 534 66 22 -

-

-

 

-
-
-
- -{% endblock %} diff --git a/digitalglarus/templates/cms/digitalglarus/partials/language-chooser.html b/digitalglarus/templates/cms/digitalglarus/partials/language-chooser.html deleted file mode 100644 index c3b75cd6..00000000 --- a/digitalglarus/templates/cms/digitalglarus/partials/language-chooser.html +++ /dev/null @@ -1,9 +0,0 @@ -{% load i18n menu_tags %} - -{% if languages|length > 1 %} -{% for language in languages %} -
  • - {{ language.1 }} -
  • -{% endfor %} -{% endif %} diff --git a/digitalglarus/templates/cms/digitalglarus/partials/menu.html b/digitalglarus/templates/cms/digitalglarus/partials/menu.html deleted file mode 100644 index b7d223fa..00000000 --- a/digitalglarus/templates/cms/digitalglarus/partials/menu.html +++ /dev/null @@ -1,26 +0,0 @@ -{% load menu_tags staticfiles cms_tags %} - - diff --git a/digitalglarus/templates/cms/digitalglarus/contact.html b/digitalglarus/templates/contact.html similarity index 96% rename from digitalglarus/templates/cms/digitalglarus/contact.html rename to digitalglarus/templates/contact.html index 01a57109..11767a8a 100755 --- a/digitalglarus/templates/cms/digitalglarus/contact.html +++ b/digitalglarus/templates/contact.html @@ -1,4 +1,4 @@ -{% extends "digitalglarus/base.html" %} +{% extends "base_glarus.html" %} {% load cms_tags %} {% block title %}Contact{% endblock %} @@ -62,4 +62,4 @@ -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/digitalglarus/templates/digitalglarus/about.html b/digitalglarus/templates/digitalglarus/about.html deleted file mode 100755 index 6aa4a185..00000000 --- a/digitalglarus/templates/digitalglarus/about.html +++ /dev/null @@ -1,72 +0,0 @@ -{% extends "digitalglarus/base.html" %} -{% load staticfiles %} -{% block title %}About{% endblock %} - -{% block content %} -
    -
    -
    -
    -

    why - Us? -

    -
    -
    -
    - -
    -
    -

    - We, the ungleich GmbH, were founded 2013 in Switzerland - - however our first incarnation in Germany dates back to 2000. - We have long knowledge in tech industry, and have extensive - networks with small to medium tech companies in Switzerland, - because we are one of them. We have been working at coworking - spaces with these small to medium sized IT companies ; - tech-savvy and flexible, tech companies have open culture in - work environment, and very often experience difficulty in - letting their employees be as creative as possible. We - understand and share their needs and problems. This is how we - came up with a solution of our own, of finding and providing - an attractive working space for technology companies - in Switzerland. -

    -
    -
    -
    -
    - -
    -
    -
    -
    -

    why - glarus? -

    -
    -
    -
    - -

    BEAUTIFUL - landscape -

    -
    -
    - -

    AFFORDABLE - price

    -
    -
    - -

    direct - connection to zurich -

    -
    -
    -
    -
    - - - - -{% endblock %} diff --git a/digitalglarus/templates/digitalglarus/contact.html b/digitalglarus/templates/digitalglarus/contact.html deleted file mode 100755 index 0736ff78..00000000 --- a/digitalglarus/templates/digitalglarus/contact.html +++ /dev/null @@ -1,76 +0,0 @@ -{% extends "digitalglarus/base.html" %} - -{% block title %}Contact{% endblock %} - -{% block content %} -
    -
    -
    -
    -

    Contact - DIGITAL GLARUS -

    -
    -
    -
    - - -
    -
    -

    Phone: - +41 (0) 44 534 66 22 -

    -

    Email: - digitalglarus@ungleich.ch -

    -

    Address: - Hauptstrasse 14, 8775 Luchsingen
    -

    -
    -
    -
    -
    - -
    -
    -
    -
    -

    Contact - form -

    -
    -

    If you want further information on Digital Glarus, please send us a message using the form below.

    -
    - {% csrf_token %} -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    -
    - - -
    -
    - - -
    -
    -
    -
    -
    -
    - - - - -{% endblock %} diff --git a/digitalglarus/templates/digitalglarus/detail.html b/digitalglarus/templates/digitalglarus/detail.html deleted file mode 100644 index 412a6b91..00000000 --- a/digitalglarus/templates/digitalglarus/detail.html +++ /dev/null @@ -1,11 +0,0 @@ -

    {{ message }}

    - - - -

    Back to Main diff --git a/digitalglarus/templates/digitalglarus/index.html b/digitalglarus/templates/digitalglarus/index.html deleted file mode 100644 index 22d6a2a6..00000000 --- a/digitalglarus/templates/digitalglarus/index.html +++ /dev/null @@ -1,106 +0,0 @@ -{% extends "digitalglarus/base.html" %} -{% load staticfiles %} - -{% block content %} -

    -
    -
    - -

    - WELCOME TO -

    -

    Digital Glarus

    -
    -

    - By - ungleich gmbh - -

    -
    -
    -
    - -
    -
    -
    -
    -

    Build a tech valley in the heart of switzerland

    -
    - -
    -

    Digital Glarus, this is how we call the new home for high tech companies. Located south of Zurich, it has unique features you can not find anywhere else in Switzerland.

    -

    The combination of beautiful landscape, recreational areas as well as having high speed Internet connections and huge variety of great food offers forms what we call "Digital Glarus".

    -

    The valley also known as "Glarnerland" has many gorgeous, eye-catching buildings from former industrial area.

    -

    In fact, Glarnerland may be the valley to contain most well preserved antique houses equipped with high quality old age furniture (those you always look at in expensive stores, but never buy - this is how people live here).

    -

     

    -
    -
    -
    - -
    -
    -
    -
    -

    a new area -

    -
    -

    While you can imagine that the old factories, many of them being weaving mills, are not running anymore, their heritage suits exactly what the tech society of Switzerland requires: Great and affordable place for computer scientists.

    -

    We are building the new tech centre of Switzerland by converting old, abandoned buidings into attractive co-working spaces.

    -

    But what is attractive to a computer scientist? Pizza, Coke and fast Internet? The latter is a still true, though computer scientists in Switzerland are more orientated on living healthy, which is exactly what Glarnerland can provide.

    -
    -
    -
    - -
    -
    -
    -
    -

    Why would anyone be interested in it?

    -
    -

    The current de-facto tech centre of Switzerland, Zurich, is overpopulated with an average of less than 0.1% free apartments.Crowded, expensive and loud, to be exact.. Although the density of population is helpful for businesses in finding customers, most tech companies are making their business on the Internet and are flexible in change of location. Why not start from beautiful, empty buildings so many available in Glarus? We are aware of the fact that some investment of time, money and passion will be required to be actually attractive for tech companies to come here. Nonetheless, the overall cost required will be significantly lower than staying in an already overcrowded city.

    -
    -
    -
    -
    -
    -
    -
    -

    Wherewe are

    -
    -

    At the moment we at ungleich are talking to authorities and  sponsors. It is crucial to build up some basic infrastructure and  attract early adopters. Building a community (meetup alike)  can be helpful, but competitive pricing as well as superior infrastructure are crucial for success.

    -

    The great first step we (ungleich) took is purchasing a charming old house in Schwanden, Glarus. This is our prototype for reviving Glarus and bringing in talents here. We plan to open this place up for Tech companies as a co-working space. We are working tightly with local authorities and supporters. It is crucial to build up some basic infrastructure, and also welcome early adopters. We want Glarus and the IT communities in Switzerland to get on this train, to a great journey we plan through the beautiful valley of Glarus.

    -

    Have you become interested in the project? -

    Contact us at
    -
    - - digitalglarus@ungleich.ch - // +41 (0) 44 534 66 22 -

    -

    -

     

    -
    -
    -
    - -{% endblock %} diff --git a/digitalglarus/templates/glarus_blog/base.html b/digitalglarus/templates/glarus_blog/base.html index 40ad0c65..a7ecc8a6 100644 --- a/digitalglarus/templates/glarus_blog/base.html +++ b/digitalglarus/templates/glarus_blog/base.html @@ -1,4 +1,4 @@ -{% extends "digitalglarus/base.html" %} +{% extends "base_glarus.html" %} {% block meta %} {% if meta %} @@ -16,4 +16,4 @@ {% endblock content %} - + \ No newline at end of file diff --git a/digitalglarus/templates/glarus_blog/includes/blog_item.html b/digitalglarus/templates/glarus_blog/includes/blog_item.html index 4a776bee..667c0111 100644 --- a/digitalglarus/templates/glarus_blog/includes/blog_item.html +++ b/digitalglarus/templates/glarus_blog/includes/blog_item.html @@ -29,4 +29,4 @@
    {% trans "read more" %} »
    - + \ No newline at end of file diff --git a/digitalglarus/templates/glarus_blog/includes/blog_meta.html b/digitalglarus/templates/glarus_blog/includes/blog_meta.html index b9e78570..253dbaa7 100644 --- a/digitalglarus/templates/glarus_blog/includes/blog_meta.html +++ b/digitalglarus/templates/glarus_blog/includes/blog_meta.html @@ -20,4 +20,4 @@
  • {{ tag.name }}{% if not forloop.last %}, {% endif %}
  • {% endfor %} {% endif %} - + \ No newline at end of file diff --git a/digitalglarus/templates/glarus_blog/post_detail.html b/digitalglarus/templates/glarus_blog/post_detail.html index cd89f8f2..807fad33 100644 --- a/digitalglarus/templates/glarus_blog/post_detail.html +++ b/digitalglarus/templates/glarus_blog/post_detail.html @@ -1,4 +1,4 @@ -{% extends "glarus_blog/base.html" %} +{% extends "base_glarus.html" %} {% load i18n thumbnail cms_tags %} {% block meta_description %}{{ post.meta_description }}{% endblock meta_description %} @@ -7,7 +7,6 @@ {% block title %}{{ post.get_title }}{% endblock %} {% block content_blog %}{% spaceless %} - {% debug %}
    {% if post.main_image_id %}
    @@ -18,7 +17,7 @@

    - + {{ post.title }} @@ -27,10 +26,10 @@


    {% block blog_meta %} - include "glarus_blog/includes/blog_meta.html" + {# include "glarus_blog/includes/blog_meta.html" #} {% endblock %}
    {% endspaceless %}
    {% render_placeholder post.content %}
    -{% endblock content_blog %} +{% endblock content_blog %} \ No newline at end of file diff --git a/digitalglarus/templates/glarus_blog/post_list.html b/digitalglarus/templates/glarus_blog/post_list.html index a05ae060..cfd90d3e 100644 --- a/digitalglarus/templates/glarus_blog/post_list.html +++ b/digitalglarus/templates/glarus_blog/post_list.html @@ -1,4 +1,4 @@ -{% extends "glarus_blog/base.html" %} +{% extends "base.html" %} {% load i18n thumbnail %}{% spaceless %} {% block canonical_url %}{% endblock canonical_url %} @@ -32,4 +32,4 @@ {% endif %} {% endblock %} -{% endspaceless %} +{% endspaceless %} \ No newline at end of file diff --git a/digitalglarus/templates/index.html b/digitalglarus/templates/index.html new file mode 100644 index 00000000..d7894fb2 --- /dev/null +++ b/digitalglarus/templates/index.html @@ -0,0 +1,99 @@ +{% extends "base_glarus.html" %} +{% load staticfiles cms_tags %} + +{% block content %} +
    +
    +
    + +

    + WELCOME TO +

    +

    Digital Glarus

    +
    +

    + By + ungleich gmbh + +

    +
    +
    +
    + +
    +
    +
    +
    +

    + {% placeholder 'digital_glarus_build_a_tech_valley' %} +

    +
    + +
    + {% placeholder 'digital_glarus_build_a_tech_valley_content' %} +

     

    +
    +
    +
    + +
    +
    +
    +
    +

    + {% placeholder 'digital_glarus_a_new_area' %} +

    +
    + {% placeholder 'digital_glarus_a_new_area_content' %} +
    +
    +
    + +
    +
    +
    +
    +

    + {% placeholder 'digital_glarus_why_be_interested' %} +

    +
    + {% placeholder 'digital_glarus_why_be_interested_content' %} +
    +
    +
    +
    +
    +
    +
    +

    + {% placeholder 'digital_glarus_where_we_are' %} +

    +
    + {% placeholder 'digital_glarus_where_we_are_content' %} +

     

    +
    +
    +
    + +{% endblock %} \ No newline at end of file diff --git a/digitalglarus/templates/digitalglarus/letscowork.html b/digitalglarus/templates/letscowork.html similarity index 74% rename from digitalglarus/templates/digitalglarus/letscowork.html rename to digitalglarus/templates/letscowork.html index 518e1224..56f42cd6 100644 --- a/digitalglarus/templates/digitalglarus/letscowork.html +++ b/digitalglarus/templates/letscowork.html @@ -1,5 +1,5 @@ -{% extends "digitalglarus/base.html" %} -{% load staticfiles %} +{% extends "base_glarus.html" %} +{% load staticfiles cms_tags %} {% block title %}crowdfunding{% endblock %} {% block content %} @@ -18,34 +18,36 @@ + +

    -

    why - glarus? +

    + {% placeholder 'digitalglarus_why_glarus' %}


    -

    BEAUTIFUL - landscape +

    + {% placeholder 'digitalglarus_why_glarus_beautiful_landscape' %}

    -

    AFFORDABLE - price

    + {% placeholder 'digitalglarus_why_glarus_affordable_price' %} +
    -

    direct - connection to zurich + {% placeholder 'digitalglarus_why_glarus_direct_connection_zurich' %}

    + -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/digitalglarus/templates/digitalglarus/supporters.html b/digitalglarus/templates/supporters.html similarity index 94% rename from digitalglarus/templates/digitalglarus/supporters.html rename to digitalglarus/templates/supporters.html index aa2d1fbf..9b1c4dbf 100644 --- a/digitalglarus/templates/digitalglarus/supporters.html +++ b/digitalglarus/templates/supporters.html @@ -1,4 +1,4 @@ -{% extends "digitalglarus/base.html" %} +{% extends "base_glarus.html" %} {% load staticfiles %} {% block title %}About{% endblock %} diff --git a/digitalglarus/urls.py b/digitalglarus/urls.py index e8e97351..9e7e6002 100644 --- a/digitalglarus/urls.py +++ b/digitalglarus/urls.py @@ -3,13 +3,9 @@ from django.conf.urls import url from . import views urlpatterns = [ - url(r'old^$', views.index, name='index'), - url(r'old_about$', views.about, name='about'), url(r'old_contact$', views.contact, name='contact'), - url(r'old_letscowork$', views.letscowork, name='letscowork'), - url(r'old_home$', views.home, name='home'), url(r'supporters/$', views.supporters, name='supporters'), - url(r'', views.index, name='index'), + # url(r'', views.index, name='index'), url(r'blog/',views.blog,name='blog'), url(r'^blog/(?P\w[-\w]*)/$', views.blog_detail, name='blog-detail'), ] diff --git a/digitalglarus/views.py b/digitalglarus/views.py index 617c1522..3fe04e88 100644 --- a/digitalglarus/views.py +++ b/digitalglarus/views.py @@ -8,7 +8,7 @@ from django.utils.translation import get_language from djangocms_blog.models import Post from django.core.urlresolvers import resolve -from .models import Message#, Supporter +from .models import Message, Supporter class MessageForm(ModelForm): required_css_class = 'form-control' @@ -36,7 +36,7 @@ def index(request): return home(request) def home(request): - return render(request, 'digitalglarus/index.html') + return render(request, 'index.html') def letscowork(request): return render(request, 'digitalglarus/letscowork.html') @@ -62,7 +62,7 @@ def contact(request): def blog(request): tags = ["digitalglarus"] - posts = Post.objects.filter(tags__name__in=tags) + posts = Post.objects.filter_by_language(get_language()).filter(tags__name__in=tags) context = { 'post_list': posts, } @@ -70,16 +70,15 @@ def blog(request): def blog_detail(request, slug): - language = get_language() - post = Post.objects.translated('en-us', slug=slug).get() + post = Post.objects.filter_by_language(get_language()).filter(slug=slug).first() context = { 'post': post, } - return render(request, 'glarus_blog/post_detail.html', context) + return render(request, 'post_detail.html', context) def supporters(request): context = { 'supporters': Supporter.objects.order_by('name') } - return render(request, 'digitalglarus/supporters.html', context) + return render(request, 'supporters.html', context) diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 2e69a003..37561a74 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -131,13 +131,9 @@ ROOT_URLCONF = 'dynamicweb.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [ - os.path.join(PROJECT_DIR, 'membership/'), # membership template - os.path.join(PROJECT_DIR, 'templates/'), - os.path.join(PROJECT_DIR, 'templates/digitalglarus/partials'), - os.path.join(PROJECT_DIR, 'templates/cms'), - os.path.join(PROJECT_DIR, 'templates/digitalglarus'), - ], + 'DIRS': [os.path.join(PROJECT_DIR,'cms_templates/'), + os.path.join(PROJECT_DIR,'cms_templates/djangocms_blog/') + ], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -158,11 +154,17 @@ TEMPLATES = [ WSGI_APPLICATION = 'dynamicweb.wsgi.application' -TDIR = os.path.join(PROJECT_DIR, 'templates') - -CMS_TEMPLATES_DIR = { - 1: os.path.join(TDIR, '') -} +CMS_TEMPLATES = ( + ('base_glarus.html', gettext('default')), + ('one_column.html', gettext('2 Column')), + ('two_columns.html', gettext('3 Column')), + ('about.html', gettext('DG.About')), + ('contact.html', gettext('DG.Contact')), + ('index.html', gettext('DG.Home')), + ('letscowork.html', gettext('DG.CoWork')), + ('detail.html', gettext('DG.Detail')), + ('one_column.html', gettext('DG.OneColumn')) +) DATABASES = { 'default': { diff --git a/membership/models.py b/membership/models.py index 4cb0ba6c..34390c45 100644 --- a/membership/models.py +++ b/membership/models.py @@ -101,7 +101,6 @@ class CustomUser(AbstractBaseUser): return self.email def has_perm(self, perm, obj=None): - print(perm) "Does the user have a specific permission?" # Simplest possible answer: Yes, always return True diff --git a/templates/__init__.py b/templates/__init__.py index eafdc433..44a1270e 100644 --- a/templates/__init__.py +++ b/templates/__init__.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- -from django.utils.translation import ugettext_lazy as _ -TEMPLATES = { - 'digitalglarus/about.html': _('DG.About'), - 'digitalglarus/contact.html': _('DG.Contact'), - 'digitalglarus/index.html': _('DG.Home'), - 'digitalglarus/letscowork.html': _('DG.CoWork'), - 'digitalglarus/one_column.html': _('DG.OneColumn'), - 'ungleichch/blog.html': _('Blog'), - 'ungleichch/page.html': _('Page'), -} +# from django.utils.translation import ugettext_lazy as _ +# TEMPLATES = { +# 'digitalglarus/about.html': _('DG.About'), +# 'digitalglarus/contact.html': _('DG.Contact'), +# 'digitalglarus/index.html': _('DG.Home'), +# 'digitalglarus/letscowork.html': _('DG.CoWork'), +# 'digitalglarus/one_column.html': _('DG.OneColumn'), +# 'ungleichch/blog.html': _('Blog'), +# 'ungleichch/page.html': _('Page'), +# } diff --git a/templates/djangocms_blog/base.html b/templates/djangocms_blog/base.html deleted file mode 100644 index 7cfd39aa..00000000 --- a/templates/djangocms_blog/base.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends CMS_TEMPLATE %} -{% block meta %} - {% if meta %} - {% include "meta_mixin/meta.html" %} - {% endif %} -{% endblock meta %} -{% block content %} -
    - {% block content_blog %}{% endblock %} -
    -{% endblock content %} diff --git a/templates/djangocms_blog/includes/blog_item.html b/templates/djangocms_blog/includes/blog_item.html deleted file mode 100644 index 0ec8535a..00000000 --- a/templates/djangocms_blog/includes/blog_item.html +++ /dev/null @@ -1,31 +0,0 @@ -{% load i18n thumbnail cms_tags %} - -
    - -

    - {{ post.title }} -

    -

    - {% if not TRUNCWORDS_COUNT %} - {% render_model post "abstract" %} - {% else %} - {% render_model post "abstract" "" "" 'truncatewords_html:TRUNCWORDS_COUNT' %} - {% endif %} -

    -
    - -
    -
    diff --git a/templates/djangocms_blog/post_detail.html b/templates/djangocms_blog/post_detail.html deleted file mode 100644 index 82a5be02..00000000 --- a/templates/djangocms_blog/post_detail.html +++ /dev/null @@ -1,37 +0,0 @@ -{% extends "glarus_blog/base.html" %} -{% load i18n thumbnail cms_tags %} - -{% block meta_description %}{{ post.meta_description }}{% endblock meta_description %} -{% block meta_keywords %}{{ post.meta_keywords }}{% endblock meta_keywords %} -{% block canonical_url %} - {% endblock canonical_url %} -{% block title %}{{ post.get_title }}{% endblock %} - -{% block content_blog %}{% spaceless %} -
    - {% if post.main_image_id %} -
    - {% 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 %} - {{ post.main_image.default_alt_text }} -
    - {% endif %} -
    -
    -

    - - {{ post.title }} - - - {{ post.date_created }} - -

    -
    -{# {% block blog_meta %}#} -{# include "glarus_blog/includes/blog_meta.html"#} -{# {% endblock %}#} -
    -{% endspaceless %} -
    {% render_placeholder post.content %}
    -
    -{% endblock content_blog %} \ No newline at end of file diff --git a/templates/djangocms_blog/post_list.html b/templates/djangocms_blog/post_list.html deleted file mode 100644 index c062eae6..00000000 --- a/templates/djangocms_blog/post_list.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends "glarus_blog/base.html" %} -{% load i18n thumbnail %}{% spaceless %} - -{% block canonical_url %}{% endblock canonical_url %} - -{% block content_blog %} -
    - {% block blog_title %} -
    -
    - {% endblock %} - {% for post in post_list %} - {% include "glarus_blog/includes/blog_item.html" with post=post image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %} - {% empty %} -

    {% trans "No article found." %}

    - {% endfor %} - {% if author or archive_date or tagged_entries %} -

    {% trans "Back" %}

    - {% endif %} - {% if is_paginated %} - - {% endif %} -
    -{% endblock %} -{% endspaceless %} \ No newline at end of file From 24badb1a9cc31b42d0299ebc46984fc055c31535 Mon Sep 17 00:00:00 2001 From: Tomislav R Date: Sun, 3 Apr 2016 11:46:25 +0200 Subject: [PATCH 2/3] updated ungleich --- digitalglarus/views.py | 2 +- dynamicweb/settings/base.py | 14 ++- dynamicweb/urls.py | 2 + ungleich/templates/cms/ungleichch/__init__.py | 8 +- .../cms/ungleichch/_header_base.html | 4 +- .../{base.html => base_ungleich.html} | 0 .../{blog.html => blog_ungleich.html} | 2 +- ungleich/templates/cms/ungleichch/index.html | 2 +- ungleich/templates/cms/ungleichch/page.html | 2 +- .../ungleich/djangocms_blog/base.html | 12 +++ .../djangocms_blog/includes/blog_item.html | 31 +++++++ .../ungleich/djangocms_blog/post_detail.html | 49 ++++++++++ .../djangocms_blog/post_list_ungleich.html | 90 +++++++++++++++++++ ungleich/urls.py | 8 ++ ungleich/views.py | 46 +++++++++- 15 files changed, 258 insertions(+), 14 deletions(-) rename ungleich/templates/cms/ungleichch/{base.html => base_ungleich.html} (100%) rename ungleich/templates/cms/ungleichch/{blog.html => blog_ungleich.html} (66%) create mode 100644 ungleich/templates/ungleich/djangocms_blog/base.html create mode 100644 ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html create mode 100644 ungleich/templates/ungleich/djangocms_blog/post_detail.html create mode 100644 ungleich/templates/ungleich/djangocms_blog/post_list_ungleich.html create mode 100644 ungleich/urls.py diff --git a/digitalglarus/views.py b/digitalglarus/views.py index 3fe04e88..4f45cf1b 100644 --- a/digitalglarus/views.py +++ b/digitalglarus/views.py @@ -62,7 +62,7 @@ def contact(request): def blog(request): tags = ["digitalglarus"] - posts = Post.objects.filter_by_language(get_language()).filter(tags__name__in=tags) + posts = Post.objects.filter_by_language(get_language()).filter(tags__name__in=tags).filter(slug=slug) context = { 'post_list': posts, } diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 37561a74..f6486c56 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -132,7 +132,12 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(PROJECT_DIR,'cms_templates/'), - os.path.join(PROJECT_DIR,'cms_templates/djangocms_blog/') + os.path.join(PROJECT_DIR,'cms_templates/djangocms_blog/'), + os.path.join(PROJECT_DIR,'membership'), + os.path.join(PROJECT_DIR,'ungleich/templates/djangocms_blog/'), + os.path.join(PROJECT_DIR,'ungleich/templates/cms/ungleichch'), + os.path.join(PROJECT_DIR,'ungleich/templates/ungleich') + ], 'APP_DIRS': True, 'OPTIONS': { @@ -162,8 +167,11 @@ CMS_TEMPLATES = ( ('contact.html', gettext('DG.Contact')), ('index.html', gettext('DG.Home')), ('letscowork.html', gettext('DG.CoWork')), - ('detail.html', gettext('DG.Detail')), - ('one_column.html', gettext('DG.OneColumn')) + # ('detail.html', gettext('DG.Detail')), + ('one_column.html', gettext('DG.OneColumn')), + #ungleich + ('blog_ungleich.html', gettext('Blog')), + ('page.html', gettext('Page')), ) DATABASES = { diff --git a/dynamicweb/urls.py b/dynamicweb/urls.py index 7f06be82..1d5e5823 100644 --- a/dynamicweb/urls.py +++ b/dynamicweb/urls.py @@ -18,6 +18,8 @@ urlpatterns = [ # note the django CMS URLs included via i18n_patterns urlpatterns += i18n_patterns('', + url(r'^$',include('ungleich.urls')), + url(r'^blog/',include('ungleich.urls',namespace='ungleich')), url(r'^login/',include(membership_urls)), url(r'^admin/', include(admin.site.urls)), url(r'^digitalglarus/', include('digitalglarus.urls', diff --git a/ungleich/templates/cms/ungleichch/__init__.py b/ungleich/templates/cms/ungleichch/__init__.py index 403fbcc0..c2394ab6 100644 --- a/ungleich/templates/cms/ungleichch/__init__.py +++ b/ungleich/templates/cms/ungleichch/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ -TEMPLATES = { - 'blog.html': _('Blog'), - 'page.html': _('Page'), -} +# TEMPLATES = { +# 'blog_u.html': _('Blog'), +# 'page.html': _('Page'), +# } diff --git a/ungleich/templates/cms/ungleichch/_header_base.html b/ungleich/templates/cms/ungleichch/_header_base.html index 43e535f6..35e1973c 100644 --- a/ungleich/templates/cms/ungleichch/_header_base.html +++ b/ungleich/templates/cms/ungleichch/_header_base.html @@ -2,8 +2,8 @@
    + {% block content_blog %}{% endblock %} + +{% endblock content %} \ No newline at end of file diff --git a/ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html b/ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html new file mode 100644 index 00000000..0ec8535a --- /dev/null +++ b/ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html @@ -0,0 +1,31 @@ +{% load i18n thumbnail cms_tags %} + +
    + +

    + {{ post.title }} +

    +

    + {% if not TRUNCWORDS_COUNT %} + {% render_model post "abstract" %} + {% else %} + {% render_model post "abstract" "" "" 'truncatewords_html:TRUNCWORDS_COUNT' %} + {% endif %} +

    +
    + +
    +
    diff --git a/ungleich/templates/ungleich/djangocms_blog/post_detail.html b/ungleich/templates/ungleich/djangocms_blog/post_detail.html new file mode 100644 index 00000000..3139c71c --- /dev/null +++ b/ungleich/templates/ungleich/djangocms_blog/post_detail.html @@ -0,0 +1,49 @@ +{% extends "ungleich/djangocms_blog/base.html" %} +{% load i18n thumbnail cms_tags %} +{% block meta_description %}{{ post.meta_description }}{% endblock meta_description %} +{% block meta_keywords %}{{ post.meta_keywords }}{% endblock meta_keywords %} +{% block canonical_url %}{% endblock canonical_url %} +{% block title %}{% page_attribute "page_title" %} - {{ post.get_title }}{% endblock %} + +{% block base_header %} +{% include "_header_post_detail.html" %} +{% endblock %} + +{% block content_blog %} +
    + {% if post.app_config.use_placeholder %} +
    {% render_placeholder post.content %}
    + {% else %} +
    {% render_model post "post_text" "post_text" %}
    + {% endif %} +
    +{% endblock content_blog %} +{#{% load i18n thumbnail cms_tags %}#} +{##} +{#{% block meta_description %}{{ post.meta_description }}{% endblock meta_description %}#} +{#{% block meta_keywords %}{{ post.meta_keywords }}{% endblock meta_keywords %}#} +{#{% block canonical_url %}{% endblock canonical_url %}#} +{#{% block title %}{{ post.get_title }}{% endblock %}#} +{##} +{#{% block content_blog %}{% spaceless %}#} +{#
    #} +{#
    #} +{#

    {% render_model post "title" %}

    #} +{# {% block blog_meta %}#} +{# {% include "djangocms_blog/includes/blog_meta.html" %}#} +{# {% endblock %}#} +{#
    #} +{# {% if post.main_image_id %}#} +{#
    #} +{# {% 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 %}#} +{# {{ post.main_image.default_alt_text }}#} +{#
    #} +{# {% endif %}#} +{# {% endspaceless %}#} +{# {% if post.app_config.use_placeholder %}#} +{#
    {% render_placeholder post.content %}
    #} +{# {% else %}#} +{#
    {% render_model post "post_text" "post_text" %}
    #} +{# {% endif %}#} +{#
    #} +{#{% endblock content_blog %}#} \ No newline at end of file diff --git a/ungleich/templates/ungleich/djangocms_blog/post_list_ungleich.html b/ungleich/templates/ungleich/djangocms_blog/post_list_ungleich.html new file mode 100644 index 00000000..e377fa90 --- /dev/null +++ b/ungleich/templates/ungleich/djangocms_blog/post_list_ungleich.html @@ -0,0 +1,90 @@ +{% extends "ungleich/djangocms_blog/base.html" %} +{% load i18n thumbnail %}{% spaceless %} + +{% block canonical_url %}{% endblock canonical_url %} + +{% block content_blog %} +
    + {% block blog_title %} +
    +

    + {% if author %}{% trans "Articles by" %} {{ author.get_full_name }} + {% elif archive_date %}{% trans "Archive" %} – {% if month %}{{ archive_date|date:'F' }} {% endif %}{{ year }} + {% elif tagged_entries %}{% trans "Tag" %} – {{ tagged_entries|capfirst }} + {% elif category %}{% trans "Category" %} – {{ category }}{% endif %} +

    +
    + + {% endblock %} + {% for post in post_list %} + {% include "ungleich/djangocms_blog/includes/blog_item.html" with post=post image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %} + {% empty %} +

    {% trans "No article found." %}

    + {% endfor %} + {% if author or archive_date or tagged_entries %} +

    {% trans "Back" %}

    + {% endif %} + {% if is_paginated %} + + + {% endif %} +
    +{% endblock %} +{% endspaceless %} + + +{#{% load i18n thumbnail %}{% spaceless %}#} +{##} +{#{% block canonical_url %}{% endblock canonical_url %}#} +{##} +{#{% block content_blog %}#} +{#
    #} +{# {% block blog_title %}#} +{#
    #} +{#

    #} +{# {% if author %}{% trans "Articles by" %} {{ author.get_full_name }}#} +{# {% elif archive_date %}{% trans "Archive" %} – {% if month %}{{ archive_date|date:'F' }} {% endif %}{{ year }}#} +{# {% elif tagged_entries %}{% trans "Tag" %} – {{ tagged_entries|capfirst }}#} +{# {% elif category %}{% trans "Category" %} – {{ category }}{% endif %}#} +{#

    #} +{#
    #} +{# {% endblock %}#} +{# {% for post in post_list %}#} +{# {% include "djangocms_blog/includes/blog_item.html" with post=post image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %}#} +{# {% empty %}#} +{#

    {% trans "No article found." %}

    #} +{# {% endfor %}#} +{# {% if author or archive_date or tagged_entries %}#} +{#

    {% trans "Back" %}

    #} +{# {% endif %}#} +{# {% if is_paginated %}#} +{# #} +{# {% endif %}#} +{#
    #} +{#{% endblock %}#} +{#{% endspaceless %}#} \ No newline at end of file diff --git a/ungleich/urls.py b/ungleich/urls.py new file mode 100644 index 00000000..8e768c6e --- /dev/null +++ b/ungleich/urls.py @@ -0,0 +1,8 @@ +from django.conf.urls import url +from . import views + +urlpatterns = [ + url(r'^$',views.PostListViewUngleich.as_view()), + # url(r'^$',views.PostListView.as_view()), + url(r'^(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/(?P\w[-\w]*)/$',views.details) +] \ No newline at end of file diff --git a/ungleich/views.py b/ungleich/views.py index 91ea44a2..238632b5 100644 --- a/ungleich/views.py +++ b/ungleich/views.py @@ -1,3 +1,47 @@ from django.shortcuts import render +from django.utils.translation import get_language +from djangocms_blog.models import Post +from django.views.generic import ListView +from djangocms_blog.views import PostListView,BaseBlogView +from django.core.paginator import Paginator +from django.core.paginator import PageNotAnInteger +from django.core.paginator import EmptyPage +from djangocms_blog.settings import get_setting -# Create your views here. + +def blog(request): + posts = Post.objects.all() + print(posts) + context = { + 'post_list': posts + } + + # PostListView.base_template_name='post_list.html' + return render(request, 'ungleich/djangocms_blog/post_list_ungleich.html', context=context) + + +class PostListViewUngleich(PostListView): + model = Post + context_object_name = 'post_list' + base_template_name = 'post_list_ungleich.html' + paginate_by = 5 + + def get_context_data(self, **kwargs): + context = super(PostListView, self).get_context_data(**kwargs) + context['TRUNCWORDS_COUNT'] = get_setting('POSTS_LIST_TRUNCWORDS_COUNT') + return context + + def get_paginate_by(self, queryset): + return get_setting('PAGINATION') + + def get_queryset(self): + language = get_language() + queryset = self.model.objects.translated(language) + setattr(self.request, get_setting('CURRENT_NAMESPACE'), self.config) + return queryset + + +def details(request, year, month, day, slug): + post = Post.objects.translated(get_language(), slug=slug).first() + context = {'post': post} + return render(request, 'ungleich/djangocms_blog/post_detail.html', context=context) From 858b3ccafafa90a7879f6906a36c22823cb8575b Mon Sep 17 00:00:00 2001 From: Raul Ascencio Date: Mon, 4 Apr 2016 03:32:22 +0200 Subject: [PATCH 3/3] blog dg fix --- digitalglarus/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/digitalglarus/views.py b/digitalglarus/views.py index 4f45cf1b..3fe04e88 100644 --- a/digitalglarus/views.py +++ b/digitalglarus/views.py @@ -62,7 +62,7 @@ def contact(request): def blog(request): tags = ["digitalglarus"] - posts = Post.objects.filter_by_language(get_language()).filter(tags__name__in=tags).filter(slug=slug) + posts = Post.objects.filter_by_language(get_language()).filter(tags__name__in=tags) context = { 'post_list': posts, }