Skip to content

Commit

Permalink
Add calculation history link
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Feb 2, 2025
1 parent 8606e03 commit 8dc8509
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/aiidalab_qe/common/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,8 @@ def __init__(
description=None,
link="",
in_place=False,
classes="",
class_="",
style_="",
icon="",
disabled=False,
**kwargs,
Expand All @@ -1161,7 +1162,8 @@ def __init__(
role="button"
href="{link}"
target="{"_self" if in_place else "_blank"}"
class="{classes}"
class="jupyter-button widget-button {class_}"
style="cursor: default; width: fit-content; {style_}"
>
"""
if icon:
Expand Down Expand Up @@ -1419,6 +1421,18 @@ def render(self):

self.info = ipw.HTML()

history_link = LinkButton(
description="Calculation history",
link="./calculation_history.ipynb",
icon="list",
class_="mod-primary",
style_="color: white;",
layout=ipw.Layout(
width="fit-content",
margin="2px 0 2px auto",
),
)

accordion = None
if self.logger:
accordion = ipw.Accordion(children=[self.logger])
Expand All @@ -1431,6 +1445,7 @@ def render(self):
[
import_button,
self.info,
history_link,
],
layout=ipw.Layout(
margin="2px 2px 4px 68px",
Expand Down

0 comments on commit 8dc8509

Please sign in to comment.