Skip to content

Commit

Permalink
Merge branch 'main' into refactor-external-url
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang authored Mar 21, 2024
2 parents d4ad30b + bfa160f commit 1336687
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 101 deletions.
6 changes: 2 additions & 4 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,7 @@ watchers = Watchers
stargazers = Stargazers
stars_remove_warning = This will remove all stars from this repository.
forks = Forks
stars = Stars
reactions_more = and %d more
unit_disabled = The site administrator has disabled this repository section.
language_other = Other
Expand Down Expand Up @@ -2966,9 +2967,6 @@ repos.unadopted.no_more = No more unadopted repositories found
repos.owner = Owner
repos.name = Name
repos.private = Private
repos.watches = Watches
repos.stars = Stars
repos.forks = Forks
repos.issues = Issues
repos.size = Size
repos.lfs_size = LFS Size
Expand Down Expand Up @@ -3093,7 +3091,7 @@ auths.tip.nextcloud = Register a new OAuth consumer on your instance using the f
auths.tip.dropbox = Create a new application at https://www.dropbox.com/developers/apps
auths.tip.facebook = Register a new application at https://developers.facebook.com/apps and add the product "Facebook Login"
auths.tip.github = Register a new OAuth application on https://github.com/settings/applications/new
auths.tip.gitlab = Register a new application on https://gitlab.com/profile/applications
auths.tip.gitlab_new = Register a new application on https://gitlab.com/-/profile/applications
auths.tip.google_plus = Obtain OAuth2 client credentials from the Google API console at https://console.developers.google.com/
auths.tip.openid_connect = Use the OpenID Connect Discovery URL (<server>/.well-known/openid-configuration) to specify the endpoints
auths.tip.twitter = Go to https://dev.twitter.com/apps, create an application and ensure that the “Allow this application to be used to Sign in with Twitter” option is enabled
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/auth/new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<li>GitHub</li>
<span>{{ctx.Locale.Tr "admin.auths.tip.github"}}</span>
<li>GitLab</li>
<span>{{ctx.Locale.Tr "admin.auths.tip.gitlab"}}</span>
<span>{{ctx.Locale.Tr "admin.auths.tip.gitlab_new"}}</span>
<li>Google</li>
<span>{{ctx.Locale.Tr "admin.auths.tip.google_plus"}}</span>
<li>OpenID Connect</li>
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/notice.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</div>
</div>
<button class="ui small teal button" id="delete-selection" data-link="{{.Link}}/delete" data-redirect="?page={{.Page.Paginater.Current}}">
{{ctx.Locale.Tr "admin.notices.delete_selected"}}
<span class="text">{{ctx.Locale.Tr "admin.notices.delete_selected"}}</span>
</button>
</th>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions templates/admin/repo/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
{{ctx.Locale.Tr "admin.repos.name"}}
{{SortArrow "alphabetically" "reversealphabetically" $.SortType false}}
</th>
<th>{{ctx.Locale.Tr "admin.repos.watches"}}</th>
<th>{{ctx.Locale.Tr "repo.watchers"}}</th>
<th data-sortt-asc="moststars" data-sortt-desc="feweststars">
{{ctx.Locale.Tr "admin.repos.stars"}}
{{ctx.Locale.Tr "repo.stars"}}
{{SortArrow "moststars" "feweststars" $.SortType false}}
</th>
<th data-sortt-asc="mostforks" data-sortt-desc="fewestforks">
{{ctx.Locale.Tr "admin.repos.forks"}}
{{ctx.Locale.Tr "repo.forks"}}
{{SortArrow "mostforks" "fewestforks" $.SortType false}}
</th>
<th>{{ctx.Locale.Tr "admin.repos.issues"}}</th>
Expand Down
10 changes: 5 additions & 5 deletions templates/base/head_navbar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</a>

