-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make the expand/collapse column have fixed width * Remove fixed header height and fix styling * Fix alignment in navbar The skewed positioning is very visible when adding a centered toolbar right below the navbar * Make table toolbar a separate component * Add all buttons and display them in the toolbar * Add on hover popovers with button names * Add focus ring * Simplify tooltip * Add a common modal component for table operations * Show generic modal on table operation buttons click * Increase font size in navbar
- Loading branch information
1 parent
963f687
commit ec4cc21
Showing
11 changed files
with
135 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/howitz/templates/components/popups/modals/table-operation-modal.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<div id="{{ modal_id }}" | ||
class="invisible fixed inset-0 z-50 flex flex-col items-center justify-center" | ||
aria-labelledby="modal-title" | ||
role="dialog" | ||
aria-modal="true" | ||
hx-target-error="body" | ||
> | ||
<div | ||
class="modal-underlay inset-0 bg-gray-500 bg-opacity-70 transition-opacity" | ||
hx-on:click="htmx.addClass(htmx.find('#{{ modal_id }}'), 'invisible')" | ||
></div> | ||
|
||
|
||
<div class="w-1/3 flex items-end justify-center p-4 text-center sm:items-center sm:p-0"> | ||
|
||
<div class="relative transform overflow-x-auto overflow-y-auto rounded-lg bg-white text-left shadow-xl sm:my-8 sm:w-full sm:max-w-3xl w-fit"> | ||
<div class="bg-slate-800 px-4 py-4"> | ||
<h3 class="text-lg font-semibold leading-6 text-center text-teal-200" | ||
id="modal-title">{{ modal_title }}</h3> | ||
</div> | ||
|
||
<div class="bg-slate-700 p-4 text-white"> | ||
{% if path_to_content %} | ||
{% include path_to_content %} | ||
{% else %} | ||
<p class="py-6 text-center"> | ||
Nothing to display | ||
</p> | ||
{% endif %} | ||
|
||
</div> | ||
|
||
<div class="bg-slate-800 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6"> | ||
<button | ||
hx-on:click="htmx.addClass(htmx.find('#{{ modal_id }}'), 'invisible')" | ||
class="mt-3 inline-flex w-full justify-center rounded-md bg-slate-800 px-3 py-2 text-sm font-semibold text-teal-200 shadow-sm ring-1 ring-inset ring-teal-200 hover:bg-slate-600 sm:mt-0 sm:w-auto"> | ||
Close | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/howitz/templates/components/toolbar/column-toggle-btn.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="relative flex flex-col items-center"> | ||
<button class="block bg-gray-600/90 hover:bg-gray-500 rounded-md m-1.5 size-9 focus:ring-2 focus:outline-none focus:ring-teal-300" | ||
hx-on:mouseenter="htmx.removeClass(htmx.find('#toggle-popover'), 'invisible')" | ||
hx-on:mouseleave="htmx.addClass(htmx.find('#toggle-popover'), 'invisible')" | ||
hx-on:click="htmx.removeClass(htmx.find('#column-toggle-menu-dropdown'), 'invisible')" | ||
aria-describedby="toggle-popover" | ||
> | ||
<svg class="fill-teal-300/90 hover:fill-teal-300 p-1.5 size-full" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 576 512"> | ||
<!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--> | ||
<path d="M384 128c70.7 0 128 57.3 128 128s-57.3 128-128 128H192c-70.7 0-128-57.3-128-128s57.3-128 128-128H384zM576 256c0-106-86-192-192-192H192C86 64 0 150 0 256S86 448 192 448H384c106 0 192-86 192-192zM192 352a96 96 0 1 0 0-192 96 96 0 1 0 0 192z"/> | ||
</svg> | ||
</button> | ||
|
||
<p id="toggle-popover" role="tooltip" | ||
class="absolute -top-4 h-fit z-40 invisible flow-root w-fit text-xs font-semibold text-nowrap text-teal-900 transition-opacity duration-300 bg-teal-300 rounded-md px-1 py-0.5" | ||
> | ||
Toggle columns | ||
</p> | ||
|
||
{% with modal_id='column-toggle-menu-dropdown', modal_title='Toggle columns' %} | ||
{% include "/components/popups/modals/table-operation-modal.html" %} | ||
{% endwith %} | ||
</div> |
25 changes: 25 additions & 0 deletions
25
src/howitz/templates/components/toolbar/table-filter-btn.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="relative flex flex-col items-center"> | ||
<button class="block bg-gray-600/90 hover:bg-gray-500 rounded-md m-1.5 size-9 focus:ring-2 focus:outline-none focus:ring-teal-300" | ||
hx-on:mouseenter="htmx.removeClass(htmx.find('#filter-popover'), 'invisible')" | ||
hx-on:mouseleave="htmx.addClass(htmx.find('#filter-popover'), 'invisible')" | ||
hx-on:click="htmx.removeClass(htmx.find('#filter-menu-dropdown'), 'invisible')" | ||
aria-describedby="filter-popover" | ||
> | ||
<svg class="fill-teal-300/90 hover:fill-teal-300 p-1.5 size-full" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 512 512"> | ||
<!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--> | ||
<path d="M3.9 54.9C10.5 40.9 24.5 32 40 32H472c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9V448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6V320.9L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"/> | ||
</svg> | ||
</button> | ||
|
||
<p id="filter-popover" role="tooltip" | ||
class="absolute -top-4 h-fit z-40 invisible flow-root w-fit text-xs font-semibold text-nowrap text-teal-900 transition-opacity duration-300 bg-teal-300 rounded-md px-1 py-0.5" | ||
> | ||
Filter events | ||
</p> | ||
|
||
{% with modal_id='filter-menu-dropdown', modal_title='Filter events' %} | ||
{% include "/components/popups/modals/table-operation-modal.html" %} | ||
{% endwith %} | ||
</div> |
25 changes: 25 additions & 0 deletions
25
src/howitz/templates/components/toolbar/table-sort-btn.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="relative flex flex-col items-center"> | ||
<button class="block bg-gray-600/90 hover:bg-gray-500 rounded-md m-1.5 size-9 focus:ring-2 focus:outline-none focus:ring-teal-300" | ||
hx-on:mouseenter="htmx.removeClass(htmx.find('#sort-popover'), 'invisible')" | ||
hx-on:mouseleave="htmx.addClass(htmx.find('#sort-popover'), 'invisible')" | ||
hx-on:click="htmx.removeClass(htmx.find('#sort-menu-dropdown'), 'invisible')" | ||
aria-describedby="sort-popover" | ||
> | ||
<svg class="fill-teal-300/90 hover:fill-teal-300 p-1.5 size-full" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 576 512"> | ||
<!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--> | ||
<path d="M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32V365.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H320z"/> | ||
</svg> | ||
</button> | ||
|
||
<p id="sort-popover" role="tooltip" | ||
class="absolute -top-4 h-fit z-40 invisible flow-root w-fit text-xs font-semibold text-nowrap text-teal-900 transition-opacity duration-300 bg-teal-300 rounded-md px-1 py-0.5" | ||
> | ||
Sort events | ||
</p> | ||
|
||
{% with modal_id='sort-menu-dropdown', modal_title='Sort events' %} | ||
{% include "/components/popups/modals/table-operation-modal.html" %} | ||
{% endwith %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="w-full"> | ||
<div class="h-11 flex justify-center items-center gap-2"> | ||
{% include "/components/toolbar/table-sort-btn.html" %} | ||
{% include "/components/toolbar/table-filter-btn.html" %} | ||
{% include "/components/toolbar/column-toggle-btn.html" %} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters