mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Introduce flex-list
& flex-item
elements for Gitea UI (#25790)
This PR introduces a new UI element type for Gitea called `flex-item`. It consists of a horizontal card with a leading, main and trailing part:  The idea behind it is that in Gitea UI, we have many cases where we use this kind of layout, but it is achieved in many different ways: - grid layout - `.ui.list` with additional hacky flexbox - `.ui.key.list` - looks to me like a style set originally created for ssh/gpg key list, was used in many other places - `.issue.list` - created for issue cards, used in many other places - ... This new style is based on `.issue.list`, specifically the refactoring of it done in #25750. In this PR, the new element is introduced and lots of templates are being refactored to use that style. This allows to remove a lot of page-specific css, makes many of the elements responsive or simply provides a cleaner/better-looking way to present information. A devtest section with the new style is also available. <details> <summary>Screenshots (left: before, right: after)</summary>                    </details> --------- Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
@@ -253,5 +253,63 @@
|
||||
{{template "shared/combomarkdowneditor" .}}
|
||||
</div>
|
||||
<script src="{{AssetUrlPrefix}}/js/devtest.js?v={{AssetVersion}}"></script>
|
||||
|
||||
<div>
|
||||
<h1>Flex List</h1>
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
{{svg "octicon-info" 32}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">
|
||||
Flex Item
|
||||
<span class="ui basic label">
|
||||
with label
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
consists of leading/main/trailing part
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
main part contains title and (multiple) body lines
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<button class="ui tiny red button">
|
||||
{{svg "octicon-warning" 12}} Button
|
||||
</button>
|
||||
<button class="ui tiny green button">
|
||||
{{svg "octicon-info" 12}} Button
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
{{svg "octicon-repo" 32}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-header">
|
||||
<div class="flex-item-title">
|
||||
<a class="text primary" href="{{$.Link}}">
|
||||
gitea-org / gitea
|
||||
</a>
|
||||
<span data-tooltip-content="{{$.locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<a class="muted" href="{{$.Link}}">
|
||||
<span class="flex-text-inline"><i class="color-icon gt-mr-3" style="background-color: aqua"></i>Go</span>
|
||||
</a>
|
||||
<a class="text grey flex-text-inline" href="{{$.Link}}">{{svg "octicon-star" 16}}45000</a>
|
||||
<a class="text grey flex-text-inline" href="{{$.Link}}">{{svg "octicon-git-branch" 16}}1234</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
when inside header, the trailing part will wrap below the title
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
|
Reference in New Issue
Block a user