mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
style(groups): align card footers and keep role badges intact
Give long names two lines, show the current role in its own non-wrapping row, and anchor every card footer to the grid-row bottom regardless of optional source metadata.
This commit is contained in:
1 parent
084acee7dd
commit
0b8c7c368d
2 files changed
+35
-12
No files matched your search
@@ -200,18 +200,18 @@
|
||||
:style="{ animationDelay: i * 35 + 'ms' }"
|
||||
@click="enterGroup(g)"
|
||||
>
|
||||
<div class="p-4 space-y-3">
|
||||
<div class="flex flex-1 flex-col gap-3 p-4">
|
||||
<div class="flex items-start justify-between gap-2.5">
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="truncate text-[15px] font-semibold text-text">{{
|
||||
g.name || t("route.untitled")
|
||||
}}</span>
|
||||
<RcBadge v-if="roleOf(g.id)" variant="brand" size="xs">
|
||||
{{ t("role.badge", { role: t("roles." + roleOf(g.id)) }) }}
|
||||
</RcBadge>
|
||||
<div
|
||||
class="line-clamp-2 text-[15px] leading-snug font-semibold text-text [overflow-wrap:anywhere]"
|
||||
:title="g.name || t('route.untitled')"
|
||||
>
|
||||
{{ g.name || t("route.untitled") }}
|
||||
</div>
|
||||
<div class="mt-0.5 font-mono text-[11px] text-faint truncate" :title="g.id">
|
||||
{{ g.id }}
|
||||
</div>
|
||||
<div class="mt-0.5 font-mono text-[11px] text-faint truncate">{{ g.id }}</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="canEditGroup(g.id)"
|
||||
@@ -232,6 +232,8 @@
|
||||
color="error"
|
||||
size="icon"
|
||||
class="h-7 w-7 text-muted hover:text-bad"
|
||||
:title="t('groups.delete')"
|
||||
:aria-label="t('groups.delete')"
|
||||
@click="onDeleteGroup(g)"
|
||||
>
|
||||
<Trash2 :size="13.5" />
|
||||
@@ -240,6 +242,15 @@
|
||||
</div>
|
||||
|
||||
<div class="space-y-1.5 text-xs">
|
||||
<div
|
||||
v-if="roleOf(g.id)"
|
||||
class="flex items-center justify-between text-[11.5px]"
|
||||
>
|
||||
<span class="text-faint font-semibold">{{ t("groups.myRole") }}</span>
|
||||
<RcBadge variant="brand" size="xs" class="whitespace-nowrap">
|
||||
{{ t("roles." + roleOf(g.id)) }}
|
||||
</RcBadge>
|
||||
</div>
|
||||
<div class="flex items-center justify-between text-[11.5px]">
|
||||
<span class="text-faint font-semibold">{{ t("groups.members") }}</span>
|
||||
<span class="rounded bg-surface-2 px-1.5 py-0.5 font-mono text-text">
|
||||
@@ -260,7 +271,7 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="flex items-center justify-between pt-2 border-t border-border/70 text-xs"
|
||||
class="mt-auto flex items-center justify-between pt-2 border-t border-border/70 text-xs"
|
||||
>
|
||||
<span class="text-faint text-[11px]">{{ t("overview.routes") }}</span>
|
||||
<span
|
||||
@@ -1004,6 +1015,16 @@ async function onDeleteGroup(group: Group): Promise<void> {
|
||||
.console-group-card {
|
||||
cursor: pointer;
|
||||
}
|
||||
/* Cards stretch to their grid row; the footer sits at the bottom so the
|
||||
dividers of one row line up whatever each card lists above them. */
|
||||
.console-group-card,
|
||||
.console-group-card > :deep(div) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.console-group-card > :deep(div) {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.console-open {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -84,7 +84,6 @@ const en: Dict = {
|
||||
"role.owner": "Owner",
|
||||
"role.admin": "Admin",
|
||||
"role.viewer": "Viewer",
|
||||
"role.badge": "You: {role}",
|
||||
"roles.owner": "Owner",
|
||||
"roles.admin": "Admin",
|
||||
"roles.viewer": "Viewer",
|
||||
@@ -136,9 +135,11 @@ const en: Dict = {
|
||||
"groups.admins": "ADMINS",
|
||||
"groups.owners": "OWNERS",
|
||||
"groups.members": "MEMBERS",
|
||||
"groups.myRole": "MY ROLE",
|
||||
"groups.any": "any",
|
||||
"groups.open": "Open",
|
||||
"group.back": "Groups",
|
||||
"groups.delete": "Delete group",
|
||||
"group.routesIn": "Routes in {name}",
|
||||
"routes.emptyGroup": "No routes in this group yet.",
|
||||
"routes.createFirst": "Create your first route",
|
||||
@@ -522,7 +523,6 @@ const zh: Dict = {
|
||||
"role.owner": "拥有者",
|
||||
"role.admin": "管理员",
|
||||
"role.viewer": "只读",
|
||||
"role.badge": "我的角色:{role}",
|
||||
"roles.owner": "拥有者",
|
||||
"roles.admin": "管理员",
|
||||
"roles.viewer": "只读",
|
||||
@@ -572,9 +572,11 @@ const zh: Dict = {
|
||||
"groups.admins": "管理员",
|
||||
"groups.owners": "来源",
|
||||
"groups.members": "成员",
|
||||
"groups.myRole": "我的角色",
|
||||
"groups.any": "任意",
|
||||
"groups.open": "进入",
|
||||
"group.back": "返回分组",
|
||||
"groups.delete": "删除分组",
|
||||
"group.routesIn": "{name} 的路由",
|
||||
"routes.emptyGroup": "该分组还没有路由。",
|
||||
"routes.createFirst": "创建第一个路由",
|
||||
|
||||
Reference in new issue
Block a user