Skip to content

Commit ba13579

Browse files
committed
fix page about the board
1 parent 249e5e9 commit ba13579

File tree

3 files changed

+33
-21
lines changed

3 files changed

+33
-21
lines changed

docs/operations/boards.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,35 @@ Mandát od 9.4.2022
1414
.. csv-table::
1515
:header: "Jméno", "GitHub", "Funkce"
1616

17-
Barbora Drbohlavová, `@baradrb <https://github.com/baradrb>`_, |:crown:|
18-
Anežka Müller, `@anezkamll <https://github.com/anezkamll>`_,
19-
Jan Javorek, `@honzajavorek <https://github.com/honzajavorek>`_,
20-
Jakub Vysoký, `@kvbik <https://github.com/kvbik>`_,
21-
Jan Čermák, `@sairon <https://github.com/sairon>`_,
17+
Barbora Drbohlavová, `@baradrb <https://github.com/baradrb>`_, |:crown:|
18+
Anežka Müller, `@anezkamll <https://github.com/anezkamll>`_,
19+
Jan Javorek, `@honzajavorek <https://github.com/honzajavorek>`_,
20+
Jakub Vysoký, `@kvbik <https://github.com/kvbik>`_,
21+
Jan Čermák, `@sairon <https://github.com/sairon>`_, |:moneybag:|
2222

2323
Mandát od 8.4.2019
2424
-------------------------------------------------
2525

2626
.. csv-table::
2727
:header: "Jméno", "GitHub", "Funkce"
2828

29-
Martin Bílek, `@martinbilek <https://github.com/martinbilek>`_, |:crown:|
30-
Aleš Zoulek, `@aleszoulek <https://github.com/aleszoulek>`_,
31-
Jan Javorek, `@honzajavorek <https://github.com/honzajavorek>`_,
32-
Jakub Vysoký, `@kvbik <https://github.com/kvbik>`_,
33-
Jiří Bartoň, `@whiskybar <https://github.com/whiskybar>`_,
29+
Martin Bílek, `@martinbilek <https://github.com/martinbilek>`_, |:crown:| |:moneybag:|
30+
Aleš Zoulek, `@aleszoulek <https://github.com/aleszoulek>`_,
31+
Jan Javorek, `@honzajavorek <https://github.com/honzajavorek>`_,
32+
Jakub Vysoký, `@kvbik <https://github.com/kvbik>`_,
33+
Jiří Bartoň, `@whiskybar <https://github.com/whiskybar>`_,
3434

3535
Mandát od 27.3.2012
3636
-------------------------------------------------
3737

3838
.. csv-table::
3939
:header: "Jméno", "GitHub", "Funkce"
4040

41-
Martin Bílek, `@martinbilek <https://github.com/martinbilek>`_, |:crown:|
42-
Aleš Zoulek, `@aleszoulek <https://github.com/aleszoulek>`_,
43-
Robin Gottfried, `@czervenka <https://github.com/czervenka>`_,
44-
Jan Král, `@honzakral <https://github.com/honzakral>`_,
45-
Jakub Vysoký, `@kvbik <https://github.com/kvbik>`_,
46-
Jiří Bartoň, `@whiskybar <https://github.com/whiskybar>`_,
47-
Vítězslav Pliska, `@whit <https://github.com/whit>`_,
41+
Martin Bílek, `@martinbilek <https://github.com/martinbilek>`_, |:crown:| |:moneybag:|
42+
Aleš Zoulek, `@aleszoulek <https://github.com/aleszoulek>`_,
43+
Robin Gottfried, `@czervenka <https://github.com/czervenka>`_,
44+
Jan Král, `@honzakral <https://github.com/honzakral>`_,
45+
Jakub Vysoký, `@kvbik <https://github.com/kvbik>`_,
46+
Jiří Bartoň, `@whiskybar <https://github.com/whiskybar>`_,
47+
Vítězslav Pliska, `@whit <https://github.com/whit>`_,
4848

docs/operations/boards.rst.jinja

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Kdyby něco nesedělo, ověřte `historii zdrojáku této stránky <https://gith
88
.. Soubor docs/operations/boards.rst je generován skriptem scripts/generate_boards.py ze šablony docs/operations/boards.rst.jinja. Neupravovat ručně!
99

1010
{% for board in boards %}
11-
Mandát od {{ board.from.strftime("%-d.%-m.%Y") }}
11+
Mandát od {{ board.start_on.strftime("%-d.%-m.%Y") }}
1212
-------------------------------------------------
1313

1414
.. csv-table::
1515
:header: "Jméno", "GitHub", "Funkce"
16-
{% for github_username, member_name in board.members.items() %}
17-
{{ member_name }}, `@{{ github_username }} <https://github.com/{{ github_username }}>`_, {% if loop.first %}|:crown:|{% endif %}
16+
{% for member in board.members %}
17+
{{ member.name }}, `@{{ member.github }} <https://github.com/{{ member.github }}>`_, {% if member.is_chair %}|:crown:| {% endif %}{% if member.is_treasurer %}|:moneybag:| {% endif %}
1818
{%- endfor %}
1919
{% endfor %}

src/pyvec_docs/board.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ class BoardMember(BaseModel):
2525

2626
model_config = {"extra": "forbid", "frozen": True}
2727

28+
@property
29+
def is_chair(self) -> bool:
30+
if self.roles is None:
31+
return False
32+
return BoardRole.chair in self.roles
33+
34+
@property
35+
def is_treasurer(self) -> bool:
36+
if self.roles is None:
37+
return False
38+
return BoardRole.treasurer in self.roles
39+
2840

2941
class Board(BaseModel):
3042
start_on: date
@@ -42,7 +54,7 @@ def years(self) -> tuple[int, int]:
4254
def load_boards(path: Path | str = BOARDS_CONFIG_PATH) -> list[Board]:
4355
data = tomllib.loads(Path(path).read_text())
4456
return sorted(
45-
(Board(**board) for board in data["boards"]),
57+
(Board(**board) for board in data["board"]),
4658
key=attrgetter("start_on"),
4759
reverse=True,
4860
)

0 commit comments

Comments
 (0)