superset list 源码

  • 2022-10-20
  • 浏览 (316)

superset list 代码

文件路径:/superset/templates/superset/models/rls/list.html

{#
  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.
#}
{% extends 'appbuilder/general/widgets/base_list.html' %}
{% import 'appbuilder/general/lib.html' as lib %}

    {% block begin_content scoped %}
        <div class="table-responsive">
        <table class="table table-hover">
    {% endblock %}

    {% block begin_loop_header scoped %}
        <thead>
        <tr>
        {% if actions %}
        <th class="action_checkboxes">
            <input id="check_all" class="action_check_all" name="check_all" type="checkbox">
        </th>
        {% endif %}

        {% if can_show or can_edit or can_delete %}
            <th class="col-md-1 col-lg-1 col-sm-1" ></th>
        {% endif %}

        {% for item in include_columns %}
            {% if item in order_columns %}
                {% set res = item | get_link_order(modelview_name) %}
                    {% if res == 2 %}
                    <th><a href={{ item | link_order(modelview_name) }}>{{label_columns.get(item)}}
                    <i class="fa fa-chevron-up pull-right"></i></a></th>
                {% elif res == 1 %}
                    <th><a href={{ item | link_order(modelview_name) }}>{{label_columns.get(item)}}
                    <i class="fa fa-chevron-down pull-right"></i></a></th>
                {% else %}
                    <th><a href={{ item | link_order(modelview_name) }}>{{label_columns.get(item)}}
                    <i class="fa fa-arrows-v pull-right"></i></a></th>
                {% endif %}
            {% else %}
                <th>{{label_columns.get(item)}}</th>
            {% endif %}
        {% endfor %}
        </tr>
        </thead>
    {% endblock %}

    {% block begin_loop_values %}
        {% for item in value_columns %}
            {% set pk = pks[loop.index-1] %}
            <tr>
                {% if actions %}
                <td>
                    <input id="{{pk}}" class="action_check" name="rowid" value="{{pk}}" type="checkbox">
                </td>
                {% endif %}
                {% if can_show or can_edit or can_delete %}
                    <td><center>
                    {{ lib.btn_crud(can_show, can_edit, can_delete, pk, modelview_name, filters) }}
                    </center></td>
                {% endif %}
                {% for value in include_columns %}
                    <td>
                    {% if value == "roles" and item["filter_type"] == "Base" and not item[value] %}
                      All
                    {% elif value == "roles" and item["filter_type"] == 'Base' %}
                      Not {{ item[value] }}
                    {% elif value == "roles" and item["filter_type"] == 'Regular' and not item[value] %}
                      None
                    {% elif value == "group_key" and item[value] == None %}
                    {% else %}
                      {{ item[value] }}
                    {% endif %}
                    </td>
                {% endfor %}
            </tr>
        {% endfor %}
    {% endblock %}

    {% block end_content scoped %}
        </table>
        </div>
    {% endblock %}

相关信息

superset 源码目录

相关文章

superset caches 源码

superset changelog 源码

superset generate_email 源码

superset superset_config 源码

superset babel.config 源码

superset docusaurus.config 源码

superset sidebars 源码

superset data 源码

superset utils 源码

superset matomo 源码

0  赞