|
1 |
| -:编号: :okr.id+by-path:`{{ id.split('-')[0] }} <{{ id }}>`\ ``-{{ id.split('-', maxsplit=1)[1]}}`` |
| 1 | +:编号: :okr.id+by-path:`{{ id.split('-') | first }} <{{ id }}>`\ ``-{{ id.split('-', maxsplit=1) | first }}`` |
2 | 2 | :优先级: {% if p0 is defined %}|p0|{% elif p1 is defined %}|p1|{% else %}|p2|{% endif %}
|
3 | 3 | {% if id.count('-') == 2 %}:对齐: :okr:`{{ id.rsplit('-', maxsplit=1)[0] }}`{% endif %}
|
4 | 4 |
|
| 5 | +{% if krs %} |
| 6 | +.. note:: 2025 前的 OKR 使用旧格式,已归档,请勿用此格式创建新 OKR |
| 7 | +.. code:: python |
| 8 | + |
| 9 | + {{ krs }} |
| 10 | +
|
| 11 | +{% else %} |
5 | 12 | .. list-table::
|
6 | 13 | :header-rows: 1
|
7 | 14 | :align: center
|
8 | 15 | :widths: auto
|
9 | 16 |
|
10 |
| - * - Key Result |
| 17 | + * - KR |
11 | 18 | - 进度
|
12 |
| - - 分数 |
13 |
| -
|
14 |
| - {# TODO: 2025-04-27: compat for old schema #} |
15 |
| - {% for n in range(krs | length) %} |
16 |
| - * - {{ krs[n] }} |
17 |
| - - {% if hrs and hrs | length > n and hrs[n] != '_' %} {{ hrs[n] }} 小时 {% else %} ⁿ̷ₐ {% endif %} |
18 |
| - - {% if progs and progs | length > n and progs[n] != '_' %} |{{ progs[n]}}| {% else %} ⁿ̷ₐ {% endif %} |
19 |
| - - {% if scores and scores | length > n and scores[n] != '_' %} |{{ scores[n] }}| {% else %} ⁿ̷ₐ {% endif %} |
20 |
| - {% endfor %} |
21 | 19 |
|
22 |
| - {% if kr1 %} |
23 |
| - * - {% for line in kr1 %} |
24 |
| - {{ line }} |
25 |
| - {% endfor %} |
26 |
| - - {{ done1 or 'ⁿ̷ₐ' }} |
27 |
| - - {{ score1 or 'ⁿ̷ₐ' }} |
28 |
| - {% endif %} |
29 |
| - {% if kr2 %} |
30 |
| - * - {% for line in kr2 %} |
31 |
| - {{ line }} |
32 |
| - {% endfor %} |
33 |
| - - {{ done2 or 'ⁿ̷ₐ' }} |
34 |
| - - {{ score2 or 'ⁿ̷ₐ' }} |
35 |
| - {% endif %} |
36 |
| - {% if kr3 %} |
37 |
| - * - {% for line in kr3 %} |
38 |
| - {{ line }} |
39 |
| - {% endfor %} |
40 |
| - - {{ done3 or }} |
41 |
| - - {{ score3 or 'ⁿ̷ₐ' }} |
42 |
| - {% endif %} |
43 |
| - {% if kr4 %} |
44 |
| - * - {% for line in kr4 %} |
45 |
| - {{ line }} |
| 20 | +{% for i in range(1, 10) %} |
| 21 | + {% set kr = _['kr%d' % i] %} |
| 22 | + {%- if not kr %}{% continue %}{% endif %} |
| 23 | + {% set ns = namespace(progress = 'ⁿ̷ₐ', priority = 'p2') %} |
| 24 | + * - {% for line in kr %} |
| 25 | + {% if loop.first %} |
| 26 | + {% for v in line.split('|') %} |
| 27 | + {% if loop.last %}{% break%}{% endif %} |
| 28 | + {% if v.startswith('p') %} |
| 29 | + {% set ns.priority = v | trim %} |
| 30 | + {% elif '/' in v %} |
| 31 | + {% set ns.progress = v | trim %} |
| 32 | + {% endif %} |
| 33 | + {% endfor %} |
| 34 | + {% set line = line.split('|') | last %} |
| 35 | + {% endif %} |
| 36 | + |{{ ns.priority }}| {{ line | trim }} |
46 | 37 | {% endfor %}
|
47 |
| - - {{ done4 or 'ⁿ̷ₐ' }} |
48 |
| - - {{ score4 or 'ⁿ̷ₐ' }} |
49 |
| - {% endif %} |
| 38 | + - {{ ns.progress }} |
| 39 | +{% endfor %} |
| 40 | +{% endif %} |
50 | 41 |
|
51 | 42 | {{ content }}
|
0 commit comments