{% load seizou_tags seizou_icons %}{% comment %} 在庫の一覧の 1 行 (masters/_rows.html が在庫の一覧 stock_list のときに core/_rows.html の row_template として渡す)。 写した元: core/_rows.html (6d52628 の main) の 15-25 行。土台の表の行の形が変わったら、ここも合わせる。 写した元から変えた所: 行に data-row-menu、行の押下で部品の詳細へ移る onclick は link と ⋮ の欄の中の押下では動かない (closest('a, details'))、最後に「操作」の欄。 行の操作は ⋮ のボタンと、同じ中身の右クリック。markup の約束と動きは core の js/seizou-row-menu.js の頭の comment。 「動きを見る」は在庫の動きの一覧を、絞りの「部品」をこの部品にして開く (?f_item=。絞りの枠と札に出る)。 「棚卸しの調整」「払い出し」は部品を選んだ形 (?item=) で入力を小窓で開く (data-modal-form は href と 1 字も違わない字。決め 11-04 17:5x)。JS が無いときと新しいタブでは href で画面へ移り、「キャンセル」で在庫の一覧へ戻る (?next=)。 この 2 つは can_move (masters/_rows.html が can_write の tag で 1 回だけ決める) が真の人にだけ出す。 {% endcomment %} {% for cell in row.cells %} {% if forloop.first and row.url and not cell.numeric and not cell.master %}{% if cell.datetime %}{{ cell.value|date:"Y-m-d H:i" }}{% elif cell.date %}{{ cell.value|date:"Y-m-d" }}{% with day=cell.value|weekday_ja %}{% if day %} ({{ day }}){% endif %}{% endwith %}{% else %}{{ cell.value|default_if_none:"" }}{% endif %} {% elif cell.numeric %}{% 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 %} {% elif cell.date or cell.datetime %}{% 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 %} {% elif cell.master %}{% master_link cell.master cell.value %} {% elif cell.boolean %}{% bool_mark cell.value %} {% elif cell.status %}{% status_badge row.obj %} {% else %}{{ cell.value|default_if_none:"" }} {% endif %} {% endfor %} {% url 'stock:stockmove_list' as moves_url %}{% url 'stock:adjust_create' as adjust_url %}{% url 'stock:issue_create' as issue_url %}