m1m02530125 commited on
Commit
00fc179
·
1 Parent(s): 05de2bb

勤務統計をメインメニューに追加

Browse files

これまでシフト表画面右上の小さなボタンからしか辿れず分かりにくかったため、
PCサイドバーとスマホのハンバーガーメニューに「勤務統計」項目を追加し、
他画面と同様にメニューから直接アクセスできるようにする。

Files changed (1) hide show
  1. templates/base.html +12 -4
templates/base.html CHANGED
@@ -334,14 +334,17 @@
334
  ('shifts.index', 'bi-pencil-square', '希望シフト'),
335
  ('generate.index', 'bi-lightning-fill', '自動生成'),
336
  ('schedule.list_periods', 'bi-calendar3', 'シフト表'),
 
337
  ('customers.list_periods','bi-cup-hot-fill', '客数管理'),
338
  ('employees.index', 'bi-people-fill', 'スタッフ管理'),
339
  ('settings.index', 'bi-gear-fill', '設定'),
340
  ('help.index', 'bi-question-circle','ヘルプ'),
341
  ] %}
342
  {% for endpoint, icon, label in nav_items %}
 
 
343
  <a href="{{ url_for(endpoint) }}"
344
- class="{{ 'active' if request.endpoint and request.endpoint.startswith(endpoint.split('.')[0]) else '' }}">
345
  <i class="bi {{ icon }}"></i>{{ label }}
346
  </a>
347
  {% endfor %}
@@ -357,7 +360,8 @@
357
  request.endpoint.startswith('customers') or
358
  request.endpoint.startswith('employees') or
359
  request.endpoint.startswith('settings') or
360
- request.endpoint.startswith('help')
 
361
  ) %}
362
  <div class="bottom-nav">
363
  {% for endpoint, icon, label in [
@@ -366,8 +370,9 @@
366
  ('generate.index', 'bi-lightning-fill', '自動生成'),
367
  ('schedule.list_periods', 'bi-calendar3', 'シフト表'),
368
  ] %}
 
369
  <a href="{{ url_for(endpoint) }}"
370
- class="{{ 'active' if request.endpoint and request.endpoint.startswith(endpoint.split('.')[0]) else '' }}">
371
  <i class="bi {{ icon }}"></i>{{ label }}
372
  </a>
373
  {% endfor %}
@@ -385,12 +390,15 @@
385
  <div class="drawer-title">メニュー</div>
386
  {% for endpoint, icon, label, desc in [
387
  ('customers.list_periods', 'bi-cup-hot-fill', '客数管理', '予約客数の入力'),
 
388
  ('employees.index', 'bi-people-fill', 'スタッフ管理','スタッフの登録・編集'),
389
  ('settings.index', 'bi-gear-fill', '設定', 'シフト制約・アプリ設定'),
390
  ('help.index', 'bi-question-circle', 'ヘルプ', '使い方・開発者情報'),
391
  ] %}
 
 
392
  <a href="{{ url_for(endpoint) }}"
393
- class="{{ 'active' if request.endpoint and request.endpoint.startswith(endpoint.split('.')[0]) else '' }}"
394
  onclick="closeDrawer()">
395
  <i class="bi {{ icon }}"></i>
396
  <div>
 
334
  ('shifts.index', 'bi-pencil-square', '希望シフト'),
335
  ('generate.index', 'bi-lightning-fill', '自動生成'),
336
  ('schedule.list_periods', 'bi-calendar3', 'シフト表'),
337
+ ('schedule.stats_multi', 'bi-bar-chart-fill', '勤務統計'),
338
  ('customers.list_periods','bi-cup-hot-fill', '客数管理'),
339
  ('employees.index', 'bi-people-fill', 'スタッフ管理'),
340
  ('settings.index', 'bi-gear-fill', '設定'),
341
  ('help.index', 'bi-question-circle','ヘルプ'),
342
  ] %}
343
  {% for endpoint, icon, label in nav_items %}
344
+ {% set active = (request.endpoint == endpoint) if endpoint == 'schedule.stats_multi'
345
+ else (request.endpoint and request.endpoint.startswith(endpoint.split('.')[0]) and request.endpoint != 'schedule.stats_multi') %}
346
  <a href="{{ url_for(endpoint) }}"
347
+ class="{{ 'active' if active else '' }}">
348
  <i class="bi {{ icon }}"></i>{{ label }}
349
  </a>
350
  {% endfor %}
 
360
  request.endpoint.startswith('customers') or
361
  request.endpoint.startswith('employees') or
362
  request.endpoint.startswith('settings') or
363
+ request.endpoint.startswith('help') or
364
+ request.endpoint == 'schedule.stats_multi'
365
  ) %}
366
  <div class="bottom-nav">
367
  {% for endpoint, icon, label in [
 
370
  ('generate.index', 'bi-lightning-fill', '自動生成'),
371
  ('schedule.list_periods', 'bi-calendar3', 'シフト表'),
372
  ] %}
373
+ {% set active = request.endpoint and request.endpoint.startswith(endpoint.split('.')[0]) and request.endpoint != 'schedule.stats_multi' %}
374
  <a href="{{ url_for(endpoint) }}"
375
+ class="{{ 'active' if active else '' }}">
376
  <i class="bi {{ icon }}"></i>{{ label }}
377
  </a>
378
  {% endfor %}
 
390
  <div class="drawer-title">メニュー</div>
391
  {% for endpoint, icon, label, desc in [
392
  ('customers.list_periods', 'bi-cup-hot-fill', '客数管理', '予約客数の入力'),
393
+ ('schedule.stats_multi', 'bi-bar-chart-fill', '勤務統計', '複数期間の勤務時間集計'),
394
  ('employees.index', 'bi-people-fill', 'スタッフ管理','スタッフの登録・編集'),
395
  ('settings.index', 'bi-gear-fill', '設定', 'シフト制約・アプリ設定'),
396
  ('help.index', 'bi-question-circle', 'ヘルプ', '使い方・開発者情報'),
397
  ] %}
398
+ {% set active = (request.endpoint == endpoint) if endpoint == 'schedule.stats_multi'
399
+ else (request.endpoint and request.endpoint.startswith(endpoint.split('.')[0])) %}
400
  <a href="{{ url_for(endpoint) }}"
401
+ class="{{ 'active' if active else '' }}"
402
  onclick="closeDrawer()">
403
  <i class="bi {{ icon }}"></i>
404
  <div>