Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • to/majak
  • b1242/majak
2 results
Select Git revision
Show changes
Showing
with 539 additions and 1 deletion
{% extends "styleguide2/base.html" %}
{% load wagtailcore_tags wagtailimages_tags %}
{% block content %}
{% block navbar %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.get_menu_title %}
{% endblock %}
{% image page.background_photo fill-1920x1080 as background_image %}
{% include 'styleguide2/includes/organisms/header/district/center_header.html' with title=page.title description=page.perex map_area_content=page.map_area_content map_address_content=page.map_address_content background_photo=background_image %}
<main role="main">
{% include "styleguide2/includes/molecules/program/secondary_card_program.html" %}
<div class="container--wide flex flex-col gap-6 my-6">
{% for block in page.content %}
{% include_block block %}
{% endfor %}
{% if page.calendar %}
<div class="container--medium mx-auto px-4">
<h2 class="head-14xl xl:leading-[10.5rem] mb-4 xl:mb-8">
Kalendář
</h2>
{% include 'styleguide2/includes/atoms/calendar/calendar.html' with calendar_data=page.get_fullcalendar_data %}
</div>
{% endif %}
</div>
{% comment %}
{% include 'styleguide2/includes/organisms/main_section/small_newsletter_section.html' %}
{% endcomment %}
</main>
{% endblock %}
{% extends "styleguide2/contact_page.html" %}
{% block navbar %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.get_menu_title %}
{% endblock %}
{% block newsletter %}{% endblock %}
{% extends "styleguide2/base.html" %}
{% load wagtailcore_tags %}
{% block content %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.get_menu_title %}
{% include 'styleguide2/includes/organisms/header/simple_header.html' with title=page.title %}
<main role="main" class="mb-10 xl:mb-32">
<div class="mb-2 lg:mb-12 container--wide">
{% for card_block in page.cards_content %}
{% include_block card_block %}
{% endfor %}
{% for block in page.content %}
{% include_block block with block_id=block.id %}
{% endfor %}
</div>
</main>
{% endblock %}
{% extends "styleguide2/simple_page.html" %}
{% block navbar %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.get_menu_title %}
{% endblock %}
{% block header %}
{% include 'styleguide2/includes/organisms/header/photo_header.html' with title=page.title main_image=page.main_image %}
{% endblock %}
{% extends "styleguide2/simple_page.html" %}
{% load wagtailcore_tags %}
{% block content %}
{% block navbar %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.get_menu_title %}
{% endblock %}
{% block header %}
{% include 'styleguide2/includes/organisms/header/photo_header.html' with title=page.title main_image=page.main_image description=page.perex %}
{% endblock %}
<main class="container--wide mb-2 lg:mb-12">
{% block inner_content %}
<div class="mt-8 __inner-content">
<section>
{% for block in page.content %}
{% include_block block with block_id=block.id %}
{% endfor %}
</section>
<section id="mapa">
{% if page.map_title %}
<h2 class="head-alt-md mb-4">{{ page.map_title }}</h2>
{% endif %}
<div
class="v-geo-feature-collection"
data-wrapper-class="container-padding--zero lg:container-padding--auto"
data-initial-zoom="14"
data-tile-server-config="{{ js_map.tile_server_config }}"
data-tile-style="{{ js_map.style }}"
data-categories="{{ js_map.categories }}"
data-geojson="{{ js_map.geojson }}"
></div>
</section>
<section id="kategorie">
{% if page.category_list_title %}
<h2 class="head-alt-md mb-4">{{ page.category_list_title }}</h2>
{% endif %}
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-8">
{% for category, features in features_by_category %}
<div class="card md:elevation-2" style="border-right: 4px rgb({{ category.rgb.0 }}, {{ category.rgb.1 }}, {{ category.rgb.2 }}) solid;">
<div class="card__body p-4">
<h3 class="head-allcaps-heavy-2xs mb-2">{{ category.name }}</h3>
<ul class="leading-normal {% if not forloop.last %}mb-4{% endif %} md:mb-0">
{% for feature in features %}
<li>
<span class="rounded-full inline-flex items-center justify-center bg-grey-125 font-bold text-center text-xs w-5 h-5 mr-2 no-underline">
<a href="?item={{ feature.pk }}-{{ feature.slug }}" class="no-underline js-feature-item-anchor">{{ feature.index }}</a>
</span>
<a href="?item={{ feature.pk }}-{{ feature.slug }}" class="js-feature-item-anchor"><span class="text-sm underline">{{ feature.title }}</span></a>
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endfor %}
</div>
</section>
{% if page.content_after %}
<section class="my-4">
{% for block in page.content_after %}
{% include_block block with block_id=block.id %}
{% endfor %}
</section>
{% endif %}
{% if page.content_footer %}
<section class="my-4">
{% for block in page.content_footer %}
{% include_block block with block_id=block.id %}
{% endfor %}
</section>
{% endif%}
</div>
{% endblock %}
</main>
{% endblock %}
{% block scripts %}
<script>
/* Handle .js-feature-item-anchor clicks without page reloads. */
Array.from(document.getElementsByClassName("js-feature-item-anchor")).forEach((el) => {
el.addEventListener("click", (evt) => {
evt.preventDefault();
const url = new URL(window.location);
// Set slug from URL.
url.searchParams.set("item", el.getAttribute("href").substring(6));
// Emulate user browser navigation event.
history.pushState({}, "", url);
window.dispatchEvent(new Event("popstate"));
return false;
})
})
</script>
{% endblock %}
{% extends "district/base.html" %}
{% load static wagtailcore_tags wagtailimages_tags %}
{% block subheader %}
{% image page.image fill-1920x500-c75 jpegquality-80 as bg_img %}
<header class="hero hero--image pt-16 pb-24 lg:pt-32 pb-24" style="--image-url: url({{ bg_img.full_url }})">
<div class="container container--default text-center lg:text-left">
{% comment %} Page index for screens up to md {% endcomment %}
{% if page.index %}
<div class="text-center relative mb-4 lg:hidden">
<span class="rounded-full inline-flex items-center justify-center bg-grey-125 font-bold text-center text-4xl md:text-5xl w-20 h-20 md:w-24 md:h-24 border-white border-8 text-black">{{ page.index }}</span>
</div>
{% endif %}
<h2 class="head-xs text-shadow-lg max-w-xl mb-2 mx-auto lg:mx-0">
<a href="{% pageurl page.get_parent %}">{{ page.get_parent.title }}</a>
</h2>
<h1 class="head-alt-lg md:head-alt-xl text-shadow-lg max-w-2xl mx-auto lg:mx-0">
{{ page.title }}
</h1>
</div>
</header>
{% endblock %}
{% block container_spacing %}py-8 lg:pb-16{% endblock %}
{% block content %}
<article>
<link itemprop="mainEntityOfPage" href="{{ page.url }}">
<meta itemprop="datePublished" content="{{ page.last_published_at }}">
<meta itemprop="dateModified" content="{{ page.latest_revision_created_at }}">
<div class="flex flex-col lg:flex-row lg:space-x-8 xl:space-x-16">
<section class="lg:w-3/5 xl:w-2/3 space-y-8" itemprop="description">
<div class="content-block w-full">
<p>
<strong>{{ page.perex }}</strong>
</p>
</div>
{% for block in page.content %}
{% include_block block with block_id=block.id %}
{% endfor %}
{% if parts|length > 1 %}
<div>
{% if page.parts_section_title %}<h2 class="head-alt-base mb-4">{{ page.parts_section_title }}</h2>{% endif %}
<div class="space-y-4">
{% for part in parts %}
{% if part.title and part.description %}
<div>
<h3 class="head-allcaps-3xs">{{ part.title }}</h3>
<div class="content-block"><p>{{ part.description }}</p></div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
</section>
<section class="lg:w-2/5 xl:w-1/3 pt-8 lg:pt-0 candidate-detail__sidebar">
<div class="space-y-8">
<div class="lg:card lg:elevation-10">
<div class="lg:card__body">
{% comment %} Page index for screens bigger than md {% endcomment %}
{% if page.index %}
<div class="text-center mb-8 h-40 -mt-28 hidden lg:block">
<span class="rounded-full inline-flex items-center justify-center bg-grey-125 font-bold text-center text-7xl w-40 h-40 border-white border-8">{{ page.index }}</span>
</div>
{% endif %}
<hr />
<h2 class="head-heavy-xs mb-2">Za tohle ručí</h2>
<div itemprop="author" itemtype="http://schema.org/Person" itemscope="">
<meta itemprop="name" content="{{ page.guarantor }}">
{% include "shared/person_badge_snippet.html" with person_page=page.guarantor %}
</div>
<hr />
<div
class="v-geo-feature-collection"
data-height="250px"
data-display-zoom-control="false"
data-display-legend="false"
data-display-popups="false"
data-handle-clicks="false"
data-initial-zoom="{{ page.initial_zoom }}"
data-tile-server-config="{{ js_map.tile_server_config }}"
data-tile-style="{{ js_map.style }}"
data-categories="{{ js_map.categories }}"
data-geojson="{{ js_map.geojson }}"
></div>
<a href="{% pageurl page.get_parent %}" class="block md:inline-block text-sm mt-4 btn btn--fullwidth btn--grey-125 btn--icon btn--hoveractive">
<div class="btn__body-wrap">
<div class="btn__body">Zobrazit celou mapu</div>
<div class="btn__icon"><i class="ico--map"></i></div>
</div>
</a>
<hr />
<div class="space-y-4">
{% for category, features in features_by_category %}
<div class="js-feature-collection" style="border-right: 4px #{{ category.hex_color }} solid;">
<div class="flex items-center space-x-2" >
<h2 class="head-allcaps-4xs cursor-pointer js-feature-collection-toggle" data-target="{{ category.pk }}-items">{{ category.name }} ({{ features|length }})</h2>
</div>
<ul id="{{ category.pk }}-items" class="leading-normal text-sm js-feature-collection-items {% if page not in features %}hidden{% endif %}">
{% for feature in features %}
<li class="pr-2">
{% if feature.pk == page.pk %}
<span v-if="feature.index" class="rounded-full inline-flex items-center justify-center bg-grey-125 font-bold text-center text-2xs w-4 h-4 mr-1 no-underline">{{ feature.index }}</span>
<span class="font-bold">{{ feature.title }}</span>
{% else %}
<a v-if="feature.index" href="{% pageurl feature %}" class="rounded-full inline-flex items-center justify-center bg-grey-125 font-bold text-center text-2xs w-4 h-4 mr-1 no-underline">{{ feature.index }}</a>
<a href="{% pageurl feature %}" class="underline">{{ feature.title }}</a>
{% endif%}
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="sharebox md:card md:elevation-10 ">
<div class="md:card__body">
<span class="head-alt-base md:head-alt-md">Sdílení je aktem lásky</span>
<div class="flex w-full space-x-4 pt-4 md:pt-8 text-center text-white">
<a
href="https://www.facebook.com/sharer/sharer.php?u={{ page.full_url|urlencode }}"
onclick="window.open(this.href, 'pop-up', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;"
class="bg-brands-facebook px-8 py-3 text-2xl w-full hover:no-underline"
><i class="ico--facebook"></i></a>
<a
href="https://twitter.com/intent/tweet?text={{ page.title|urlencode }}&url={{ page.full_url|urlencode }}"
onclick="window.open(this.href, 'pop-up', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;"
class="bg-brands-twitter px-8 py-3 text-2xl w-full hover:no-underline"
><i class="ico--twitter"></i></a>
</div>
</div>
<div class="h-52 overflow-hidden hidden md:block">
<img src="{% static "shared/img/flag.png" %}" alt="Pirátská strana" class="w-80 object-cover m-auto"/>
</div>
</div>
</div>
</div>
</section>
</article>
{% endblock %}
{% block scripts %}
<script>
document.querySelectorAll(".js-feature-collection-toggle").forEach((el) => {
const target = document.getElementById(el.dataset.target);
el.addEventListener("click", () => {
target.classList.toggle("hidden");
});
})
</script
{% endblock %}
{% extends "styleguide2/base.html" %}
{% load wagtailcore_tags %}
{% block content %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with is_transparent=True %}
<main role="main">
{% for block in page.content %}
{% include_block block %}
{% endfor %}
</main>
{% endblock %}
{% extends "styleguide2/person_page.html" %}
{% block navbar %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.root_page.people_page.get_menu_title is_transparent=True is_on_dark_background=True %}
{% endblock %}
{% block header %}
{% include 'styleguide2/includes/organisms/header/district/person_header.html' with first_nav_text=page.root_page.people_page.title first_nav_link=page.root_page.people_page.url second_nav_text=page.primary_group degree_before=page.before_name name=page.title degree_after=page.after_name function=page.position job=page.job main_image=page.main_image profile_image=page.get_profile_image is_pirate=page.is_pirate other_party_image_source=page.other_party_logo other_party_name=page.other_party %}
{% endblock %}
{% block newsletter %}{% endblock %}
{% extends "styleguide2/program_page.html" %}
{% block navbar %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.get_menu_title %}
{% endblock %}
{% extends "styleguide2/person_page.html" %}
{% block navbar %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.root_page.people_page.get_menu_title is_transparent=True is_on_dark_background=True %}
{% endblock %}
{% block header %}
{% include 'styleguide2/includes/organisms/header/district/person_header.html' with first_nav_text=page.root_page.people_page.title first_nav_link=page.root_page.people_page.url second_nav_text=page.primary_group degree_before=page.before_name name=page.title degree_after=page.after_name function=page.position job=page.job main_image=page.main_image profile_image=page.get_profile_image is_pirate=page.is_pirate other_party_image_source=page.other_party_logo other_party_name=page.other_party %}
{% endblock %}
{% block newsletter %}{% endblock %}
{% extends "styleguide2/simple_page.html" %}
{% block navbar %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.get_menu_title %}
{% endblock %}
{% block inner_content %}
<div class="__inner-content">
{% include "shared/pdf_snippet.html" with download_link=True %}
</div>
{% endblock %}
{% extends "styleguide2/people_page.html" %}
{% block navbar %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.get_menu_title %}
{% endblock %}
{% block newsletter %}{% endblock %}
{% extends "styleguide2/person_page.html" %}
{% block navbar %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.root_page.people_page.get_menu_title is_transparent=True is_on_dark_background=True %}
{% endblock %}
{% block header %}
{% include 'styleguide2/includes/organisms/header/district/person_header.html' with first_nav_text=page.root_page.people_page.title first_nav_link=page.root_page.people_page.url second_nav_text=page.primary_group degree_before=page.before_name name=page.title degree_after=page.after_name function=page.position job=page.job main_image=page.main_image profile_image=page.get_profile_image is_pirate=page.is_pirate other_party_image_source=page.other_party_logo other_party_name=page.other_party %}
{% endblock %}
{% block newsletter %}{% endblock %}
{% extends "district/base.html" %}
{% load wagtailcore_tags wagtailimages_tags shared_filters %}
{% block content %}
<div class="lg:flex lg:mt-8 space-y-16 lg:space-y-0 lg:space-x-8 xl:space-x-16 mb-5">
<section>
<header>
<h1 itemprop="headline" class="head-alt-md md:head-alt-lg max-w-5xl mb-8">
{{ page.title }}
</h1>
</header>
<p>
{{ page.perex }}
</p>
{% for block in page.content %}
{% include_block block %}
{% endfor %}
</section>
</div>
{% endblock %}
{% extends "styleguide2/search_page.html" %}
{% block navbar %}
{% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.get_menu_title %}
{% endblock %}
{% extends "district/base.html" %}
{% load wagtailroutablepage_tags %}
{% block content %}
{% routablepageurl page "tags" as articles_tag_page_url %}
<h1 class="head-alt-md md:head-alt-lg max-w-5xl mb-4">
{% if tag %}{{ page.title }} "{{ tag.name }}"{% else %}Výběr z článků{% endif %}
</h1>
<div class="space-y-8">
<div class="article-card-list grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-8">
{% for a in article_page_list %}
{% include "shared/article_preview.html" with article=a %}
{% endfor %}
</div>
{% include 'styleguide/2.3.x/pagination.html' with page_url=articles_tag_page_url paginator=article_page_list %}
<div>
<h2 class="head-heavy-base mb-4">Další štítky</h2>
<nav class="inline-block-nogap">
{% for tag in tag_list %}
<a
href="{{ articles_tag_page_url }}?tag={{ tag.slug }}"
class="btn btn--condensed font-light text-sm btn--grey-{% if tag.slug == request.GET.tag %}500{% else %}125{% endif %} btn--hoveractive mr-1 mb-1 inline-block"
>
<div class="btn__body ">{{ tag.name }} ({{ tag.count }})</div>
</a>
{% endfor %}
</nav>
</div>
</div>
{% endblock %}
from django import template
from django.db import models
register = template.Library()
@register.filter
def get_block_octopus_person_list(block):
from district.models import DistrictOctopusPersonPage
filter = (
models.Q(originating_groups__name=block.value["group_shortcut"])
if "group_shortcut" in block.value
else (
models.Q(
originating_teams__name=block.value["team_shortcut"],
originating_role__in=block.value["roles"].split(","),
)
if block.value["roles"]
else models.Q(originating_teams__name=block.value["team_shortcut"])
)
)
return (
DistrictOctopusPersonPage.objects.filter(filter)
.order_by("person__order", "title")
# Hacky, but should work all of the time with our current members.
.distinct("person__order", "title")
.live()
.all()
)
from django.templatetags.static import static
from django.utils.html import format_html
from wagtail import hooks
from district.models import DistrictCenterPage, DistrictHomePage
@hooks.register("after_copy_page")
def handle_copy_calendar(request, origin_page, copied_page):
if (
isinstance(copied_page, DistrictHomePage)
or isinstance(copied_page, DistrictCenterPage)
) and origin_page.specific.calendar_id:
# get current calendar from origin page
calendar = origin_page.specific.calendar
# create copy of calendar
calendar.pk = None
calendar.save()
# set new copy of calendar
copied_page.calendar_id = calendar.id
copied_page.save()
@hooks.register("insert_global_admin_css", order=100)
def global_admin_css():
return format_html(
'<link rel="stylesheet" href="{}">',
static("district/css/district_custom_admin.css"),
)
......@@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
......