<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
<div class="ui secondary menu item navbar-mobile-right">
<div class="ui secondary menu item navbar-mobile-right only-mobile">
{{if .IsSigned}}
<a id="mobile-notifications-icon" class="item tw-w-auto gt-p-3" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}">
<div class="tw-relative">
Expand Down Expand Up @@ -58,7 +58,7 @@
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
<span class="text gt-df gt-ac">
{{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}}
<span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span>
<span class="only-mobile gt-ml-3">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span>
<div class="menu user-menu">
Expand All @@ -80,7 +80,7 @@
{{svg "octicon-stopwatch"}}
<span class="header-stopwatch-dot"></span>
</div>
<span class="mobile-only gt-ml-3">{{ctx.Locale.Tr "active_stopwatch"}}</span>
<span class="only-mobile gt-ml-3">{{ctx.Locale.Tr "active_stopwatch"}}</span>
</a>
<div class="active-stopwatch-popup item tippy-target gt-p-3">
<div class="gt-df gt-ac">
Expand Down Expand Up @@ -122,7 +122,7 @@
<span class="text">
{{svg "octicon-plus"}}
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
<span class="mobile-only">{{ctx.Locale.Tr "create_new"}}</span>
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
</span>
<div class="menu">
<a class="item" href="{{AppSubUrl}}/repo/create">
Expand All @@ -144,7 +144,7 @@
<div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
<span class="text gt-df gt-ac">
{{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}}
<span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span>
<span class="only-mobile gt-ml-3">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span>
<div class="menu user-menu">
Expand Down
17 changes: 12 additions & 5 deletions templates/explore/repo_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,23 @@
{{end}}
</span>
</div>
<div class="flex-item-trailing">
<div class="flex-item-trailing muted-links">
{{if .PrimaryLanguage}}
<a class="muted" href="?q={{$.Keyword}}&sort={{$.SortType}}&language={{.PrimaryLanguage.Language}}{{if $.TabName}}&tab={{$.TabName}}{{end}}">
<span class="flex-text-inline"><i class="color-icon gt-mr-3" style="background-color: {{.PrimaryLanguage.Color}}"></i>{{.PrimaryLanguage.Language}}</span>
<a class="flex-text-inline" href="?q={{$.Keyword}}&sort={{$.SortType}}&language={{.PrimaryLanguage.Language}}{{if $.TabName}}&tab={{$.TabName}}{{end}}">
<i class="color-icon gt-mr-3" style="background-color: {{.PrimaryLanguage.Color}}"></i>
{{.PrimaryLanguage.Language}}
</a>
{{end}}
{{if not $.DisableStars}}
<a class="text grey flex-text-inline" href="{{.Link}}/stars">{{svg "octicon-star" 16}}{{.NumStars}}</a>
<a class="flex-text-inline" href="{{.Link}}/stars">
<span aria-label="{{ctx.Locale.Tr "repo.stars"}}">{{svg "octicon-star" 16}}</span>
<span {{if ge .NumStars 1000}}data-tooltip-content="{{.NumStars}}"{{end}}>{{CountFmt .NumStars}}</span>
</a>
{{end}}
<a class="text grey flex-text-inline" href="{{.Link}}/forks">{{svg "octicon-git-branch" 16}}{{.NumForks}}</a>
<a class="flex-text-inline" href="{{.Link}}/forks">
<span aria-label="{{ctx.Locale.Tr "repo.forks"}}">{{svg "octicon-git-branch" 16}}</span>
<span {{if ge .NumForks 1000}}data-tooltip-content="{{.NumForks}}"{{end}}>{{CountFmt .NumForks}}</span>
</a>
</div>
</div>
{{$description := .DescriptionHTML $.Context}}
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/graph.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</div>
</h2>
<div class="ui dividing"></div>
<div class="ui segment loading gt-hidden" id="loading-indicator"></div>
<div class="is-loading tw-py-32 gt-hidden" id="loading-indicator"></div>
{{template "repo/graph/svgcontainer" .}}
{{template "repo/graph/commits" .}}
</div>
Expand Down
30 changes: 16 additions & 14 deletions templates/repo/header.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,31 @@
<div class="ui container">
<div class="repo-header">
<div class="flex-item gt-ac">
<div class="flex-item-leading">{{template "repo/icon" .}}</div>
<div class="flex-item-leading">
{{template "repo/icon" .}}
</div>
<div class="flex-item-main">
<div class="flex-item-title gt-font-18">
<a class="muted gt-font-normal" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/
<a class="muted" href="{{$.RepoLink}}">{{.Name}}</a></div>
<a class="muted gt-font-normal" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/<a class="muted" href="{{$.RepoLink}}">{{.Name}}</a>
</div>
</div>
<div class="flex-item-trailing">
{{if .IsArchived}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
<div class="repo-icon" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.archived"}}">{{svg "octicon-archive" 18}}</div>
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.archived"}}">{{svg "octicon-archive" 18}}</div>
{{end}}
{{if .IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
<div class="repo-icon" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.private"}}">{{svg "octicon-lock" 18}}</div>
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.private"}}</span>
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.private"}}">{{svg "octicon-lock" 18}}</div>
{{else}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
<div class="repo-icon" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.internal"}}">{{svg "octicon-shield-lock" 18}}</div>
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.internal"}}">{{svg "octicon-shield-lock" 18}}</div>
{{end}}
{{end}}
{{if .IsTemplate}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.template"}}</span>
<div class="repo-icon" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.template"}}">{{svg "octicon-repo-template" 18}}</div>
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.template"}}</span>
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.template"}}">{{svg "octicon-repo-template" 18}}</div>
{{end}}
{{if eq .ObjectFormatName "sha256"}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.sha256"}}</span>
Expand Down Expand Up @@ -76,18 +78,18 @@
<a class="ui compact{{if $.ShowForkModal}} show-modal{{end}} small basic button"
{{if not $.CanSignedUserFork}}
{{if gt (len $.UserAndOrgForks) 1}}
data-modal="#fork-repo-modal"
href="#" data-modal="#fork-repo-modal"
{{else if eq (len $.UserAndOrgForks) 1}}
href="{{AppSubUrl}}/{{(index $.UserAndOrgForks 0).FullName}}"
{{/*else is not required here, because the button shouldn't link to any site if you can't create a fork*/}}
{{end}}
{{else if not $.UserAndOrgForks}}
href="{{$.RepoLink}}/fork"
{{else}}
data-modal="#fork-repo-modal"
href="#" data-modal="#fork-repo-modal"
{{end}}
>
{{svg "octicon-repo-forked"}}<span class="text">{{ctx.Locale.Tr "repo.fork"}}</span>
{{svg "octicon-repo-forked"}}<span class="text not-mobile">{{ctx.Locale.Tr "repo.fork"}}</span>
</a>
<div class="ui small modal" id="fork-repo-modal">
<div class="header">
Expand Down
4 changes: 3 additions & 1 deletion templates/repo/settings/webhook/history.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<div class="ui right">
<!-- the button is wrapped with a span because the tooltip doesn't show on hover if we put data-tooltip-content directly on the button -->
<span data-tooltip-content="{{if or $isNew .Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc_disabled"}}{{end}}">
<button class="ui teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{ctx.Locale.Tr "repo.settings.webhook.test_delivery"}}</button>
<button class="ui teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">
<span class="text">{{ctx.Locale.Tr "repo.settings.webhook.test_delivery"}}</span>
</button>
</span>
</div>
{{end}}
Expand Down
21 changes: 0 additions & 21 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -710,16 +710,6 @@ img.ui.avatar,
background: var(--color-active);
}

.ui.loading.segment::before,
.ui.loading.form::before {
background: none;
}

.ui.loading.form > *,
.ui.loading.segment > * {
opacity: 0.35;
}

.ui.form .fields.error .field textarea,
.ui.form .fields.error .field select,
.ui.form .fields.error .field input:not([type]),
Expand Down Expand Up @@ -811,10 +801,6 @@ input:-webkit-autofill:active,
opacity: var(--opacity-disabled);
}

.ui.loading.loading.input > i.icon svg {
visibility: hidden;
}

.text.primary {
color: var(--color-primary) !important;
}
Expand Down Expand Up @@ -1266,13 +1252,6 @@ strong.attention-caution, svg.attention-caution {
text-align: center;
}

@media (max-width: 767.98px) {
/* double selector so it wins over .gt-df etc */
.not-mobile.not-mobile {
display: none !important;
}
}

overflow-menu {
margin-bottom: 15px !important;
border-bottom: 1px solid var(--color-secondary) !important;
Expand Down
6 changes: 0 additions & 6 deletions web_src/css/features/gitgraph.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
min-height: 350px;
}

#git-graph-container > .ui.segment.loading {
border: 0;
z-index: 1;
min-height: 246px;
}

#git-graph-container h2 {
display: flex;
justify-content: space-between;
Expand Down
12 changes: 12 additions & 0 deletions web_src/css/helpers.css
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,15 @@ only use:
* showElem/hideElem/toggleElem functions in "utils/dom.js"
*/
.gt-hidden.gt-hidden { display: none !important; }

@media (max-width: 767.98px) {
/* double selector so it wins over .tw-flex (old .gt-df) etc */
.not-mobile.not-mobile {
display: none !important;
}
}
@media (min-width: 767.98px) {
.only-mobile.only-mobile {
display: none !important;
}
}
7 changes: 0 additions & 7 deletions web_src/css/modules/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,6 @@
}
}

