{{if .PrimaryLanguage}}
-
- {{.PrimaryLanguage.Language}}
+
+ {{.PrimaryLanguage.Language}}
{{end}}
{{if not $.DisableStars}}
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl
index 3ff86259d5..448639975f 100644
--- a/templates/org/home.tmpl
+++ b/templates/org/home.tmpl
@@ -68,8 +68,8 @@
{{end}}
diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl
index b697573d24..e4a10ee57d 100644
--- a/templates/repo/blame.tmpl
+++ b/templates/repo/blame.tmpl
@@ -1,14 +1,9 @@
-
{{end}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentHTMLURL|Escape) $refFrom | Safe}} {{if eq .RefAction 3}}{{end}}-
+
+
{{if .ReadmeInList}}
{{svg "octicon-book" 16 "mr-3"}}
{{.FileName}}
{{else}}
-
- {{if .FileIsSymlink}}
-
- {{.locale.Tr "repo.symbolic_link"}}
-
- {{end}}
- {{if .NumLinesSet}}
-
- {{.NumLines}} {{.locale.TrN .NumLines "repo.line" "repo.lines"}}
-
- {{end}}
- {{if .FileSize}}
-
- {{FileSize .FileSize}}{{if .IsLFSFile}} ({{.locale.Tr "repo.stored_lfs"}}){{end}}
-
- {{end}}
- {{if .LFSLock}}
-
- {{svg "octicon-lock" 16 "mr-2"}}
- {{.LFSLockOwner}}
-
- {{end}}
-
+ {{template "repo/file_info" .}}
{{end}}
-
+
{{if .HasSourceRenderedToggle}}
{{svg "octicon-code" 15}}
diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl
index 6fce412ffa..e8ad8406cd 100644
--- a/templates/shared/issuelist.tmpl
+++ b/templates/shared/issuelist.tmpl
@@ -160,7 +160,7 @@
{{if .NumComments}}
-
+
{{svg "octicon-comment" 16 "mr-2"}}{{.NumComments}}
{{end}}
diff --git a/templates/shared/user/authorlink.tmpl b/templates/shared/user/authorlink.tmpl
index 81c2a4ed5e..4a6672181f 100644
--- a/templates/shared/user/authorlink.tmpl
+++ b/templates/shared/user/authorlink.tmpl
@@ -1,3 +1 @@
-
- {{.GetDisplayName}}
-
+{{.GetDisplayName}}
diff --git a/templates/shared/user/avatarlink.tmpl b/templates/shared/user/avatarlink.tmpl
index 40f5ee7129..90f5d96700 100644
--- a/templates/shared/user/avatarlink.tmpl
+++ b/templates/shared/user/avatarlink.tmpl
@@ -1,3 +1 @@
-
- {{avatar .}}
-
+{{avatar .}}
diff --git a/templates/shared/user/namelink.tmpl b/templates/shared/user/namelink.tmpl
index 25dff36a78..a122f4f45b 100644
--- a/templates/shared/user/namelink.tmpl
+++ b/templates/shared/user/namelink.tmpl
@@ -1,3 +1 @@
-
- {{.GetDisplayName}}
-
+{{.GetDisplayName}}
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 73856dbb5a..692d138bf4 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -16830,11 +16830,7 @@
"x-go-name": "FileName"
},
"labels": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "x-go-name": "Labels"
+ "$ref": "#/definitions/IssueTemplateLabels"
},
"name": {
"type": "string",
@@ -16851,6 +16847,13 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "IssueTemplateLabels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"Label": {
"description": "Label a label to an issue or a pr",
"type": "object",
diff --git a/templates/user/notification/notification_div.tmpl b/templates/user/notification/notification_div.tmpl
index 192652d06b..18071549a0 100644
--- a/templates/user/notification/notification_div.tmpl
+++ b/templates/user/notification/notification_div.tmpl
@@ -34,7 +34,6 @@
{{range $notification := .Notifications}}
{{$issue := .Issue}}
{{$repo := .Repository}}
- {{$repoOwner := $repo.MustOwner}}
{{if eq .Status 3}}
@@ -69,9 +68,7 @@
-
- {{$repoOwner.Name}}/{{$repo.Name}}
-
+ {{$repo.FullName}}
{{if ne .Status 3}}
diff --git a/tests/integration/api_comment_test.go b/tests/integration/api_comment_test.go
index 126d886842..9cac32b9b9 100644
--- a/tests/integration/api_comment_test.go
+++ b/tests/integration/api_comment_test.go
@@ -10,6 +10,7 @@ import (
"net/url"
"testing"
+ "code.gitea.io/gitea/models/db"
issues_model "code.gitea.io/gitea/models/issues"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
@@ -115,7 +116,7 @@ func TestAPIGetComment(t *testing.T) {
defer tests.PrepareTestEnv(t)()
comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 2})
- assert.NoError(t, comment.LoadIssue())
+ assert.NoError(t, comment.LoadIssue(db.DefaultContext))
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: comment.Issue.RepoID})
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID})
@@ -129,7 +130,7 @@ func TestAPIGetComment(t *testing.T) {
var apiComment api.Comment
DecodeJSON(t, resp, &apiComment)
- assert.NoError(t, comment.LoadPoster())
+ assert.NoError(t, comment.LoadPoster(db.DefaultContext))
expect := convert.ToComment(comment)
assert.Equal(t, expect.ID, apiComment.ID)
diff --git a/tests/integration/api_issue_reaction_test.go b/tests/integration/api_issue_reaction_test.go
index a3cb9303fb..9afc7475e2 100644
--- a/tests/integration/api_issue_reaction_test.go
+++ b/tests/integration/api_issue_reaction_test.go
@@ -82,7 +82,7 @@ func TestAPICommentReactions(t *testing.T) {
defer tests.PrepareTestEnv(t)()
comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 2})
- _ = comment.LoadIssue()
+ _ = comment.LoadIssue(db.DefaultContext)
issue := comment.Issue
_ = issue.LoadRepo(db.DefaultContext)
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: issue.Repo.OwnerID})
diff --git a/tests/integration/api_notification_test.go b/tests/integration/api_notification_test.go
index bf85520bb5..f143802228 100644
--- a/tests/integration/api_notification_test.go
+++ b/tests/integration/api_notification_test.go
@@ -10,6 +10,7 @@ import (
"testing"
activities_model "code.gitea.io/gitea/models/activities"
+ "code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
@@ -25,7 +26,7 @@ func TestAPINotification(t *testing.T) {
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
repo1 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
thread5 := unittest.AssertExistsAndLoadBean(t, &activities_model.Notification{ID: 5})
- assert.NoError(t, thread5.LoadAttributes())
+ assert.NoError(t, thread5.LoadAttributes(db.DefaultContext))
session := loginUser(t, user2.Name)
token := getTokenForLoggedInUser(t, session)
@@ -143,7 +144,7 @@ func TestAPINotificationPUT(t *testing.T) {
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
thread5 := unittest.AssertExistsAndLoadBean(t, &activities_model.Notification{ID: 5})
- assert.NoError(t, thread5.LoadAttributes())
+ assert.NoError(t, thread5.LoadAttributes(db.DefaultContext))
session := loginUser(t, user2.Name)
token := getTokenForLoggedInUser(t, session)
diff --git a/tests/integration/api_pull_commits_test.go b/tests/integration/api_pull_commits_test.go
index aa58f44bbe..6753ceaa97 100644
--- a/tests/integration/api_pull_commits_test.go
+++ b/tests/integration/api_pull_commits_test.go
@@ -8,6 +8,7 @@ import (
"net/http"
"testing"
+ "code.gitea.io/gitea/models/db"
issues_model "code.gitea.io/gitea/models/issues"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
@@ -19,12 +20,12 @@ import (
func TestAPIPullCommits(t *testing.T) {
defer tests.PrepareTestEnv(t)()
- pullIssue := unittest.AssertExistsAndLoadBean(t, &issues_model.PullRequest{ID: 2})
- assert.NoError(t, pullIssue.LoadIssue())
- repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: pullIssue.HeadRepoID})
+ pr := unittest.AssertExistsAndLoadBean(t, &issues_model.PullRequest{ID: 2})
+ assert.NoError(t, pr.LoadIssue(db.DefaultContext))
+ repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: pr.HeadRepoID})
session := loginUser(t, "user2")
- req := NewRequestf(t, http.MethodGet, "/api/v1/repos/%s/%s/pulls/%d/commits", repo.OwnerName, repo.Name, pullIssue.Index)
+ req := NewRequestf(t, http.MethodGet, "/api/v1/repos/%s/%s/pulls/%d/commits", repo.OwnerName, repo.Name, pr.Index)
resp := session.MakeRequest(t, req, http.StatusOK)
var commits []*api.Commit
diff --git a/tests/integration/api_pull_test.go b/tests/integration/api_pull_test.go
index 8ce92f3d4a..81842b05fb 100644
--- a/tests/integration/api_pull_test.go
+++ b/tests/integration/api_pull_test.go
@@ -10,6 +10,7 @@ import (
"net/http"
"testing"
+ "code.gitea.io/gitea/models/db"
issues_model "code.gitea.io/gitea/models/issues"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
@@ -65,11 +66,11 @@ func TestAPIMergePullWIP(t *testing.T) {
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID})
pr := unittest.AssertExistsAndLoadBean(t, &issues_model.PullRequest{Status: issues_model.PullRequestStatusMergeable}, unittest.Cond("has_merged = ?", false))
- pr.LoadIssue()
+ pr.LoadIssue(db.DefaultContext)
issue_service.ChangeTitle(pr.Issue, owner, setting.Repository.PullRequest.WorkInProgressPrefixes[0]+" "+pr.Issue.Title)
// force reload
- pr.LoadAttributes()
+ pr.LoadAttributes(db.DefaultContext)
assert.Contains(t, pr.Issue.Title, setting.Repository.PullRequest.WorkInProgressPrefixes[0])
diff --git a/tests/integration/eventsource_test.go b/tests/integration/eventsource_test.go
index cd496e0129..2f698659cb 100644
--- a/tests/integration/eventsource_test.go
+++ b/tests/integration/eventsource_test.go
@@ -11,6 +11,7 @@ import (
"time"
activities_model "code.gitea.io/gitea/models/activities"
+ "code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
@@ -57,7 +58,7 @@ func TestEventSourceManagerRun(t *testing.T) {
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
repo1 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
thread5 := unittest.AssertExistsAndLoadBean(t, &activities_model.Notification{ID: 5})
- assert.NoError(t, thread5.LoadAttributes())
+ assert.NoError(t, thread5.LoadAttributes(db.DefaultContext))
session := loginUser(t, user2.Name)
token := getTokenForLoggedInUser(t, session)
diff --git a/tests/integration/pull_update_test.go b/tests/integration/pull_update_test.go
index c08faaaeb6..1bfe5c7050 100644
--- a/tests/integration/pull_update_test.go
+++ b/tests/integration/pull_update_test.go
@@ -35,8 +35,8 @@ func TestAPIPullUpdate(t *testing.T) {
assert.NoError(t, err)
assert.EqualValues(t, 1, diffCount.Behind)
assert.EqualValues(t, 1, diffCount.Ahead)
- assert.NoError(t, pr.LoadBaseRepo())
- assert.NoError(t, pr.LoadIssue())
+ assert.NoError(t, pr.LoadBaseRepo(db.DefaultContext))
+ assert.NoError(t, pr.LoadIssue(db.DefaultContext))
session := loginUser(t, "user2")
token := getTokenForLoggedInUser(t, session)
@@ -63,8 +63,8 @@ func TestAPIPullUpdateByRebase(t *testing.T) {
assert.NoError(t, err)
assert.EqualValues(t, 1, diffCount.Behind)
assert.EqualValues(t, 1, diffCount.Ahead)
- assert.NoError(t, pr.LoadBaseRepo())
- assert.NoError(t, pr.LoadIssue())
+ assert.NoError(t, pr.LoadBaseRepo(db.DefaultContext))
+ assert.NoError(t, pr.LoadIssue(db.DefaultContext))
session := loginUser(t, "user2")
token := getTokenForLoggedInUser(t, session)
diff --git a/tests/integration/repo_tag_test.go b/tests/integration/repo_tag_test.go
index fb08895e21..e20c725915 100644
--- a/tests/integration/repo_tag_test.go
+++ b/tests/integration/repo_tag_test.go
@@ -9,6 +9,7 @@ import (
"testing"
"code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/models/db"
git_model "code.gitea.io/gitea/models/git"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
@@ -74,22 +75,22 @@ func TestCreateNewTagProtected(t *testing.T) {
})
// Cleanup
- releases, err := repo_model.GetReleasesByRepoID(repo.ID, repo_model.FindReleasesOptions{
+ releases, err := repo_model.GetReleasesByRepoID(db.DefaultContext, repo.ID, repo_model.FindReleasesOptions{
IncludeTags: true,
TagNames: []string{"v-1", "v-1.1"},
})
assert.NoError(t, err)
for _, release := range releases {
- err = repo_model.DeleteReleaseByID(release.ID)
+ err = repo_model.DeleteReleaseByID(db.DefaultContext, release.ID)
assert.NoError(t, err)
}
- protectedTags, err := git_model.GetProtectedTags(repo.ID)
+ protectedTags, err := git_model.GetProtectedTags(db.DefaultContext, repo.ID)
assert.NoError(t, err)
for _, protectedTag := range protectedTags {
- err = git_model.DeleteProtectedTag(protectedTag)
+ err = git_model.DeleteProtectedTag(db.DefaultContext, protectedTag)
assert.NoError(t, err)
}
}
diff --git a/web_src/js/markup/math.js b/web_src/js/markup/math.js
index 5790a327a5..d4e40d5be2 100644
--- a/web_src/js/markup/math.js
+++ b/web_src/js/markup/math.js
@@ -23,12 +23,14 @@ export async function renderMath() {
for (const el of els) {
const source = el.textContent;
- const options = {display: el.classList.contains('display')};
+ const nodeName = el.classList.contains('display') ? 'p' : 'span';
try {
- const markup = katex.renderToString(source, options);
- const tempEl = document.createElement(options.display ? 'p' : 'span');
- tempEl.innerHTML = markup;
+ const tempEl = document.createElement(nodeName);
+ katex.render(source, tempEl, {
+ maxSize: 25,
+ maxExpand: 50,
+ });
targetElement(el).replaceWith(tempEl);
} catch (error) {
displayError(el, error);
diff --git a/web_src/less/_base.less b/web_src/less/_base.less
index dc0e69c6d1..f2173d6d2b 100644
--- a/web_src/less/_base.less
+++ b/web_src/less/_base.less
@@ -79,6 +79,7 @@
--color-pink: #e03997;
--color-brown: #a5673f;
--color-grey: #888888;
+ --color-black: #1b1c1d;
/* light variants - produced via Sass scale-color(color, $lightness: +25%) */
--color-red-light: #e45e5e;
--color-orange-light: #f59555;
@@ -92,9 +93,9 @@
--color-pink-light: #e86bb1;
--color-brown-light: #c58b66;
--color-grey-light: #a6a6a6;
+ --color-black-light: #525558;
/* other colors */
--color-gold: #a1882b;
- --color-black: #1b1c1d;
--color-white: #ffffff;
--color-diff-removed-word-bg: #fdb8c0;
--color-diff-added-word-bg: #acf2bd;
@@ -293,13 +294,15 @@ a,
text-decoration-skip-ink: all;
}
-a.muted {
+a.muted,
+.muted-links a {
color: inherit;
}
a:hover,
a.muted:hover,
a.muted:hover [class*="color-text"],
+.muted-links a:hover,
.ui.breadcrumb a:hover {
color: var(--color-primary);
}
diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less
index bf1fb53e2b..63f1f954a0 100644
--- a/web_src/less/_repository.less
+++ b/web_src/less/_repository.less
@@ -829,7 +829,7 @@
.timeline-avatar {
position: absolute;
- left: -72px;
+ left: -68px;
img {
width: 40px !important;
@@ -846,7 +846,6 @@
.avatar img {
width: 20px;
height: 20px;
- margin: 0 .25rem;
vertical-align: middle;
}
@@ -981,10 +980,6 @@
margin-top: 4px;
}
- .author {
- font-weight: 600;
- }
-
.comment-form-reply .footer {
padding-bottom: 1em;
}
@@ -1165,9 +1160,12 @@
padding-left: 15px;
.detail {
- font-size: .9rem;
- margin-top: 5px;
- margin-left: 8px;
+ margin-top: 4px;
+ margin-left: 14px;
+
+ .svg {
+ margin-right: 2px;
+ }
}
.segments {
@@ -2723,12 +2721,10 @@
a {
color: var(--color-text);
- text-decoration: none;
}
a:hover {
color: var(--color-primary);
- text-decoration: none;
}
}
diff --git a/web_src/less/shared/issuelist.less b/web_src/less/shared/issuelist.less
index 2dffe19909..8d4cfc46d4 100644
--- a/web_src/less/shared/issuelist.less
+++ b/web_src/less/shared/issuelist.less
@@ -91,6 +91,14 @@
border-radius: 3px;
vertical-align: 2px !important;
}
+
+ progress::-webkit-progress-value {
+ background-color: var(--color-secondary-dark-4);
+ }
+
+ progress::-moz-progress-bar {
+ background-color: var(--color-secondary-dark-4);
+ }
}
.conflicting {
diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less
index 370a866abb..b793f99509 100644
--- a/web_src/less/themes/theme-arc-green.less
+++ b/web_src/less/themes/theme-arc-green.less
@@ -67,8 +67,9 @@
--color-purple: #b259d0;
--color-pink: #d22e8b;
--color-brown: #a47252;
- --color-grey: #5e626a;
- /* light variants */
+ --color-grey: #9ea2aa;
+ --color-black: #1e222e;
+ /* light variants - produced via Sass scale-color(color, $lightness: -10%) */
--color-red-light: #c23636;
--color-orange-light: #b84f0b;
--color-yellow-light: #b88a03;
@@ -80,9 +81,9 @@
--color-purple-light: #a742c9;
--color-pink-light: #be297d;
--color-brown-light: #94674a;
- --color-grey-light: #55585f;
+ --color-grey-light: #8d919b;
+ --color-black-light: #1b1f29;
/* other colors */
- --color-black: #1e222e;
--color-gold: #b1983b;
--color-white: #ffffff;
--color-diff-removed-word-bg: #6f3333;
diff --git a/webpack.config.js b/webpack.config.js
index 2663242992..a8363051df 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -47,6 +47,7 @@ const filterCssImport = (url, ...args) => {
return true;
};
+/** @type {import("webpack").Configuration} */
export default {
mode: isProduction ? 'production' : 'development',
entry: {
@@ -228,7 +229,8 @@ export default {
override: {
'jquery.are-you-sure@*': {licenseName: 'MIT'},
},
- allow: '(Apache-2.0 OR BSD-2-Clause OR BSD-3-Clause OR MIT OR ISC)',
+ emitError: true,
+ allow: '(Apache-2.0 OR BSD-2-Clause OR BSD-3-Clause OR MIT OR ISC OR CPAL-1.0)',
ignore: [
'font-awesome',
],