aboutsummaryrefslogtreecommitdiff
path: root/src/koszko_org_website/templates/__koszko_base.html.jinja
blob: b7de249b4bb62e5e06237d8bfb0496cca7297ac6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
{#
SPDX-License-Identifier: CC0-1.0

koszko.org website campaign pages template.

Copyright (C) 2021,2022 Wojtek Kosior <koszko@koszko.org>
#}
{% set section_attrs = {'class': 'layout-item'} %}
{% set header_attrs = {'class': 'content-subhead'} %}

{% extends "__base.html.jinja" %}

{% macro gitlink() -%}
  {%- for project_id in varargs -%}
    {{ numberlink('https://git.koszko.org/' ~ project_id ~ '/') }}
  {%- endfor -%}
{%- endmacro %}

{% block external_css %}
  {{ super() }}

  <link rel="stylesheet" href="/static/pure-main.css">
  <link rel="stylesheet" href="/static/pure-layouts.css">
{% endblock %}

{% block style %}
  {{ super() }}

  .pure-menu-item a {
      display: block;
  }

  #no-fb {
      position: relative;
  }

  #no-fb img {
      width: 150px;
      height: auto;
      position: absolute;
      left: 100px;
      top: -70px;
      -webkit-backface-visibility: hidden;
  }

  @media (max-width: 520px) {
      #no-fb img {
          width: 130px;
          left: 90px;
          top: -60px;
      }
  }
  @media (max-width: 460px) {
      #no-fb img {
          width: 110px;
          top: -50px;
      }
  }
  @media (max-width: 410px) {
      #no-fb img {
          width: 100px;
          left: 80px;
          top: -40px;
      }
  }
  @media (max-width: 380px) {
      #no-fb img {
          width: 70px;
          left: 65px;
          top: -30px;
      }
  }

  #main {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
  }

  .header, .content {
      width: 100%;
  }

  .content {
      flex-grow: 1;
  }

  aside {
      background: #1f8dd6;
      margin: 10px 0;
      padding: 3px 10px;
      border-radius: 3px;
      color: #fff;
  }

  .layout-item:first-child {
      margin-top: 0;
      border-top: 0;
  }

  .content .content-subhead {
      margin-top: 0;
  }

  dt {
      float: left;
      margin-right: .5em;
  }

  dd {
      display: inline;
  }

  dl.indent-dl dt {
      margin-left: -2em;
  }

  dl.indent-dl {
      margin-top: 0;
      margin-left: 2em;
  }

  footer > p {
      max-width: 768px;
      margin: auto;
  }
{% endblock %}

{% macro menu_item(link_url, text, active) %}
  <li class="pure-menu-item">
    {% if active %}
      {% set link_url = "#" %}
    {% endif %}
    {% set attrs = {'href': link_url, 'class': 'active' if active else none} %}
    <a{{ attrs|xmlattr }}>{{ text }}</a>
  </li>
{% endmacro %}

{% block body %}
  <input id="show-menu" type="checkbox"></input>
  <label href="#menu" id="menuLink" class="menu-link" for="show-menu">
    <span></span>
  </label>
  <nav id="menu">
    <div class="pure-menu">
      <span class="pure-menu-heading">
        {{ _('koszko_base.menu.span:languages') }}
      </span>
      <ul class="pure-menu-list">
        {% for current_lang, text in [('en', 'English'), ('pl', 'Polski')] %}
          {% set flask_endpoint = '.show_page_in_' ~ current_lang %}
          {% set link_url = url_for(flask_endpoint, page_path=page_path) %}
          {{ menu_item(link_url, text, lang_short == current_lang) }}
        {% endfor %}
      </ul>
      <span class="pure-menu-heading">
        {{ _('koszko_base.menu.span:places') }}
      </span>
      <ul class="pure-menu-list">
        {%
          for current_page, text in [
              ('koszko.html', _('koszko_base.menu.a:home')),
              ('cv.html',     _('koszko_base.menu.a:curriculum_vitae')),
              ('',            _('koszko_base.menu.a:campaign'))
          ]
        %}
          {% set link_url = same_lang_url(current_page) %}
          {{ menu_item(link_url, text, page_path == current_page) }}
        {% endfor %}
      </ul>
    </div>
  </nav>

  <div id="main">
    <div class="header">
      {% block header %}
        <h1>
          {% if page_path == 'koszko.html' %}
            {% set url = '#' %}
          {% else %}
            {% set url = same_lang_url('koszko.html') %}
          {% endif %}
          <a href="{{ url }}">
            {{ _('koszko_base.h1:wojtek_kosior') }}
          </a>
        </h1>
        <h2>
          <a href="#">
            {% block subheading_text %}
            {% endblock %}
          </a>
        </h2>
        {% if include_not_facebookd|default(false) %}
          <span id="no-fb">
            <a href="https://stallman.org/facebook.html" draggable="false">
              <img src="/static/no-facebook.svg" draggable="false">
            </a>
          </span>
        {% endif %}
      {% endblock %}
    </div>
    <div class="content">
      {% block content %}
      {% endblock %}
    </div>
    <footer class="footer center-text">
      {% include [dedicated_footer_path, lang_short ~ '/__footer.html.jinja'] %}
    </footer>
  </div>
{% endblock %}