heroweb/lib/webcomponents/timeline/model_view.py
2024-09-11 22:19:48 +03:00

66 lines
2.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class TimelineEvent:
def __init__(
self,
icon,
icon_color_from,
icon_color_to,
title,
date,
time,
description,
tags,
):
self.icon = icon
self.icon_color_from = icon_color_from
self.icon_color_to = icon_color_to
self.title = title
self.date = date
self.time = time
self.description = description
self.tags = tags
class Timeline:
def __init__(self, example=False):
if example:
self.events = self.example().events
def example():
events: list[TimelineEvent] = [
TimelineEvent(
icon='ni-bell-55',
icon_color_from='green-600',
icon_color_to='lime-400',
title='$2400, Design changes',
date='22 DEC',
time='7:20 PM',
description='People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.',
tags=['design'],
),
TimelineEvent(
icon='ni-html5',
icon_color_from='red-600',
icon_color_to='rose-400',
title='New order #1832412',
date='21 DEC',
time='11 PM',
description='People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.',
tags=['order', '#1832412'],
),
TimelineEvent(
icon='ni-cart',
icon_color_from='blue-600',
icon_color_to='cyan-400',
title='Server payments for April',
date='21 DEC',
time='9:34 PM',
description='People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.',
tags=['server', 'payments'],
),
# Add more events as needed
]
timeline = Timeline()
timeline.events = events
return timeline