Skip to content

Commit

Permalink
Added overall flatpages
Browse files Browse the repository at this point in the history
  • Loading branch information
Ameriks committed May 28, 2018
1 parent c2c37bc commit 5a606d5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
CompanyApplicationParticipantAdd, MyCompanyApplicationList, CompanyApplicationParticipantAddOK, \
CompanyApplicationUpdate, ParticipantPDF
from velo.results.views import ResultAllView
from velo.staticpage.views import StaticPageView, SimpleStaticPageView
from velo.velo.views import CustomAutoResponseView, cached_javascript_catalog

admin.autodiscover()
Expand Down Expand Up @@ -82,6 +83,7 @@ def register_sitetrees():
url(r'^jsi18n/$', cached_javascript_catalog, js_info_dict),

url(r'^toyota/$', ToyotaFrameView.as_view(), name='marketing_toyota'),
url(r'(?P<slug>.*)/$', SimpleStaticPageView.as_view(), name='simple_staticpage'),
)


Expand Down
10 changes: 10 additions & 0 deletions velo/staticpage/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ def get_context_data(self, **kwargs):

context.update({'content': content})
return context


class SimpleStaticPageView(DetailView):
slug_field = 'url'
model = StaticPage
template_name = 'staticpage/simple_flatpage.html'

def get_queryset(self):
queryset = super().get_queryset().filter(is_published=True, competition=None)
return queryset
2 changes: 1 addition & 1 deletion velo/templates/core/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
</div>
</div>
{# <figure class="logo-tiles__hero col-xl-96 flex js-background-image" data-background-image="{{ front_photo.image.front_small.url }}"></figure>#}
<figure class="logo-tiles__hero col-xl-96 flex js-background-image" data-background-image="/media/adverts/toyota_banner_lv.jpg" onclick="window.location='{% url 'marketing_toyota' %}';" style="cursor:pointer;"></figure>
<figure class="logo-tiles__hero col-xl-96 flex js-background-image" data-background-image="/media/adverts/toyota_banner_lv.jpg" onclick="window.location='https://toyota.lv';" style="cursor:pointer;"></figure>

</div>
</div>
Expand Down
33 changes: 33 additions & 0 deletions velo/templates/staticpage/simple_flatpage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% extends "base.html" %}
{% load staticfiles i18n %}
{% block content %}

<main>
<div class="primary-heading c-white border-bottom">
<div class="inner">
<div class="row border-right border-left">
<div class="col-xl-17 col-l-15 col-m-24">
<div class="primary-heading__spacing w100">
<h1 class="primary-heading__text primary-heading__text--smaller bottom-margin--10">{{ object.title }}</h1>
</div>
</div>
</div>
</div>
</div>
<div class="w100">
<div class="inner">
<div class="flex wrap--nowrap direction--row justify--start align-items--stretch border-right no-border--480">
<div class="banner-area-context flex--1 border-left no-border--480 bgc-dblue">
<article class="article">
<div class="article__text editor-text">
{{ object.content|safe }}
</div>
</article>
</div>
</div>
</div>
</div>
</main>


{% endblock %}

0 comments on commit 5a606d5

Please sign in to comment.