portal cms apphook and various fixes
This commit is contained in:
@@ -3,6 +3,16 @@
|
||||
padding: em(100px) 0 0;
|
||||
will-change: transform, height;
|
||||
text-align: left;
|
||||
.section__title {
|
||||
padding-left: 75%;
|
||||
}
|
||||
}
|
||||
|
||||
.control_panel, .downloads__frame {
|
||||
.section__title {
|
||||
position: relative;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
|
||||
.information__form {
|
||||
@@ -189,6 +199,9 @@
|
||||
padding: em(150px) 0;
|
||||
position: relative;
|
||||
will-change: transform;
|
||||
.section__title {
|
||||
padding-left: 25%;
|
||||
}
|
||||
.downloads {
|
||||
li {
|
||||
width: 33.3333%;
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
width: em(12px);
|
||||
height: em(12px);
|
||||
top: em(-1px);
|
||||
margin-right: em(10px);
|
||||
margin-left: em(10px);
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: $medium_breakpoint) {
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
}
|
||||
|
||||
.form__field--icon {
|
||||
input {
|
||||
input[type="text"], input[type="email"], input[type="number"], input[type="password"] {
|
||||
height: em(70px);
|
||||
padding: 0 em(90px) 0 em(15px);
|
||||
}
|
||||
|
||||
14
settings.py
14
settings.py
@@ -33,8 +33,7 @@ INSTALLED_APPS.extend([
|
||||
'image_cropping',
|
||||
])
|
||||
|
||||
|
||||
LOGIN_REDIRECT_URL = 'portal:overview'
|
||||
LOGIN_REDIRECT_URL = 'login_redirect'
|
||||
|
||||
MIDDLEWARE_CLASSES.extend([
|
||||
# add your own middlewares here
|
||||
@@ -92,7 +91,18 @@ CMS_PLACEHOLDER_CONF = {
|
||||
'plugins': ['TimetablePlugin'],
|
||||
},
|
||||
'social_media': {
|
||||
'name': 'Social Media',
|
||||
'plugins': ['SocialMediaListPlugin'],
|
||||
'limits': {
|
||||
'global': 1,
|
||||
},
|
||||
},
|
||||
'portal_intro': {
|
||||
'name': 'Portal Intro',
|
||||
'plugins': ['IntroImagePlugin'],
|
||||
'limits': {
|
||||
'global': 1,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
11
src/portal/cms_apps.py
Normal file
11
src/portal/cms_apps.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from cms.app_base import CMSApp
|
||||
from cms.apphook_pool import apphook_pool
|
||||
|
||||
|
||||
@apphook_pool.register
|
||||
class PortalApphook(CMSApp):
|
||||
name = 'Portal'
|
||||
app_name = 'portal'
|
||||
|
||||
def get_urls(self, page=None, language=None, **kwargs):
|
||||
return ['portal.urls']
|
||||
@@ -1,5 +1,5 @@
|
||||
{% extends 'main.html' %}
|
||||
{% load i18n static %}
|
||||
{% load i18n static cms_tags %}
|
||||
|
||||
{% block title %}{% trans 'Mitgliederbereich' %}{% endblock %}
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
<span class="button__text">{% trans 'Logout' %}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="content__intro__image scroll reveal reveal_animation" data-ease-multiplier="-2"
|
||||
style="background-image: url({% static 'img/portal_background.jpg' %})"></div>
|
||||
{% static_placeholder 'portal_intro' %}
|
||||
</div>
|
||||
<div class="content__container">
|
||||
<div class="content__main">
|
||||
@@ -88,10 +87,12 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% trans 'Einstellungen' as settings_section_title %}
|
||||
{% include 'project/plugins/content/section_title.html' with section_title=settings_section_title %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="downloads" class="downloads__frame reveal_self reveal reveal_animation">
|
||||
<div id="downloads" class="downloads__frame">
|
||||
<h2 class="reveal_self reveal reveal_animation">{% trans 'Downloads' %}</h2>
|
||||
<form class="downloads__filter reveal_self reveal reveal_animation"
|
||||
action="{{ request.path }}#downloads" method="get">
|
||||
@@ -110,6 +111,8 @@
|
||||
{% include 'project/plugins/content/download_section.html' with instance=section %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% trans 'Downloads' as downloads_section_title %}
|
||||
{% include 'project/plugins/content/section_title.html' with section_title=downloads_section_title %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,7 @@ from mailchimp3 import MailChimp
|
||||
from project.forms import NewsletterSubscriptionForm
|
||||
from project.models import Section, Quote, SliderItem, SectionText, Video, DownloadSection, DownloadSectionFolder, \
|
||||
TextSliderItem, HighlightListItem, ReferenceListItem, SocialMediaList, SocialMediaListItem, Timetable, \
|
||||
TimetableItem, Partner, HighlightList, Image, TitleListItem, TitleList
|
||||
TimetableItem, Partner, HighlightList, Image, TitleListItem, TitleList, IntroImage
|
||||
|
||||
|
||||
@plugin_pool.register_plugin
|
||||
@@ -37,6 +37,14 @@ class SectionTitlePlugin(CMSPluginBase):
|
||||
render_template = 'project/plugins/content/section_title.html'
|
||||
|
||||
|
||||
@plugin_pool.register_plugin
|
||||
class IntroImagePlugin(CMSPluginBase):
|
||||
model = IntroImage
|
||||
module = 'Intro'
|
||||
name = 'Intro Image'
|
||||
render_template = 'project/plugins/content/intro_image.html'
|
||||
|
||||
|
||||
plugin_pool.unregister_plugin(_TextPlugin)
|
||||
|
||||
|
||||
|
||||
35
src/project/migrations/0006_introimage.py
Normal file
35
src/project/migrations/0006_introimage.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.11 on 2018-03-23 10:12
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import image_cropping.fields
|
||||
import project.utils
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.FILER_IMAGE_MODEL),
|
||||
('cms', '0018_pagenode'),
|
||||
('project', '0005_auto_20180322_1612'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='IntroImage',
|
||||
fields=[
|
||||
('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='project_introimage', serialize=False, to='cms.CMSPlugin')),
|
||||
('cropping', image_cropping.fields.ImageRatioField('image', '1000x1000', adapt_rotation=False, allow_fullsize=False, free_crop=True, help_text=None, hide_image_field=False, size_warning=False, verbose_name='cropping')),
|
||||
('image', project.utils.CroppableFilerImageField(on_delete=django.db.models.deletion.CASCADE, to=settings.FILER_IMAGE_MODEL, verbose_name='Bild')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
'verbose_name_plural': 'intro Bilder',
|
||||
'verbose_name': 'Intro Bild',
|
||||
},
|
||||
bases=('cms.cmsplugin',),
|
||||
),
|
||||
]
|
||||
@@ -42,6 +42,15 @@ class SectionText(CMSPlugin):
|
||||
verbose_name_plural = 'Section Texts'
|
||||
|
||||
|
||||
class IntroImage(CMSPlugin):
|
||||
image = CroppableFilerImageField(verbose_name='Bild')
|
||||
cropping = ImageRatioField('image', '1000x1000', free_crop=True)
|
||||
|
||||
class Meta(CMSPlugin.Meta):
|
||||
verbose_name = 'Intro Bild'
|
||||
verbose_name_plural = 'intro Bilder'
|
||||
|
||||
|
||||
class Video(CMSPlugin):
|
||||
vimeo_id = models.IntegerField(verbose_name='Vimeo ID', help_text='e.g. https://vimeo.com/<b>131766159</b>')
|
||||
thumbnail = CroppableFilerImageField(verbose_name='Vorschaubild')
|
||||
|
||||
@@ -121,12 +121,16 @@
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<a href="#" class="footer__login header__button header__button--light data_id_1">
|
||||
<span class="header__button__icon">
|
||||
{% include 'project/assets/arrow-right-long.svg' %}
|
||||
</span>
|
||||
{% trans 'Login' %}
|
||||
</a>
|
||||
{% page_url 'cta' as cta_url %}
|
||||
{% if cta_url %}
|
||||
<a href="{{ cta_url }}"
|
||||
class="footer__login header__button header__button--light header__button--reverse data_id_1">
|
||||
{% trans 'Kontakt aufnehmen' %}
|
||||
<span class="header__button__icon">
|
||||
{% include 'project/assets/arrow-right-long.svg' %}
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
<div class="footer__content">
|
||||
{% show_menu_below_id 'footer' 0 0 0 0 'project/includes/header_button_menu.html' %}
|
||||
{% static_placeholder 'social_media' %}
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
<div class="content__navigation__frame">
|
||||
<div class="content__navigation__main">
|
||||
<span class="content__navigation__title">
|
||||
{% block navigation_title %}{{ request.current_page }}{% endblock %}
|
||||
{% block navigation_title %}
|
||||
{% if request.current_page %}{{ request.current_page }}{% endif %}
|
||||
{% endblock %}
|
||||
</span>
|
||||
<div class="content__navigation__content">
|
||||
<div class="content__navigation__progress">
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
{% load menu_tags %}
|
||||
{% load i18n cms_tags menu_tags %}
|
||||
|
||||
{% for child in children %}
|
||||
<a href="{{ child.attr.redirect_url|default:child.get_absolute_url }}"
|
||||
class="header__button header__button--light data_id_{{ forloop.counter0 }}">
|
||||
{{ child.get_menu_title }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% page_url 'portal' as portal_url %}
|
||||
{% if portal_url %}
|
||||
<a href="{{ portal_url }}"
|
||||
class="header__button header__button--light data_id_{{ children|length|add:1 }}">
|
||||
{% trans 'Login' %}
|
||||
</a>
|
||||
{% endif %}
|
||||
@@ -5,6 +5,18 @@
|
||||
|
||||
<div class="navigation__footer">
|
||||
{% include 'project/includes/meta_navigation.html' %}
|
||||
|
||||
{% page_url 'cta' as cta_url %}
|
||||
{% if cta_url %}
|
||||
<a href="{{ cta_url }}"
|
||||
class="footer__login header__button header__button--light header__button--reverse data_id_1">
|
||||
{% trans 'Kontakt aufnehmen' %}
|
||||
<span class="header__button__icon">
|
||||
{% include 'project/assets/arrow-right-long.svg' %}
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<div class="navigation__meta">
|
||||
{% show_menu_below_id 'footer' 0 0 0 0 'project/includes/header_button_menu.html' %}
|
||||
</div>
|
||||
@@ -18,11 +30,5 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<a href="{% url 'portal:overview' %}" class="footer__login header__button header__button--light header__button--reverse data_id_1">
|
||||
<span class="header__button__icon">
|
||||
{% include 'project/assets/arrow-right-long.svg' %}
|
||||
</span>
|
||||
{% trans 'Login' %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,5 +1,9 @@
|
||||
{% extends 'project/content.html' %}
|
||||
|
||||
{% block extra_meta %}
|
||||
<meta name="robots" content="noindex, nofollow"/>
|
||||
{% endblock %}
|
||||
|
||||
{% block content_main %}
|
||||
{% include 'project/newsletter/subscription_form.html' %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,5 @@
|
||||
{% load thumbnail %}
|
||||
|
||||
{% thumbnail instance.image 1600x800 box=instance.cropping crop detail as thumb %}
|
||||
<div class="content__intro__image scroll reveal reveal_animation" data-ease-multiplier="-2"
|
||||
style="background-image: url({{ thumb.url }})"></div>
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="section__title reveal_self reveal reveal_animation">
|
||||
<div class="section__title__main">
|
||||
<div class="section__title__content scroll" data-scroll-mod="horizontal"
|
||||
data-ease-multiplier="5"></div>
|
||||
data-ease-multiplier="5">{{ section_title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3,7 +3,7 @@ from django.conf.urls import url, include
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views.generic.base import TemplateView
|
||||
|
||||
from project.views import SearchView, NewsletterSubscriptionView
|
||||
from project.views import SearchView, NewsletterSubscriptionView, LoginRedirectView
|
||||
|
||||
urlpatterns = [
|
||||
url(_(r'^suche/'), SearchView.as_view(), kwargs={'search': True}, name='search'),
|
||||
@@ -11,6 +11,5 @@ urlpatterns = [
|
||||
url(r'^newsletter/subscription/success/$',
|
||||
TemplateView.as_view(template_name='project/newsletter/subscription.html'), kwargs={'success': True},
|
||||
name='newsletter_subscription_success'),
|
||||
|
||||
url(_(r'^portal/'), include('portal.urls', namespace='portal')),
|
||||
url(r'^login/redirect/$', LoginRedirectView.as_view(), name='login_redirect'),
|
||||
]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from aldryn_search.views import AldrynSearchView
|
||||
from cms.models import Page
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.views.generic import RedirectView
|
||||
from django.views.generic.edit import FormView
|
||||
|
||||
from project.forms import NewsletterSubscriptionForm
|
||||
@@ -22,3 +24,18 @@ class NewsletterSubscriptionView(FormView):
|
||||
template_name = 'project/newsletter/subscription.html'
|
||||
form_class = NewsletterSubscriptionForm
|
||||
success_url = reverse_lazy('newsletter_subscription_success')
|
||||
|
||||
|
||||
class LoginRedirectView(RedirectView):
|
||||
|
||||
def get_redirect_url(self, *args, **kwargs):
|
||||
fallback_url = '/'
|
||||
try:
|
||||
portal_page = Page.objects.public().get(reverse_id='portal')
|
||||
portal_url = portal_page.get_public_url()
|
||||
if portal_url:
|
||||
return portal_url
|
||||
else:
|
||||
return fallback_url
|
||||
except Page.DoesNotExist:
|
||||
return fallback_url
|
||||
|
||||
Reference in New Issue
Block a user