Merge pull request #542 from tiwariav/task/video_cover

video slider cms plugin
This commit is contained in:
Arvind Tiwari 2017-12-23 02:18:31 +05:30 committed by GitHub
commit 8fad2ef09d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 266 additions and 27 deletions

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-13 17:59+0000\n" "POT-Creation-Date: 2017-12-22 01:00+0530\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -316,6 +316,9 @@ msgstr ""
msgid "Forgot password?" msgid "Forgot password?"
msgstr "Passwort vergessen?" msgstr "Passwort vergessen?"
msgid "Resend activation link"
msgstr "Aktivierungslink noch einmal senden"
msgid "Sign up" msgid "Sign up"
msgstr "Registrieren" msgstr "Registrieren"

View file

@ -7,7 +7,8 @@ from .models import (
UngleichHeaderItem, UngleichProductItem, UngleichProduct, UngleichCustomer, UngleichHeaderItem, UngleichProductItem, UngleichProduct, UngleichCustomer,
UngleichCustomerItem, UngleichHTMLOnly, UngleichSimpleHeader, UngleichCustomerItem, UngleichHTMLOnly, UngleichSimpleHeader,
UngleichHeaderWithBackgroundImageSlider, UngleichHeaderWithBackgroundImageSlider,
UngleichHeaderWithBackgroundImageSliderItem UngleichHeaderWithBackgroundImageSliderItem,
UngleichHeaderWithBackgroundVideoSliderItem,
) )
@ -235,13 +236,33 @@ class UngleichHeaderBackgroundImageAndTextSliderPlugin(CMSPluginBase):
) )
cache = False cache = False
allow_children = True allow_children = True
child_classes = ['UngleichHeaderBackgroundImageAndTextItemPlugin'] child_classes = [
'UngleichHeaderBackgroundImageAndTextItemPlugin',
'UngleichHeaderBackgroundVideoItemPlugin',
]
def render(self, context, instance, placeholder): def render(self, context, instance, placeholder):
context['instance'] = instance context['instance'] = instance
return context return context
@plugin_pool.register_plugin
class UngleichHeaderBackgroundVideoItemPlugin(CMSPluginBase):
name = "ungleich Header Background Video Item Plugin"
model = UngleichHeaderWithBackgroundVideoSliderItem
render_template = "ungleich_page/ungleich/_header_with_background_video_slider_item.html"
cache = False
require_parent = True
parent_classes = ['UngleichHeaderBackgroundImageAndTextSliderPlugin']
def render(self, context, instance, placeholder):
context = super(UngleichHeaderBackgroundVideoItemPlugin, self).render(
context, instance, placeholder
)
context['instance'] = instance
return context
@plugin_pool.register_plugin @plugin_pool.register_plugin
class UngleichHeaderBackgroundImageAndTextItemPlugin(CMSPluginBase): class UngleichHeaderBackgroundImageAndTextItemPlugin(CMSPluginBase):
name = "ungleich Header with Background and Image and Text Item Plugin" name = "ungleich Header with Background and Image and Text Item Plugin"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-26 00:34+0530\n" "POT-Creation-Date: 2017-12-22 01:00+0530\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -157,8 +157,8 @@ msgstr "Copyright © ungleich GmbH"
msgid "ungleich Home" msgid "ungleich Home"
msgstr "ungleich Home" msgstr "ungleich Home"
msgid "We Design, Configure &amp; Maintain <br> Your Linux Infrastructure " msgid "We Design, Configure &amp; Maintain<br>Your Linux Infrastructure "
msgstr "Wir designen, erstellen und warten Ihre Linux-Infrastruktur" msgstr "Wir designen, erstellen und warten<br>Ihre Linux-Infrastruktur"
msgid "Our Products" msgid "Our Products"
msgstr "Unsere Produkte" msgstr "Unsere Produkte"
@ -350,6 +350,9 @@ msgstr "WARUM UNGLEICH?"
msgid "BLOG" msgid "BLOG"
msgstr "BLOG" msgstr "BLOG"
msgid "Learn More"
msgstr "erfahren Sie mehr"
msgid "contact/$" msgid "contact/$"
msgstr "kontakt/$" msgstr "kontakt/$"

