Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaoffical/main'
Browse files Browse the repository at this point in the history
* giteaoffical/main:
  Fix issue not showing on default board and add test (go-gitea#27720)
  Show placeholder email in privacy popup (go-gitea#27770)
  Add word-break to organization name and description (go-gitea#26624)
  Add border to file tree 'sub-items' and add padding to 'item-file' (go-gitea#27593)
  Fix the missing repo count in new team page and edit team page (go-gitea#27743)
  Only show diff file tree when more than one file changed (go-gitea#27775)
  Add gap between diff boxes (go-gitea#27776)
  • Loading branch information
zjjhot committed Oct 25, 2023
2 parents 356b2f4 + 1eae2aa commit 0d4b119
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 12 deletions.
2 changes: 1 addition & 1 deletion models/issues/issue_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func applyProjectBoardCondition(sess *xorm.Session, opts *IssuesOptions) *xorm.S
if opts.ProjectBoardID > 0 {
sess.In("issue.id", builder.Select("issue_id").From("project_issue").Where(builder.Eq{"project_board_id": opts.ProjectBoardID}))
} else if opts.ProjectBoardID == db.NoConditionID {
sess.In("issue.id", builder.Select("issue_id").From("project_issue").Where(builder.Neq{"project_board_id": 0}))
sess.In("issue.id", builder.Select("issue_id").From("project_issue").Where(builder.Eq{"project_board_id": 0}))
}
return sess
}
Expand Down
6 changes: 6 additions & 0 deletions modules/indexer/issues/indexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,12 @@ func searchIssueInProject(t *testing.T) {
},
[]int64{1},
},
{
SearchOptions{
ProjectBoardID: int64Pointer(0), // issue with in default board
},
[]int64{2},
},
}
for _, test := range tests {
issueIDs, _, err := SearchIssues(context.TODO(), &test.opts)
Expand Down
2 changes: 1 addition & 1 deletion options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ add_email_success = The new email address has been added.
email_preference_set_success = Email preference has been set successfully.
add_openid_success = The new OpenID address has been added.
keep_email_private = Hide Email Address
keep_email_private_popup = This will hide your email address from your profile, as well as when you make a pull request or edit a file using the web interface. Pushed commits will not be modified.
keep_email_private_popup = This will hide your email address from your profile, as well as when you make a pull request or edit a file using the web interface. Pushed commits will not be modified. Use %s in commits to associate them with your account.
openid_desc = OpenID lets you delegate authentication to an external provider.

manage_ssh_keys = Manage SSH Keys
Expand Down
8 changes: 8 additions & 0 deletions routers/web/org/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ func NewTeam(ctx *context.Context) {
ctx.Data["PageIsOrgTeamsNew"] = true
ctx.Data["Team"] = &org_model.Team{}
ctx.Data["Units"] = unit_model.Units
if err := shared_user.LoadHeaderCount(ctx); err != nil {
ctx.ServerError("LoadHeaderCount", err)
return
}
ctx.HTML(http.StatusOK, tplTeamNew)
}

Expand Down Expand Up @@ -463,6 +467,10 @@ func EditTeam(ctx *context.Context) {
ctx.ServerError("LoadUnits", err)
return
}
if err := shared_user.LoadHeaderCount(ctx); err != nil {
ctx.ServerError("LoadHeaderCount", err)
return
}
ctx.Data["Team"] = ctx.Org.Team
ctx.Data["Units"] = unit_model.Units
ctx.HTML(http.StatusOK, tplTeamNew)
Expand Down
2 changes: 1 addition & 1 deletion templates/org/header.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="ui container">
<div class="ui vertically grid head">
<div class="column">
<div class="ui header">
<div class="ui header gt-df gt-ac gt-word-break">
{{ctx.AvatarUtils.Avatar . 100}}
<span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span>
<span class="org-visibility">
Expand Down
2 changes: 1 addition & 1 deletion templates/org/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="ui container gt-df">
{{ctx.AvatarUtils.Avatar .Org 140 "org-avatar"}}
<div id="org-info">
<div class="ui header gt-df gt-fw">
<div class="ui header">
{{.Org.DisplayName}}
<span class="org-visibility">
{{if .Org.Visibility.IsLimited}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</span>{{end}}
Expand Down
13 changes: 9 additions & 4 deletions templates/repo/diff/box.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{{$showFileTree := (and (not .DiffNotAvailable) (gt .Diff.NumFiles 1))}}
<div>
<div class="diff-detail-box diff-box">
<div class="gt-df gt-ac gt-fw">
{{if not .DiffNotAvailable}}
{{if $showFileTree}}
<button class="diff-toggle-file-tree-button gt-df gt-ac not-mobile" data-show-text="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{ctx.Locale.Tr "repo.diff.hide_file_tree"}}">
{{/* the icon meaning is reversed here, "octicon-sidebar-collapse" means show the file tree */}}
{{svg "octicon-sidebar-collapse" 20 "icon gt-hidden"}}
Expand All @@ -15,6 +16,8 @@
diffTreeBtn.querySelector(diffTreeIcon).classList.remove('gt-hidden');
diffTreeBtn.setAttribute('data-tooltip-content', diffTreeBtn.getAttribute(diffTreeVisible ? 'data-hide-text' : 'data-show-text'));
</script>
{{end}}
{{if not .DiffNotAvailable}}
<div class="diff-detail-stats gt-df gt-ac gt-fw">
{{svg "octicon-diff" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
</div>
Expand Down Expand Up @@ -85,13 +88,15 @@
<div id="diff-file-list"></div>
{{end}}
<div id="diff-container">
{{if .DiffNotAvailable}}
<h4>{{ctx.Locale.Tr "repo.diff.data_not_available"}}</h4>
{{else}}
{{if $showFileTree}}
<div id="diff-file-tree" class="gt-hidden"></div>
<script>
if (diffTreeVisible) document.getElementById('diff-file-tree').classList.remove('gt-hidden');
</script>
{{end}}
{{if .DiffNotAvailable}}
<h4>{{ctx.Locale.Tr "repo.diff.data_not_available"}}</h4>
{{else}}
<div id="diff-file-boxes" class="sixteen wide column">
{{range $i, $file := .Diff.Files}}
{{/*notice: the index of Diff.Files should not be used for element ID, because the index will be restarted from 0 when doing load-more for PRs with a lot of files*/}}
Expand Down
2 changes: 1 addition & 1 deletion templates/shared/user/org_profile_avatar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="ui container">
<div class="ui vertically grid head">
<div class="column">
<div class="ui header">
<div class="ui header gt-df gt-ac gt-word-break">
{{ctx.AvatarUtils.Avatar . 100}}
<span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span>
<span class="org-visibility">
Expand Down
2 changes: 1 addition & 1 deletion templates/user/settings/profile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

<div class="field">
<div class="ui checkbox">
<label data-tooltip-content="{{ctx.Locale.Tr "settings.keep_email_private_popup"}}"><strong>{{ctx.Locale.Tr "settings.keep_email_private"}}</strong></label>
<label data-tooltip-content="{{ctx.Locale.Tr "settings.keep_email_private_popup" .SignedUser.GetPlaceholderEmail}}"><strong>{{ctx.Locale.Tr "settings.keep_email_private"}}</strong></label>
<input name="keep_email_private" type="checkbox" {{if .SignedUser.KeepEmailPrivate}}checked{{end}}>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,7 @@ img.ui.avatar,
.ui.label {
padding: 0.3em 0.5em;
transition: none;
white-space: nowrap;
}

.ui.label,
Expand Down
1 change: 1 addition & 0 deletions web_src/css/org.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
.organization.profile #org-info {
overflow-wrap: anywhere;
flex: 1;
word-break: break-all;
}

.organization.profile #org-info .ui.header {
Expand Down
4 changes: 4 additions & 0 deletions web_src/css/repo.css
Original file line number Diff line number Diff line change
Expand Up @@ -2606,6 +2606,7 @@ tbody.commit-list {
justify-content: space-between;
flex-wrap: wrap;
word-break: break-word;
gap: 0.5rem;
}

@media (max-width: 767.98px) {
Expand Down Expand Up @@ -2734,6 +2735,9 @@ tbody.commit-list {
#diff-file-boxes {
flex: 1;
max-width: 100%;
display: flex;
flex-direction: column;
gap: 8px;
}

#diff-file-tree {
Expand Down
5 changes: 3 additions & 2 deletions web_src/js/components/DiffFileTreeItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ a, a:hover {
display: flex;
flex-direction: column;
gap: 1px;
padding-left: 8px;
margin-left: 13px;
border-left: 1px solid var(--color-secondary);
}
.sub-items .item-file {
padding-left: 24px;
padding-left: 18px;
}
.item-file.selected {
Expand Down

0 comments on commit 0d4b119

Please sign in to comment.