{# Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. #} {% import 'appbuilder/general/lib.html' as lib %} {% extends 'appbuilder/general/widgets/base_list.html' %} {% block begin_content scoped %}
| {% endif %} {% if can_show or can_edit or can_delete %} | {% endif %} {% for item in include_columns %} {% if item == 'id' %} {# ID/Name 切换列 #} | {{label_columns.get('id')}} | {% elif item == 'name' %} {# name 列默认隐藏,通过JS控制显示 #} {% else %} {% if item in order_columns %} {% set res = item | get_link_order(modelview_name) %} {% if res == 2 %}{{label_columns.get(item)}} | {% elif res == 1 %}{{label_columns.get(item)}} | {% else %}{{label_columns.get(item)}} | {% endif %} {% else %}{{label_columns.get(item)}} | {% endif %} {% endif %} {% endfor %}
|---|---|---|---|---|---|---|
| {% endif %} {% if can_show or can_edit or can_delete %} | {{ item[value] }} | {% elif value == 'name' %} {# Name 列,可切换显示 #} {% else %} {% set formatter = formatters_columns.get(value) %} {% if formatter and formatter(item) %}{{ formatter(item) }} | {% elif item[value] != None %}{{ item[value] }} | {% else %}{% endif %} {% endif %} {% endfor %} |