Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
4dd83685
Commit
4dd83685
authored
Nov 17, 2021
by
Ondrej Rehounek
Browse files
Options
Downloads
Patches
Plain Diff
district: Person page - WIP
parent
5b01e186
No related branches found
No related tags found
2 merge requests
!418
Release
,
!414
district and region modules
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
district/models.py
+2
-16
2 additions, 16 deletions
district/models.py
district/templates/district/district_person_page.html
+97
-94
97 additions, 94 deletions
district/templates/district/district_person_page.html
with
99 additions
and
110 deletions
district/models.py
+
2
−
16
View file @
4dd83685
...
...
@@ -388,20 +388,16 @@ class DistrictPersonTag(TaggedItemBase):
class
DistrictPersonPage
(
SubpageMixin
,
MetadataPageMixin
,
Page
):
### FIELDS
groups
=
ClusterTaggableManager
(
through
=
DistrictPersonTag
,
blank
=
True
,
help_text
=
"
Skupina pro zařazení na stránce Lidé
"
,
)
perex
=
models
.
TextField
(
"
Perex osoby
"
,
blank
=
True
)
person
=
models
.
ForeignKey
(
Person
,
on_delete
=
models
.
PROTECT
,
null
=
True
)
text
=
RichTextField
(
"
text
"
,
blank
=
True
,
features
=
RICH_TEXT_FEATURES
)
### PANELS
content_panels
=
Page
.
content_panels
+
[
FieldPanel
(
"
person
"
),
FieldPanel
(
"
perex
"
),
FieldPanel
(
"
groups
"
),
FieldPanel
(
"
text
"
),
]
### RELATIONS
...
...
@@ -458,16 +454,6 @@ class DistrictPeoplePage(SubpageMixin, MetadataPageMixin, Page):
class
Meta
:
verbose_name
=
"
Lidé
"
def
get_context
(
self
,
request
):
context
=
super
().
get_context
(
request
)
# Groupy (tagy) si natáhnu přes QS s orderingem, abych mohl udělat regroup v šabloně
context
[
"
district_person_tag_qs
"
]
=
DistrictPersonTag
.
objects
.
select_related
(
"
content_object
"
).
order_by
(
"
tag_id
"
)
return
context
class
DistrictProgramPage
(
SubpageMixin
,
MetadataPageMixin
,
Page
):
### FIELDS
...
...
...
...
This diff is collapsed.
Click to expand it.
district/templates/district/district_person_page.html
+
97
−
94
View file @
4dd83685
...
...
@@ -2,7 +2,6 @@
{% load wagtailcore_tags wagtailimages_tags shared_filters %}
{% block subheader %}
<header
class=
"hero hero--image pt-16 pb-24 lg:pt-32 pb-24 candidate-detail__hero"
style=
"--image-url: url(https://roznov.pirati.cz/assets/articles/2020/kampan20/zahajenikampan1-067fb446ec8933ae14591cbc29fc53ebb3009e4185900838bfb94752addbfa7b.jpg)"
>
...
...
@@ -14,44 +13,44 @@
<h2
class=
"head-xs mt-2 max-w-xl mx-auto text-center lg:text-left"
></h2>
</div>
</header>
{% endblock %}
{% block content %}
<div
class=
"container container--default py-8 lg:pb-24"
>
<main>
<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"
>
<div
class=
"content-block w-full"
>
{{ page.
long
text }}
{{ page.
text|rich
text }}
</div>
</section>
</section>
<section
class=
"lg:w-2/5 xl:w-1/3 pt-8 lg:pt-0 order-first lg:order-last candidate-detail__sidebar"
>
<aside
class=
"container-padding--zero lg:container-padding--auto lg:card lg:elevation-10"
>
<div
class=
"lg:card__body p-4 lg:p-8"
>
<div
class=
"container-padding--zero lg:card lg:elevation-10 lg:container-padding--auto"
>
<div
class=
"card__body p-4 lg:p-8"
>
<div
class=
"text-center mb-8"
>
<div
class=
"avatar avatar--2xl lg:avatar--3xl avatar--bordered candidate-detail__avatar"
>
<img
src=
"{{ page.portrait }}"
alt=
""
/>
</div>
<img
src=
"http://placeimg.com/100/100/people"
alt=
"Avatar"
>
</div>
{% if page.facebook %}
<div
class=
"flex flex-wrap item-center"
>
<div
class=
"social-icon-group space-x-0/5"
>
<a
class=
"social-icon"
target=
"_blank"
rel=
"noreferrer noopener"
href=
"{{ page.facebook }}"
><i
class=
"ico--facebook"
></i></a>
</div>
<div
class=
"social-icon-group space-x-2 text-lg"
>
<a
href=
"#"
class=
"social-icon "
><i
class=
"ico--twitter"
></i></a>
<a
href=
"#"
class=
"social-icon "
><i
class=
"ico--youtube"
></i></a>
<a
href=
"#"
class=
"social-icon "
><i
class=
"ico--instagram"
></i></a>
<a
href=
"#"
class=
"social-icon "
><i
class=
"ico--flickr"
></i></a>
</div>
{% endif %}
{{ page.person.name }}
<hr>
{#
<div
class=
"flex items-center"
>
#}
{#
<div
class=
"avatar w-6 mr-2"
>
#}
{#
<img
src=
"http://placeimg.com/100/100/people"
alt=
"Avatar"
>
#}
{#
</div>
#}
{##}
{#
<span
class=
"font-bold font-condensed"
>
Pirátská strana
</span>
#}
{#
</div>
#}
<hr>
<div
class=
"content-block"
>
<hr
/>
<div
class=
"space-y-4"
>
{% if page.phone %}
<div>
...
...
@@ -68,23 +67,16 @@
</a>
</div>
</div>
<
/div
>
<
hr
>
<hr
/>
<div
class=
"hidden lg:block"
>
<div
class=
"content-block"
>
<h2>
Lidé
</h2>
</div>
<div
class=
"space-y-4"
>
<div
class=
"space-y-4 mt-4"
>
{% for person in random_people %}
{% include "shared/person_badge_snippet.html" with person=person skipcontacts=1 %}
{% endfor %}
</div>
<a
href=
"{{ page.root_page.people_page.url }}"
class=
"btn btn--icon btn--violet-500 btn--fullwidth btn--hoveractive pt-4"
>
<a
href=
"{{ page.root_page.people_page.url }}"
class=
"btn btn--icon btn--violet-500 btn--fullwidth btn--hoveractive pt-4"
>
<div
class=
"btn__body-wrap"
>
<div
class=
"btn__body "
>
Poznejte celý náš tým
</div>
<div
class=
"btn__icon "
>
...
...
@@ -92,13 +84,24 @@
</div>
</div>
</a>
<hr>
{#
<h2>
Kancelář
</h2>
#}
{#
<h4>
Poslanecká sněmovna
</h4>
#}
{#
<p>
#}
{# Jiřího náměstí 39, 290 33 Poděbrady#}
{#
</p>
#}
{#
<iframe
#
}
{
#
src=
"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d82007.99920528589!2d15.688131074078123!3d50.034780639742856!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x470dc94b239307b5%3A0x12d59894ccf624ae!2sPardubice!5e0!3m2!1scs!2scz!4v1589382658695!5m2!1scs!2scz"
#
}
{
#
width=
"100%"
height=
"300"
id=
"mapa-mobile"
frameborder=
"0"
style=
"border:0;"
allowfullscreen=
""
#
}
{
#
aria-hidden=
"false"
tabindex=
"0"
></iframe>
#}
{#
<h4>
Otevírací doba
</h4>
#}
{#
<p>
Pondělí 14:00 - 18:00 objednat se přes: kancelář-podebrady@pirati.cz nebo 778 111 462.
</p>
#}
{#
<!-- Mobile divider -->
#}
{#
<hr
class=
"block lg:hidden"
>
#}
</div>
</div>
</div>
</aside>
</section>
</div>
</main>
</div>
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment