Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3648491
  • 博文数量: 365
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 2522
  • 用 户 组: 普通用户
  • 注册时间: 2019-10-28 13:40
文章分类

全部博文(365)

文章存档

2023年(8)

2022年(130)

2021年(155)

2020年(50)

2019年(22)

我的朋友

分类: Python/Ruby

2021-07-29 17:26:18

{#  This file was part of Flask-Bootstrap and was modified under the terms of

 its BSD License. Copyright (c) 2013, Marc Brinkmann. All rights reserved. #}

{% macro render_pager(pagination,

                      fragment='',

                      prev=(' Previous')|safe,

                      next=('Next ')|safe,

                      align='') -%}

    

{%- endmacro %}

{% macro _arg_url_for(endpoint, base) %}

    {# calls url_for() with a given endpoint and **base as the parameters,

   additionally passing on all keyword_arguments (may overwrite existing ones)

 #}

    {%- with kargs = base.copy() -%}

        {%- do kargs.update(kwargs) -%}

        {{ url_for(endpoint, **kargs) }}

    {%- endwith %}

{%- endmacro %}

{% macro render_pagination(pagination,

                           endpoint=None,

                           prev=('?')|safe,

                           next=('?')|safe,

                           size=None,

                           ellipses='',

                           args={},

                           fragment='',

                           align=''

                           )-%}

    {% if fragment != '' and not fragment.startswith('#') %}{% set fragment = '#' + fragment %}{% endif %}

    {% with url_args = {} %}

        {%- do url_args.update(request.view_args if not endpoint else {}),

       url_args.update(request.args if not endpoint else {}),

       url_args.update(args) -%}

        {% with endpoint = endpoint or request.endpoint %}

            

        {% endwith %}

    {% endwith %}

{% endmacro %}

阅读(1763) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~