{% load seizou_tags seizou_icons %}{% comment %} orders の一覧の行の部分。土台は画面の全体でも htmx の要求でも、この部分を core/_rows.html より先に探す。 受注の一覧 (order_list) と注文残の一覧 (orderline_list) に行があるときだけ、core/_rows.html の「行がある時」の部分 (表・ページ送り・partial のときの _list_meta.html の oob) を写して、次の 2 つを変える。 - 受注の一覧: 状態の列 (列の名前 status) の欄を色の印にする。字は欄の値 (状態の表示名) のまま。列の並びは変えない。 右端に「要点」の列 (行の「要点を見る」の目の印 = core/_row_summary_link.html。押すと受注の小窓 orders:order_modal を開く。受け渡しの seizou-部品の6案-20261107/指示書.md の 6)。 - 注文残の一覧 (注残の盤): orders/_board_rows.html (判断の列の印・合計の行・行のメニュー)。 注文残の一覧が空で、検索も絞りの札も無いときは orders/_board_empty.html (「受注を入れると、出荷の残りがある明細がここに並びます。」の 1 文と「受注の新規登録」のボタン。作者の決め)。 それ以外 (検索か札のある 0 件、受注の一覧の 0 件、ほかの画面) は core/_rows.html をそのまま使う。 写した元: core/_rows.html (11-02 夜の main)。土台の表の形が変わったら、ここも合わせる。 {% endcomment %} {% with url_name=request.resolver_match.url_name %} {% if rows and url_name == "orderline_list" %}{% include "orders/_board_rows.html" %} {% elif rows and url_name == "order_list" %} {# 表の箱を包む要素。右に続きがあるときだけ、箱の印 (data-scroll-hint) を見る JS がこの要素に印を付け、この要素の中に「→」のボタンを作る (右の端の影はやめた。11-07 の決め)。 #}
{% for col in columns %}{% endfor %} {% if url_name == "orderline_list" %}{% elif url_name == "order_list" %}{% endif %} {% for row in rows %} {% for cell in row.cells %} {# 欄の dict に列の名前が無いので、同じ番号の列 (columns) を内側の for で探して名前を見る。内側の forloop.parentloop が欄の for。 #} {% for col in columns %}{% if forloop.counter0 == forloop.parentloop.counter0 %} {% if url_name == "order_list" and col.name == "status" %} {% elif cell.numeric %} {% elif cell.date or cell.datetime %} {% elif cell.master %} {% elif cell.boolean %} {% elif forloop.parentloop.first and row.url %} {% else %} {% endif %} {% endif %}{% endfor %} {% endfor %} {% if url_name == "orderline_list" %}{% elif url_name == "order_list" %}{% endif %} {% endfor %} {% if totals %}{% for cell in totals %}{% endfor %}{% if url_name == "orderline_list" or url_name == "order_list" %}{% endif %}{% endif %}
{% if col.sortable %}{{ col.label }}{% if sort == col.name %}{% icon "chevron-up" "size-4 text-primary" %}{% elif sort == col.desc_name %}{% icon "chevron-down" "size-4 text-primary" %}{% else %}{% icon "chevrons-up-down" "size-4 text-base-content/60" %}{% endif %}{% else %}{{ col.label }}{% endif %} 操作要点
{% status_badge row.obj %}{% if cell.master %}{% master_link cell.master cell.value %}{% elif cell.negative %}{{ cell.value|yen_if:cell.money }}{% else %}{{ cell.value|yen_if:cell.money }}{% endif %}{% if cell.datetime %}{{ cell.value|date:"Y-m-d H:i" }}{% else %}{{ cell.value|date:"Y-m-d" }}{% with day=cell.value|weekday_ja %}{% if day %} ({{ day }}){% endif %}{% endwith %}{% endif %}{% master_link cell.master cell.value %}{% bool_mark cell.value %}{{ cell.value|default_if_none:"" }}{{ cell.value|default_if_none:"" }}{% include "orders/_line_actions.html" with line=row.obj order=row.obj.order %}{% url 'orders:order_modal' row.pk as modal_url %}{% include "core/_row_summary_link.html" with modal_url=modal_url detail_url=row.url %}
{% if cell.numeric %}{{ cell.value|yen_if:cell.money }}{% elif forloop.first %}合計{% endif %}

{{ paginator.count|comma }} 件中 {{ page_obj.start_index|comma }}–{{ page_obj.end_index|comma }} 件

{% if paginator.num_pages > 1 %} {% endif %}
{% if partial %}{% include "core/_list_meta.html" with oob=True %}{% if filters %}{% include "core/_filter_clear.html" with oob=True %}{% endif %}{% endif %} {% elif url_name == "orderline_list" and not search_q and not filter_chips %}{% include "orders/_board_empty.html" %} {% else %}{% include "core/_rows.html" %} {% endif %} {% endwith %}