ui: update language stats layout and click behavior (#6700)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6700
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
0ko 2025-01-29 16:55:10 +00:00
parent fd285bfc4e
commit 4cc0320ed0
3 changed files with 28 additions and 8 deletions

View file

@ -20,7 +20,12 @@
{{end}}
</div>
{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats}}
<div class="ui segment sub-menu language-stats-details tw-hidden">
<a class="ui segment show-panel toggle" id="language-stats-bar" data-panel="#language-stats-legend">
{{range .LanguageStats}}
<div class="bar" style="width: {{.Percentage}}%; background-color: {{.Color}}" data-tooltip-placement="top" data-tooltip-content={{.Language}} data-tooltip-follow-cursor="horizontal"></div>
{{end}}
</a>
<div class="ui segment sub-menu tw-hidden" id="language-stats-legend">
{{range .LanguageStats}}
<div class="item">
<i class="color-icon" style="background-color: {{.Color}}"></i>
@ -35,11 +40,6 @@
</div>
{{end}}
</div>
<a class="ui segment language-stats show-panel toggle" data-panel=".repository-summary > .sub-menu">
{{range .LanguageStats}}
<div class="bar" style="width: {{.Percentage}}%; background-color: {{.Color}}" data-tooltip-placement="top" data-tooltip-content={{.Language}} data-tooltip-follow-cursor="horizontal"></div>
{{end}}
</a>
{{end}}
</div>
{{end}}