{% load seizou_tags seizou_icons %}{% comment %} 不良の一覧の 1 行 (progress/_rows.html が不良の一覧 progressdefect_list のときに core/_rows.html の row_template として渡す。N407b)。 写した元: progress/_record_row.html (実績の一覧の 1 行。その元は stock/_row.html と core/_rows.html の行)。土台の表の行の形が変わったら、ここも合わせる。 写した元から変えた所: 最後の「操作」の欄の項目は「原因と対策を書く」の 1 つだけ (区分と数は実績の編集で直し、行は実績の編集で消す)。 1 列目 (日時) は実績を辿る名前なので、土台の列は日時の印 (cell.datetime) を付けない。画面 (ProgressDefectListView) の 1 列目は日時なので、ここで 1 列目を分まで出す (画面の class は土台の 13 の属性のほかを上書きしない決まり R15 のため、行の作り方 row_for は変えない。会社ごとの項目の列は最後に足されるので 1 列目は動かない)。 行の操作は ⋮ のボタンと、同じ中身の右クリック。markup の約束と動きは core の js/seizou-row-menu.js の頭の comment。 「原因と対策を書く」は入力を小窓で開く (data-modal-form は href と 1 字も違わない字)。JS が無いときと新しいタブでは href で画面へ移り、 保存の後と「キャンセル」で不良の一覧へ戻る (?next=)。can_edit (progress/_rows.html が can_write の tag で 1 回だけ決める) が真の人にだけ出す。 {% endcomment %} {% for cell in row.cells %} {% if forloop.first %}{{ cell.value|date:"Y-m-d H:i" }} {% 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 %} {% if can_edit %}{% url 'progress:progressdefect_update' row.pk as note_url %} {% endif %}