0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-25 17:42:48 +01:00

Remove a gt-float-right and some unnecessary helpers (#27110)

Follow  Remove polluted .ui.right #26825 

Remove more `gt-float-right`, remove unnecessary helpers, remove
negative margin tricks.

![image](https://github.com/go-gitea/gitea/assets/2114189/2785c6e6-7823-4699-a4f3-184eef50ceda)
This commit is contained in:
wxiaoguang 2023-09-18 12:25:36 +08:00 committed by GitHub
parent 558eea69bd
commit e97baed800
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 56 deletions

View file

@ -16,19 +16,19 @@
</div> </div>
<div class="ui twelve wide column detail"> <div class="ui twelve wide column detail">
<div class="gt-df gt-ac gt-sb gt-fw gt-mb-3"> <div class="gt-df gt-ac gt-sb gt-fw gt-mb-3">
<h4 class="release-list-title gt-df gt-ac"> <h4 class="release-list-title">
<a href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{.Title}}</a> <a href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{.Title}}</a>
{{if .IsDraft}} {{if .IsDraft}}
<span class="ui yellow label gt-ml-3 gt-mt-1">{{$.locale.Tr "repo.release.draft"}}</span> <span class="ui yellow label">{{$.locale.Tr "repo.release.draft"}}</span>
{{else if .IsPrerelease}} {{else if .IsPrerelease}}
<span class="ui orange label gt-ml-3 gt-mt-1">{{$.locale.Tr "repo.release.prerelease"}}</span> <span class="ui orange label">{{$.locale.Tr "repo.release.prerelease"}}</span>
{{else if not .IsTag}} {{else if not .IsTag}}
<span class="ui green label gt-ml-3 gt-mt-1">{{$.locale.Tr "repo.release.stable"}}</span> <span class="ui green label">{{$.locale.Tr "repo.release.stable"}}</span>
{{end}} {{end}}
</h4> </h4>
<div class="gt-df gt-ac"> <div>
{{if and $.CanCreateRelease (not .IsTag)}} {{if and $.CanCreateRelease (not .IsTag)}}
<a class="muted gt-ml-3 gt-df gt-ac" data-tooltip-content="{{$.locale.Tr "repo.release.edit"}}" href="{{$.RepoLink}}/releases/edit/{{.TagName | PathEscapeSegments}}" rel="nofollow"> <a class="muted" data-tooltip-content="{{$.locale.Tr "repo.release.edit"}}" href="{{$.RepoLink}}/releases/edit/{{.TagName | PathEscapeSegments}}" rel="nofollow">
{{svg "octicon-pencil"}} {{svg "octicon-pencil"}}
</a> </a>
{{end}} {{end}}
@ -38,7 +38,7 @@
<p class="text grey"> <p class="text grey">
{{if gt .Publisher.ID 0}} {{if gt .Publisher.ID 0}}
<span class="author"> <span class="author">
{{ctx.AvatarUtils.Avatar .Publisher 20}} {{ctx.AvatarUtils.Avatar .Publisher 20 "gt-mr-2"}}
<a href="{{.Publisher.HomeLink}}">{{.Publisher.Name}}</a> <a href="{{.Publisher.HomeLink}}">{{.Publisher.Name}}</a>
</span> </span>
<span class="released"> <span class="released">
@ -55,9 +55,9 @@
<p class="text grey"> <p class="text grey">
<span class="author"> <span class="author">
{{if .OriginalAuthor}} {{if .OriginalAuthor}}
{{svg "octicon-mark-github" 16 "gt-mr-2"}}{{.OriginalAuthor}} {{svg "octicon-mark-github" 20 "gt-mr-2"}}{{.OriginalAuthor}}
{{else if .Publisher}} {{else if .Publisher}}
{{ctx.AvatarUtils.Avatar .Publisher 20}} {{ctx.AvatarUtils.Avatar .Publisher 20 "gt-mr-2"}}
<a href="{{.Publisher.HomeLink}}">{{.Publisher.GetDisplayName}}</a> <a href="{{.Publisher.HomeLink}}">{{.Publisher.GetDisplayName}}</a>
{{else}} {{else}}
Ghost Ghost
@ -77,8 +77,9 @@
<div class="markup desc"> <div class="markup desc">
{{Str2html .Note}} {{Str2html .Note}}
</div> </div>
<details class="download gt-border-secondary-top gt-mt-4 gt-pt-4" {{if eq $idx 0}}open{{end}}> <div class="divider"></div>
<summary class="gt-mb-4"> <details class="download" {{if eq $idx 0}}open{{end}}>
<summary class="gt-my-4">
{{$.locale.Tr "repo.release.downloads"}} {{$.locale.Tr "repo.release.downloads"}}
</summary> </summary>
<ul class="list"> <ul class="list">
@ -93,21 +94,21 @@
{{if .Attachments}} {{if .Attachments}}
{{range .Attachments}} {{range .Attachments}}
<li> <li>
<span class="gt-float-right"> <a target="_blank" rel="nofollow" href="{{.DownloadURL}}">
<span class="ui text grey">{{.Size | FileSize}}</span> <strong>{{svg "octicon-package" 16 "gt-mr-2"}}{{.Name}}</strong>
</a>
<div>
<span class="text grey">{{.Size | FileSize}}</span>
<span data-tooltip-content="{{$.locale.Tr "repo.release.download_count" ($.locale.PrettyNumber .DownloadCount)}}"> <span data-tooltip-content="{{$.locale.Tr "repo.release.download_count" ($.locale.PrettyNumber .DownloadCount)}}">
{{svg "octicon-info"}} {{svg "octicon-info"}}
</span> </span>
</span> </div>
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
<strong>{{svg "octicon-package" 16 "gt-mr-2"}}{{.Name}}</strong>
</a>
</li> </li>
{{end}} {{end}}
{{end}} {{end}}
</ul> </ul>
</details> </details>
<span class="dot">&nbsp;</span> <div class="dot"></div>
</div> </div>
</li> </li>
{{end}} {{end}}

