ahuang11 commited on
Commit
86bb9ef
1 Parent(s): f2d7c0f

Add back buttons

Browse files
Files changed (1) hide show
  1. app.py +13 -12
app.py CHANGED
@@ -9,13 +9,12 @@ from transformers import CLIPModel, CLIPProcessor
9
 
10
  pn.extension(design="bootstrap", sizing_mode="stretch_width")
11
 
12
- EXTERNAL_LINKS = {
13
- "Source Code": "https://huggingface.co/spaces/Panel-Org/panel-template/blob/main/app.py",
14
- "GitHub": "https://github.com/holoviz/panel",
15
- "Twitter": "https://twitter.com/Panel_Org",
16
- "LinkedIn": "https://www.linkedin.com/company/panel-org",
17
- "Discourse": "https://discourse.holoviz.org/",
18
- "Discord": "https://discord.gg/AXRHnJU6sP",
19
  }
20
 
21
 
@@ -119,16 +118,18 @@ interactive_result = pn.panel(
119
  )
120
 
121
  # add footer
122
- footer = pn.pane.Markdown(
123
- " | ".join(f"[{name}]({link})" for name, link in EXTERNAL_LINKS.items()),
124
- justify="center",
125
- )
 
 
126
 
127
  # create dashboard
128
  main = pn.WidgetBox(
129
  input_widgets,
130
  interactive_result,
131
- footer,
132
  )
133
 
134
  title = "Panel Demo - Image Classification"
 
9
 
10
  pn.extension(design="bootstrap", sizing_mode="stretch_width")
11
 
12
+ ICON_URLS = {
13
+ "brand-github": "https://github.com/holoviz/panel",
14
+ "brand-twitter": "https://twitter.com/Panel_Org",
15
+ "brand-linkedin": "https://www.linkedin.com/company/panel-org",
16
+ "message-circle": "https://discourse.holoviz.org/",
17
+ "brand-discord": "https://discord.gg/AXRHnJU6sP",
 
18
  }
19
 
20
 
 
118
  )
119
 
120
  # add footer
121
+ footer_row = pn.Row(pn.Spacer(), align="center")
122
+ for icon, url in ICON_URLS.items():
123
+ href_button = pn.widgets.Button(icon=icon, width=35, height=35)
124
+ href_button.js_on_click(code=f"window.open('{url}')")
125
+ footer_row.append(href_button)
126
+ footer_row.append(pn.Spacer())
127
 
128
  # create dashboard
129
  main = pn.WidgetBox(
130
  input_widgets,
131
  interactive_result,
132
+ footer_row,
133
  )
134
 
135
  title = "Panel Demo - Image Classification"