diff --git a/data/status_list.json b/data/status_list.json new file mode 100644 index 0000000..546f791 --- /dev/null +++ b/data/status_list.json @@ -0,0 +1 @@ +[{"selected": true, "id": "TASK-8782", "title": "You can't compress the program without quantifying the open-source SSD pixel!", "status": "progress", "label": "documentation", "priority": "medium"}, {"selected": false, "id": "TASK-7878", "title": "Try to calculate the EXE feed, maybe it will index the multi-byte pixel!", "status": "backlog", "label": "documentation", "priority": "medium"}, {"selected": false, "id": "TASK-7839", "title": "We need to bypass the neural TCP card!", "status": "todo", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-5562", "title": "The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!", "status": "backlog", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-8686", "title": "I'll parse the wireless SSL protocol, that should driver the API panel!", "status": "cancelled", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-1280", "title": "Use the digital TLS panel, then you can transmit the haptic system!", "status": "done", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-7262", "title": "The UTF8 application is down, parse the neural bandwidth so we can back up the PNG firewall!", "status": "done", "label": "feature", "priority": "high"}, {"selected": false, "id": "TASK-1138", "title": "Generating the driver won't do anything, we need to quantify the 1080p SMTP bandwidth!", "status": "progress", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-7184", "title": "We need to program the back-end THX pixel!", "status": "todo", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-5160", "title": "Calculating the bus won't do anything, we need to navigate the back-end JSON protocol!", "status": "progress", "label": "documentation", "priority": "high"}, {"selected": false, "id": "TASK-5618", "title": "Generating the driver won't do anything, we need to index the online SSL application!", "status": "done", "label": "documentation", "priority": "medium"}, {"selected": false, "id": "TASK-6699", "title": "I'll transmit the wireless JBOD capacitor, that should hard drive the SSD feed!", "status": "backlog", "label": "documentation", "priority": "medium"}, {"selected": false, "id": "TASK-2858", "title": "We need to override the online UDP bus!", "status": "backlog", "label": "bug", "priority": "medium"}, {"selected": false, "id": "TASK-9864", "title": "I'll reboot the 1080p FTP panel, that should matrix the HEX hard drive!", "status": "done", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-8404", "title": "We need to generate the virtual HEX alarm!", "status": "progress", "label": "bug", "priority": "low"}, {"selected": false, "id": "TASK-5365", "title": "Backing up the pixel won't do anything, we need to transmit the primary IB array!", "status": "progress", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-1780", "title": "The CSS feed is down, index the bluetooth transmitter so we can compress the CLI protocol!", "status": "todo", "label": "documentation", "priority": "high"}, {"selected": false, "id": "TASK-6938", "title": "Use the redundant SCSI application, then you can hack the optical alarm!", "status": "todo", "label": "documentation", "priority": "high"}, {"selected": false, "id": "TASK-9885", "title": "We need to compress the auxiliary VGA driver!", "status": "backlog", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-3216", "title": "Transmitting the transmitter won't do anything, we need to compress the virtual HDD sensor!", "status": "backlog", "label": "documentation", "priority": "medium"}, {"selected": false, "id": "TASK-9285", "title": "The IP monitor is down, copy the haptic alarm so we can generate the HTTP transmitter!", "status": "todo", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-1024", "title": "Overriding the microchip won't do anything, we need to transmit the digital OCR transmitter!", "status": "progress", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-7068", "title": "You can't generate the capacitor without indexing the wireless HEX pixel!", "status": "cancelled", "label": "bug", "priority": "low"}, {"selected": false, "id": "TASK-6502", "title": "Navigating the microchip won't do anything, we need to bypass the back-end SQL bus!", "status": "todo", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-5326", "title": "We need to hack the redundant UTF8 transmitter!", "status": "todo", "label": "bug", "priority": "low"}, {"selected": false, "id": "TASK-6274", "title": "Use the virtual PCI circuit, then you can parse the bluetooth alarm!", "status": "cancelled", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-1571", "title": "I'll input the neural DRAM circuit, that should protocol the SMTP interface!", "status": "progress", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-9518", "title": "Compressing the interface won't do anything, we need to compress the online SDD matrix!", "status": "cancelled", "label": "documentation", "priority": "medium"}, {"selected": false, "id": "TASK-5581", "title": "I'll synthesize the digital COM pixel, that should transmitter the UTF8 protocol!", "status": "backlog", "label": "documentation", "priority": "high"}, {"selected": false, "id": "TASK-2197", "title": "Parsing the feed won't do anything, we need to copy the bluetooth DRAM bus!", "status": "todo", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-8484", "title": "We need to parse the solid state UDP firewall!", "status": "progress", "label": "bug", "priority": "low"}, {"selected": false, "id": "TASK-9892", "title": "If we back up the application, we can get to the UDP application through the multi-byte THX capacitor!", "status": "done", "label": "documentation", "priority": "high"}, {"selected": false, "id": "TASK-9616", "title": "We need to synthesize the cross-platform ASCII pixel!", "status": "progress", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-9744", "title": "Use the back-end IP card, then you can input the solid state hard drive!", "status": "done", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-1376", "title": "Generating the alarm won't do anything, we need to generate the mobile IP capacitor!", "status": "backlog", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-7382", "title": "If we back up the firewall, we can get to the RAM alarm through the primary UTF8 pixel!", "status": "todo", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-2290", "title": "I'll compress the virtual JSON panel, that should application the UTF8 bus!", "status": "cancelled", "label": "documentation", "priority": "high"}, {"selected": false, "id": "TASK-1533", "title": "You can't input the firewall without overriding the wireless TCP firewall!", "status": "done", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-4920", "title": "Bypassing the hard drive won't do anything, we need to input the bluetooth JSON program!", "status": "progress", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-5168", "title": "If we synthesize the bus, we can get to the IP panel through the virtual TLS array!", "status": "progress", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-7103", "title": "We need to parse the multi-byte EXE bandwidth!", "status": "cancelled", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-4314", "title": "If we compress the program, we can get to the XML alarm through the multi-byte COM matrix!", "status": "progress", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-3415", "title": "Use the cross-platform XML application, then you can quantify the solid state feed!", "status": "todo", "label": "feature", "priority": "high"}, {"selected": false, "id": "TASK-8339", "title": "Try to calculate the DNS interface, maybe it will input the bluetooth capacitor!", "status": "progress", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-6995", "title": "Try to hack the XSS bandwidth, maybe it will override the bluetooth matrix!", "status": "todo", "label": "feature", "priority": "high"}, {"selected": false, "id": "TASK-8053", "title": "If we connect the program, we can get to the UTF8 matrix through the digital UDP protocol!", "status": "todo", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-4336", "title": "If we synthesize the microchip, we can get to the SAS sensor through the optical UDP program!", "status": "todo", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-8790", "title": "I'll back up the optical COM alarm, that should alarm the RSS capacitor!", "status": "done", "label": "bug", "priority": "medium"}, {"selected": false, "id": "TASK-8980", "title": "Try to navigate the SQL transmitter, maybe it will back up the virtual firewall!", "status": "cancelled", "label": "bug", "priority": "low"}, {"selected": false, "id": "TASK-7342", "title": "Use the neural CLI card, then you can parse the online port!", "status": "backlog", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-5608", "title": "I'll hack the haptic SSL program, that should bus the UDP transmitter!", "status": "cancelled", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-1606", "title": "I'll generate the bluetooth PNG firewall, that should pixel the SSL driver!", "status": "done", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-7872", "title": "Transmitting the circuit won't do anything, we need to reboot the 1080p RSS monitor!", "status": "cancelled", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-4167", "title": "Use the cross-platform SMS circuit, then you can synthesize the optical feed!", "status": "cancelled", "label": "bug", "priority": "medium"}, {"selected": false, "id": "TASK-9581", "title": "You can't index the port without hacking the cross-platform XSS monitor!", "status": "backlog", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-8806", "title": "We need to bypass the back-end SSL panel!", "status": "done", "label": "bug", "priority": "medium"}, {"selected": false, "id": "TASK-6542", "title": "Try to quantify the RSS firewall, maybe it will quantify the open-source system!", "status": "done", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-6806", "title": "The VGA protocol is down, reboot the back-end matrix so we can parse the CSS panel!", "status": "cancelled", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-9549", "title": "You can't bypass the bus without connecting the neural JBOD bus!", "status": "todo", "label": "feature", "priority": "high"}, {"selected": false, "id": "TASK-1075", "title": "Backing up the driver won't do anything, we need to parse the redundant RAM pixel!", "status": "done", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-1427", "title": "Use the auxiliary PCI circuit, then you can calculate the cross-platform interface!", "status": "done", "label": "documentation", "priority": "high"}, {"selected": false, "id": "TASK-1907", "title": "Hacking the circuit won't do anything, we need to back up the online DRAM system!", "status": "todo", "label": "documentation", "priority": "high"}, {"selected": false, "id": "TASK-4309", "title": "If we generate the system, we can get to the TCP sensor through the optical GB pixel!", "status": "backlog", "label": "bug", "priority": "medium"}, {"selected": false, "id": "TASK-3973", "title": "I'll parse the back-end ADP array, that should bandwidth the RSS bandwidth!", "status": "todo", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-7962", "title": "Use the wireless RAM program, then you can hack the cross-platform feed!", "status": "cancelled", "label": "bug", "priority": "low"}, {"selected": false, "id": "TASK-3360", "title": "You can't quantify the program without synthesizing the neural OCR interface!", "status": "done", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-9887", "title": "Use the auxiliary ASCII sensor, then you can connect the solid state port!", "status": "backlog", "label": "bug", "priority": "medium"}, {"selected": false, "id": "TASK-3649", "title": "I'll input the virtual USB system, that should circuit the DNS monitor!", "status": "progress", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-3586", "title": "If we quantify the circuit, we can get to the CLI feed through the mobile SMS hard drive!", "status": "progress", "label": "bug", "priority": "low"}, {"selected": false, "id": "TASK-5150", "title": "I'll hack the wireless XSS port, that should transmitter the IP interface!", "status": "cancelled", "label": "feature", "priority": "medium"}, {"selected": false, "id": "TASK-3652", "title": "The SQL interface is down, override the optical bus so we can program the ASCII interface!", "status": "backlog", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-6884", "title": "Use the digital PCI circuit, then you can synthesize the multi-byte microchip!", "status": "cancelled", "label": "feature", "priority": "high"}, {"selected": false, "id": "TASK-1591", "title": "We need to connect the mobile XSS driver!", "status": "progress", "label": "feature", "priority": "high"}, {"selected": false, "id": "TASK-3802", "title": "Try to override the ASCII protocol, maybe it will parse the virtual matrix!", "status": "progress", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-7253", "title": "Programming the capacitor won't do anything, we need to bypass the neural IB hard drive!", "status": "backlog", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-9739", "title": "We need to hack the multi-byte HDD bus!", "status": "done", "label": "documentation", "priority": "medium"}, {"selected": false, "id": "TASK-4424", "title": "Try to hack the HEX alarm, maybe it will connect the optical pixel!", "status": "progress", "label": "documentation", "priority": "medium"}, {"selected": false, "id": "TASK-3922", "title": "You can't back up the capacitor without generating the wireless PCI program!", "status": "backlog", "label": "bug", "priority": "low"}, {"selected": false, "id": "TASK-4921", "title": "I'll index the open-source IP feed, that should system the GB application!", "status": "cancelled", "label": "bug", "priority": "low"}, {"selected": false, "id": "TASK-5814", "title": "We need to calculate the 1080p AGP feed!", "status": "backlog", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-2645", "title": "Synthesizing the system won't do anything, we need to navigate the multi-byte HDD firewall!", "status": "todo", "label": "documentation", "priority": "medium"}, {"selected": false, "id": "TASK-4535", "title": "Try to copy the JSON circuit, maybe it will connect the wireless feed!", "status": "progress", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-4463", "title": "We need to copy the solid state AGP monitor!", "status": "done", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-9745", "title": "If we connect the protocol, we can get to the GB system through the bluetooth PCI microchip!", "status": "cancelled", "label": "feature", "priority": "high"}, {"selected": false, "id": "TASK-2080", "title": "If we input the bus, we can get to the RAM matrix through the auxiliary RAM card!", "status": "todo", "label": "bug", "priority": "medium"}, {"selected": false, "id": "TASK-3838", "title": "I'll bypass the online TCP application, that should panel the AGP system!", "status": "backlog", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-1340", "title": "We need to navigate the virtual PNG circuit!", "status": "todo", "label": "bug", "priority": "medium"}, {"selected": false, "id": "TASK-6665", "title": "If we parse the monitor, we can get to the SSD hard drive through the cross-platform AGP alarm!", "status": "cancelled", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-7585", "title": "If we calculate the hard drive, we can get to the SSL program through the multi-byte CSS microchip!", "status": "backlog", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-6319", "title": "We need to copy the multi-byte SCSI program!", "status": "backlog", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-4369", "title": "Try to input the SCSI bus, maybe it will generate the 1080p pixel!", "status": "backlog", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-9035", "title": "We need to override the solid state PNG array!", "status": "cancelled", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-3970", "title": "You can't index the transmitter without quantifying the haptic ASCII card!", "status": "todo", "label": "documentation", "priority": "medium"}, {"selected": false, "id": "TASK-4473", "title": "You can't bypass the protocol without overriding the neural RSS program!", "status": "todo", "label": "documentation", "priority": "low"}, {"selected": false, "id": "TASK-4136", "title": "You can't hack the hard drive without hacking the primary JSON program!", "status": "cancelled", "label": "bug", "priority": "medium"}, {"selected": false, "id": "TASK-3939", "title": "Use the back-end SQL firewall, then you can connect the neural hard drive!", "status": "done", "label": "feature", "priority": "low"}, {"selected": false, "id": "TASK-2007", "title": "I'll input the back-end USB protocol, that should bandwidth the PCI system!", "status": "backlog", "label": "bug", "priority": "high"}, {"selected": false, "id": "TASK-7516", "title": "Use the primary SQL program, then you can generate the auxiliary transmitter!", "status": "done", "label": "documentation", "priority": "medium"}, {"selected": false, "id": "TASK-6906", "title": "Try to back up the DRAM system, maybe it will reboot the online transmitter!", "status": "done", "label": "feature", "priority": "high"}, {"selected": false, "id": "TASK-5207", "title": "The SMS interface is down, copy the bluetooth bus so we can quantify the VGA card!", "status": "progress", "label": "bug", "priority": "low"}] \ No newline at end of file diff --git a/data/statuses.json b/data/statuses.json new file mode 100644 index 0000000..bbfb93b --- /dev/null +++ b/data/statuses.json @@ -0,0 +1,22 @@ +{ + "backlog": { + "icon": "", + "text": "Backlog" + }, + "cancelled": { + "icon": "", + "text": "Cancelled" + }, + "done": { + "icon": "", + "text": "Done" + }, + "progress": { + "icon": "", + "text": "In Progress" + }, + "todo": { + "icon": "", + "text": "Todo" + } +} \ No newline at end of file diff --git a/ex_app/cards.py b/ex_app/cards.py index 594b005..5480350 100644 --- a/ex_app/cards.py +++ b/ex_app/cards.py @@ -3,9 +3,9 @@ # AUTOGENERATED! DO NOT EDIT! File to edit: ../ex_nbs/02_cards.ipynb. # %% auto 0 -__all__ = ['GalleryCard', 'Left1', 'Card1Svg', 'Card2Svg', 'AppleSvg', 'Left2', 'area_opts', 'severity_opts', 'Right1', - 'franken_desc', 'Right2', 'Right3', 'team_members', 'options', 'body', 'Middle1', 'access_roles', 'Middle2', - 'Middle3', 'section_content', 'Middle4', 'cards_homepage', 'page'] +__all__ = ['Left1', 'Card1Svg', 'Card2Svg', 'AppleSvg', 'Left2', 'area_opts', 'severity_opts', 'Right1', 'franken_desc', 'Right2', + 'Right3', 'team_members', 'options', 'body', 'Middle1', 'access_roles', 'Middle2', 'Middle3', + 'section_content', 'Middle4', 'cards_homepage', 'page'] # %% ../ex_nbs/02_cards.ipynb 2 from fasthtml.common import * @@ -14,19 +14,19 @@ import calendar # %% ../ex_nbs/02_cards.ipynb 7 -GalleryCard = Card(UkH3("Inline Field Validation"),Br(), - P(cls=TextT.muted_sm)('A form with inline field validation on individual inputs with the submit aditionally validating the whole form.'), - header=Img(cls='uk-img',src='public/inline_validation.gif',), - footer=Div(cls=('grid','grid-cols-3', 'gap-12'))( - UkButton('App', cls=UkButtonT.primary), - UkButton('Info'), - UkButton('Code')), - footer_cls='uk-background-muted') +# GalleryCard = Card(UkH3("Inline Field Validation"),Br(), +# P(cls=TextT.muted_sm)('A form with inline field validation on individual inputs with the submit aditionally validating the whole form.'), +# header=Img(cls='uk-img',src='public/inline_validation.gif',), +# footer=Div(cls=('grid','grid-cols-3', 'gap-12'))( +# UkButton('App', cls=UkButtonT.primary), +# UkButton('Info'), +# UkButton('Code')), +# footer_cls='uk-background-muted') # %% ../ex_nbs/02_cards.ipynb 9 Left1 = Card(Div(cls='grid grid-cols-2 gap-6')( - UkButton(Span(cls="uk-margin-small-right", uk_icon="icon: github; ratio: 1"),'Github'), - UkButton(Span(cls="uk-margin-small-right", uk_icon="icon: google; ratio: 1"),'Google')), + UkButton(UkIcon('github',cls='uk-margin-small-right'),'Github'), + UkButton(UkIcon('google',cls='uk-margin-small-right'),'Google')), UkHSplit("OR CONTINUE WITH", text_cls = (TextB.sz_xsmall, TextB.cl_muted)), UkInput('Email', 'email', placeholder='m@example.com'), UkInput('Password', 'Password',placeholder='Password', type='Password'), @@ -42,15 +42,15 @@ # %% ../ex_nbs/02_cards.ipynb 12 Left2 = Card( Div(cls='grid grid-cols-3 gap-4')( - UkButton(Div(cls='flex flex-col items-center justify-center')(Card1Svg,"Card"), cls='h-20 w-full border-2 border-primary'), - UkButton(Div(cls='flex flex-col items-center justify-center')(Card2Svg, "Card"), cls='h-20 w-full'), - UkButton(Div(cls='flex flex-col items-center justify-center')(AppleSvg, "Apple"), cls='h-20 w-full')), + UkButton(CenteredContainer(Card1Svg,"Card"), cls='h-20 w-full border-2 border-primary'), + UkButton(CenteredContainer(Card2Svg, "Card"), cls='h-20 w-full'), + UkButton(CenteredContainer(AppleSvg, "Apple"), cls='h-20 w-full')), Div(cls='space-y-4')( UkInput('Name', 'name',placeholder='m@example.com'), UkInput('Card Number', 'card_number',placeholder='m@example.com'), Div(cls='grid grid-cols-3 gap-4')( - UkSelect(*Options(calendar.month_name[1:],0),label='Expires',id='expire_month'), - UkSelect(*Options(range(2024,2030),0), label='Year', id='expire_year'), + UkSelect(*Options(*calendar.month_name[1:],0),label='Expires',id='expire_month'), + UkSelect(*Options(*range(2024,2030),0), label='Year', id='expire_year'), UkInput('CVV', 'cvv',placeholder='CVV'))), header=(UkH3('Payment Method'),P(cls=TextT.muted_sm)('Add a new payment method to your account.'))) @@ -59,14 +59,14 @@ severity_opts = ('Severity 1 (Highest)', 'Severity 2', 'Severity 3', 'Severity 4 (Lowest)') Right1 = Card( Div(cls='grid grid-cols-2 gap-2')( - UkSelect(*Options(area_opts), label='Area', id='area'), - UkSelect(*Options(severity_opts),label='Severity',id='area')), + UkSelect(*Options(*area_opts), label='Area', id='area'), + UkSelect(*Options(*severity_opts),label='Severity',id='area')), UkInput( label='Subject', placeholder='I need help with'), UkTextArea( label='Description',placeholder='Please include all information relevant to your issue'), UkFormLabel(label="Tags",state="danger", value="Spam,Invalid"), header=(H3('Report an issue'),P(cls=TextT.muted_sm)('What area are you having problems with')), - footer = (UkButton(cls=UkButtonT.ghost)('Cancel'),UkButton(cls=UkButtonT.primary)('Submit')), - footer_cls='flex justify-between') + footer = FullySpacedContainer(UkButton(cls=UkButtonT.ghost)('Cancel'),UkButton(cls=UkButtonT.primary)('Submit'))) + # %% ../ex_nbs/02_cards.ipynb 16 franken_desc ="HTML-first, framework-agnostic, beautifully designed components that you can truly copy and paste into your site. Accessible. Customizable. Open Source." @@ -74,7 +74,7 @@ P(cls=TextT.muted_sm)(franken_desc), Div(cls=('flex','gap-x-4',TextT.muted_sm))( Div(cls='flex items-center')("TypeScript"), - Div(cls='flex items-center')(Span(uk_icon='star'),"20k"),"Updated April 2023")) + Div(cls='flex items-center')(UkIcon('star'),"20k"),"Updated April 2023")) # %% ../ex_nbs/02_cards.ipynb 18 Right3 = Card( @@ -91,9 +91,9 @@ team_members = [{"name": "Sofia Davis", "email": "m@example.com", "role": "Owner"},{"name": "Jackson Lee", "email": "p@example.com", "role": "Member"},] options = ((Div('Viewer'),Div(cls=TextT.muted_sm)('Can view and comment.',)), - (Div('Developer'),Div(cls=TextT.muted_sm)('Can view, comment and edit.',)), - (Div('Billing'),Div(cls=TextT.muted_sm)('Can view, comment and manage billing.',)), - (Div('Owner'),Div(cls=TextT.muted_sm)('Admin-level to all resources.')),) + (Div('Developer'),Div(cls=TextT.muted_sm)('Can view, comment and edit.',)), + (Div('Billing'),Div(cls=TextT.muted_sm)('Can view, comment and manage billing.',)), + (Div('Owner'),Div(cls=TextT.muted_sm)('Admin-level to all resources.')),) body = [Div(cls='flex items-center space-x-4')( Span(cls='relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full bg-accent')( @@ -128,7 +128,7 @@ Div(cls='flex-1')( P(member['name'], cls='text-sm font-medium leading-none'), P(member['email'], cls=TextT.muted_sm)), - UkSelect(*Options(access_roles, access_roles.index(member['role'])))) for member in team_members], + UkSelect(*Options(*access_roles, selected_idx=access_roles.index(member['role'])))) for member in team_members], header = (UkH4('Share this document'),Div('Anyone with the link can view this document.', cls=('mt-1.5',TextT.muted_sm)))) # %% ../ex_nbs/02_cards.ipynb 25 @@ -150,7 +150,7 @@ # %% ../ex_nbs/02_cards.ipynb 30 def page(): return Title("Custom"),Div(cls='uk-child-width-1-3@l uk-child-width-1-2@m', uk_grid=True)( - Div(cls='space-y-6')(map(Div,(Left1,Left2,GalleryCard))), + Div(cls='space-y-6')(map(Div,(Left1,Left2))), Div(cls='space-y-6')(map(Div,(Middle1,Middle2,Middle3,Middle4))), Div(cls='space-y-6')(map(Div,(Right1,Right2, Right3)))) diff --git a/ex_app/tasks.py b/ex_app/tasks.py index c750ed4..f31b4b9 100644 --- a/ex_app/tasks.py +++ b/ex_app/tasks.py @@ -3,15 +3,20 @@ # AUTOGENERATED! DO NOT EDIT! File to edit: ../ex_nbs/01_tasks.ipynb. # %% auto 0 -__all__ = ['priority_dd', 'rows_per_page_dd', 'status_dd', 'statuses', 'data', 'hotkeys', 'avatar_opts', 'page_heading', - 'table_controls', 'tasks_homepage', 'MakeTaskForm', 'UkIconButton', 'CreateTaskModal', 'tasks'] +__all__ = ['priority_dd', 'rows_per_page_dd', 'status_dd', 'hotkeys', 'avatar_opts', 'page_heading', 'table_controls', + 'tasks_homepage', 'UkIconButton', 'CreateTaskModal', 'tasks'] # %% ../ex_nbs/01_tasks.ipynb 3 from fasthtml.common import * from fh_frankenui.components import * from fasthtml.svg import * +import json # %% ../ex_nbs/01_tasks.ipynb 6 +with open('../data/status_list.json', 'r') as f: data = json.load(f) +with open('../data/statuses.json', 'r') as f: statuses = json.load(f) + +# %% ../ex_nbs/01_tasks.ipynb 7 priority_dd = [{'priority': "low", 'count': 36 }, {'priority': "medium", 'count': 33 }, {'priority': "high", 'count': 31 }] rows_per_page_dd = [10,20,30,40,50] @@ -19,913 +24,6 @@ status_dd = [{'status': "backlog", 'count': 21 },{'status': "todo", 'count': 21 },{'status': "progress", 'count': 20 },{'status': "done",'count': 19 },{'status': "cancelled", 'count': 19 }] -# %% ../ex_nbs/01_tasks.ipynb 7 -statuses = { - 'backlog': { - 'icon': '''''', - 'text': "Backlog", - }, - 'cancelled': { - 'icon': '''''', - 'text': "Cancelled", - }, - 'done': { - 'icon': '''''', - 'text': "Done", - }, - 'progress': { - 'icon': '''''', - 'text': "In Progress", - }, - 'todo': { - 'icon': '''''', - 'text': "Todo", - }, -} - -data = [ - { - "selected": True, - "id": "TASK-8782", - "title": - "You can't compress the program without quantifying the open-source SSD pixel!", - "status": "progress", - "label": "documentation", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-7878", - "title": - "Try to calculate the EXE feed, maybe it will index the multi-byte pixel!", - "status": "backlog", - "label": "documentation", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-7839", - "title": "We need to bypass the neural TCP card!", - "status": "todo", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-5562", - "title": - "The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!", - "status": "backlog", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-8686", - "title": - "I'll parse the wireless SSL protocol, that should driver the API panel!", - "status": "cancelled", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-1280", - "title": - "Use the digital TLS panel, then you can transmit the haptic system!", - "status": "done", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-7262", - "title": - "The UTF8 application is down, parse the neural bandwidth so we can back up the PNG firewall!", - "status": "done", - "label": "feature", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-1138", - "title": - "Generating the driver won't do anything, we need to quantify the 1080p SMTP bandwidth!", - "status": "progress", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-7184", - "title": "We need to program the back-end THX pixel!", - "status": "todo", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-5160", - "title": - "Calculating the bus won't do anything, we need to navigate the back-end JSON protocol!", - "status": "progress", - "label": "documentation", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-5618", - "title": - "Generating the driver won't do anything, we need to index the online SSL application!", - "status": "done", - "label": "documentation", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-6699", - "title": - "I'll transmit the wireless JBOD capacitor, that should hard drive the SSD feed!", - "status": "backlog", - "label": "documentation", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-2858", - "title": "We need to override the online UDP bus!", - "status": "backlog", - "label": "bug", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-9864", - "title": - "I'll reboot the 1080p FTP panel, that should matrix the HEX hard drive!", - "status": "done", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-8404", - "title": "We need to generate the virtual HEX alarm!", - "status": "progress", - "label": "bug", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-5365", - "title": - "Backing up the pixel won't do anything, we need to transmit the primary IB array!", - "status": "progress", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-1780", - "title": - "The CSS feed is down, index the bluetooth transmitter so we can compress the CLI protocol!", - "status": "todo", - "label": "documentation", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-6938", - "title": - "Use the redundant SCSI application, then you can hack the optical alarm!", - "status": "todo", - "label": "documentation", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-9885", - "title": "We need to compress the auxiliary VGA driver!", - "status": "backlog", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-3216", - "title": - "Transmitting the transmitter won't do anything, we need to compress the virtual HDD sensor!", - "status": "backlog", - "label": "documentation", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-9285", - "title": - "The IP monitor is down, copy the haptic alarm so we can generate the HTTP transmitter!", - "status": "todo", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-1024", - "title": - "Overriding the microchip won't do anything, we need to transmit the digital OCR transmitter!", - "status": "progress", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-7068", - "title": - "You can't generate the capacitor without indexing the wireless HEX pixel!", - "status": "cancelled", - "label": "bug", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-6502", - "title": - "Navigating the microchip won't do anything, we need to bypass the back-end SQL bus!", - "status": "todo", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-5326", - "title": "We need to hack the redundant UTF8 transmitter!", - "status": "todo", - "label": "bug", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-6274", - "title": - "Use the virtual PCI circuit, then you can parse the bluetooth alarm!", - "status": "cancelled", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-1571", - "title": - "I'll input the neural DRAM circuit, that should protocol the SMTP interface!", - "status": "progress", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-9518", - "title": - "Compressing the interface won't do anything, we need to compress the online SDD matrix!", - "status": "cancelled", - "label": "documentation", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-5581", - "title": - "I'll synthesize the digital COM pixel, that should transmitter the UTF8 protocol!", - "status": "backlog", - "label": "documentation", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-2197", - "title": - "Parsing the feed won't do anything, we need to copy the bluetooth DRAM bus!", - "status": "todo", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-8484", - "title": "We need to parse the solid state UDP firewall!", - "status": "progress", - "label": "bug", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-9892", - "title": - "If we back up the application, we can get to the UDP application through the multi-byte THX capacitor!", - "status": "done", - "label": "documentation", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-9616", - "title": "We need to synthesize the cross-platform ASCII pixel!", - "status": "progress", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-9744", - "title": - "Use the back-end IP card, then you can input the solid state hard drive!", - "status": "done", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-1376", - "title": - "Generating the alarm won't do anything, we need to generate the mobile IP capacitor!", - "status": "backlog", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-7382", - "title": - "If we back up the firewall, we can get to the RAM alarm through the primary UTF8 pixel!", - "status": "todo", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-2290", - "title": - "I'll compress the virtual JSON panel, that should application the UTF8 bus!", - "status": "cancelled", - "label": "documentation", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-1533", - "title": - "You can't input the firewall without overriding the wireless TCP firewall!", - "status": "done", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-4920", - "title": - "Bypassing the hard drive won't do anything, we need to input the bluetooth JSON program!", - "status": "progress", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-5168", - "title": - "If we synthesize the bus, we can get to the IP panel through the virtual TLS array!", - "status": "progress", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-7103", - "title": "We need to parse the multi-byte EXE bandwidth!", - "status": "cancelled", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-4314", - "title": - "If we compress the program, we can get to the XML alarm through the multi-byte COM matrix!", - "status": "progress", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-3415", - "title": - "Use the cross-platform XML application, then you can quantify the solid state feed!", - "status": "todo", - "label": "feature", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-8339", - "title": - "Try to calculate the DNS interface, maybe it will input the bluetooth capacitor!", - "status": "progress", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-6995", - "title": - "Try to hack the XSS bandwidth, maybe it will override the bluetooth matrix!", - "status": "todo", - "label": "feature", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-8053", - "title": - "If we connect the program, we can get to the UTF8 matrix through the digital UDP protocol!", - "status": "todo", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-4336", - "title": - "If we synthesize the microchip, we can get to the SAS sensor through the optical UDP program!", - "status": "todo", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-8790", - "title": - "I'll back up the optical COM alarm, that should alarm the RSS capacitor!", - "status": "done", - "label": "bug", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-8980", - "title": - "Try to navigate the SQL transmitter, maybe it will back up the virtual firewall!", - "status": "cancelled", - "label": "bug", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-7342", - "title": "Use the neural CLI card, then you can parse the online port!", - "status": "backlog", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-5608", - "title": - "I'll hack the haptic SSL program, that should bus the UDP transmitter!", - "status": "cancelled", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-1606", - "title": - "I'll generate the bluetooth PNG firewall, that should pixel the SSL driver!", - "status": "done", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-7872", - "title": - "Transmitting the circuit won't do anything, we need to reboot the 1080p RSS monitor!", - "status": "cancelled", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-4167", - "title": - "Use the cross-platform SMS circuit, then you can synthesize the optical feed!", - "status": "cancelled", - "label": "bug", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-9581", - "title": - "You can't index the port without hacking the cross-platform XSS monitor!", - "status": "backlog", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-8806", - "title": "We need to bypass the back-end SSL panel!", - "status": "done", - "label": "bug", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-6542", - "title": - "Try to quantify the RSS firewall, maybe it will quantify the open-source system!", - "status": "done", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-6806", - "title": - "The VGA protocol is down, reboot the back-end matrix so we can parse the CSS panel!", - "status": "cancelled", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-9549", - "title": "You can't bypass the bus without connecting the neural JBOD bus!", - "status": "todo", - "label": "feature", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-1075", - "title": - "Backing up the driver won't do anything, we need to parse the redundant RAM pixel!", - "status": "done", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-1427", - "title": - "Use the auxiliary PCI circuit, then you can calculate the cross-platform interface!", - "status": "done", - "label": "documentation", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-1907", - "title": - "Hacking the circuit won't do anything, we need to back up the online DRAM system!", - "status": "todo", - "label": "documentation", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-4309", - "title": - "If we generate the system, we can get to the TCP sensor through the optical GB pixel!", - "status": "backlog", - "label": "bug", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-3973", - "title": - "I'll parse the back-end ADP array, that should bandwidth the RSS bandwidth!", - "status": "todo", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-7962", - "title": - "Use the wireless RAM program, then you can hack the cross-platform feed!", - "status": "cancelled", - "label": "bug", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-3360", - "title": - "You can't quantify the program without synthesizing the neural OCR interface!", - "status": "done", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-9887", - "title": - "Use the auxiliary ASCII sensor, then you can connect the solid state port!", - "status": "backlog", - "label": "bug", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-3649", - "title": - "I'll input the virtual USB system, that should circuit the DNS monitor!", - "status": "progress", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-3586", - "title": - "If we quantify the circuit, we can get to the CLI feed through the mobile SMS hard drive!", - "status": "progress", - "label": "bug", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-5150", - "title": - "I'll hack the wireless XSS port, that should transmitter the IP interface!", - "status": "cancelled", - "label": "feature", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-3652", - "title": - "The SQL interface is down, override the optical bus so we can program the ASCII interface!", - "status": "backlog", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-6884", - "title": - "Use the digital PCI circuit, then you can synthesize the multi-byte microchip!", - "status": "cancelled", - "label": "feature", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-1591", - "title": "We need to connect the mobile XSS driver!", - "status": "progress", - "label": "feature", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-3802", - "title": - "Try to override the ASCII protocol, maybe it will parse the virtual matrix!", - "status": "progress", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-7253", - "title": - "Programming the capacitor won't do anything, we need to bypass the neural IB hard drive!", - "status": "backlog", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-9739", - "title": "We need to hack the multi-byte HDD bus!", - "status": "done", - "label": "documentation", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-4424", - "title": - "Try to hack the HEX alarm, maybe it will connect the optical pixel!", - "status": "progress", - "label": "documentation", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-3922", - "title": - "You can't back up the capacitor without generating the wireless PCI program!", - "status": "backlog", - "label": "bug", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-4921", - "title": - "I'll index the open-source IP feed, that should system the GB application!", - "status": "cancelled", - "label": "bug", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-5814", - "title": "We need to calculate the 1080p AGP feed!", - "status": "backlog", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-2645", - "title": - "Synthesizing the system won't do anything, we need to navigate the multi-byte HDD firewall!", - "status": "todo", - "label": "documentation", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-4535", - "title": - "Try to copy the JSON circuit, maybe it will connect the wireless feed!", - "status": "progress", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-4463", - "title": "We need to copy the solid state AGP monitor!", - "status": "done", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-9745", - "title": - "If we connect the protocol, we can get to the GB system through the bluetooth PCI microchip!", - "status": "cancelled", - "label": "feature", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-2080", - "title": - "If we input the bus, we can get to the RAM matrix through the auxiliary RAM card!", - "status": "todo", - "label": "bug", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-3838", - "title": - "I'll bypass the online TCP application, that should panel the AGP system!", - "status": "backlog", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-1340", - "title": "We need to navigate the virtual PNG circuit!", - "status": "todo", - "label": "bug", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-6665", - "title": - "If we parse the monitor, we can get to the SSD hard drive through the cross-platform AGP alarm!", - "status": "cancelled", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-7585", - "title": - "If we calculate the hard drive, we can get to the SSL program through the multi-byte CSS microchip!", - "status": "backlog", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-6319", - "title": "We need to copy the multi-byte SCSI program!", - "status": "backlog", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-4369", - "title": "Try to input the SCSI bus, maybe it will generate the 1080p pixel!", - "status": "backlog", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-9035", - "title": "We need to override the solid state PNG array!", - "status": "cancelled", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-3970", - "title": - "You can't index the transmitter without quantifying the haptic ASCII card!", - "status": "todo", - "label": "documentation", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-4473", - "title": - "You can't bypass the protocol without overriding the neural RSS program!", - "status": "todo", - "label": "documentation", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-4136", - "title": - "You can't hack the hard drive without hacking the primary JSON program!", - "status": "cancelled", - "label": "bug", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-3939", - "title": - "Use the back-end SQL firewall, then you can connect the neural hard drive!", - "status": "done", - "label": "feature", - "priority": "low", - }, - { - "selected": False, - "id": "TASK-2007", - "title": - "I'll input the back-end USB protocol, that should bandwidth the PCI system!", - "status": "backlog", - "label": "bug", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-7516", - "title": - "Use the primary SQL program, then you can generate the auxiliary transmitter!", - "status": "done", - "label": "documentation", - "priority": "medium", - }, - { - "selected": False, - "id": "TASK-6906", - "title": - "Try to back up the DRAM system, maybe it will reboot the online transmitter!", - "status": "done", - "label": "feature", - "priority": "high", - }, - { - "selected": False, - "id": "TASK-5207", - "title": - "The SMS interface is down, copy the bluetooth bus so we can quantify the VGA card!", - "status": "progress", - "label": "bug", - "priority": "low", - }, -] - # %% ../ex_nbs/01_tasks.ipynb 9 hotkeys = (('Profile','⇧⌘P'),('Billing','⌘B'),('Settings','⌘S'),('New Team',''),('Logout','')) avatar_opts =Ul(cls='uk-dropdown-nav uk-nav')( @@ -937,52 +35,43 @@ *map(lambda x: Li(A(cls='uk-drop-close justify-between')(x[0],Span(x[1],cls='ml-auto text-xs tracking-widest opacity-60'))), hotkeys)) # %% ../ex_nbs/01_tasks.ipynb 10 -def MakeTaskForm(): - return Form(cls='uk-modal-body uk-modal-dialog space-y-6')( - UkH3('Create Task'),P(cls=TextT.muted_sm)('Fill out the information below to create a new task',), - Div(cls='grid grid-cols-3 gap-2')( - UkSelect(*map(Option,('Documentation','Bug','Feature')), label='Task Type',id='task_type'), - UkSelect(*map(Option,('In Progress','Backlog','Todo','Cancelled','Done')),label='Status', id='task_status'), - UkSelect(*map(Option,('Low','Medium','High')), label='Priority', id='task_priority')), - UkTextArea(label='Title',placeholder='Please describe the task that needs to be completed'), - Div(cls='grid grid-cols-2')( - UkButton(cls=UkButtonT.ghost + ' uk-modal-close')('Cancel'), - UkButton(cls=UkButtonT.primary + ' uk-modal-close')('Submit'))) +def UkIconButton(*c, sz='small', cls=()): + if sz not in ('small','medium','large'): raise ValueError(f"Invalid size '{sz}'. Must be 'small', 'medium', or 'large'.") + return Button(cls=f'uk-icon-button uk-icon-button-{sz} ' + stringify(cls))(*c) # %% ../ex_nbs/01_tasks.ipynb 11 -def UkIconButton(*c, cls='uk-icon-button-sm'): return Button(cls='uk-icon-button ' + stringify(cls))(*c) - -# %% ../ex_nbs/01_tasks.ipynb 12 def CreateTaskModal(): return Modal( Div(cls='p-6')( UkModalTitle('Create Task'),P(cls=TextT.muted_sm)('Fill out the information below to create a new task'),Br(), Form(cls='space-y-6')( Div(cls='grid grid-cols-3 gap-2')( - UkSelect(*map(Option, ('Documentation', 'Bug', 'Feature')), label='Task Type', id='task_type'), - UkSelect(*map(Option, ('In Progress', 'Backlog', 'Todo', 'Cancelled', 'Done')), label='Status', id='task_status'), - UkSelect(*map(Option, ('Low', 'Medium', 'High')), label='Priority', id='task_priority')), + UkSelect(*Options('Documentation', 'Bug', 'Feature'), label='Task Type', id='task_type'), + UkSelect(*Options('In Progress', 'Backlog', 'Todo', 'Cancelled', 'Done'), label='Status', id='task_status'), + UkSelect(*Options('Low', 'Medium', 'High'), label='Priority', id='task_priority')), UkTextArea(label='Title', placeholder='Please describe the task that needs to be completed'), Div(cls='flex justify-end space-x-2')( UkButton(cls=UkButtonT.ghost + ' uk-modal-close')('Cancel'), UkButton(cls=UkButtonT.primary + ' uk-modal-close')('Submit')))), id='TaskForm') -# %% ../ex_nbs/01_tasks.ipynb 13 +# %% ../ex_nbs/01_tasks.ipynb 12 page_heading =Div(cls='flex items-center justify-between space-y-2')( Div(cls='space-y-2')( UkH2('Welcome back!'),P("Here's a list of your tasks for this month!", cls=TextT.muted_sm)), Div(A(href='#', cls='h-8 w-8 inline-flex rounded-full bg-accent ring-ring')(Img(src='https://api.dicebear.com/8.x/lorelei/svg?seed=sveltecult')), Div(uk_dropdown='mode: click; pos: bottom-right', cls='uk-dropdown uk-drop')(avatar_opts))) -# %% ../ex_nbs/01_tasks.ipynb 14 +# %% ../ex_nbs/01_tasks.ipynb 13 table_controls =(UkInput(cls='w-[250px]',placeholder='Filter task'), - UkDropdownButton(label = "Status", options = [map(Span, (a['status'], a['count'])) for a in status_dd], - btn_cls=(TextT.medium_xs, 'uk-button-default'),dd_cls='flex justify-between capitalize'), - UkDropdownButton( label = "Priority", options = [map(Span, (a['priority'], a['count'])) for a in priority_dd], - btn_cls=(TextT.medium_xs,'uk-button-default'), dd_cls='flex justify-between capitalize'), - UkDropdownButton(label='View', options = [Div(cls='flex flex-column')((Span(o), Span(uk_icon='check'))) for o in ['Title','Status','Priority']], - btn_cls=(TextT.medium_xs,'uk-button-default')), + UkDropdownButton(label = "Status", + options = list(A(FullySpacedContainer(a['status'], a['count'], wrap_tag=P),cls='capitalize') for a in status_dd), + btn_cls=(TextT.medium_xs, 'uk-button-default')), + UkDropdownButton(label = "Priority", + options = [A(FullySpacedContainer(a['priority'], a['count'],wrap_tag=P),cls='capitalize') for a in priority_dd], + btn_cls=(TextT.medium_xs,'uk-button-default')), + UkDropdownButton(label='View', + options = [FullySpacedContainer(P(o), UkIcon('check')) for o in ['Title','Status','Priority']]), UkButton('Create Task',cls=('uk-button-primary', TextT.medium_xs), uk_toggle="target: #TaskForm")) # %% ../ex_nbs/01_tasks.ipynb 15 @@ -1027,5 +116,5 @@ def tasks(): Span('Go to last page', cls='sr-only'), Span(uk_icon='chevron-double-right', cls='h-4 w-4'))))))) -# %% ../ex_nbs/01_tasks.ipynb 17 +# %% ../ex_nbs/01_tasks.ipynb 16 tasks_homepage = tasks() diff --git a/ex_nbs/01_tasks.ipynb b/ex_nbs/01_tasks.ipynb index 79d2116..66f9e6d 100644 --- a/ex_nbs/01_tasks.ipynb +++ b/ex_nbs/01_tasks.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -30,956 +30,62 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "#| export\n", "from fasthtml.common import *\n", "from fh_frankenui.components import *\n", - "from fasthtml.svg import *" + "from fasthtml.svg import *\n", + "import json" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "heading_collapsed": true + }, "source": [ "## Data" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "hidden": true + }, "source": [ "We store data in Python to minic the static data in the examples. Eventually this should be replaced with sqlite data store to allow for interactive functionality" ] }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 4, + "metadata": { + "hidden": true + }, "outputs": [], "source": [ "#| export\n", - "priority_dd = [{'priority': \"low\", 'count': 36 }, {'priority': \"medium\", 'count': 33 }, {'priority': \"high\", 'count': 31 }]\n", - "\n", - "rows_per_page_dd = [10,20,30,40,50]\n", - "\n", - "status_dd = [{'status': \"backlog\", 'count': 21 },{'status': \"todo\", 'count': 21 },{'status': \"progress\", 'count': 20 },{'status': \"done\",'count': 19 },{'status': \"cancelled\", 'count': 19 }]\n" + "with open('../data/status_list.json', 'r') as f: data = json.load(f)\n", + "with open('../data/statuses.json', 'r') as f: statuses = json.load(f)" ] }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 5, + "metadata": { + "hidden": true + }, "outputs": [], "source": [ "#| export\n", - "statuses = {\n", - " 'backlog': {\n", - " 'icon': '''''',\n", - " 'text': \"Backlog\",\n", - " },\n", - " 'cancelled': {\n", - " 'icon': '''''',\n", - " 'text': \"Cancelled\",\n", - " },\n", - " 'done': {\n", - " 'icon': '''''',\n", - " 'text': \"Done\",\n", - " },\n", - " 'progress': {\n", - " 'icon': '''''',\n", - " 'text': \"In Progress\",\n", - " },\n", - " 'todo': {\n", - " 'icon': '''''',\n", - " 'text': \"Todo\",\n", - " },\n", - "}\n", + "priority_dd = [{'priority': \"low\", 'count': 36 }, {'priority': \"medium\", 'count': 33 }, {'priority': \"high\", 'count': 31 }]\n", "\n", - "data = [\n", - " {\n", - " \"selected\": True,\n", - " \"id\": \"TASK-8782\",\n", - " \"title\":\n", - " \"You can't compress the program without quantifying the open-source SSD pixel!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7878\",\n", - " \"title\":\n", - " \"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7839\",\n", - " \"title\": \"We need to bypass the neural TCP card!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-5562\",\n", - " \"title\":\n", - " \"The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-8686\",\n", - " \"title\":\n", - " \"I'll parse the wireless SSL protocol, that should driver the API panel!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1280\",\n", - " \"title\":\n", - " \"Use the digital TLS panel, then you can transmit the haptic system!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7262\",\n", - " \"title\":\n", - " \"The UTF8 application is down, parse the neural bandwidth so we can back up the PNG firewall!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1138\",\n", - " \"title\":\n", - " \"Generating the driver won't do anything, we need to quantify the 1080p SMTP bandwidth!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7184\",\n", - " \"title\": \"We need to program the back-end THX pixel!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-5160\",\n", - " \"title\":\n", - " \"Calculating the bus won't do anything, we need to navigate the back-end JSON protocol!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-5618\",\n", - " \"title\":\n", - " \"Generating the driver won't do anything, we need to index the online SSL application!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-6699\",\n", - " \"title\":\n", - " \"I'll transmit the wireless JBOD capacitor, that should hard drive the SSD feed!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-2858\",\n", - " \"title\": \"We need to override the online UDP bus!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9864\",\n", - " \"title\":\n", - " \"I'll reboot the 1080p FTP panel, that should matrix the HEX hard drive!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-8404\",\n", - " \"title\": \"We need to generate the virtual HEX alarm!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-5365\",\n", - " \"title\":\n", - " \"Backing up the pixel won't do anything, we need to transmit the primary IB array!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1780\",\n", - " \"title\":\n", - " \"The CSS feed is down, index the bluetooth transmitter so we can compress the CLI protocol!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-6938\",\n", - " \"title\":\n", - " \"Use the redundant SCSI application, then you can hack the optical alarm!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9885\",\n", - " \"title\": \"We need to compress the auxiliary VGA driver!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3216\",\n", - " \"title\":\n", - " \"Transmitting the transmitter won't do anything, we need to compress the virtual HDD sensor!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9285\",\n", - " \"title\":\n", - " \"The IP monitor is down, copy the haptic alarm so we can generate the HTTP transmitter!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1024\",\n", - " \"title\":\n", - " \"Overriding the microchip won't do anything, we need to transmit the digital OCR transmitter!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7068\",\n", - " \"title\":\n", - " \"You can't generate the capacitor without indexing the wireless HEX pixel!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-6502\",\n", - " \"title\":\n", - " \"Navigating the microchip won't do anything, we need to bypass the back-end SQL bus!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-5326\",\n", - " \"title\": \"We need to hack the redundant UTF8 transmitter!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-6274\",\n", - " \"title\":\n", - " \"Use the virtual PCI circuit, then you can parse the bluetooth alarm!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1571\",\n", - " \"title\":\n", - " \"I'll input the neural DRAM circuit, that should protocol the SMTP interface!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9518\",\n", - " \"title\":\n", - " \"Compressing the interface won't do anything, we need to compress the online SDD matrix!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-5581\",\n", - " \"title\":\n", - " \"I'll synthesize the digital COM pixel, that should transmitter the UTF8 protocol!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-2197\",\n", - " \"title\":\n", - " \"Parsing the feed won't do anything, we need to copy the bluetooth DRAM bus!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-8484\",\n", - " \"title\": \"We need to parse the solid state UDP firewall!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9892\",\n", - " \"title\":\n", - " \"If we back up the application, we can get to the UDP application through the multi-byte THX capacitor!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9616\",\n", - " \"title\": \"We need to synthesize the cross-platform ASCII pixel!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9744\",\n", - " \"title\":\n", - " \"Use the back-end IP card, then you can input the solid state hard drive!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1376\",\n", - " \"title\":\n", - " \"Generating the alarm won't do anything, we need to generate the mobile IP capacitor!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7382\",\n", - " \"title\":\n", - " \"If we back up the firewall, we can get to the RAM alarm through the primary UTF8 pixel!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-2290\",\n", - " \"title\":\n", - " \"I'll compress the virtual JSON panel, that should application the UTF8 bus!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1533\",\n", - " \"title\":\n", - " \"You can't input the firewall without overriding the wireless TCP firewall!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4920\",\n", - " \"title\":\n", - " \"Bypassing the hard drive won't do anything, we need to input the bluetooth JSON program!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-5168\",\n", - " \"title\":\n", - " \"If we synthesize the bus, we can get to the IP panel through the virtual TLS array!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7103\",\n", - " \"title\": \"We need to parse the multi-byte EXE bandwidth!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4314\",\n", - " \"title\":\n", - " \"If we compress the program, we can get to the XML alarm through the multi-byte COM matrix!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3415\",\n", - " \"title\":\n", - " \"Use the cross-platform XML application, then you can quantify the solid state feed!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-8339\",\n", - " \"title\":\n", - " \"Try to calculate the DNS interface, maybe it will input the bluetooth capacitor!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-6995\",\n", - " \"title\":\n", - " \"Try to hack the XSS bandwidth, maybe it will override the bluetooth matrix!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-8053\",\n", - " \"title\":\n", - " \"If we connect the program, we can get to the UTF8 matrix through the digital UDP protocol!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4336\",\n", - " \"title\":\n", - " \"If we synthesize the microchip, we can get to the SAS sensor through the optical UDP program!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-8790\",\n", - " \"title\":\n", - " \"I'll back up the optical COM alarm, that should alarm the RSS capacitor!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-8980\",\n", - " \"title\":\n", - " \"Try to navigate the SQL transmitter, maybe it will back up the virtual firewall!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7342\",\n", - " \"title\": \"Use the neural CLI card, then you can parse the online port!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-5608\",\n", - " \"title\":\n", - " \"I'll hack the haptic SSL program, that should bus the UDP transmitter!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1606\",\n", - " \"title\":\n", - " \"I'll generate the bluetooth PNG firewall, that should pixel the SSL driver!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7872\",\n", - " \"title\":\n", - " \"Transmitting the circuit won't do anything, we need to reboot the 1080p RSS monitor!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4167\",\n", - " \"title\":\n", - " \"Use the cross-platform SMS circuit, then you can synthesize the optical feed!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9581\",\n", - " \"title\":\n", - " \"You can't index the port without hacking the cross-platform XSS monitor!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-8806\",\n", - " \"title\": \"We need to bypass the back-end SSL panel!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-6542\",\n", - " \"title\":\n", - " \"Try to quantify the RSS firewall, maybe it will quantify the open-source system!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-6806\",\n", - " \"title\":\n", - " \"The VGA protocol is down, reboot the back-end matrix so we can parse the CSS panel!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9549\",\n", - " \"title\": \"You can't bypass the bus without connecting the neural JBOD bus!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1075\",\n", - " \"title\":\n", - " \"Backing up the driver won't do anything, we need to parse the redundant RAM pixel!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1427\",\n", - " \"title\":\n", - " \"Use the auxiliary PCI circuit, then you can calculate the cross-platform interface!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1907\",\n", - " \"title\":\n", - " \"Hacking the circuit won't do anything, we need to back up the online DRAM system!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4309\",\n", - " \"title\":\n", - " \"If we generate the system, we can get to the TCP sensor through the optical GB pixel!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3973\",\n", - " \"title\":\n", - " \"I'll parse the back-end ADP array, that should bandwidth the RSS bandwidth!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7962\",\n", - " \"title\":\n", - " \"Use the wireless RAM program, then you can hack the cross-platform feed!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3360\",\n", - " \"title\":\n", - " \"You can't quantify the program without synthesizing the neural OCR interface!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9887\",\n", - " \"title\":\n", - " \"Use the auxiliary ASCII sensor, then you can connect the solid state port!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3649\",\n", - " \"title\":\n", - " \"I'll input the virtual USB system, that should circuit the DNS monitor!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3586\",\n", - " \"title\":\n", - " \"If we quantify the circuit, we can get to the CLI feed through the mobile SMS hard drive!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-5150\",\n", - " \"title\":\n", - " \"I'll hack the wireless XSS port, that should transmitter the IP interface!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3652\",\n", - " \"title\":\n", - " \"The SQL interface is down, override the optical bus so we can program the ASCII interface!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-6884\",\n", - " \"title\":\n", - " \"Use the digital PCI circuit, then you can synthesize the multi-byte microchip!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1591\",\n", - " \"title\": \"We need to connect the mobile XSS driver!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3802\",\n", - " \"title\":\n", - " \"Try to override the ASCII protocol, maybe it will parse the virtual matrix!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7253\",\n", - " \"title\":\n", - " \"Programming the capacitor won't do anything, we need to bypass the neural IB hard drive!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9739\",\n", - " \"title\": \"We need to hack the multi-byte HDD bus!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4424\",\n", - " \"title\":\n", - " \"Try to hack the HEX alarm, maybe it will connect the optical pixel!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3922\",\n", - " \"title\":\n", - " \"You can't back up the capacitor without generating the wireless PCI program!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4921\",\n", - " \"title\":\n", - " \"I'll index the open-source IP feed, that should system the GB application!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-5814\",\n", - " \"title\": \"We need to calculate the 1080p AGP feed!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-2645\",\n", - " \"title\":\n", - " \"Synthesizing the system won't do anything, we need to navigate the multi-byte HDD firewall!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4535\",\n", - " \"title\":\n", - " \"Try to copy the JSON circuit, maybe it will connect the wireless feed!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4463\",\n", - " \"title\": \"We need to copy the solid state AGP monitor!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9745\",\n", - " \"title\":\n", - " \"If we connect the protocol, we can get to the GB system through the bluetooth PCI microchip!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-2080\",\n", - " \"title\":\n", - " \"If we input the bus, we can get to the RAM matrix through the auxiliary RAM card!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3838\",\n", - " \"title\":\n", - " \"I'll bypass the online TCP application, that should panel the AGP system!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-1340\",\n", - " \"title\": \"We need to navigate the virtual PNG circuit!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-6665\",\n", - " \"title\":\n", - " \"If we parse the monitor, we can get to the SSD hard drive through the cross-platform AGP alarm!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7585\",\n", - " \"title\":\n", - " \"If we calculate the hard drive, we can get to the SSL program through the multi-byte CSS microchip!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-6319\",\n", - " \"title\": \"We need to copy the multi-byte SCSI program!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4369\",\n", - " \"title\": \"Try to input the SCSI bus, maybe it will generate the 1080p pixel!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-9035\",\n", - " \"title\": \"We need to override the solid state PNG array!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3970\",\n", - " \"title\":\n", - " \"You can't index the transmitter without quantifying the haptic ASCII card!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4473\",\n", - " \"title\":\n", - " \"You can't bypass the protocol without overriding the neural RSS program!\",\n", - " \"status\": \"todo\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-4136\",\n", - " \"title\":\n", - " \"You can't hack the hard drive without hacking the primary JSON program!\",\n", - " \"status\": \"cancelled\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-3939\",\n", - " \"title\":\n", - " \"Use the back-end SQL firewall, then you can connect the neural hard drive!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"low\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-2007\",\n", - " \"title\":\n", - " \"I'll input the back-end USB protocol, that should bandwidth the PCI system!\",\n", - " \"status\": \"backlog\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-7516\",\n", - " \"title\":\n", - " \"Use the primary SQL program, then you can generate the auxiliary transmitter!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"documentation\",\n", - " \"priority\": \"medium\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-6906\",\n", - " \"title\":\n", - " \"Try to back up the DRAM system, maybe it will reboot the online transmitter!\",\n", - " \"status\": \"done\",\n", - " \"label\": \"feature\",\n", - " \"priority\": \"high\",\n", - " },\n", - " {\n", - " \"selected\": False,\n", - " \"id\": \"TASK-5207\",\n", - " \"title\":\n", - " \"The SMS interface is down, copy the bluetooth bus so we can quantify the VGA card!\",\n", - " \"status\": \"progress\",\n", - " \"label\": \"bug\",\n", - " \"priority\": \"low\",\n", - " },\n", - "]" + "rows_per_page_dd = [10,20,30,40,50]\n", + "\n", + "status_dd = [{'status': \"backlog\", 'count': 21 },{'status': \"todo\", 'count': 21 },{'status': \"progress\", 'count': 20 },{'status': \"done\",'count': 19 },{'status': \"cancelled\", 'count': 19 }]\n" ] }, { @@ -991,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -1008,37 +114,19 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#| export\n", - "def MakeTaskForm():\n", - " return Form(cls='uk-modal-body uk-modal-dialog space-y-6')(\n", - " UkH3('Create Task'),P(cls=TextT.muted_sm)('Fill out the information below to create a new task',),\n", - " Div(cls='grid grid-cols-3 gap-2')(\n", - " UkSelect(*map(Option,('Documentation','Bug','Feature')), label='Task Type',id='task_type'),\n", - " UkSelect(*map(Option,('In Progress','Backlog','Todo','Cancelled','Done')),label='Status', id='task_status'),\n", - " UkSelect(*map(Option,('Low','Medium','High')), label='Priority', id='task_priority')),\n", - " UkTextArea(label='Title',placeholder='Please describe the task that needs to be completed'),\n", - " Div(cls='grid grid-cols-2')(\n", - " UkButton(cls=UkButtonT.ghost + ' uk-modal-close')('Cancel'),\n", - " UkButton(cls=UkButtonT.primary + ' uk-modal-close')('Submit')))" - ] - }, - { - "cell_type": "code", - "execution_count": null, + "execution_count": 52, "metadata": {}, "outputs": [], "source": [ "#| export\n", - "def UkIconButton(*c, cls='uk-icon-button-sm'): return Button(cls='uk-icon-button ' + stringify(cls))(*c)" + "def UkIconButton(*c, sz='small', cls=()):\n", + " if sz not in ('small','medium','large'): raise ValueError(f\"Invalid size '{sz}'. Must be 'small', 'medium', or 'large'.\")\n", + " return Button(cls=f'uk-icon-button uk-icon-button-{sz} ' + stringify(cls))(*c)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -1049,9 +137,9 @@ " UkModalTitle('Create Task'),P(cls=TextT.muted_sm)('Fill out the information below to create a new task'),Br(),\n", " Form(cls='space-y-6')(\n", " Div(cls='grid grid-cols-3 gap-2')(\n", - " UkSelect(*map(Option, ('Documentation', 'Bug', 'Feature')), label='Task Type', id='task_type'),\n", - " UkSelect(*map(Option, ('In Progress', 'Backlog', 'Todo', 'Cancelled', 'Done')), label='Status', id='task_status'),\n", - " UkSelect(*map(Option, ('Low', 'Medium', 'High')), label='Priority', id='task_priority')),\n", + " UkSelect(*Options('Documentation', 'Bug', 'Feature'), label='Task Type', id='task_type'),\n", + " UkSelect(*Options('In Progress', 'Backlog', 'Todo', 'Cancelled', 'Done'), label='Status', id='task_status'),\n", + " UkSelect(*Options('Low', 'Medium', 'High'), label='Priority', id='task_priority')),\n", " UkTextArea(label='Title', placeholder='Please describe the task that needs to be completed'),\n", " Div(cls='flex justify-end space-x-2')(\n", " UkButton(cls=UkButtonT.ghost + ' uk-modal-close')('Cancel'),\n", @@ -1061,7 +149,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -1075,21 +163,30 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 29, "metadata": {}, "outputs": [], "source": [ "#| export\n", "table_controls =(UkInput(cls='w-[250px]',placeholder='Filter task'),\n", - " UkDropdownButton(label = \"Status\", options = [map(Span, (a['status'], a['count'])) for a in status_dd],\n", - " btn_cls=(TextT.medium_xs, 'uk-button-default'),dd_cls='flex justify-between capitalize'),\n", - " UkDropdownButton( label = \"Priority\", options = [map(Span, (a['priority'], a['count'])) for a in priority_dd],\n", - " btn_cls=(TextT.medium_xs,'uk-button-default'), dd_cls='flex justify-between capitalize'),\n", - " UkDropdownButton(label='View', options = [Div(cls='flex flex-column')((Span(o), Span(uk_icon='check'))) for o in ['Title','Status','Priority']],\n", - " btn_cls=(TextT.medium_xs,'uk-button-default')),\n", + " UkDropdownButton(label = \"Status\", \n", + " options = list(A(FullySpacedContainer(a['status'], a['count'], wrap_tag=P),cls='capitalize') for a in status_dd),\n", + " btn_cls=(TextT.medium_xs, 'uk-button-default')),\n", + " UkDropdownButton(label = \"Priority\", \n", + " options = [A(FullySpacedContainer(a['priority'], a['count'],wrap_tag=P),cls='capitalize') for a in priority_dd],\n", + " btn_cls=(TextT.medium_xs,'uk-button-default')),\n", + " UkDropdownButton(label='View', \n", + " options = [FullySpacedContainer(P(o), UkIcon('check')) for o in ['Title','Status','Priority']]),\n", " UkButton('Create Task',cls=('uk-button-primary', TextT.medium_xs), uk_toggle=\"target: #TaskForm\"))" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Route Data" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1139,13 +236,6 @@ " Span(uk_icon='chevron-double-right', cls='h-4 w-4')))))))" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Route Data" - ] - }, { "cell_type": "code", "execution_count": null, diff --git a/ex_nbs/02_cards.ipynb b/ex_nbs/02_cards.ipynb index 0dade9d..57a5a71 100644 --- a/ex_nbs/02_cards.ipynb +++ b/ex_nbs/02_cards.ipynb @@ -12,7 +12,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, "id": "4878c4e1", "metadata": {}, "outputs": [], @@ -22,7 +22,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "id": "db96459b", "metadata": {}, "outputs": [], @@ -36,7 +36,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "id": "c8c2cc08", "metadata": {}, "outputs": [], @@ -47,7 +47,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 4, "id": "7f8fd12f", "metadata": {}, "outputs": [ @@ -105,20 +105,20 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "id": "08d5a085", "metadata": {}, "outputs": [], "source": [ "#| export\n", - "GalleryCard = Card(UkH3(\"Inline Field Validation\"),Br(),\n", - " P(cls=TextT.muted_sm)('A form with inline field validation on individual inputs with the submit aditionally validating the whole form.'),\n", - " header=Img(cls='uk-img',src='public/inline_validation.gif',),\n", - " footer=Div(cls=('grid','grid-cols-3', 'gap-12'))(\n", - " UkButton('App', cls=UkButtonT.primary),\n", - " UkButton('Info'),\n", - " UkButton('Code')),\n", - " footer_cls='uk-background-muted')" + "# GalleryCard = Card(UkH3(\"Inline Field Validation\"),Br(),\n", + "# P(cls=TextT.muted_sm)('A form with inline field validation on individual inputs with the submit aditionally validating the whole form.'),\n", + "# header=Img(cls='uk-img',src='public/inline_validation.gif',),\n", + "# footer=Div(cls=('grid','grid-cols-3', 'gap-12'))(\n", + "# UkButton('App', cls=UkButtonT.primary),\n", + "# UkButton('Info'),\n", + "# UkButton('Code')),\n", + "# footer_cls='uk-background-muted')" ] }, { @@ -131,15 +131,15 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "id": "576c1ec3", "metadata": {}, "outputs": [], "source": [ "#| export\n", "Left1 = Card(Div(cls='grid grid-cols-2 gap-6')(\n", - " UkButton(Span(cls=\"uk-margin-small-right\", uk_icon=\"icon: github; ratio: 1\"),'Github'),\n", - " UkButton(Span(cls=\"uk-margin-small-right\", uk_icon=\"icon: google; ratio: 1\"),'Google')),\n", + " UkButton(UkIcon('github',cls='uk-margin-small-right'),'Github'),\n", + " UkButton(UkIcon('google',cls='uk-margin-small-right'),'Google')),\n", " UkHSplit(\"OR CONTINUE WITH\", text_cls = (TextB.sz_xsmall, TextB.cl_muted)),\n", " UkInput('Email', 'email', placeholder='m@example.com'),\n", " UkInput('Password', 'Password',placeholder='Password', type='Password'),\n", @@ -158,7 +158,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "id": "71067a4e", "metadata": {}, "outputs": [], @@ -171,7 +171,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "id": "d30e1e29", "metadata": {}, "outputs": [], @@ -179,15 +179,15 @@ "#| export\n", "Left2 = Card(\n", " Div(cls='grid grid-cols-3 gap-4')(\n", - " UkButton(Div(cls='flex flex-col items-center justify-center')(Card1Svg,\"Card\"), cls='h-20 w-full border-2 border-primary'),\n", - " UkButton(Div(cls='flex flex-col items-center justify-center')(Card2Svg, \"Card\"), cls='h-20 w-full'),\n", - " UkButton(Div(cls='flex flex-col items-center justify-center')(AppleSvg, \"Apple\"), cls='h-20 w-full')),\n", + " UkButton(CenteredContainer(Card1Svg,\"Card\"), cls='h-20 w-full border-2 border-primary'),\n", + " UkButton(CenteredContainer(Card2Svg, \"Card\"), cls='h-20 w-full'),\n", + " UkButton(CenteredContainer(AppleSvg, \"Apple\"), cls='h-20 w-full')),\n", " Div(cls='space-y-4')(\n", " UkInput('Name', 'name',placeholder='m@example.com'),\n", " UkInput('Card Number', 'card_number',placeholder='m@example.com'),\n", " Div(cls='grid grid-cols-3 gap-4')(\n", - " UkSelect(*Options(calendar.month_name[1:],0),label='Expires',id='expire_month'),\n", - " UkSelect(*Options(range(2024,2030),0), label='Year', id='expire_year'),\n", + " UkSelect(*Options(*calendar.month_name[1:],0),label='Expires',id='expire_month'),\n", + " UkSelect(*Options(*range(2024,2030),0), label='Year', id='expire_year'),\n", " UkInput('CVV', 'cvv',placeholder='CVV'))),\n", " header=(UkH3('Payment Method'),P(cls=TextT.muted_sm)('Add a new payment method to your account.')))" ] @@ -202,7 +202,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "id": "8c238a7f", "metadata": {}, "outputs": [], @@ -212,14 +212,13 @@ "severity_opts = ('Severity 1 (Highest)', 'Severity 2', 'Severity 3', 'Severity 4 (Lowest)')\n", "Right1 = Card(\n", " Div(cls='grid grid-cols-2 gap-2')(\n", - " UkSelect(*Options(area_opts), label='Area', id='area'),\n", - " UkSelect(*Options(severity_opts),label='Severity',id='area')),\n", + " UkSelect(*Options(*area_opts), label='Area', id='area'),\n", + " UkSelect(*Options(*severity_opts),label='Severity',id='area')),\n", " UkInput( label='Subject', placeholder='I need help with'),\n", " UkTextArea( label='Description',placeholder='Please include all information relevant to your issue'),\n", " UkFormLabel(label=\"Tags\",state=\"danger\", value=\"Spam,Invalid\"),\n", " header=(H3('Report an issue'),P(cls=TextT.muted_sm)('What area are you having problems with')),\n", - " footer = (UkButton(cls=UkButtonT.ghost)('Cancel'),UkButton(cls=UkButtonT.primary)('Submit')),\n", - " footer_cls='flex justify-between')" + " footer = FullySpacedContainer(UkButton(cls=UkButtonT.ghost)('Cancel'),UkButton(cls=UkButtonT.primary)('Submit')))\n" ] }, { @@ -232,7 +231,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "id": "aa8a07f7", "metadata": {}, "outputs": [], @@ -243,7 +242,7 @@ " P(cls=TextT.muted_sm)(franken_desc),\n", " Div(cls=('flex','gap-x-4',TextT.muted_sm))(\n", " Div(cls='flex items-center')(\"TypeScript\"),\n", - " Div(cls='flex items-center')(Span(uk_icon='star'),\"20k\"),\"Updated April 2023\"))" + " Div(cls='flex items-center')(UkIcon('star'),\"20k\"),\"Updated April 2023\"))" ] }, { @@ -256,7 +255,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "id": "bfee421c", "metadata": {}, "outputs": [], @@ -283,7 +282,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "id": "1b354a91", "metadata": {}, "outputs": [], @@ -292,9 +291,9 @@ "team_members = [{\"name\": \"Sofia Davis\", \"email\": \"m@example.com\", \"role\": \"Owner\"},{\"name\": \"Jackson Lee\", \"email\": \"p@example.com\", \"role\": \"Member\"},]\n", "\n", "options = ((Div('Viewer'),Div(cls=TextT.muted_sm)('Can view and comment.',)),\n", - " (Div('Developer'),Div(cls=TextT.muted_sm)('Can view, comment and edit.',)),\n", - " (Div('Billing'),Div(cls=TextT.muted_sm)('Can view, comment and manage billing.',)),\n", - " (Div('Owner'),Div(cls=TextT.muted_sm)('Admin-level to all resources.')),)\n", + " (Div('Developer'),Div(cls=TextT.muted_sm)('Can view, comment and edit.',)),\n", + " (Div('Billing'),Div(cls=TextT.muted_sm)('Can view, comment and manage billing.',)),\n", + " (Div('Owner'),Div(cls=TextT.muted_sm)('Admin-level to all resources.')),)\n", "\n", "body = [Div(cls='flex items-center space-x-4')(\n", " Span(cls='relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full bg-accent')(\n", @@ -321,7 +320,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "id": "68dfdd14", "metadata": {}, "outputs": [], @@ -335,7 +334,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 14, "id": "26a5cbf0", "metadata": {}, "outputs": [], @@ -353,7 +352,7 @@ " Div(cls='flex-1')(\n", " P(member['name'], cls='text-sm font-medium leading-none'),\n", " P(member['email'], cls=TextT.muted_sm)),\n", - " UkSelect(*Options(access_roles, access_roles.index(member['role'])))) for member in team_members],\n", + " UkSelect(*Options(*access_roles, selected_idx=access_roles.index(member['role'])))) for member in team_members],\n", " header = (UkH4('Share this document'),Div('Anyone with the link can view this document.', cls=('mt-1.5',TextT.muted_sm))))" ] }, @@ -367,7 +366,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 15, "id": "61fde698", "metadata": {}, "outputs": [], @@ -386,7 +385,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "id": "a77f02ee", "metadata": {}, "outputs": [], @@ -399,7 +398,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 17, "id": "aecb3bce", "metadata": {}, "outputs": [], @@ -423,7 +422,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 18, "id": "a1987227", "metadata": {}, "outputs": [], @@ -431,14 +430,14 @@ "#| export\n", "def page():\n", " return Title(\"Custom\"),Div(cls='uk-child-width-1-3@l uk-child-width-1-2@m', uk_grid=True)(\n", - " Div(cls='space-y-6')(map(Div,(Left1,Left2,GalleryCard))),\n", + " Div(cls='space-y-6')(map(Div,(Left1,Left2))),\n", " Div(cls='space-y-6')(map(Div,(Middle1,Middle2,Middle3,Middle4))),\n", " Div(cls='space-y-6')(map(Div,(Right1,Right2, Right3))))" ] }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 19, "id": "0954254d", "metadata": {}, "outputs": [], @@ -449,7 +448,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 20, "id": "3c32b2aa", "metadata": {}, "outputs": [], diff --git a/fh_frankenui/_modidx.py b/fh_frankenui/_modidx.py index 8be45c8..2e3b380 100644 --- a/fh_frankenui/_modidx.py +++ b/fh_frankenui/_modidx.py @@ -6,6 +6,8 @@ 'git_url': 'https://github.com/Isaac-Flath/fh-frankenui', 'lib_path': 'fh_frankenui'}, 'syms': { 'fh_frankenui.components': { 'fh_frankenui.components.Card': ('components.html#card', 'fh_frankenui/components.py'), + 'fh_frankenui.components.CenteredContainer': ( 'components.html#centeredcontainer', + 'fh_frankenui/components.py'), 'fh_frankenui.components.FullySpacedContainer': ( 'components.html#fullyspacedcontainer', 'fh_frankenui/components.py'), 'fh_frankenui.components.Modal': ('components.html#modal', 'fh_frankenui/components.py'), diff --git a/fh_frankenui/components.py b/fh_frankenui/components.py index f3509cb..411e456 100644 --- a/fh_frankenui/components.py +++ b/fh_frankenui/components.py @@ -4,9 +4,9 @@ # %% auto 0 __all__ = ['UkInput', 'UkSwitch', 'UkTextArea', 'UkFormLabel', 'UkH1', 'UkH2', 'UkH3', 'UkH4', 'UkH5', 'UkH6', 'stringify', - 'VEnum', 'Theme', 'TextB', 'TextT', 'UkIcon', 'FullySpacedContainer', 'UkGenericInput', 'Options', - 'UkSelect', 'UkButtonT', 'UkDropdownButton', 'UkButton', 'UkGenericComponent', 'UkHSplit', 'UkNavDivider', - 'UkNavbarDropdown', 'UkNavbar', 'Card', 'UkModalTitle', 'Modal'] + 'VEnum', 'Theme', 'TextB', 'TextT', 'UkIcon', 'FullySpacedContainer', 'CenteredContainer', 'UkGenericInput', + 'Options', 'UkSelect', 'UkButtonT', 'UkDropdownButton', 'UkButton', 'UkGenericComponent', 'UkHSplit', + 'UkNavDivider', 'UkNavbarDropdown', 'UkNavbar', 'Card', 'UkModalTitle', 'Modal'] # %% ../lib_nbs/01_components.ipynb 4 from fasthtml.common import * @@ -105,14 +105,18 @@ def __str__(self): return self.value # %% ../lib_nbs/01_components.ipynb 30 -def UkIcon(icon, ratio=1): - return Span(uk_icon=f"icon: {icon}; ratio: {ratio}") +def UkIcon(icon, ratio=1,cls=()): + return Span(uk_icon=f"icon: {icon}; ratio: {ratio}",cls=cls) # %% ../lib_nbs/01_components.ipynb 32 def FullySpacedContainer(*c,wrap_tag=None): return Div(cls='uk-flex uk-flex-between uk-flex-middle uk-width-1-1')(*(map(ifnone(wrap_tag,noop),c))) -# %% ../lib_nbs/01_components.ipynb 34 +# %% ../lib_nbs/01_components.ipynb 33 +def CenteredContainer(*c,cls=()): + return Div(cls='flex flex-col items-center justify-center ' + stringify(cls))(*c) + +# %% ../lib_nbs/01_components.ipynb 35 from typing import Union, Tuple, Optional from fastcore.all import L # from fasthtml.common import FT @@ -135,21 +139,21 @@ def UkGenericInput(input_fn: FT, # FT Components that generates a user input (e. if id: res.id = id return Div(cls=cls)(label, res) -# %% ../lib_nbs/01_components.ipynb 36 +# %% ../lib_nbs/01_components.ipynb 37 UkInput = partial(UkGenericInput, partial(Input, cls='uk-input')) UkSwitch = partial(UkGenericInput, partial(CheckboxX, cls='uk-toggle-switch uk-toggle-switch-primary')) UkTextArea = partial(UkGenericInput, partial(Textarea, cls='uk-textarea')) UkFormLabel = partial(UkGenericInput, partial(Uk_input_tag, cls='uk-form-label')) -# %% ../lib_nbs/01_components.ipynb 42 +# %% ../lib_nbs/01_components.ipynb 43 def Options(*c, # Content for an `Option` selected_idx=None # Index location of selected `Option` ): "Generates list of `Option`s with the proper `selected_idx`" return [Option(o,selected=i==selected_idx) for i,o in enumerate(c)] -# %% ../lib_nbs/01_components.ipynb 43 +# %% ../lib_nbs/01_components.ipynb 44 def UkSelect(*options, label=(), lbl_cls=(), @@ -159,19 +163,15 @@ def UkSelect(*options, name="", placeholder="", searchable=False, - optgroup_label=None, **kwargs): lbl_cls, inp_cls, cls = map(stringify, (lbl_cls, inp_cls, cls)) if label: - label = Label(cls=f'uk-form-label {lbl_cls}', fr=id)(label) if id else Label(cls=f'uk-form-label {lbl_cls}')(label) - - bool_attrs = {'uk-cloak': True, 'searchable': searchable, **kwargs} - bool_attrs = {k: v for k, v in bool_attrs.items() if v} - select = Uk_select(cls=inp_cls, uk_cloak=True, id=id, name=name, placeholder=placeholder, **bool_attrs) + lbl = Label(cls=f'uk-form-label {lbl_cls}', fr=id)(label) if id else Label(cls=f'uk-form-label {lbl_cls}')(label) + select = Uk_select(cls=inp_cls, uk_cloak=True, id=id, name=name, placeholder=placeholder, searchable=searchable, **kwargs) select = select(Optgroup(*options,label=label)) - return Div(cls=cls)(label, select) if label else Div(cls=cls)(select) + return Div(cls=cls)(lbl, select) if label else Div(cls=cls)(select) -# %% ../lib_nbs/01_components.ipynb 46 +# %% ../lib_nbs/01_components.ipynb 47 class UkButtonT(VEnum): default = 'default' primary = 'primary' @@ -181,7 +181,7 @@ class UkButtonT(VEnum): text = 'text' link = 'link' -# %% ../lib_nbs/01_components.ipynb 47 +# %% ../lib_nbs/01_components.ipynb 48 def UkDropdownButton(label, # String or FT component that goes in the `Button` options, # list of tuples that contain what you want listed (FT component/str) btn_cls=UkButtonT.default, # Button class(es) @@ -197,13 +197,13 @@ def UkDropdownButton(label, # String or FT component that goes in the `Button` dd = Div(uk_drop='mode: click; pos: bottom-right', cls='uk-dropdown uk-drop '+ dd_cls)(Ul(cls='uk-dropdown-nav')(*([Li(cls='uk-nav-divider')] + dd_opts))) return Div(cls=cls)(Div(cls='flex items-center space-x-4')(btn, dd)) -# %% ../lib_nbs/01_components.ipynb 50 +# %% ../lib_nbs/01_components.ipynb 51 def UkButton(*c, cls=UkButtonT.default, # Use UkButtonT or styles **kwargs): return Button(type='button', cls='uk-button ' + stringify(cls), **kwargs)(*c) -# %% ../lib_nbs/01_components.ipynb 51 +# %% ../lib_nbs/01_components.ipynb 52 def UkGenericComponent(component_fn, *c, cls=(), **kwargs): res = component_fn(**kwargs)(*c) if cls: res.attrs['class'] += ' ' + cls @@ -217,23 +217,23 @@ def UkGenericComponent(component_fn, *c, cls=(), **kwargs): UkH6 = partial(UkGenericComponent, partial(H6,cls='uk-h6')) -# %% ../lib_nbs/01_components.ipynb 53 +# %% ../lib_nbs/01_components.ipynb 54 def UkHSplit(*c, cls=(), line_cls=(), text_cls=()): cls, line_cls, text_cls = map(stringify,(cls, line_cls, text_cls)) return Div(cls='relative ' + cls)( Div(cls="absolute inset-0 flex items-center " + line_cls)(Span(cls="w-full border-t border-border")), Div(cls="relative flex justify-center " + text_cls)(Span(cls="bg-background px-2 ")(*c))) -# %% ../lib_nbs/01_components.ipynb 54 +# %% ../lib_nbs/01_components.ipynb 55 def UkNavDivider(): return Li(cls="uk-nav-divider") -# %% ../lib_nbs/01_components.ipynb 58 +# %% ../lib_nbs/01_components.ipynb 59 def UkNavbarDropdown(*c,label): return Li(A(label,href='#'), Div(cls='uk-navbar-dropdown')( Ul(cls='uk-nav uk-navbar-dropdown-nav')(*map(Li,c)))) -# %% ../lib_nbs/01_components.ipynb 59 +# %% ../lib_nbs/01_components.ipynb 60 def UkNavbar(lnav: Sequence[Union[str, FT]]=None, # Contents for left aligned part of nav rnav: Sequence[Union[str, FT]]=None, # Contents for right aligned part of nav cls='z-10' # Class(es) to be added to parent container @@ -243,7 +243,7 @@ def UkNavbar(lnav: Sequence[Union[str, FT]]=None, # Contents for left aligned pa _NavBarSide(lnav,'left') if lnav else '', _NavBarSide(rnav,'right') if rnav else '') -# %% ../lib_nbs/01_components.ipynb 61 +# %% ../lib_nbs/01_components.ipynb 62 def Card(*c, # Components that go in the body header=None, # Components that go in the header footer=None, # Components that go in the footer @@ -260,7 +260,7 @@ def Card(*c, # Components that go in the body if footer: res += [Div(cls='uk-card-footer ' + footer_cls)(footer),] return Div(cls='uk-card '+cls, **kwargs)(*res) -# %% ../lib_nbs/01_components.ipynb 63 +# %% ../lib_nbs/01_components.ipynb 64 def UkModalTitle(*c, cls=()): return Div(cls='uk-modal-title ' + stringify(cls))(*c) def Modal(*c, diff --git a/lib_nbs/01_components.ipynb b/lib_nbs/01_components.ipynb index 69cedb4..1afc56f 100644 --- a/lib_nbs/01_components.ipynb +++ b/lib_nbs/01_components.ipynb @@ -456,8 +456,8 @@ "outputs": [], "source": [ "#| export\n", - "def UkIcon(icon, ratio=1):\n", - " return Span(uk_icon=f\"icon: {icon}; ratio: {ratio}\")" + "def UkIcon(icon, ratio=1,cls=()):\n", + " return Span(uk_icon=f\"icon: {icon}; ratio: {ratio}\",cls=cls)" ] }, { @@ -478,6 +478,17 @@ " return Div(cls='uk-flex uk-flex-between uk-flex-middle uk-width-1-1')(*(map(ifnone(wrap_tag,noop),c)))" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#| export\n", + "def CenteredContainer(*c,cls=()):\n", + " return Div(cls='flex flex-col items-center justify-center ' + stringify(cls))(*c)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -825,17 +836,13 @@ " name=\"\",\n", " placeholder=\"\",\n", " searchable=False,\n", - " optgroup_label=None,\n", " **kwargs):\n", " lbl_cls, inp_cls, cls = map(stringify, (lbl_cls, inp_cls, cls))\n", " if label:\n", - " label = Label(cls=f'uk-form-label {lbl_cls}', fr=id)(label) if id else Label(cls=f'uk-form-label {lbl_cls}')(label)\n", - " \n", - " bool_attrs = {'uk-cloak': True, 'searchable': searchable, **kwargs}\n", - " bool_attrs = {k: v for k, v in bool_attrs.items() if v}\n", - " select = Uk_select(cls=inp_cls, uk_cloak=True, id=id, name=name, placeholder=placeholder, **bool_attrs)\n", + " lbl = Label(cls=f'uk-form-label {lbl_cls}', fr=id)(label) if id else Label(cls=f'uk-form-label {lbl_cls}')(label)\n", + " select = Uk_select(cls=inp_cls, uk_cloak=True, id=id, name=name, placeholder=placeholder, searchable=searchable, **kwargs)\n", " select = select(Optgroup(*options,label=label)) \n", - " return Div(cls=cls)(label, select) if label else Div(cls=cls)(select)" + " return Div(cls=cls)(lbl, select) if label else Div(cls=cls)(select)" ] }, {