Skip to content

Commit ea26fc6

Browse files
committed
chore: handle kwargs
1 parent 6a5a821 commit ea26fc6

8 files changed

Lines changed: 26 additions & 0 deletions

File tree

ckanext/theming/themes/bare/macros/ui/component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{%- macro organization_item(group) -%}
2+
{%- do kwargs -%}
23
{{ ui.group_item(group, **kwargs) }}
34
{%- endmacro %}
45

56
{%- macro group_item(group) -%}
7+
{%- do kwargs -%}
68
{% set img = group.image_display_url or h.url_for_static('/base/images/placeholder-' ~ ('organization' if group.is_organization else 'group') ~ '.png') %}
79
{% set title = group.title or group.name %}
810
{% set body = h.markdown_extract(group.description, 120)|urlize %}
@@ -12,13 +14,15 @@
1214

1315

1416
{%- macro package_item(pkg) -%}
17+
{%- do kwargs -%}
1518
{% set title = pkg.title or pkg.name %}
1619
{% set body = h.markdown_extract(pkg.notes, 120)|urlize %}
1720

1821
{{ ui.card(title=title, body=body, href=h.url_for(pkg.type ~ ".read", id=pkg.name)) }}
1922
{%- endmacro %}
2023

2124
{%- macro resource_item(res) -%}
25+
{%- do kwargs -%}
2226
{% set title = res.name %}
2327
{% set body = h.markdown_extract(res.description, 120)|urlize %}
2428

ckanext/theming/themes/bare/macros/ui/form.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
{%- endmacro %}
99

1010
{%- macro form_actions_wrapper(content) -%}
11+
{%- do kwargs -%}
1112
{{ content }}
1213
{%- endmacro %}
1314

ckanext/theming/themes/bare/macros/ui/misc.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{%- macro datetime(dt) -%}
2+
{%- do kwargs -%}
23
<span data-datetime="{{ h.render_datetime(dt, date_format='%Y-%m-%dT%H:%M:%S%z') }}">
34
{{ h.render_datetime(dt, with_hours=True) }}
45
</span>

ckanext/theming/themes/bootstrap5/macros/ui/nav.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
{%- endmacro %}
88

99
{%- macro breadcrumb_item(content, href) -%}
10+
{%- do kwargs -%}
1011
<li class="breadcrumb-item">
1112
<a href="{{ href }}">{{ content }}</a>
1213
</li>
@@ -19,6 +20,7 @@
1920
{%- endmacro %}
2021

2122
{%- macro nav_item(content, href, active=False) -%}
23+
{%- do kwargs -%}
2224
<a class="nav-link {{ 'active' if active }}" href="{{ href }}">{{ content }}</a>
2325
{%- endmacro %}
2426

@@ -29,6 +31,7 @@
2931
{%- endmacro %}
3032

3133
{%- macro tab_item(content, href, active=False) -%}
34+
{%- do kwargs -%}
3235
<li class="nav-item" role="presentation">
3336
<button class="nav-link {{ 'active' if active }}" id="{{ href|replace('#', '') }}-tab" data-bs-toggle="tab" data-bs-target="{{ href }}" type="button" role="tab">
3437
{{ content }}
@@ -43,6 +46,7 @@
4346
{%- endmacro %}
4447

4548
{%- macro menu_item(content, href, active=False) -%}
49+
{%- do kwargs -%}
4650
<a class="list-group-item list-group-item-action {{ 'active' if active }}" href="{{ href }}">{{ content }}</a>
4751
{%- endmacro %}
4852

@@ -110,6 +114,7 @@
110114
{%- endmacro %}
111115

112116
{%- macro dropdown_item(content, href="#") -%}
117+
{%- do kwargs -%}
113118
<li><a class="dropdown-item" href="{{ href }}">{{ content }}</a></li>
114119
{%- endmacro %}
115120

@@ -140,5 +145,6 @@
140145
{%- endmacro %}
141146

142147
{%- macro breadcrumb_divider() -%}
148+
{%- do kwargs -%}
143149
<li class="breadcrumb-item active" aria-current="page">/</li>
144150
{%- endmacro %}

ckanext/theming/themes/bulma/macros/ui/container.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{%- endmacro %}
66

77
{%- macro accordion_item(title, open=false) -%}
8+
{%- do kwargs -%}
89
<div class="panel">
910
<p class="panel-heading">
1011
{{ title }}

ckanext/theming/themes/bulma/macros/ui/element.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
{%- endmacro %}
2525

