Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* giteaofficial/main:
  cleanup repo details icons/labels (go-gitea#27644)
  Improve dropdown button alignment and fix hover bug (go-gitea#27632)
  • Loading branch information
zjjhot committed Oct 17, 2023
2 parents 6454a58 + 0271114 commit ac6db5e
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 61 deletions.
4 changes: 1 addition & 3 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1030,10 +1030,8 @@ transfer.no_permission_to_reject = You do not have permission to reject this tra

desc.private = Private
desc.public = Public
desc.private_template = Private template
desc.public_template = Template
desc.template = Template
desc.internal = Internal
desc.internal_template = Internal template
desc.archived = Archived

template.items = Template Items
Expand Down
29 changes: 11 additions & 18 deletions templates/admin/repo/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,22 @@
<td>
<a href="{{.Link}}">{{.Name}}</a>
{{if .IsArchived}}
<span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
{{end}}
{{if .IsTemplate}}
{{if .IsPrivate}}
<span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span>
{{else}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span>
{{end}}
{{end}}
{{if .IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
{{else}}
{{if .IsPrivate}}
<span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
{{else}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
{{end}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
{{end}}
{{end}}
{{if .IsFork}}
{{svg "octicon-repo-forked"}}
{{else if .IsMirror}}
{{if .IsTemplate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.template"}}</span>
{{end}}
{{if .IsMirror}}
{{svg "octicon-mirror"}}
{{else if .IsFork}}
{{svg "octicon-repo-forked"}}
{{end}}
</td>
<td>{{.NumWatches}}</td>
Expand Down
9 changes: 9 additions & 0 deletions templates/devtest/gitea-ui.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</div>
</div>

<div>
<hr>
<div class="ui tiny button">Button align with ...</div>
<div class="ui dropdown tiny button">
<span class="text">... Dropdown Button</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</div>
</div>
</div>

<div>
Expand Down
26 changes: 7 additions & 19 deletions templates/explore/repo_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,17 @@
{{if .IsArchived}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
{{end}}
{{if .IsTemplate}}
{{if .IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span>
{{else}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span>
{{end}}
{{end}}
{{if .IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
{{else}}
{{if .IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
{{else}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
{{end}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
{{end}}
{{end}}
{{if .IsTemplate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.template"}}</span>
{{end}}
</span>
{{if .IsFork}}
<span data-tooltip-content="{{ctx.Locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
{{else if .IsMirror}}
<span data-tooltip-content="{{ctx.Locale.Tr "mirror"}}">{{svg "octicon-mirror"}}</span>
{{end}}
</div>
<div class="flex-item-trailing">
{{if .PrimaryLanguage}}
Expand Down
25 changes: 9 additions & 16 deletions templates/repo/header.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,18 @@
<div class="gt-mx-2">/</div>
<a href="{{$.RepoLink}}">{{.Name}}</a>
<div class="labels gt-df gt-ac gt-fw">
{{if .IsTemplate}}
{{if .IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span>
{{else}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span>
{{end}}
{{end}}
{{if .IsArchived}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
{{end}}
{{if .IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
{{else}}
{{if .IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
{{else}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
{{end}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
{{end}}
{{end}}
{{if .IsArchived}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
{{if .IsTemplate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.template"}}</span>
{{end}}
</div>
{{if $.EnableFeed}}
Expand Down
4 changes: 0 additions & 4 deletions templates/repo/icon.tmpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{{$avatarLink := (.RelAvatarLink ctx)}}
{{if $avatarLink}}
<img class="ui avatar gt-vm" src="{{$avatarLink}}" width="32" height="32" alt="{{.FullName}}">
{{else if $.IsTemplate}}
{{svg "octicon-repo-template" 32}}
{{else if $.IsPrivate}}
{{svg "octicon-lock" 32}}
{{else if $.IsMirror}}
{{svg "octicon-mirror" 32}}
{{else if $.IsFork}}
Expand Down
2 changes: 1 addition & 1 deletion web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ table th[data-sortt-desc] .svg {
height: 15px;
}

.ui.dropdown {
.ui.dropdown:not(.button) {
line-height: var(--line-height-default); /* the dropdown doesn't have default line-height, use this to make the dropdown icon align with plain dropdown */
}

Expand Down
2 changes: 2 additions & 0 deletions web_src/css/modules/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ It needs some tricks to tweak the left/right borders with active state */
.ui.primary.button:focus,
.ui.primary.buttons .button:focus {
background: var(--color-primary);
color: var(--color-primary-contrast);
}

.ui.primary.button:hover,
.ui.primary.buttons .button:hover {
background: var(--color-primary-hover);
color: var(--color-primary-contrast);
}

.ui.primary.button:active,
Expand Down

0 comments on commit ac6db5e

Please sign in to comment.