View file

@ -7,22 +7,14 @@
.repository.releases #release-list .release-list-title { .repository.releases #release-list .release-list-title {
font-size: 2rem; font-size: 2rem;
font-weight: var(--font-weight-normal); font-weight: var(--font-weight-normal);
margin-top: -4px; display: flex;
margin-bottom: 0; align-items: center;
} gap: 0.25em;
margin: 0;
.repository.releases #release-list > li {
list-style: none;
}
.repository.releases #release-list > li .meta,
.repository.releases #release-list > li .detail {
padding-top: 30px;
padding-bottom: 40px;
} }
.repository.releases #release-list > li .meta { .repository.releases #release-list > li .meta {
margin-top: 4px; padding-top: 25px;
position: relative; position: relative;
text-align: right; text-align: right;
display: flex; display: flex;
@ -31,44 +23,30 @@
} }
.repository.releases #release-list > li .detail { .repository.releases #release-list > li .detail {
padding-bottom: 20px;
border-left: 1px solid var(--color-secondary); border-left: 1px solid var(--color-secondary);
} }
.repository.releases #release-list > li .detail .author img { .repository.releases #release-list > li .detail .author img {
margin-bottom: 3px; margin-bottom: 2px; /* the legacy trick to align the avatar vertically, no better solution at the moment */
}
.repository.releases #release-list > li .detail .download > a .svg {
margin-left: 5px;
margin-right: 5px;
} }
.repository.releases #release-list > li .detail .download .list { .repository.releases #release-list > li .detail .download .list {
padding-left: 0; padding-left: 0;
}
.repository.releases #release-list > li .detail .download .list li {
list-style: none;
display: block;
padding: 8px;
border: 1px solid var(--color-secondary); border: 1px solid var(--color-secondary);
border-radius: var(--border-radius);
background: var(--color-light); background: var(--color-light);
} }
.repository.releases #release-list > li .detail .download .list li a > .text.right { .repository.releases #release-list > li .detail .download .list li {
margin-right: 5px; display: flex;
justify-content: space-between;
padding: 8px;
border-bottom: 1px solid var(--color-secondary);
} }
.repository.releases #release-list > li .detail .download .list li + li { .repository.releases #release-list > li .detail .download .list li:last-child {
border-top: 0; border-bottom: none;
}
.repository.releases #release-list > li .detail .download .list li:first-of-type {
border-radius: var(--border-radius) 0 0 var(--border-radius);
}
.repository.releases #release-list > li .detail .download .list li:last-of-type {
border-radius: 0 var(--border-radius) var(--border-radius) 0;
} }
.repository.releases #release-list > li .detail .dot { .repository.releases #release-list > li .detail .dot {
@ -77,7 +55,7 @@
background-color: var(--color-secondary-dark-3); background-color: var(--color-secondary-dark-3);
position: absolute; position: absolute;
left: -5.5px; left: -5.5px;
top: 40px; top: 30px;
border-radius: var(--border-radius-circle); border-radius: var(--border-radius-circle);
border: 2.5px solid var(--color-body); border: 2.5px solid var(--color-body);
} }