View file

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2017-12-19 21:19
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import filer.fields.file
import filer.fields.image
class Migration(migrations.Migration):
dependencies = [
('ungleich_page', '0016_ungleichheaderwithbackgroundimageslider_ungleichheaderwithbackgroundimageslideritem'),
]
operations = [
migrations.CreateModel(
name='UngleichHeaderWithBackgroundVideoSliderItem',
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')),
('description', models.TextField(
blank=True, help_text='An optional description for this slide.', null=True)),
('image', filer.fields.image.FilerImageField(blank=True, help_text='The background image or poster image for video.',
null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ungleich_header_item_poster', to='filer.Image')),
('btn_link', models.URLField(
blank=True, help_text='If this field is left empty, no button would be displayed.', null=True)),
('btn_text', models.CharField(
blank=True, help_text='Text for the button, if a link is provided.', max_length=50, null=True)),
('heading', models.CharField(
blank=True, help_text='An optional title for this slide.', max_length=100, null=True)),
('video', filer.fields.file.FilerFileField(blank=True, help_text='Leavig this blank will make the image as the background.',
null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ungleich_header_item_video', to='filer.File')),
],
options={
'abstract': False,
},
bases=('cms.cmsplugin',),
),
]

View file

@ -1,7 +1,7 @@
from cms.models.pluginmodel import CMSPlugin from cms.models.pluginmodel import CMSPlugin
from django.db import models from django.db import models
from djangocms_text_ckeditor.fields import HTMLField from djangocms_text_ckeditor.fields import HTMLField
from filer.fields.image import FilerImageField from filer.fields.image import FilerImageField, FilerFileField
class UngelichPicture(CMSPlugin): class UngelichPicture(CMSPlugin):
@ -155,6 +155,39 @@ class UngleichHeaderItem(CMSPlugin):
description = HTMLField() description = HTMLField()
class UngleichHeaderWithBackgroundVideoSliderItem(CMSPlugin):
image = FilerImageField(
null=True,
blank=True,
related_name="ungleich_header_item_poster",
on_delete=models.SET_NULL,
help_text='The background image or poster image for video.'
)
video = FilerFileField(
null=True,
blank=True,
related_name="ungleich_header_item_video",
on_delete=models.SET_NULL,
help_text='Leaving this blank will make the image as the background.'
)
heading = models.CharField(
blank=True, null=True, max_length=100,
help_text='An optional title for this slide.',
)
description = models.TextField(
blank=True, null=True,
help_text='An optional description for this slide.'
)
btn_link = models.URLField(
blank=True, null=True,
help_text='If this field is left empty, no button would be displayed.'
)
btn_text = models.CharField(
blank=True, null=True, max_length=50,
help_text='Text for the button, if a link is provided.'
)
class UngleichProductItem(ServiceItem): class UngleichProductItem(ServiceItem):
url = models.URLField(max_length=300, default="", blank=True) url = models.URLField(max_length=300, default="", blank=True)

View file

@ -1,8 +1,15 @@
@media (min-width: 768px) and (max-width: 991px) {
.navbar > .container {
width: 100%;
}
}
.btn-trans { .btn-trans {
color: #fff; color: #fff;
border: 2px solid #fff; border: 2px solid #fff;
padding: 4px 18px; padding: 4px 18px;
letter-spacing: 0.6px; letter-spacing: 0.6px;
background: rgba(0,0,0,0.35);
} }
.btn-trans:focus, .btn-trans:focus,
@ -142,18 +149,30 @@
} }
} }
.header_slider { .header_slider > .carousel .carousel-inner {
height: 95vh; min-height: 95vh;
display: flex;
} }
.header_slider > .carousel, .header_slider > .carousel .carousel-inner > .next,
.header_slider > .carousel .carousel-inner, .header_slider > .carousel .carousel-inner > .prev {
.header_slider > .carousel .item { bottom: 0;
height: 100%; }
.header_slider .carousel-indicators {
width: 100%;
left: 0;
margin-left: 0;
}
.header_slider .carousel-indicators li {
margin-right: 25px;
width: 16px;
height: 16px;
} }
.header_slider .carousel-indicators li.active { .header_slider .carousel-indicators li.active {
background-color: #ffffff; background-color: #ffffff;
} }
.header_slider .carousel-control { .header_slider .carousel-control {
@ -167,6 +186,11 @@
margin-top: -50px; margin-top: -50px;
} }
.header_slider > .carousel .item {
background: rgba(0,0,0,0.5);
flex: 1;
}
.header_slider > .carousel .item .container { .header_slider > .carousel .item .container {
overflow: auto; overflow: auto;
padding: 50px 20px 60px; padding: 50px 20px 60px;
@ -174,13 +198,15 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-end; justify-content: flex-end;
/* background: rgba(0,0,0,0.5); */
} }
.header_slider .intro-cap { .header_slider .intro-cap {
margin: 0;
text-align: right; text-align: right;
line-height: 1.1; line-height: 1.1;
font-size: 23px; font-size: 23px;
margin-bottom: 12px; padding-bottom: 10px;
} }
.header_slider .btn-trans { .header_slider .btn-trans {
@ -191,8 +217,7 @@
@media (min-width: 768px) { @media (min-width: 768px) {
.header_slider .intro-cap { .header_slider .intro-cap {
font-size: 2.25em; font-size: 2.5em;
margin-bottom: 20px;
} }
.header_slider .carousel-control { .header_slider .carousel-control {
width: 50px; width: 50px;
@ -211,6 +236,12 @@
overflow: auto; overflow: auto;
padding: 75px 50px; padding: 75px 50px;
} }
.header_slider .btn-trans {
padding: 8px 15px;
min-width: 175px;
letter-spacing: 1px;
font-size: 1.25em;
}
} }
@media (min-width: 992px) { @media (min-width: 992px) {
@ -224,7 +255,8 @@
font-size: 1.55em; font-size: 1.55em;
text-align: right; text-align: right;
line-height: 1.4; line-height: 1.4;
margin-bottom: 20px; margin-bottom: 0;
padding-bottom: 10px;
} }
@media (max-width: 768px) { @media (max-width: 768px) {
@ -234,12 +266,12 @@
} }
.header_slider .carousel-indicators li { .header_slider .carousel-indicators li {
margin: 1px 7px; margin: 1px 25px;
width: 16px; width: 16px;
height: 16px; height: 16px;
} }
.header_slider .carousel-indicators li.active { .header_slider .carousel-indicators li.active {
margin: 0 7px; margin: 0 25px;
width: 18px; width: 18px;
height: 18px; height: 18px;
} }
@ -256,6 +288,31 @@
background-position: center; background-position: center;
} }
.bg_vid {
position: absolute;
top: 0;
left: 0;
z-index: -1;
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
}
@media (min-aspect-ratio: 16/9) {
.bg_vid > video {
width: 100%;
height: auto;
}
}
@media (max-aspect-ratio: 16/9) {
.bg_vid > video {
/* width: auto; */
height: 100%;
}
}
.timeline>li .timeline-panel { .timeline>li .timeline-panel {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -301,3 +358,45 @@
min-height: 170px; min-height: 170px;
} }
} }
.header_slider_box {
position: relative;
text-shadow: 0px 3px 5px rgba(0,0,0,0.5);
background: rgba(0,0,0,0.35);
box-shadow: 0 0 5px rgba(0,0,0,0.7);
}
.cam_corner:after,
.cam_corner:before{
position: absolute;
content: ' ';
z-index: 5;
width: 50px;
height: 50px;
background: transparent;
display: block;
}
.cam_corner:after {
top: -2px;
right: -2px;
border-top: 2px solid rgba(255,255,255,0.5);
border-right: 2px solid rgba(255,255,255,0.5);
}
.cam_corner:before {
bottom: -2px;
left: -2px;
border-bottom: 2px solid rgba(255,255,255,0.5);
border-left: 2px solid rgba(255,255,255,0.5);
}
.bg_vid_back:after {
content: ' ';
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(0,0,0,0.35);
}

