formatting, full migration to svelte-french-toast
This commit is contained in:
		| @@ -13,13 +13,14 @@ | ||||
|   ); | ||||
| </script> | ||||
|  | ||||
| {#if store.state.jwtinfo.userdetails.permissions.includes('USERGROUP:GET')} | ||||
| {#if store.state.jwtinfo.userdetails.permissions.includes("USERGROUP:GET")} | ||||
|   {#await groups_promise} | ||||
|     <div | ||||
|       class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2" | ||||
|       role="alert"> | ||||
|       <p class="font-bold">{$_('groups-are-being-loaded')}</p> | ||||
|       <p class="text-sm">{$_('this-might-take-a-moment')}</p> | ||||
|       role="alert" | ||||
|     > | ||||
|       <p class="font-bold">{$_("groups-are-being-loaded")}</p> | ||||
|       <p class="text-sm">{$_("this-might-take-a-moment")}</p> | ||||
|     </div> | ||||
|   {:then} | ||||
|     {#if current_groups.length === 0} | ||||
| @@ -28,26 +29,30 @@ | ||||
|       <input | ||||
|         type="search" | ||||
|         bind:value={searchvalue} | ||||
|         placeholder={$_('datatable.search')} | ||||
|         aria-label={$_('datatable.search')} | ||||
|         class="mb-4" /> | ||||
|         placeholder={$_("datatable.search")} | ||||
|         aria-label={$_("datatable.search")} | ||||
|         class="mb-4" | ||||
|       /> | ||||
|       <div | ||||
|         class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll"> | ||||
|         class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll" | ||||
|       > | ||||
|         <table class="divide-y divide-gray-200 w-full"> | ||||
|           <thead class="bg-gray-50"> | ||||
|             <tr> | ||||
|               <th | ||||
|                 scope="col" | ||||
|                 class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> | ||||
|                 {$_('name')} | ||||
|                 class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider" | ||||
|               > | ||||
|                 {$_("name")} | ||||
|               </th> | ||||
|               <th | ||||
|                 scope="col" | ||||
|                 class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> | ||||
|                 {$_('description')} | ||||
|                 class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider" | ||||
|               > | ||||
|                 {$_("description")} | ||||
|               </th> | ||||
|               <th scope="col" class="relative px-6 py-3"> | ||||
|                 <span class="sr-only">{$_('action')}</span> | ||||
|                 <span class="sr-only">{$_("action")}</span> | ||||
|               </th> | ||||
|             </tr> | ||||
|           </thead> | ||||
| @@ -72,39 +77,53 @@ | ||||
|                   </td> | ||||
|                   {#if active_deletes[group.id] === true} | ||||
|                     <td | ||||
|                       class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> | ||||
|                       class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium" | ||||
|                     > | ||||
|                       <button | ||||
|                         on:click={() => { | ||||
|                           active_deletes[group.id] = false; | ||||
|                         }} | ||||
|                         tabindex="0" | ||||
|                         class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer">{$_('cancel-delete')}</button> | ||||
|                         class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer" | ||||
|                         >{$_("cancel-delete")}</button | ||||
|                       > | ||||
|                       <button | ||||
|                         on:click={() => { | ||||
|                           UserGroupService.userGroupControllerRemove(group.id, true) | ||||
|                           UserGroupService.userGroupControllerRemove( | ||||
|                             group.id, | ||||
|                             true | ||||
|                           ) | ||||
|                             .then((resp) => { | ||||
|                               current_groups = current_groups.filter((obj) => obj.id !== group.id); | ||||
|                               current_groups = current_groups.filter( | ||||
|                                 (obj) => obj.id !== group.id | ||||
|                               ); | ||||
|                             }) | ||||
|                             .catch((err) => { | ||||
|                               // error deleting user | ||||
|                             }); | ||||
|                         }} | ||||
|                         tabindex="0" | ||||
|                         class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('confirm-delete')}</button> | ||||
|                         class="ml-4 text-red-600 hover:text-red-900 cursor-pointer" | ||||
|                         >{$_("confirm-delete")}</button | ||||
|                       > | ||||
|                     </td> | ||||
|                   {:else} | ||||
|                     <td | ||||
|                       class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> | ||||
|                       class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium" | ||||
|                     > | ||||
|                       <a | ||||
|                         href="./{group.id}" | ||||
|                         class="text-indigo-600 hover:text-indigo-900">Details</a> | ||||
|                       {#if store.state.jwtinfo.userdetails.permissions.includes('USERGROUP:DELETE')} | ||||
|                         class="text-indigo-600 hover:text-indigo-900">Details</a | ||||
|                       > | ||||
|                       {#if store.state.jwtinfo.userdetails.permissions.includes("USERGROUP:DELETE")} | ||||
|                         <button | ||||
|                           on:click={() => { | ||||
|                             active_deletes[group.id] = true; | ||||
|                           }} | ||||
|                           tabindex="0" | ||||
|                           class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('delete')}</button> | ||||
|                           class="ml-4 text-red-600 hover:text-red-900 cursor-pointer" | ||||
|                           >{$_("delete")}</button | ||||
|                         > | ||||
|                       {/if} | ||||
|                     </td> | ||||
|                   {/if} | ||||
| @@ -118,7 +137,7 @@ | ||||
|   {:catch error} | ||||
|     <div class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500"> | ||||
|       <span class="inline-block align-middle mr-8"> | ||||
|         <b class="capitalize">{$_('general_promise_error')}</b> | ||||
|         <b class="capitalize">{$_("general_promise_error")}</b> | ||||
|         {error} | ||||
|       </span> | ||||
|     </div> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user