Base implementation of inspirations page/models
This commit is contained in:
parent
fb1bf1f289
commit
0a4b55e2fe
8 changed files with 287 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
from django.contrib import admin
|
||||
from urlaubsauktion.admin import joker_admin as admin
|
||||
|
||||
# Register your models here.
|
||||
from .models import Inspiration, InspirationRegion, InspirationSponsor, Testimonial
|
||||
|
||||
admin.register(Testimonial)
|
||||
admin.register(Inspiration)
|
||||
admin.register(InspirationRegion)
|
||||
admin.register(InspirationSponsor)
|
|
@ -1,8 +1,15 @@
|
|||
from django.db import models
|
||||
from django.contrib.gis.db import models
|
||||
from django.conf import settings
|
||||
from django.core.validators import MaxValueValidator, MinValueValidator
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
# Create your models here.
|
||||
from localauth.models import ImageMixin
|
||||
|
||||
from django_countries.fields import CountryField
|
||||
|
||||
class ClassProperty(property):
|
||||
def __get__(self, cls, owner):
|
||||
return self.fget.__get__(None, owner)()
|
||||
|
||||
class Testimonial(models.Model):
|
||||
name = models.CharField(max_length=128)
|
||||
|
@ -14,3 +21,38 @@ class Testimonial(models.Model):
|
|||
])
|
||||
language = models.CharField(max_length=12, choices=settings.LANGUAGES)
|
||||
public = models.BooleanField(default=False)
|
||||
|
||||
class InspirationRegion(models.Model):
|
||||
name = models.CharField(max_length=128)
|
||||
is_state = models.BooleanField(default=False)
|
||||
country = CountryField()
|
||||
|
||||
@ClassProperty
|
||||
@classmethod
|
||||
def country_set(cls):
|
||||
return cls.objects.all().values_list("country").distinct()
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class InspirationSponsor(ImageMixin):
|
||||
user = models.ForeignKey(get_user_model(), models.SET_NULL, null=True, blank=True)
|
||||
name = models.CharField(max_length=128)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class Inspiration(ImageMixin):
|
||||
title = models.CharField(max_length=256)
|
||||
region = models.ForeignKey(InspirationRegion, models.PROTECT)
|
||||
sponsor = models.ForeignKey(InspirationSponsor, models.PROTECT)
|
||||
content = models.TextField()
|
||||
destination_name = models.CharField(max_length=128)
|
||||
destination_coords = models.PointField()
|
||||
|
||||
@property
|
||||
def user(self):
|
||||
return self.sponsor.user
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
|
@ -1,6 +1,6 @@
|
|||
from django.urls import path, include
|
||||
|
||||
from .views import HomeView, DemoTemplateView, ImpressumView, PrivacyNoticeView, TOSView
|
||||
from .views import HomeView, DemoTemplateView, ImpressumView, PrivacyNoticeView, TOSView, InspirationsView
|
||||
|
||||
app_name = "frontend"
|
||||
|
||||
|
@ -11,4 +11,5 @@ urlpatterns = [
|
|||
path('impressum/', ImpressumView.as_view(), name="impressum"),
|
||||
path('privacy/', PrivacyNoticeView.as_view(), name="privacy"),
|
||||
path('tos/', TOSView.as_view(), name="tos"),
|
||||
path('inspirations/', InspirationsView.as_view(), name="inspirations"),
|
||||
]
|
|
@ -16,4 +16,7 @@ class PrivacyNoticeView(TemplateView):
|
|||
template_name = "frontend/privacy.html"
|
||||
|
||||
class TOSView(TemplateView):
|
||||
template_name = "frontend/terms.html"
|
||||
template_name = "frontend/terms.html"
|
||||
|
||||
class InspirationsView(TemplateView):
|
||||
template_name = "frontend/inspirations.html"
|
91
static/frontend/css/inspirations.css
Normal file
91
static/frontend/css/inspirations.css
Normal file
|
@ -0,0 +1,91 @@
|
|||
.widget.widget-image {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.widget {
|
||||
border: none;
|
||||
box-shadow: 0 2px 0 rgba(0,0,0,.07);
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.widget-image-cover {
|
||||
margin: -20px;
|
||||
padding: 100% 20px 20px;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
background: #3C454D;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.widget-image:hover .widget-image-cover img {
|
||||
max-width: 110%;
|
||||
min-height: 110%;
|
||||
margin-left: -5%;
|
||||
margin-top: -5%;
|
||||
}
|
||||
|
||||
.widget-image .widget-image-cover img {
|
||||
transition: all .1s ease-in-out;
|
||||
}
|
||||
|
||||
.widget-image-cover img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
min-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.widget-image-info {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: linear-gradient(to bottom,rgba(0,0,0,0) 0,rgba(0,0,0,.8) 75%);
|
||||
padding: 20px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.widget-image-info h5 {
|
||||
color: #fff;
|
||||
margin-top: 0;
|
||||
margin-bottom: 5px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.widget-image-info p {
|
||||
color: rgba(255,255,255,.9);
|
||||
}
|
||||
|
||||
.row {
|
||||
margin: 0 -10px;
|
||||
}
|
||||
|
||||
.row>[class*=col-] {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.widget-image-user .widget-image-user-image {
|
||||
border-radius: 36px;
|
||||
float: left;
|
||||
width: 36px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.widget-image-user .widget-image-user-info {
|
||||
margin-left: 46px;
|
||||
}
|
||||
|
||||
.widget-image-user .widget-image-user-image img {
|
||||
max-width: 100%;
|
||||
border-radius: 36px;
|
||||
}
|
BIN
static/frontend/images/inspiration.png
Normal file
BIN
static/frontend/images/inspiration.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
|
@ -176,7 +176,7 @@
|
|||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item dropdown">
|
||||
<a href="#" class="nav-link" data-toggle="dropdown">Inspirationen</a>
|
||||
<a href="{% url "frontend:inspirations" %}" class="nav-link">Inspirationen</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a href="#" class="nav-link" data-toggle="dropdown">{% trans "Über uns" %}<span><i class="fa fa-angle-down"></i></span></a>
|
||||
|
|
138
templates/frontend/inspirations.html
Normal file
138
templates/frontend/inspirations.html
Normal file
|
@ -0,0 +1,138 @@
|
|||
{% extends "frontend/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
{% load bootstrap4 %}
|
||||
{% block "styles" %}
|
||||
<link rel="stylesheet" href="{% static "frontend/css/inspirations.css" %}">
|
||||
{% endblock %}
|
||||
{% block "content" %}
|
||||
<!--===== INNERPAGE-WRAPPER ====-->
|
||||
<section class="innerpage-wrapper">
|
||||
<div id="payment-success" class="section-padding">
|
||||
<div class="container text-center">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-md-12 col-lg-8 col-lg-offset-2">
|
||||
<h2>{% trans "Inspirationen" %}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<select class="form-control">
|
||||
<optgroup label="Staat">
|
||||
<option>Testland</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<select class="form-control">
|
||||
<optgroup label="Land/Region">
|
||||
<option>Testregion</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row d-flex justify-content-center">
|
||||
<!--<div class="col-md-12 col-lg-8 col-lg-offset-2">-->
|
||||
|
||||
<div class="container bootstrap snippets bootdey">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<a href="javascript:;" data-toggle="modal" data-target="#exampleModal1" class="widget widget-image">
|
||||
<div class="widget-image-cover">
|
||||
<img src="{% static "frontend/images/inspiration.png" %}" alt="">
|
||||
</div>
|
||||
<div class="widget-image-info">
|
||||
<h5>Consectetur adipiscing elit. </h5>
|
||||
<p>
|
||||
Curabitur ullamcorper mi ut rutrum gravida commodo tellus.
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="widget-image-user">
|
||||
<div class="widget-image-user-image">
|
||||
<img src="{% static "frontend/images/user-profile.jpg" %}" alt="">
|
||||
</div>
|
||||
<div class="widget-image-user-info">
|
||||
<div>Tourismusverband Hintertupfing</div>
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="widget-image-rating-text">1234 Testdorf</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a href="javascript:;" data-toggle="modal" data-target="#exampleModal1" class="widget widget-image">
|
||||
<div class="widget-image-cover">
|
||||
<img src="{% static "frontend/images/inspiration.png" %}" alt="">
|
||||
</div>
|
||||
<div class="widget-image-info">
|
||||
<h5>Consectetur adipiscing elit. </h5>
|
||||
<p>
|
||||
Curabitur ullamcorper mi ut rutrum gravida commodo tellus.
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="widget-image-user">
|
||||
<div class="widget-image-user-image">
|
||||
<img src="{% static "frontend/images/user-profile.jpg" %}" alt="">
|
||||
</div>
|
||||
<div class="widget-image-user-info">
|
||||
<div>Tourismusverband Hintertupfing</div>
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="widget-image-rating-text">1234 Testdorf</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- </div> --><!-- end columns -->
|
||||
</div><!-- end row -->
|
||||
</div><!-- end container -->
|
||||
</div><!-- end coming-soon-text -->
|
||||
</section><!-- end innerpage-wrapper -->
|
||||
{% endblock %}
|
||||
{% block "modal" %}
|
||||
<!-- Modal 1 --> <!-- TODO: You know... -->
|
||||
<div
|
||||
class="modal fade"
|
||||
id="exampleModal1"
|
||||
tabindex="-1"
|
||||
aria-labelledby="exampleModal1Label"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="ratio ratio-16x9">
|
||||
<iframe
|
||||
src="https://www.youtube.com/embed/A3PDXmYoF5U"
|
||||
title="YouTube video"
|
||||
allowfullscreen width="100%" height="100%"
|
||||
></iframe>
|
||||
</div>
|
||||
|
||||
<div class="text-center py-3">
|
||||
<button type="button" class="btn btn-primary">
|
||||
Jetzt Urlaubsangebote in und um Testdorf erhalten!
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">
|
||||
Schließen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in a new issue