View file

@ -1,7 +1,7 @@
{% load static i18n %} {% load static i18n %}
<header class="header_slider"> <header class="header_slider">
<div id="carousel-header-ungleich" class="carousel slide" data-interval="2000"> <div id="carousel-header-ungleich" class="carousel slide" data-ride="carousel" data-interval="8000">
<!-- Indicators --> <!-- Indicators -->
<ol class="carousel-indicators"> <ol class="carousel-indicators">
<li data-target="#carousel-header-ungleich" data-slide-to="0" class="active"></li> <li data-target="#carousel-header-ungleich" data-slide-to="0" class="active"></li>
@ -12,30 +12,43 @@
<!-- Wrapper for slides --> <!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox"> <div class="carousel-inner" role="listbox">
<div class="item active"> <div class="item active">
<div class="bg_img" style="background-image:url({% static 'ungleich_page/img/header-bg.jpg' %})"></div> <div class="bg_vid bg_vid_back">
<video autoplay muted loop>
<source type="video/mp4" src="https://s3.ap-south-1.amazonaws.com/tiwariav-ungleich/nico-cable.mp4">
</video>
</div>
<div class="container"> <div class="container">
<div class="intro-cap"> <div class="intro-cap">
{% trans "We Design, Configure &amp; Maintain <br> Your Linux Infrastructure " %} {% trans "We Design, Configure &amp; Maintain<br>Your Linux Infrastructure " %}
</div> </div>
<p class="intro_lead">Ruby on Rails, Django, Java, Webserver, Mailserver, any infrastructure that needs to configured, we provide comprehensive solutions. Amazon, rackspace or bare metal servers, we configure for you.</p> <p class="intro_lead">Ruby on Rails, Django, Java, Webserver, Mailserver, any infrastructure that needs to configured, we provide comprehensive solutions. Amazon, rackspace or bare metal servers, we configure for you.</p>
<a class="btn btn-trans" href="">Learn More</a> <a class="btn btn-trans" href="">Learn More</a>
</div> </div>
</div> </div>
<div class="item"> <div class="item">
<div class="bg_img" style="background-image:url({% static 'ungleich_page/img/glasfaser/header-nico-sans.jpg' %})"></div> <!-- <div class="bg_img" style="background-image:url({% static 'ungleich_page/img/glasfaser/header-nico-sans.jpg' %})"></div> -->
<div class="bg_vid bg_vid_back">
<video autoplay muted loop>
<source type="video/mp4" src="https://s3.ap-south-1.amazonaws.com/tiwariav-ungleich/applause.mp4">
</video>
</div>
<div class="container"> <div class="container">
<div class="intro-cap"> <div class="intro-cap">
{% trans "We Design, Configure &amp; Maintain <br> Your Linux Infrastructure " %} {% trans "We Design, Configure &amp; Maintain<br>Your Linux Infrastructure " %}
</div> </div>
<p class="intro_lead">Ruby on Rails, Django, Nothing else.</p> <p class="intro_lead">Ruby on Rails, Django, Nothing else.</p>
<a class="btn btn-trans" href="">Learn More</a> <a class="btn btn-trans" href="">Learn More</a>
</div> </div>
</div> </div>
<div class="item"> <div class="item">
<div class="bg_img" style="background-image:url({% static 'ungleich_page/img/portfolio/startup-framework-preview.jpg' %})"></div> <div class="bg_vid bg_vid_back">
<video autoplay muted loop>
<source type="video/mp4" src="https://s3.ap-south-1.amazonaws.com/tiwariav-ungleich/nanos.mp4">
</video>
</div>
<div class="container"> <div class="container">
<div class="intro-cap"> <div class="intro-cap">
{% trans "We Design, Configure &amp; Maintain <br> Your Linux Infrastructure " %} {% trans "We Design, Configure &amp; Maintain<br>Your Linux Infrastructure " %}
</div> </div>
<a class="btn btn-trans" href="">Learn More</a> <a class="btn btn-trans" href="">Learn More</a>
</div> </div>

View file

@ -0,0 +1,26 @@
{% if instance.image %}
<div class="bg_img" style="background-image:url({{ instance.image.url }})"></div>
{% endif %}
{% if instance.video %}
<div class="bg_vid bg_vid_back">
{% comment %}
use attribute poster="{{ instance.image.url }}" after cross browser testing
in place of .bg_img
{% endcomment %}
<video autoplay muted loop>
<source type="video/mp4" src="{{ instance.video.url }}">
</video>
</div>
{% endif %}
<div class="container">
{% if instance.heading %}
<div class="intro-cap">{{ instance.heading }}</div>
{% endif %}
{% if instance.description %}
<p class="intro_lead">{{ instance.description }}</p>
{% endif %}
{% if instance.btn_link %}
{% trans "Learn More" as default_btn_text %}
<a class="btn btn-trans" href="{{ instance.btn_link }}">{{ instance.btn_text|default:default_btn_text }}</a>
{% endif %}
</div>