Skip to content

Commit 8b5c081

Browse files
Remove fomantic loader module (#26670)
Replace Fomantic `loader` CSS module with our existing `is-loading` spinner. Only three places in the UI used this module, which are pictured here: imagediff: <img width="1237" alt="Screenshot 2023-08-22 at 22 18 01" src="https://github.com/go-gitea/gitea/assets/115237/b0d82531-f05e-43c6-9e5b-1bfc268c056d"> webauthn: <img width="894" alt="Screenshot 2023-08-22 at 22 05 05" src="https://github.com/go-gitea/gitea/assets/115237/7b583425-d944-474a-a57a-22a65bbd8b29"> heatmap (I removed the previous loading text, it was unreadable because it was tiny and on fast machines only visible for a fraction of a second): <img width="764" alt="Screenshot 2023-08-22 at 22 18 44" src="https://github.com/go-gitea/gitea/assets/115237/1c7472d6-3e17-4224-a992-d8c0b380cc73"> Also, heatmap container does not resize any more after loading now and previous duplicate id `user-heatmap` is gone. --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent f626366 commit 8b5c081

File tree

9 files changed

+25
-993
lines changed

9 files changed

+25
-993
lines changed

options/locale/locale_en-US.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,6 @@ overview = Overview
598598
following = Following
599599
follow = Follow
600600
unfollow = Unfollow
601-
heatmap.loading = Loading Heatmap…
602601
user_bio = Biography
603602
disabled_public_activity = This user has disabled the public visibility of the activity.
604603
email_visibility.limited = Your email address is visible to all authenticated users

templates/user/auth/webauthn.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
{{template "base/alert" .}}
1111
<p>{{.locale.Tr "webauthn_sign_in"}}</p>
1212
</div>
13-
<div class="ui attached segment">
14-
<div class="ui active indeterminate inline loader"></div>
13+
<div class="ui attached segment gt-df gt-ac gt-jc gt-gap-2 gt-py-3">
14+
<div class="is-loading" style="width: 40px; height: 40px"></div>
1515
{{.locale.Tr "webauthn_press_button"}}
1616
</div>
1717
<div class="ui attached segment">

templates/user/heatmap.tmpl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
{{if .HeatmapData}}
2-
<div id="user-heatmap"
2+
<div id="user-heatmap" class="is-loading"
33
data-heatmap-data="{{JsonUtils.EncodeToString .HeatmapData}}"
44
data-locale-total-contributions="{{$.locale.Tr "heatmap.number_of_contributions_in_the_last_12_months" ($.locale.PrettyNumber .HeatmapTotalContributions)}}"
55
data-locale-no-contributions="{{.locale.Tr "heatmap.no_contributions"}}"
66
data-locale-more="{{.locale.Tr "heatmap.more"}}"
77
data-locale-less="{{.locale.Tr "heatmap.less"}}"
8-
>
9-
<div slot="loading">
10-
<div class="ui active centered inline indeterminate text loader" id="loading-heatmap">{{.locale.Tr "user.heatmap.loading"}}</div>
11-
</div>
12-
</div>
8+
></div>
139
<div class="divider"></div>
1410
{{end}}

web_src/css/features/heatmap.css

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
width: 100%;
33
font-size: 9px;
44
position: relative;
5-
min-height: 125px;
5+
}
6+
7+
/* before the Vue component is mounted, show a loading indicator with dummy size */
8+
/* the ratio is guesswork, see https://github.com/razorness/vue3-calendar-heatmap/issues/26 */
9+
#user-heatmap.is-loading {
10+
aspect-ratio: 5.415; /* the size is about 790 x 145 */
11+
}
12+
.user.profile #user-heatmap.is-loading {
13+
aspect-ratio: 5.645; /* the size is about 953 x 169 */
614
}
715

816
#user-heatmap text {
@@ -32,37 +40,15 @@
3240
}
3341

3442
@media (max-width: 1200px) {
35-
#user-heatmap {
36-
min-height: 105px;
37-
}
3843
#user-heatmap .total-contributions {
3944
left: 21px;
4045
}
4146
}
4247

4348
@media (max-width: 1000px) {
44-
#user-heatmap {
45-
min-height: 80px;
46-
}
4749
#user-heatmap .total-contributions {
4850
font-size: 10px;
4951
left: 17px;
5052
bottom: -4px;
5153
}
5254
}
53-
54-
.user.profile #user-heatmap {
55-
min-height: 135px;
56-
}
57-
58-
@media (max-width: 1200px) {
59-
.user.profile #user-heatmap {
60-
min-height: 115px;
61-
}
62-
}
63-
64-
@media (max-width: 1000px) {
65-
.user.profile #user-heatmap {
66-
min-height: 90px;
67-
}
68-
}

web_src/css/user.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@
5858
}
5959
}
6060

61-
.user.profile #loading-heatmap {
62-
margin-bottom: 1em;
63-
}
64-
6561
.user.profile .ui.secondary.stackable.pointing.menu {
6662
flex-wrap: wrap;
6763
}

0 commit comments

Comments
 (0)