gov-uk-dashboards 15.0.3__py3-none-any.whl → 15.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gov_uk_dashboards/assets/dashboard.css +4 -0
- gov_uk_dashboards/components/dash/home_page_link_button.py +74 -0
- {gov_uk_dashboards-15.0.3.dist-info → gov_uk_dashboards-15.1.0.dist-info}/METADATA +1 -1
- {gov_uk_dashboards-15.0.3.dist-info → gov_uk_dashboards-15.1.0.dist-info}/RECORD +7 -6
- {gov_uk_dashboards-15.0.3.dist-info → gov_uk_dashboards-15.1.0.dist-info}/WHEEL +0 -0
- {gov_uk_dashboards-15.0.3.dist-info → gov_uk_dashboards-15.1.0.dist-info}/licenses/LICENSE +0 -0
- {gov_uk_dashboards-15.0.3.dist-info → gov_uk_dashboards-15.1.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,74 @@
|
|
1
|
+
"""home_page_link_button"""
|
2
|
+
from typing import Optional
|
3
|
+
from dash import html
|
4
|
+
|
5
|
+
|
6
|
+
def home_page_link_button(
|
7
|
+
title: str,
|
8
|
+
pathname_or_url_link: str,
|
9
|
+
pathname_rather_than_url: bool,
|
10
|
+
image_path: str,
|
11
|
+
info: Optional[str] = None,
|
12
|
+
):
|
13
|
+
"""Creates home page link card.
|
14
|
+
|
15
|
+
Args:
|
16
|
+
title (str): Button title.
|
17
|
+
pathname_or_url_link (str): The target link, either a pathname or full URL.
|
18
|
+
pathname_rather_than_url (bool): If True, `pathname_or_url_link` is treated as a pathname
|
19
|
+
(loading content in the same tab). If False, it is treated as a full URL
|
20
|
+
(opening in a new tab).
|
21
|
+
image_path (str): The path to an SVG image used as an icon for the button.
|
22
|
+
info (Optional[str], optional): Additional text for the button. Defaults to None.
|
23
|
+
|
24
|
+
Returns:
|
25
|
+
dash_html_components.A: A Dash HTML `A` element representing the link button.
|
26
|
+
"""
|
27
|
+
|
28
|
+
link_attributes = {
|
29
|
+
"href": pathname_or_url_link,
|
30
|
+
"id": f"link-to-{title.replace(' ', '-')}",
|
31
|
+
"className": "govuk-body homepage-card-grid-item",
|
32
|
+
}
|
33
|
+
|
34
|
+
if pathname_rather_than_url is False:
|
35
|
+
link_attributes["target"] = "_blank"
|
36
|
+
link_attributes["rel"] = "noopener noreferrer"
|
37
|
+
|
38
|
+
return html.A(
|
39
|
+
[
|
40
|
+
html.Div(
|
41
|
+
[
|
42
|
+
html.Div(
|
43
|
+
[
|
44
|
+
html.Div(
|
45
|
+
[title],
|
46
|
+
className="govuk-heading-l"
|
47
|
+
if info is not None
|
48
|
+
else None,
|
49
|
+
),
|
50
|
+
(
|
51
|
+
html.Div(
|
52
|
+
[info], className="font-weight-normal-override"
|
53
|
+
)
|
54
|
+
if info is not None
|
55
|
+
else None
|
56
|
+
),
|
57
|
+
],
|
58
|
+
style={
|
59
|
+
"text-align": "left",
|
60
|
+
"text-decoration": "none",
|
61
|
+
"padding-left": "5%",
|
62
|
+
},
|
63
|
+
),
|
64
|
+
html.Img(src=image_path, style={"width": "100%"}),
|
65
|
+
],
|
66
|
+
style={
|
67
|
+
"display": "grid",
|
68
|
+
"grid-template-columns": "5fr 1fr",
|
69
|
+
"align-items": "center",
|
70
|
+
},
|
71
|
+
)
|
72
|
+
],
|
73
|
+
**link_attributes,
|
74
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: gov_uk_dashboards
|
3
|
-
Version: 15.0
|
3
|
+
Version: 15.1.0
|
4
4
|
Summary: Provides access to functionality common to creating a data dashboard.
|
5
5
|
Author: Department for Levelling Up, Housing and Communities
|
6
6
|
Description-Content-Type: text/markdown
|
@@ -7,7 +7,7 @@ gov_uk_dashboards/template.html,sha256=uFAki9bEpcei5dP_NZYP8dsxpxXpNIDQPn7ezsE7V
|
|
7
7
|
gov_uk_dashboards/template.py,sha256=WNVkAW3LCNoUHcxQ1kiUPkGCKIan5DgZQaAA_ZbE5WA,534
|
8
8
|
gov_uk_dashboards/assets/__init__.py,sha256=SwV4sjjMQmuZXloVcvf2H86XFiAd8xhPLJvaSMC2MQE,101
|
9
9
|
gov_uk_dashboards/assets/attach-event-to-dash.js,sha256=mbea5TaxEnjMN-MebR3J0hVjOb1B27-zXwWw9ZYqBBw,562
|
10
|
-
gov_uk_dashboards/assets/dashboard.css,sha256=
|
10
|
+
gov_uk_dashboards/assets/dashboard.css,sha256=exnujRlse2xHOeuE_TAs84gITv5YMRzKJKEeSjoXO6U,202134
|
11
11
|
gov_uk_dashboards/assets/get_assets_folder.py,sha256=ozYOmuO2r36vaTdWMU5cBuskl47RHBp8z9KIO06BXBM,171
|
12
12
|
gov_uk_dashboards/assets/govuk-frontend-3.14.0.min.js,sha256=kKi_r2hAqumi2pKM43W8NKpR2UtksUww9lSQOjkOmMI,34806
|
13
13
|
gov_uk_dashboards/assets/mobile-nav.js,sha256=wsmOQtunN6HiA4EimNWPsr-qXomp9UruS2zr09Tsbeg,1772
|
@@ -52,6 +52,7 @@ gov_uk_dashboards/components/dash/footer.py,sha256=RnJKN1YTP88GuJ4e7ci2T-jDqIe0-
|
|
52
52
|
gov_uk_dashboards/components/dash/graph.py,sha256=bd49W5sVyhtWd4lNBfQST1RyLNlTLA0KRxS7jTgVMwE,886
|
53
53
|
gov_uk_dashboards/components/dash/header.py,sha256=ncwPcrGLLSpEL2E1NzSh6qtVW92B5JgAmA-qcTnNBhE,2886
|
54
54
|
gov_uk_dashboards/components/dash/heading.py,sha256=VjyBng591B_366vnan96PukpCDBTTj-2iJWuq0s0CLw,766
|
55
|
+
gov_uk_dashboards/components/dash/home_page_link_button.py,sha256=kmdNNMM7QaxPizUbwLR7XIDgCTZ3u-pVhb3DrpmPuHs,2536
|
55
56
|
gov_uk_dashboards/components/dash/html_list.py,sha256=P3xkxxDp8oT81SSbK594IyX8l2PClufUG3cUTtlARrI,674
|
56
57
|
gov_uk_dashboards/components/dash/key_value_pair.py,sha256=L8mjdCfqpBxOdbcEqZWDC36ou4xISNQSTsmXIWteUxI,690
|
57
58
|
gov_uk_dashboards/components/dash/main_content.py,sha256=GBqVlNx_ambSiW1lsKpwB6-mFVZAvcTZq5oBYzHRza0,545
|
@@ -99,8 +100,8 @@ gov_uk_dashboards/lib/dap/dap_deployment.py,sha256=ZXixeOAtRNjMsPdGKLwwLNamlo0mi
|
|
99
100
|
gov_uk_dashboards/lib/dap/get_dataframe_from_cds.py,sha256=OiusRCgYnkBjK_GZgYLGzNrxOGizYt8CgThiWRCVKK0,3921
|
100
101
|
gov_uk_dashboards/lib/datetime_functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
101
102
|
gov_uk_dashboards/lib/datetime_functions/datetime_functions.py,sha256=BQgr8I_vFNYwLi-fE4YC6jZ5PpbPea2rnD_2a_lw0YE,12209
|
102
|
-
gov_uk_dashboards-15.0.
|
103
|
-
gov_uk_dashboards-15.0.
|
104
|
-
gov_uk_dashboards-15.0.
|
105
|
-
gov_uk_dashboards-15.0.
|
106
|
-
gov_uk_dashboards-15.0.
|
103
|
+
gov_uk_dashboards-15.1.0.dist-info/licenses/LICENSE,sha256=GDiD7Y2Gx7JucPV1JfVySJeah-qiSyBPdpJ6RHCEHTc,1126
|
104
|
+
gov_uk_dashboards-15.1.0.dist-info/METADATA,sha256=AF-hcenFhQ7jtSw02N_Kb44fcGdrnPXP_G2x-l1VDgs,5917
|
105
|
+
gov_uk_dashboards-15.1.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
106
|
+
gov_uk_dashboards-15.1.0.dist-info/top_level.txt,sha256=gPaN1P3-H3Rgi2me6tt-fX_cxo19CZfA4PjlZPjGRpo,18
|
107
|
+
gov_uk_dashboards-15.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|