2626
{%- macro link(content, href) -%}
27+
{%- do kwargs -%}
2728
<a class="has-text-link" href="{{ href or content }}">{{ content }}</a>
2829
{%- endmacro %}
2930

@@ -36,6 +37,7 @@
3637
{%- endmacro %}
3738

3839
{%- macro tag(content, id, href) -%}
40+
{%- do kwargs -%}
3941
<a class="tag is-link" href="{{ href or h.url_for('dataset.search', tags=id or content) }}">{{ content }}</a>
4042
{%- endmacro %}
4143

ckanext/theming/themes/bulma/macros/ui/nav.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{%- endmacro %}
66

77
{%- macro breadcrumb_item(content, href) -%}
8+
{%- do kwargs -%}
89
<li><a href="{{ href }}">{{ content }}</a></li>
910
{%- endmacro %}
1011

@@ -15,6 +16,7 @@
1516
{%- endmacro %}
1617

1718
{%- macro nav_item(content, href, active=False) -%}
19+
{%- do kwargs -%}
1820
<a class="navbar-item {{ 'is-active' if active }}" href="{{ href }}">{{ content }}</a>
1921
{%- endmacro %}
2022

@@ -25,6 +27,7 @@
2527
{%- endmacro %}
2628

2729
{%- macro tab_item(content, href, active=False) -%}
30+
{%- do kwargs -%}
2831
<li class="{{ 'is-active' if active }}"><a href="{{ href }}">{{ content }}</a></li>
2932
{%- endmacro %}
3033

@@ -35,6 +38,7 @@
3538
{%- endmacro %}
3639

3740
{%- macro menu_item(content, href, active=False) -%}
41+
{%- do kwargs -%}
3842
<li>
3943
<a class="{{ 'is-active' if active }}" href="{{ href }}">{{ content }}</a>
4044
</li>
@@ -97,6 +101,7 @@
97101
{%- endmacro %}
98102

99103
{%- macro dropdown_item(content, href="#") -%}
104+
{%- do kwargs -%}
100105
<a href="{{ href }}" class="dropdown-item">{{ content }}</a>
101106
{%- endmacro %}
102107

ckanext/theming/themes/tailwind/macros/ui/nav.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
{%- endmacro %}
88

99
{%- macro breadcrumb_item(content, href) -%}
10+
{%- do kwargs -%}
1011
<li class="inline-flex items-center">
1112
<div class="flex items-center">
1213
{{ ui.link(content, href=href, class="ml-1 text-sm font-medium text-gray-700 hover:text-blue-600 md:ml-2") }}
@@ -21,6 +22,7 @@
2122
{%- endmacro %}
2223

2324
{%- macro nav_item(content, href, active=False) -%}
25+
{%- do kwargs -%}
2426
<a href="{{ href }}" class="{{ 'bg-blue-100 text-blue-700' if active else 'text-gray-700 hover:bg-gray-50 hover:text-gray-900' }} px-3 py-2 rounded-md text-sm font-medium">
2527
{{ content }}
2628
</a>
@@ -35,6 +37,7 @@
3537
{%- endmacro %}
3638

3739
{%- macro tab_item(content, href, active=False) -%}
40+
{%- do kwargs -%}
3841
<a href="{{ href }}" class="{{ 'border-blue-500 text-blue-600' if active else 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300' }} whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm">
3942
{{ content }}
4043
</a>
@@ -49,6 +52,7 @@
4952
{%- endmacro %}
5053

5154
{%- macro menu_item(content, href, active=False) -%}
55+
{%- do kwargs -%}
5256
<li>
5357
<a href="{{ href }}" class="{{ 'bg-gray-100 text-gray-900' if active else 'text-gray-700 hover:bg-gray-50 hover:text-gray-900' }} block px-3 py-2 text-sm font-medium rounded-md">
5458
{{ content }}
@@ -137,6 +141,7 @@
137141
{%- endmacro %}
138142

139143
{%- macro dropdown_item(content, href="#") -%}
144+
{%- do kwargs -%}
140145
<a href="{{ href }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" role="menuitem" tabindex="-1">
141146
{{ content }}
142147
</a>
@@ -168,6 +173,7 @@
168173
{%- endmacro %}
169174

170175
{%- macro breadcrumb_divider() -%}
176+
{%- do kwargs -%}
171177
<svg class="w-5 h-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
172178
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
173179
</svg>

0 commit comments

Comments
 (0)