Skip to content

Commit

Permalink
Fix list page styling consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
silverbackdan committed Aug 16, 2024
1 parent efe34ad commit 4a057f5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/layer/pages/_cwa/layouts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ListFilter :order-options="orderOptions" :search-fields="['reference', 'uiComponent']" />
<ListContent ref="listContent" fetch-url="/_/layouts">
<template #item="data">
<div class="cwa-flex cwa-border-b cwa-border-b-stone-700 cwa-py-4 cwa-space-x-4 cwa-items-center">
<div class="cwa-flex cwa-border-b cwa-border-b-stone-700 cwa-py-6 cwa-space-x-4 cwa-items-center">
<div class="cwa-grow cwa-flex cwa-flex-col cwa-space-y-1">
<span class="cwa-text-xl">{{ data.reference }}</span>
<span class="cwa-text-stone-400">UI: {{ getDisplayLayoutUi(data.uiComponent) }}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/layer/pages/_cwa/pages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ListContainer>
<ListContent ref="listContent" fetch-url="/_/pages">
<template #item="data">
<div class="cwa-flex cwa-border-b cwa-border-b-stone-700 cwa-py-4 cwa-space-x-4 cwa-items-center">
<div class="cwa-flex cwa-border-b cwa-border-b-stone-700 cwa-py-6 cwa-space-x-4 cwa-items-center">
<div class="cwa-grow cwa-flex cwa-flex-col cwa-space-y-1">
<div class="cwa-flex cwa-items-center cwa-space-x-3">
<span class="cwa-text-xl">{{ data.reference }}</span><span :class="['cwa-outline', 'cwa-outline-1', 'cwa-outline-offset-2', 'cwa-w-2', 'cwa-h-2', 'cwa-rounded-full', data.isTemplate ? 'cwa-outline-yellow cwa-bg-yellow' : 'cwa-outline-blue-600 cwa-bg-blue-600']" />
Expand Down
14 changes: 9 additions & 5 deletions src/layer/pages/_cwa/routes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ListFilter :order-options="orderOptions" :search-fields="['path']" />
<ListContent ref="listContent" fetch-url="/_/routes">
<template #item="data">
<div class="cwa-flex cwa-border-b cwa-border-b-stone-700 cwa-py-4 cwa-space-x-4 cwa-items-center">
<div class="cwa-flex cwa-border-b cwa-border-b-stone-700 cwa-py-6 cwa-space-x-4 cwa-items-center">
<div class="cwa-grow cwa-flex cwa-flex-col cwa-space-y-1 cwa-min-w-0">
<span class="cwa-text-xl cwa-truncate">{{ data.path }}</span>
<span v-if="data.redirect || getAssociatedIri(data)" class="cwa-text-stone-400">
Expand All @@ -13,16 +13,20 @@
<span class="cwa-truncate">{{ data.redirect || getAssociatedIri(data) }}</span>
</span>
</span>
<span v-else class="cwa-truncate cwa-text-magenta cwa-font-bold">This route has no association and should be deleted</span>
<span v-else>
<span class="cwa-inline-flex cwa-truncate cwa-bg-magenta/60 cwa-text-white cwa-font-bold cwa-py-1 cwa-px-3 cwa-border cwa-border-magenta cwa-rounded">
This route has no association and should be deleted
</span>
</span>
</div>
<div>
<CwaUiFormButton v-if="getAssociatedIri(data)" :to="computedItemLink(getAssociatedIri(data), '_cwa-pages', '#routes')">
<IconPages class="cwa-w-6" />
<span class="cwa-sr-only">Settings</span>
<span class="cwa-sr-only">View</span>
</CwaUiFormButton>
<CwaUiFormButton v-else-if="!data.redirect" color="blue" @click="deleteRoute(data['@id'])">
<CwaUiFormButton v-else-if="!data.redirect" color="error" @click="deleteRoute(data['@id'])">
<CwaUiIconBinIcon class="cwa-w-4 cwa-m-1" />
<span class="cwa-sr-only">Settings</span>
<span class="cwa-sr-only">Delete</span>
</CwaUiFormButton>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/layer/pages/_cwa/users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ListFilter :order-options="orderOptions" :search-fields="['emailAddress', 'username']" />
<ListContent ref="listContent" fetch-url="/users">
<template #item="data">
<div class="cwa-flex cwa-border-b cwa-border-b-stone-700 cwa-py-4 cwa-space-x-4 cwa-items-center" :class="{ 'cwa-opacity-50': !data.enabled }">
<div class="cwa-flex cwa-border-b cwa-border-b-stone-700 cwa-py-6 cwa-space-x-4 cwa-items-center" :class="{ 'cwa-opacity-50': !data.enabled }">
<div class="cwa-grow cwa-flex cwa-flex-col cwa-space-y-1">
<span class="cwa-text-xl">{{ data.username }} <span class="cwa-text-stone-400 cwa-text-sm">{{ getUserRole(data.roles) }}</span></span>
<span>{{ data.emailAddress }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</h2>
</div>
</div>
<ul v-else class="cwa-flex cwa-flex-col cwa-space-y-4">
<ul v-else class="cwa-flex cwa-flex-col">
<li v-for="(item, index) in itemsFromStore" :key="`list-item-${index}`">
<slot name="item" v-bind="item">
<div class="cwa-dark-blur cwa-p-2 cwa-border cwa-border-light/20">
Expand Down
5 changes: 4 additions & 1 deletion src/runtime/templates/components/ui/form/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface ButtonOption {
value: ModelValue
}
export type ButtonColor = 'blue' | 'grey' | 'dark'
export type ButtonColor = 'blue' | 'grey' | 'dark' | 'error'
const props = withDefaults(defineProps<
{
Expand Down Expand Up @@ -53,6 +53,9 @@ const buttonColorClassNames = computed(() => {
if (props.color === 'dark') {
return 'cwa-text-light cwa-bg-dark/90 hover:cwa-bg-dark cwa-border-stone-400 hover:cwa-border-white hover:cwa-text-white'
}
if (props.color === 'error') {
return 'cwa-text-light cwa-bg-magenta/80 hover:cwa-bg-magenta cwa-border-magenta hover:cwa-border-magenta hover:cwa-text-white'
}
return 'cwa-text-white cwa-bg-stone-700/90 hover:cwa-bg-stone-700 cwa-border-transparent'
})
Expand Down

0 comments on commit 4a057f5

Please sign in to comment.