Skip to content

Commit 0f904b1

Browse files
committed
Fix some layout issues and issues in mobile in admin page
1 parent 4f7b5a8 commit 0f904b1

6 files changed

Lines changed: 22 additions & 14 deletions

File tree

frontend/app/components/site/mod/mod-row.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</NuxtLink>
77
</td>
88

9-
<td>
10-
<NuxtLink class="mod-title" style="min-width: 150px;" :to="!static && `/mod/${mod.id}` || undefined" :title="mod.name">
9+
<td style="min-width: 250px;">
10+
<NuxtLink class="mod-title" :to="!static && `/mod/${mod.id}` || undefined" :title="mod.name">
1111
<mod-status :mod="mod"/>
1212
{{ mod.name }}
1313
</NuxtLink>

frontend/app/components/site/pages/admin/admin-glance.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<span v-if="adminData" class="h2">{{ $t('admin_at_a_glance') }}</span>
3-
<m-flex v-if="adminData" class="max-md:flex-wrap">
3+
<m-flex v-if="adminData" class="max-md:flex-col overflow-hidden">
44
<m-flex class="flex-1" column>
55
<NuxtLink :to="reportsUrl" class="glance-block">
66
<span class="text-2xl text-body">{{ $t('last_reports') }}</span>
@@ -37,12 +37,12 @@
3737
<span class="text-2xl text-body">{{ $t('last_suspensions') }}</span>
3838
<m-flex v-if="adminData.suspensions" column>
3939
<template v-if="adminData.suspensions.length">
40-
<m-content-block v-for="sus of adminData.suspensions" :key="sus.id" class="text-body" :column="false">
41-
<mod-thumbnail :thumbnail="sus.mod.thumbnail" style="width: 96px; height: 48px;"/>
42-
<m-flex column>
40+
<m-content-block v-for="sus of adminData.suspensions" :key="sus.id" class="text-body items-center" :column="false" wrap>
41+
<m-flex class="items-center">
42+
<mod-thumbnail :thumbnail="sus.mod.thumbnail" style="width: 96px; height: 48px;"/>
4343
<span>{{ sus.mod.name }}</span>
44-
<span>{{ $t('reason') }}: {{ sus.reason }}</span>
4544
</m-flex>
45+
<span>{{ $t('reason') }}: {{ sus.reason }}</span>
4646
</m-content-block>
4747
</template>
4848
<span v-else class="text-body">

frontend/app/components/ui/layout/m-list.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<m-flex column gap="4" style="flex: 1;">
3-
<m-flex v-if="title || $slots.title" class="items-center">
3+
<m-flex v-if="title || $slots.title || $slots.buttons" class="items-center">
44
<slot name="title">
55
<h2 v-if="title">{{ title }}</h2>
66
</slot>
@@ -14,6 +14,8 @@
1414
</m-flex>
1515
</m-flex>
1616

17+
<slot name="filters" :items="items"/>
18+
1719
<m-pagination v-if="pagination" v-model="page" :total="total" :per-page="limit">
1820
<slot name="pagination" :items="items"/>
1921
</m-pagination>
@@ -71,8 +73,8 @@ const props = withDefaults(defineProps<{
7173
column: true
7274
});
7375
74-
const vmPage = defineModel<number>('page');
75-
const page = props.query ? useRouteQuery('page', 1) : ref(vmPage.value);
76+
const vmPage = defineModel<number>('page', { default: undefined });
77+
const page = !vmPage.value ? useRouteQuery('page', 1) : ref(vmPage.value);
7678
7779
const queryRef = props.query ? useRouteQuery('query', '') : ref('');
7880

frontend/app/components/ui/layout/m-list/item.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ withDefaults(defineProps<{
1717
textBy?: string;
1818
}>(), { textBy: 'name' });
1919
</script>
20+
21+
<style scoped>
22+
.list-button {
23+
width: 100%;
24+
}
25+
</style>

frontend/app/pages/admin/sessions.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<user-select v-model="user" :label="$t('user')" clearable/>
66
<m-list v-model:page="page" query :items="sessions" :loading="loading">
77
<template #before-item="{ item }">
8-
<a-user :user="item.user">
8+
<a-user :user="item.user" class="overflow-hidden">
99
<template #details>
10-
{{ item.ip_address }}
10+
<span>{{ item.ip_address }}</span>
1111
<m-time :datetime="item.updated_at" relative/>
1212
</template>
1313
</a-user>

frontend/app/pages/admin/suspensions.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<m-list :items="data" :loading="loading">
3-
<template #buttons>
2+
<m-list :items="data" :loading="loading" :title="$t('suspensions')">
3+
<template #filters>
44
<m-input v-model="query" :label="$t('search')"/>
55
<user-select v-model="userId" :label="$t('user')" clearable/>
66
</template>

0 commit comments

Comments
 (0)