Skip to content

Commit 6af901c

Browse files
committed
feat: Introduce update available indicators for addons and themes, and update internationalization strings.
1 parent 3134796 commit 6af901c

7 files changed

Lines changed: 79 additions & 26 deletions

File tree

lang/en-US.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@
7979
"title": "Themes",
8080
"card-title": "{amount} Installed Theme",
8181
"by": "by <strong>{author}</strong>",
82-
"active": "Active"
82+
"active": "Active",
83+
"update-available": "Update Available"
8384
},
8485
"theme-settings": {
8586
"title": "Theme Settings",
@@ -111,7 +112,8 @@
111112
"active": "{amount} Active Addon",
112113
"inactive": "{amount} Inactive Addon",
113114
"installed": "{amount} Installed Addon"
114-
}
115+
},
116+
"update-available": "Update Available"
115117
},
116118
"addon-detail": {
117119
"title": "Addon Detail",

lang/ru.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@
7777
"title": "Темы",
7878
"card-title": "{amount} Установленных тем",
7979
"by": "от <strong>{author}</strong>",
80-
"active": "Активно"
80+
"active": "Активно",
81+
"update-available": "Доступно обновление"
8182
},
8283
"theme-settings": {
8384
"title": "Настройки темы",
@@ -109,7 +110,8 @@
109110
"active": "{amount} Активных аддонов",
110111
"inactive": "{amount} Неактивных аддонов",
111112
"installed": "{amount} Установленных аддонов"
112-
}
113+
},
114+
"update-available": "Доступно обновление"
113115
},
114116
"addon-detail": {
115117
"title": "Детали аддона",

lang/tr.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@
7979
"title": "Temalar",
8080
"card-title": "{amount} Yüklü Tema",
8181
"by": "<strong>{author}</strong> tarafından",
82-
"active": "Aktif"
82+
"active": "Aktif",
83+
"update-available": "Güncelleme Mevcut"
8384
},
8485
"theme-settings": {
8586
"title": "Tema Ayarları",
@@ -111,7 +112,8 @@
111112
"active": "{amount} Aktif Eklenti",
112113
"inactive": "{amount} Devre Dışı Eklenti",
113114
"installed": "{amount} Yüklü Eklenti"
114-
}
115+
},
116+
"update-available": "Güncelleme Mevcut"
115117
},
116118
"addon-detail": {
117119
"title": "Eklenti Detayı",

src/lib/pages/Addons.svelte

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<button
6969
type="button"
7070
aria-label={$_('buttons.error-log')}
71-
class="btn btn-link link-danger p-0"
71+
class="btn btn-link link-danger"
7272
data-bs-toggle="popover"
7373
data-bs-trigger="focus"
7474
data-bs-title={$_('buttons.error-log')}
@@ -80,10 +80,21 @@
8080
{#if plugin.loading}
8181
<i class="fa-solid fa-spinner fa-spin me-2"></i>
8282
{:else}
83+
<button
84+
type="button"
85+
class="btn btn-link"
86+
title={$_('pages.addons.update-available')}
87+
aria-label={$_('pages.addons.update-available')}
88+
on:click={(e) => {
89+
e.preventDefault();
90+
goto(`${base}/settings/updates`);
91+
}}>
92+
<i class="fas fa-sync"></i>
93+
</button>
8394
<AddonSettingsButton {plugin} />
84-
<div class="form-check form-switch m-0 ps-0">
95+
<div class="form-check form-switch">
8596
<input
86-
class="form-check-input ms-0"
97+
class="form-check-input"
8798
type="checkbox"
8899
role="switch"
89100
checked={plugin.status === 'STARTED'}
@@ -179,6 +190,7 @@
179190
<script>
180191
import { getContext } from 'svelte';
181192
import { _ } from 'svelte-i18n';
193+
import tooltip from '$lib/tooltip.util';
182194
183195
import { base } from '$app/paths';
184196
import { browser } from '$app/environment';

src/lib/pages/addons/AddonDetail.svelte

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@
8080
<i class="fas fa-store"></i>
8181
</a>
8282
{/if}
83+
<button
84+
type="button"
85+
class="btn btn-link position-relative"
86+
title={$_('pages.addons.update-available')}
87+
aria-label={$_('pages.addons.update-available')}
88+
on:click={() => goto(`${base}/settings/updates`)}>
89+
<i class="fas fa-sync"></i>
90+
<span
91+
class="position-absolute top-50 start-100 translate-middle badge rounded-pill bg-secondary p-1">
92+
<span class="visually-hidden">{$_('pages.addons.update-available')}</span>
93+
</span>
94+
</button>
8395
<button
8496
class="btn btn-link"
8597
type="button"
@@ -227,6 +239,7 @@
227239
import { getContext, onDestroy } from 'svelte';
228240
import { get } from 'svelte/store';
229241
import { _ } from 'svelte-i18n';
242+
import tooltip from '$lib/tooltip.util';
230243
231244
import { goto, invalidate } from '$app/navigation';
232245
import { base } from '$app/paths';

src/lib/pages/view/ThemeDetail.svelte

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
aria-label={$_('buttons.remove')}
1212
class="btn btn-link"
1313
type="button"
14-
on:click={onRemoveClick}
14+
onclick={onRemoveClick}
1515
title={$_('buttons.remove')}
1616
class:disabled={removing}>
1717
<i class="fas fa-trash"></i>
@@ -27,29 +27,37 @@
2727
<i class="fas fa-store"></i>
2828
</a>
2929
{/if}
30+
<button
31+
type="button"
32+
class="btn btn-link position-relative"
33+
title={$_('pages.themes.update-available')}
34+
aria-label={$_('pages.themes.update-available')}
35+
onclick={() => goto(`${base}/settings/updates`)}>
36+
<i class="fas fa-sync"></i>
37+
<span
38+
class="position-absolute top-50 start-100 translate-middle badge rounded-pill bg-secondary p-1">
39+
<span class="visually-hidden">{$_('pages.themes.update-available')}</span>
40+
</span>
41+
</button>
3042
{#if theme.running}
3143
<button
3244
class="btn btn-danger"
3345
type="button"
3446
aria-label={$_('buttons.stop')}
35-
on:click={onStopClick}
47+
onclick={onStopClick}
3648
class:disabled={stoping}>
3749
<i class="fas fa-stop"></i>
3850
<span class="d-lg-inline d-none ms-2">{$_('buttons.stop')}</span>
3951
</button>
4052
{/if}
4153
{#if !theme.running && theme.active}
42-
<button
43-
class="btn btn-secondary"
44-
type="button"
45-
on:click={onStartClick}
46-
class:disabled={stoping}>
54+
<button class="btn btn-secondary" type="button" onclick={onStartClick} class:disabled={stoping}>
4755
<i class="fas fa-play"></i>
4856
<span class="d-lg-inline d-none ms-2">{$_('buttons.start')}</span>
4957
</button>
5058
{/if}
5159
{#if !theme.active}
52-
<button class="btn btn-secondary" on:click={activate} disabled={activating}>
60+
<button class="btn btn-secondary" onclick={activate} disabled={activating}>
5361
{$_('buttons.activate')}{#if activating}<i class="fas fa-spinner fa-spin ms-2"></i>{/if}
5462
</button>
5563
{/if}
@@ -222,6 +230,7 @@
222230
<script>
223231
import { getContext } from 'svelte';
224232
import { _ } from 'svelte-i18n';
233+
import tooltip from '$lib/tooltip.util';
225234
226235
import { goto, invalidate } from '$app/navigation';
227236
import { base } from '$app/paths';

src/lib/pages/view/Themes.svelte

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,10 @@
4343
aria-label={$_('buttons.reload')}
4444
class="btn btn-link"
4545
class:active={reloading}
46-
on:click={reloadThemes}>
46+
onclick={reloadThemes}>
4747
<i class="fas fa-sync" class:fa-spin={reloading}></i>
4848
</button>
49-
<button
50-
type="button"
51-
class="btn btn-secondary"
52-
on:click={() => showInstallResourceModal('THEME')}>
49+
<button type="button" class="btn btn-secondary" onclick={() => showInstallResourceModal('THEME')}>
5350
<i class="fas fa-plus"></i>
5451
<span class="d-lg-inline d-none ms-2">{$_('buttons.install-theme')}</span>
5552
</button>
@@ -67,7 +64,7 @@
6764
initialValue={search}
6865
searching={isSearching}
6966
debounceMs={500}
70-
on:change={onSearchInput} />
67+
onchange={onSearchInput} />
7168
</div>
7269
</CardHeader>
7370
<div class="card-body">
@@ -112,11 +109,27 @@
112109
<i class="fa-solid fa-code fa-fw me-1"></i>{theme.version}
113110
</small>
114111
</div>
115-
{#if theme.active}
116-
<span class="badge text-bg-success">{$_('pages.themes.active')}</span>
117-
{/if}
112+
<div class="hstack gap-2">
113+
{#if theme.active}
114+
<span class="badge text-bg-success">{$_('pages.themes.active')}</span>
115+
{/if}
116+
</div>
118117
</div>
119118
</div>
119+
120+
<!-- Fake Update Indicator -->
121+
<button
122+
type="button"
123+
class="position-absolute top-0 end-0 m-3 btn btn-sm btn-primary rounded-circle shadow-sm"
124+
title={$_('pages.themes.update-available')}
125+
aria-label={$_('pages.themes.update-available')}
126+
onclick={(e) => {
127+
e.preventDefault();
128+
e.stopPropagation();
129+
goto(`${base}/settings/updates`);
130+
}}>
131+
<i class="fas fa-sync text-white"></i>
132+
</button>
120133
</div>
121134
</a>
122135
</div>

0 commit comments

Comments
 (0)