@media (min-width: 767.98px) {
#navbar .navbar-mobile-right,
#navbar .mobile-only {
display: none;
}
}

#navbar a.item .notification_count {
color: var(--color-nav-bg);
padding: 0 3.75px;
Expand Down
23 changes: 2 additions & 21 deletions web_src/css/repo/header.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.fork-flag {
.header-wrapper .fork-flag {
margin-top: 0.5rem;
font-size: 12px;
}
Expand All @@ -15,22 +15,15 @@
padding: 0;
}

.repo-header .btn.interact-bg:hover {
text-decoration: none;
}

.repo-header .flex-item-main {
flex: 0;
flex-basis: unset;
}

.repo-header .flex-item-trailing {
flex-wrap: nowrap;
}

.repo-header .flex-item-trailing .repo-icon {
display: none;
}

.repo-buttons {
align-items: center;
display: flex;
Expand Down Expand Up @@ -75,15 +68,3 @@
padding-top: 12px;
background-color: var(--color-header-wrapper);
}

@media (max-width: 767.98px) {
.repo-header .flex-item {
flex-grow: 1;
}
.repo-header .flex-item-trailing .label {
display: none;
}
.repo-header .flex-item-trailing .repo-icon {
display: initial;
}
}
2 changes: 1 addition & 1 deletion web_src/js/features/admin/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export function initAdminCommon() {
$('#delete-selection').on('click', async function (e) {
e.preventDefault();
const $this = $(this);
$this.addClass('loading disabled');
$this.addClass('is-loading disabled');
const data = new FormData();
$checkboxes.each(function () {
if ($(this).checkbox('is checked')) {
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/comp/WebHookEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function initCompWebHookEditor() {

// Test delivery
document.getElementById('test-delivery')?.addEventListener('click', async function () {
this.classList.add('loading', 'disabled');
this.classList.add('is-loading', 'disabled');
await POST(this.getAttribute('data-link'));
setTimeout(() => {
window.location.href = this.getAttribute('data-redirect');
Expand Down
Loading

0 comments on commit 1336687

Please sign in to comment.