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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
e03e606d
Commit
e03e606d
authored
2 years ago
by
jan.bednarik
Committed by
jan.bednarik
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
majak: Public sites list
parent
20ceb3a4
No related branches found
No related tags found
2 merge requests
!536
Release
,
!535
majak: Public sites list
Pipeline
#8326
passed
2 years ago
Stage: build
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
majak/urls.py
+2
-0
2 additions, 0 deletions
majak/urls.py
tuning/templates/tuning/sites_list.html
+135
-0
135 additions, 0 deletions
tuning/templates/tuning/sites_list.html
tuning/views.py
+21
-0
21 additions, 0 deletions
tuning/views.py
with
158 additions
and
0 deletions
majak/urls.py
+
2
−
0
View file @
e03e606d
...
@@ -9,6 +9,7 @@ from wagtail.documents import urls as wagtaildocs_urls
...
@@ -9,6 +9,7 @@ from wagtail.documents import urls as wagtaildocs_urls
from
elections2021
import
views
as
elections2021_views
from
elections2021
import
views
as
elections2021_views
from
maps_utils
import
urls
as
maps_utils_urls
from
maps_utils
import
urls
as
maps_utils_urls
from
tuning.views
import
SitesListView
handler404
=
"
shared.views.page_not_found
"
handler404
=
"
shared.views.page_not_found
"
...
@@ -23,6 +24,7 @@ urlpatterns = [
...
@@ -23,6 +24,7 @@ urlpatterns = [
),
),
path
(
"
maps/
"
,
include
(
maps_utils_urls
)),
path
(
"
maps/
"
,
include
(
maps_utils_urls
)),
path
(
"
captcha/
"
,
include
(
captcha
.
urls
)),
path
(
"
captcha/
"
,
include
(
captcha
.
urls
)),
path
(
"
seznam-webu/
"
,
SitesListView
.
as_view
()),
]
+
pirates_urlpatterns
]
+
pirates_urlpatterns
...
...
This diff is collapsed.
Click to expand it.
tuning/templates/tuning/sites_list.html
0 → 100644
+
135
−
0
View file @
e03e606d
{% load static %}
<!doctype html>
<html
lang=
"cs"
>
<head>
<!-- Meta -->
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width"
/>
<meta
name=
"robots"
content=
"noindex, nofollow"
>
<title>
Seznam webů v Majáku
</title>
<!-- Favicon -->
{% include "shared/favicon_snippet.html" %}
<!-- Styles -->
<link
href=
"https://styleguide.pirati.cz/2.3.x/css/styles.css"
rel=
"stylesheet"
media=
"all"
/>
<link
href=
"https://styleguide.pirati.cz/2.3.x/css/pattern-scaffolding.css"
rel=
"stylesheet"
media=
"all"
/>
<style
type=
"text/css"
>
.head-alt-md
,
.head-alt-lg
{
line-height
:
1.25
;
}
.ul-picture
li
:before
{
content
:
none
!important
;
}
.ul-picture
li
{
background-repeat
:
no-repeat
;
background-position
:
0
0
;
padding
:
0
0
1em
35px
!important
;
}
.content-block
a
{
color
:
#004958
;
}
.text-white
a
{
color
:
#FFFFFF
;
}
</style>
</head>
<body>
<nav
class=
"navbar navbar--simple __js-root"
>
<ui-app
inline-template
>
<ui-navbar
inline-template
>
<div>
<div
class=
"container container--default navbar__content"
:class=
"{'navbar__content--initialized': true}"
>
<div
class=
"navbar__brand my-4 flex items-center lg:pr-8 lg:my-0"
>
<img
src=
"{% static "
majak
/
img
/
majak-pruhledny.svg
"
%}"
class=
"w-8"
/>
<span
class=
"pl-4 font-bold text-xl lg:border-r lg:border-grey-300 lg:pr-8"
>
Seznam webů v Majáku
</span>
</div>
<div
class=
"navbar__menutoggle my-4 flex justify-end lg:hidden"
>
<a
href=
"#"
@
click=
"show = !show"
class=
"no-underline hover:no-underline"
>
<i
class=
"ico--menu text-3xl"
></i>
</a>
</div>
<div
v-if=
"show || isLgScreenSize"
class=
"navbar__main navbar__section navbar__section--expandable container-padding--zero lg:container-padding--auto"
>
<ul
class=
"navbar-menu text-white"
>
<li
class=
"navbar-menu__item"
>
<a
href=
"https://majak.pirati.cz"
data-href=
"https://majak.pirati.cz"
class=
"navbar-menu__link"
>
do Majáku
</a>
</li>
</ul>
</div>
</div>
</div>
</ui-navbar>
</ui-app>
</nav>
<div
class=
"container container--default py-8 lg:py-16"
>
<main>
<div
class=
"lg:flex clearfix"
>
<div
class=
"content-block lg:w-1/3 lg:pr-5 px-4 py-2"
>
<div
class=
"content-block"
>
<ul>
{% for site in sites_first %}
<li><a
href=
"{{ site.root_url }}"
>
{{ site.root_page.title }}
</a></li>
{% endfor %}
</ul>
</div>
</div>
<div
class=
"content-block lg:w-1/3 lg:pl-5 px-4 py-2"
>
<div
class=
"content-block"
>
<ul>
{% for site in sites_second %}
<li><a
href=
"{{ site.root_url }}"
>
{{ site.root_page.title }}
</a></li>
{% endfor %}
</ul>
</div>
</div>
<div
class=
"content-block lg:w-1/3 lg:pl-5 px-4 py-2"
>
<div
class=
"content-block"
>
<ul>
{% for site in sites_third %}
<li><a
href=
"{{ site.root_url }}"
>
{{ site.root_page.title }}
</a></li>
{% endfor %}
</ul>
</div>
</div>
</div>
</main>
</div>
<footer
class=
"footer bg-grey-700 text-white __js-root"
>
<ui-app
inline-template
>
<div>
<div
class=
"footer__main py-4 lg:py-16 container container--default"
>
<section
class=
"footer__brand"
>
{% if page.root_page.show_logo %}
<a
href=
"https://www.pirati.cz"
>
<img
src=
"https://styleguide.pirati.cz/2.3.x/images/logo-full-white.svg"
alt=
"logo pirátské strany"
class=
"w-32 md:w-40 pb-6"
/>
</a>
{% endif %}
<p
class=
"para hidden md:block md:mb-4 lg:mb-0 text-grey-200"
>
<span
class=
"copyleft inline-block"
>
©
</span>
{% now "Y" %} Piráti. Všechna práva vyhlazena. Sdílejte a nechte ostatní sdílet za stejných podmínek.
</p>
</section>
<section
class=
"footer__social lg:text-right"
>
<div
class=
"mb-4"
>
</div>
<div
class=
"flex flex-col md:flex-row lg:flex-col lg:items-end space-y-2 md:space-y-0 md:space-x-2 lg:space-x-0 lg:space-y-2"
>
</div>
</section>
</div>
</div>
</ui-app>
</footer>
<script
src=
"{% static "
shared
/
vendor
/
vue
/
vue.2.6.11.js
"
%}"
></script>
<script
src=
"https://styleguide.pirati.cz/2.3.x/js/main.bundle.js"
></script>
<script
src=
"{% static "
shared
/
vendor
/
jquery
/
jquery-3.4.1.min.js
"
%}"
></script>
<script
src=
"{% static "
shared
/
vendor
/
lazysizes
/
lazysizes.min.js
"
%}"
></script>
</body>
</html>
This diff is collapsed.
Click to expand it.
tuning/views.py
0 → 100644
+
21
−
0
View file @
e03e606d
import
math
from
django.views.generic.base
import
TemplateView
from
wagtail.core.models
import
Site
class
SitesListView
(
TemplateView
):
template_name
=
"
tuning/sites_list.html
"
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
().
get_context_data
(
**
kwargs
)
sites
=
list
(
Site
.
objects
.
exclude
(
hostname__contains
=
"
.pir-test.eu
"
)
.
select_related
(
"
root_page
"
)
.
order_by
(
"
root_page__title
"
)
)
third
=
math
.
ceil
(
len
(
sites
)
/
3
)
context
[
"
sites_first
"
]
=
sites
[:
third
]
context
[
"
sites_second
"
]
=
sites
[
third
:
third
*
2
]
context
[
"
sites_third
"
]
=
sites
[
third
*
2
:]
return
context
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
register
or
sign in
to comment