-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy path_package_header.html
More file actions
49 lines (44 loc) · 1.57 KB
/
_package_header.html
File metadata and controls
49 lines (44 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{#
Context variables needed for `package_header`:
Snap data:
snap_title: Title of the snap
icon_url: URL of the icon
categories: List of categories with slug/name
Publisher data:
username: Publisher's username
publisher: Publisher object (used in display_name)
developer: Tuple/List – name and URL
developer_validation: Status string
Other:
image: template function
display_name: template function
VERIFIED_PUBLISHER: const (value of developer_validation)
STAR_DEVELOPER: const (value of developer_validation)
#}
{%- from 'store/package_header/_package_header_data.html' import package_header_data, package_icon -%}
{%- macro package_header() -%}
{%- set buttons_content = caller('buttons') -%}
{%- set has_buttons_content = buttons_content|trim|length > 0 -%}
<div class="grid-row">
<div class="grid-col-2 grid-col-medium-1 grid-col-small-1">
{{ package_icon(icon_url, image) }}
</div>
<div class="grid-col-6 grid-col-medium-3 grid-col-small-3">
{{ package_header_data(package_title=snap_title,
package_name=package_name,
icon_url=icon_url,
developer=developer,
categories=categories,
image=image,
display_name=display_name,
username=username,
publisher=publisher,
developer_validation=developer_validation,
STAR_DEVELOPER=STAR_DEVELOPER,
VERIFIED_PUBLISHER=VERIFIED_PUBLISHER) }}
{%- if has_buttons_content -%}
<div class="p-section--shallow">{{ buttons_content }}</div>
{%- endif -%}
</div>
</div>
{%- endmacro -%}