mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-14 00:01:44 -04:00
Compare commits
No commits in common. "5a12e95d2a3bc3dcc017dfce0cb1b77b0736e6f4" and "3f318a4bad432b206386ba31399f84341913caf4" have entirely different histories.
5a12e95d2a
...
3f318a4bad
@ -79,10 +79,6 @@ func main() {
|
|||||||
Name: "no-xdg-open",
|
Name: "no-xdg-open",
|
||||||
Usage: "Set this flag to not use xdg-open to open the PR URL",
|
Usage: "Set this flag to not use xdg-open to open the PR URL",
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
|
||||||
Name: "continue",
|
|
||||||
Usage: "Set this flag to continue from a git cherry-pick that has broken",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
cli.AppHelpTemplate = `NAME:
|
cli.AppHelpTemplate = `NAME:
|
||||||
{{.Name}} - {{.Usage}}
|
{{.Name}} - {{.Usage}}
|
||||||
@ -108,19 +104,7 @@ func runBackport(c *cli.Context) error {
|
|||||||
ctx, cancel := installSignals()
|
ctx, cancel := installSignals()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
continuing := c.Bool("continue")
|
|
||||||
|
|
||||||
var pr string
|
|
||||||
|
|
||||||
version := c.String("version")
|
version := c.String("version")
|
||||||
if version == "" && continuing {
|
|
||||||
// determine version from current branch name
|
|
||||||
var err error
|
|
||||||
pr, version, err = readCurrentBranch(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if version == "" {
|
if version == "" {
|
||||||
version = readVersion()
|
version = readVersion()
|
||||||
}
|
}
|
||||||
@ -151,14 +135,13 @@ func runBackport(c *cli.Context) error {
|
|||||||
localReleaseBranch := path.Join(upstream, upstreamReleaseBranch)
|
localReleaseBranch := path.Join(upstream, upstreamReleaseBranch)
|
||||||
|
|
||||||
args := c.Args()
|
args := c.Args()
|
||||||
if len(args) == 0 && pr == "" {
|
if len(args) == 0 {
|
||||||
return fmt.Errorf("no PR number provided\nProvide a PR number to backport")
|
return fmt.Errorf("no PR number provided\nProvide a PR number to backport")
|
||||||
} else if len(args) != 1 && pr == "" {
|
} else if len(args) != 1 {
|
||||||
return fmt.Errorf("multiple PRs provided %v\nOnly a single PR can be backported at a time", args)
|
return fmt.Errorf("multiple PRs provided %v\nOnly a single PR can be backported at a time", args)
|
||||||
}
|
}
|
||||||
if pr == "" {
|
|
||||||
pr = args[0]
|
pr := args[0]
|
||||||
}
|
|
||||||
|
|
||||||
backportBranch := c.String("backport-branch")
|
backportBranch := c.String("backport-branch")
|
||||||
if backportBranch == "" {
|
if backportBranch == "" {
|
||||||
@ -185,10 +168,8 @@ func runBackport(c *cli.Context) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !continuing {
|
if err := checkoutBackportBranch(ctx, backportBranch, localReleaseBranch); err != nil {
|
||||||
if err := checkoutBackportBranch(ctx, backportBranch, localReleaseBranch); err != nil {
|
return err
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cherrypick(ctx, sha); err != nil {
|
if err := cherrypick(ctx, sha); err != nil {
|
||||||
@ -372,22 +353,6 @@ func determineRemote(ctx context.Context, forkUser string) (string, string, erro
|
|||||||
return "", "", fmt.Errorf("unable to find appropriate remote in:\n%s", string(out))
|
return "", "", fmt.Errorf("unable to find appropriate remote in:\n%s", string(out))
|
||||||
}
|
}
|
||||||
|
|
||||||
func readCurrentBranch(ctx context.Context) (pr, version string, err error) {
|
|
||||||
out, err := exec.CommandContext(ctx, "git", "branch", "--show-current").Output()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Unable to read current git branch:\n%s\n", string(out))
|
|
||||||
return "", "", fmt.Errorf("unable to read current git branch: %w", err)
|
|
||||||
}
|
|
||||||
parts := strings.Split(strings.TrimSpace(string(out)), "-")
|
|
||||||
|
|
||||||
if len(parts) != 3 || parts[0] != "backport" {
|
|
||||||
fmt.Fprintf(os.Stderr, "Unable to continue from git branch:\n%s\n", string(out))
|
|
||||||
return "", "", fmt.Errorf("unable to continue from git branch:\n%s", string(out))
|
|
||||||
}
|
|
||||||
|
|
||||||
return parts[1], parts[2], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func readVersion() string {
|
func readVersion() string {
|
||||||
bs, err := os.ReadFile("docs/config.yaml")
|
bs, err := os.ReadFile("docs/config.yaml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -23,7 +23,7 @@ import "code.gitea.io/gitea/models/db"
|
|||||||
// GPGKeyImport the original import of key
|
// GPGKeyImport the original import of key
|
||||||
type GPGKeyImport struct {
|
type GPGKeyImport struct {
|
||||||
KeyID string `xorm:"pk CHAR(16) NOT NULL"`
|
KeyID string `xorm:"pk CHAR(16) NOT NULL"`
|
||||||
Content string `xorm:"MEDIUMTEXT NOT NULL"`
|
Content string `xorm:"TEXT NOT NULL"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -457,8 +457,6 @@ var migrations = []Migration{
|
|||||||
NewMigration("Add actions tables", v1_19.AddActionsTables),
|
NewMigration("Add actions tables", v1_19.AddActionsTables),
|
||||||
// v241 -> v242
|
// v241 -> v242
|
||||||
NewMigration("Add card_type column to project table", v1_19.AddCardTypeToProjectTable),
|
NewMigration("Add card_type column to project table", v1_19.AddCardTypeToProjectTable),
|
||||||
// v242 -> v243
|
|
||||||
NewMigration("Alter gpg_key_import content TEXT field to MEDIUMTEXT", v1_19.AlterPublicGPGKeyImportContentFieldToMediumText),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCurrentDBVersion returns the current db version
|
// GetCurrentDBVersion returns the current db version
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
package v1_19 //nolint
|
|
||||||
|
|
||||||
import (
|
|
||||||
"code.gitea.io/gitea/modules/setting"
|
|
||||||
|
|
||||||
"xorm.io/xorm"
|
|
||||||
)
|
|
||||||
|
|
||||||
// AlterPublicGPGKeyImportContentFieldToMediumText: set GPGKeyImport Content field to MEDIUMTEXT
|
|
||||||
func AlterPublicGPGKeyImportContentFieldToMediumText(x *xorm.Engine) error {
|
|
||||||
sess := x.NewSession()
|
|
||||||
defer sess.Close()
|
|
||||||
if err := sess.Begin(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if setting.Database.UseMySQL {
|
|
||||||
if _, err := sess.Exec("ALTER TABLE `gpg_key_import` CHANGE `content` `content` MEDIUMTEXT"); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sess.Commit()
|
|
||||||
}
|
|
@ -640,11 +640,6 @@ func CreateUser(u *User, overwriteDefault ...*CreateUserOverwriteOptions) (err e
|
|||||||
u.IsRestricted = setting.Service.DefaultUserIsRestricted
|
u.IsRestricted = setting.Service.DefaultUserIsRestricted
|
||||||
u.IsActive = !(setting.Service.RegisterEmailConfirm || setting.Service.RegisterManualConfirm)
|
u.IsActive = !(setting.Service.RegisterEmailConfirm || setting.Service.RegisterManualConfirm)
|
||||||
|
|
||||||
// Ensure consistency of the dates.
|
|
||||||
if u.UpdatedUnix < u.CreatedUnix {
|
|
||||||
u.UpdatedUnix = u.CreatedUnix
|
|
||||||
}
|
|
||||||
|
|
||||||
// overwrite defaults if set
|
// overwrite defaults if set
|
||||||
if len(overwriteDefault) != 0 && overwriteDefault[0] != nil {
|
if len(overwriteDefault) != 0 && overwriteDefault[0] != nil {
|
||||||
overwrite := overwriteDefault[0]
|
overwrite := overwriteDefault[0]
|
||||||
@ -722,15 +717,7 @@ func CreateUser(u *User, overwriteDefault ...*CreateUserOverwriteOptions) (err e
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if u.CreatedUnix == 0 {
|
if err = db.Insert(ctx, u); err != nil {
|
||||||
// Caller expects auto-time for creation & update timestamps.
|
|
||||||
err = db.Insert(ctx, u)
|
|
||||||
} else {
|
|
||||||
// Caller sets the timestamps themselves. They are responsible for ensuring
|
|
||||||
// both `CreatedUnix` and `UpdatedUnix` are set appropriately.
|
|
||||||
_, err = db.GetEngine(ctx).NoAutoTime().Insert(u)
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,11 +4,9 @@
|
|||||||
package user_test
|
package user_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
|
||||||
|
|
||||||
"code.gitea.io/gitea/models/auth"
|
"code.gitea.io/gitea/models/auth"
|
||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
@ -16,7 +14,6 @@ import (
|
|||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"code.gitea.io/gitea/modules/structs"
|
"code.gitea.io/gitea/modules/structs"
|
||||||
"code.gitea.io/gitea/modules/timeutil"
|
|
||||||
"code.gitea.io/gitea/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@ -255,58 +252,6 @@ func TestCreateUserEmailAlreadyUsed(t *testing.T) {
|
|||||||
assert.True(t, user_model.IsErrEmailAlreadyUsed(err))
|
assert.True(t, user_model.IsErrEmailAlreadyUsed(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCreateUserCustomTimestamps(t *testing.T) {
|
|
||||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
|
||||||
|
|
||||||
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
|
||||||
|
|
||||||
// Add new user with a custom creation timestamp.
|
|
||||||
var creationTimestamp timeutil.TimeStamp = 12345
|
|
||||||
user.Name = "testuser"
|
|
||||||
user.LowerName = strings.ToLower(user.Name)
|
|
||||||
user.ID = 0
|
|
||||||
user.Email = "unique@example.com"
|
|
||||||
user.CreatedUnix = creationTimestamp
|
|
||||||
err := user_model.CreateUser(user)
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
fetched, err := user_model.GetUserByID(context.Background(), user.ID)
|
|
||||||
assert.NoError(t, err)
|
|
||||||
assert.Equal(t, creationTimestamp, fetched.CreatedUnix)
|
|
||||||
assert.Equal(t, creationTimestamp, fetched.UpdatedUnix)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestCreateUserWithoutCustomTimestamps(t *testing.T) {
|
|
||||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
|
||||||
|
|
||||||
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
|
||||||
|
|
||||||
// There is no way to use a mocked time for the XORM auto-time functionality,
|
|
||||||
// so use the real clock to approximate the expected timestamp.
|
|
||||||
timestampStart := time.Now().Unix()
|
|
||||||
|
|
||||||
// Add new user without a custom creation timestamp.
|
|
||||||
user.Name = "Testuser"
|
|
||||||
user.LowerName = strings.ToLower(user.Name)
|
|
||||||
user.ID = 0
|
|
||||||
user.Email = "unique@example.com"
|
|
||||||
user.CreatedUnix = 0
|
|
||||||
user.UpdatedUnix = 0
|
|
||||||
err := user_model.CreateUser(user)
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
timestampEnd := time.Now().Unix()
|
|
||||||
|
|
||||||
fetched, err := user_model.GetUserByID(context.Background(), user.ID)
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
assert.LessOrEqual(t, timestampStart, fetched.CreatedUnix)
|
|
||||||
assert.LessOrEqual(t, fetched.CreatedUnix, timestampEnd)
|
|
||||||
|
|
||||||
assert.LessOrEqual(t, timestampStart, fetched.UpdatedUnix)
|
|
||||||
assert.LessOrEqual(t, fetched.UpdatedUnix, timestampEnd)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestGetUserIDsByNames(t *testing.T) {
|
func TestGetUserIDsByNames(t *testing.T) {
|
||||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||||
|
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
package structs
|
package structs
|
||||||
|
|
||||||
import "time"
|
|
||||||
|
|
||||||
// CreateUserOption create user options
|
// CreateUserOption create user options
|
||||||
type CreateUserOption struct {
|
type CreateUserOption struct {
|
||||||
SourceID int64 `json:"source_id"`
|
SourceID int64 `json:"source_id"`
|
||||||
@ -22,11 +20,6 @@ type CreateUserOption struct {
|
|||||||
SendNotify bool `json:"send_notify"`
|
SendNotify bool `json:"send_notify"`
|
||||||
Restricted *bool `json:"restricted"`
|
Restricted *bool `json:"restricted"`
|
||||||
Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
|
Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
|
||||||
|
|
||||||
// For explicitly setting the user creation timestamp. Useful when users are
|
|
||||||
// migrated from other systems. When omitted, the user's creation timestamp
|
|
||||||
// will be set to "now".
|
|
||||||
Created *time.Time `json:"created_at"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// EditUserOption edit user options
|
// EditUserOption edit user options
|
||||||
|
@ -1361,7 +1361,7 @@ issues.commented_at = `commented <a href="#%s">%s</a>`
|
|||||||
issues.delete_comment_confirm = Are you sure you want to delete this comment?
|
issues.delete_comment_confirm = Are you sure you want to delete this comment?
|
||||||
issues.context.copy_link = Copy Link
|
issues.context.copy_link = Copy Link
|
||||||
issues.context.quote_reply = Quote Reply
|
issues.context.quote_reply = Quote Reply
|
||||||
issues.context.reference_issue = Reference in New Issue
|
issues.context.reference_issue = Reference in new issue
|
||||||
issues.context.edit = Edit
|
issues.context.edit = Edit
|
||||||
issues.context.delete = Delete
|
issues.context.delete = Delete
|
||||||
issues.no_content = There is no content yet.
|
issues.no_content = There is no content yet.
|
||||||
|
@ -20,7 +20,6 @@ import (
|
|||||||
"code.gitea.io/gitea/modules/password"
|
"code.gitea.io/gitea/modules/password"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
api "code.gitea.io/gitea/modules/structs"
|
api "code.gitea.io/gitea/modules/structs"
|
||||||
"code.gitea.io/gitea/modules/timeutil"
|
|
||||||
"code.gitea.io/gitea/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
"code.gitea.io/gitea/modules/web"
|
"code.gitea.io/gitea/modules/web"
|
||||||
"code.gitea.io/gitea/routers/api/v1/user"
|
"code.gitea.io/gitea/routers/api/v1/user"
|
||||||
@ -121,14 +120,6 @@ func CreateUser(ctx *context.APIContext) {
|
|||||||
overwriteDefault.Visibility = &visibility
|
overwriteDefault.Visibility = &visibility
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the user creation timestamp. This can only be done after the user
|
|
||||||
// record has been inserted into the database; the insert intself will always
|
|
||||||
// set the creation timestamp to "now".
|
|
||||||
if form.Created != nil {
|
|
||||||
u.CreatedUnix = timeutil.TimeStamp(form.Created.Unix())
|
|
||||||
u.UpdatedUnix = u.CreatedUnix
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := user_model.CreateUser(u, overwriteDefault); err != nil {
|
if err := user_model.CreateUser(u, overwriteDefault); err != nil {
|
||||||
if user_model.IsErrUserAlreadyExist(err) ||
|
if user_model.IsErrUserAlreadyExist(err) ||
|
||||||
user_model.IsErrEmailAlreadyUsed(err) ||
|
user_model.IsErrEmailAlreadyUsed(err) ||
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{{template "base/head" .}}
|
{{template "base/head" .}}
|
||||||
<div role="main" aria-label="{{.Title}}" class="page-content repository diff">
|
<div role="main" aria-label="{{.Title}}" class="page-content repository diff">
|
||||||
{{template "repo/header" .}}
|
{{template "repo/header" .}}
|
||||||
<div class="ui container fluid padded">
|
<div class="ui container {{if .IsSplitStyle}}fluid padded{{end}}">
|
||||||
{{$class := ""}}
|
{{$class := ""}}
|
||||||
{{if .Commit.Signature}}
|
{{if .Commit.Signature}}
|
||||||
{{$class = (printf "%s%s" $class " isSigned")}}
|
{{$class = (printf "%s%s" $class " isSigned")}}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{{template "base/head" .}}
|
{{template "base/head" .}}
|
||||||
<div role="main" aria-label="{{.Title}}" class="page-content repository diff {{if .PageIsComparePull}}compare pull{{end}}">
|
<div role="main" aria-label="{{.Title}}" class="page-content repository diff {{if .PageIsComparePull}}compare pull{{end}}">
|
||||||
{{template "repo/header" .}}
|
{{template "repo/header" .}}
|
||||||
<div class="ui container fluid padded">
|
<div class="ui container {{if .IsSplitStyle}}fluid padded{{end}}">
|
||||||
|
|
||||||
<h2 class="ui header">
|
<h2 class="ui header">
|
||||||
{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
|
{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
|
||||||
|
@ -213,7 +213,7 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
</span>
|
</span>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{template "shared/user/avatarlink" Dict "Context" $.Context "user" .Assignee}}
|
{{template "shared/user/avatarlink" "user" .Assignee}}
|
||||||
<span class="text grey muted-links">
|
<span class="text grey muted-links">
|
||||||
{{template "shared/user/authorlink" .Assignee}}
|
{{template "shared/user/authorlink" .Assignee}}
|
||||||
{{if eq .Poster.ID .AssigneeID}}
|
{{if eq .Poster.ID .AssigneeID}}
|
||||||
@ -485,7 +485,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{if or $invalid $resolved}}
|
{{if or $invalid $resolved}}
|
||||||
<button id="show-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if not $resolved}}gt-hidden {{end}}ui compact right labeled button show-outdated gt-df gt-ac">
|
<button id="show-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if not $resolved}}hide {{end}}ui compact right labeled button show-outdated gt-df gt-ac">
|
||||||
{{svg "octicon-unfold" 16 "gt-mr-3"}}
|
{{svg "octicon-unfold" 16 "gt-mr-3"}}
|
||||||
{{if $resolved}}
|
{{if $resolved}}
|
||||||
{{$.locale.Tr "repo.issues.review.show_resolved"}}
|
{{$.locale.Tr "repo.issues.review.show_resolved"}}
|
||||||
@ -493,7 +493,7 @@
|
|||||||
{{$.locale.Tr "repo.issues.review.show_outdated"}}
|
{{$.locale.Tr "repo.issues.review.show_outdated"}}
|
||||||
{{end}}
|
{{end}}
|
||||||
</button>
|
</button>
|
||||||
<button id="hide-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if $resolved}}gt-hidden {{end}}ui compact right labeled button hide-outdated gt-df gt-ac">
|
<button id="hide-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if $resolved}}hide {{end}}ui compact right labeled button hide-outdated gt-df gt-ac">
|
||||||
{{svg "octicon-fold" 16 "gt-mr-3"}}
|
{{svg "octicon-fold" 16 "gt-mr-3"}}
|
||||||
{{if $resolved}}
|
{{if $resolved}}
|
||||||
{{$.locale.Tr "repo.issues.review.hide_resolved"}}
|
{{$.locale.Tr "repo.issues.review.hide_resolved"}}
|
||||||
@ -507,7 +507,7 @@
|
|||||||
{{$diff := (CommentMustAsDiff (index $comms 0))}}
|
{{$diff := (CommentMustAsDiff (index $comms 0))}}
|
||||||
{{if $diff}}
|
{{if $diff}}
|
||||||
{{$file := (index $diff.Files 0)}}
|
{{$file := (index $diff.Files 0)}}
|
||||||
<div id="code-preview-{{(index $comms 0).ID}}" class="ui table segment{{if $resolved}} gt-hidden{{end}}">
|
<div id="code-preview-{{(index $comms 0).ID}}" class="ui table segment{{if $resolved}} hide{{end}}">
|
||||||
<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}}">
|
<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}}">
|
||||||
<div class="file-body file-code code-view code-diff code-diff-unified unicode-escaped">
|
<div class="file-body file-code code-view code-diff code-diff-unified unicode-escaped">
|
||||||
<table>
|
<table>
|
||||||
@ -519,7 +519,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div id="code-comments-{{(index $comms 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} gt-hidden{{end}}">
|
<div id="code-comments-{{(index $comms 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} hide{{end}}">
|
||||||
<div class="ui comments gt-mb-0">
|
<div class="ui comments gt-mb-0">
|
||||||
{{range $comms}}
|
{{range $comms}}
|
||||||
{{$createdSubStr:= TimeSinceUnix .CreatedUnix $.locale}}
|
{{$createdSubStr:= TimeSinceUnix .CreatedUnix $.locale}}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<div role="main" aria-label="{{.Title}}" class="page-content repository view issue pull files diff">
|
<div role="main" aria-label="{{.Title}}" class="page-content repository view issue pull files diff">
|
||||||
{{template "repo/header" .}}
|
{{template "repo/header" .}}
|
||||||
<div class="ui container fluid padded">
|
<div class="ui container {{if .IsSplitStyle}}fluid padded{{end}}">
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
{{template "repo/issue/navbar" .}}
|
{{template "repo/issue/navbar" .}}
|
||||||
<div class="ui right">
|
<div class="ui right">
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<strong>{{.locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
|
<strong>{{.locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
|
||||||
</audio>
|
</audio>
|
||||||
{{else if .IsPDFFile}}
|
{{else if .IsPDFFile}}
|
||||||
<iframe width="100%" height="600px" src="{{AssetUrlPrefix}}/vendor/plugins/pdfjs/web/viewer.html?file={{$.RawFileLink}}"></iframe>
|
<iframe width="100%" height="600px" src="{{AppSubUrl}}/vendor/plugins/pdfjs/web/viewer.html?file={{$.RawFileLink}}"></iframe>
|
||||||
{{else}}
|
{{else}}
|
||||||
<a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.locale.Tr "repo.file_view_raw"}}</a>
|
<a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.locale.Tr "repo.file_view_raw"}}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -15809,12 +15809,6 @@
|
|||||||
"password"
|
"password"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"created_at": {
|
|
||||||
"description": "For explicitly setting the user creation timestamp. Useful when users are\nmigrated from other systems. When omitted, the user's creation timestamp\nwill be set to \"now\".",
|
|
||||||
"type": "string",
|
|
||||||
"format": "date-time",
|
|
||||||
"x-go-name": "Created"
|
|
||||||
},
|
|
||||||
"email": {
|
"email": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "email",
|
"format": "email",
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-show="show" class="tooltip" :title="item.name">
|
<div v-show="show">
|
||||||
<!--title instead of tooltip above as the tooltip needs too much work with the current methods, i.e. not being loaded or staying open for "too long"-->
|
|
||||||
<div class="item" :class="item.isFile ? 'filewrapper gt-p-1' : ''">
|
<div class="item" :class="item.isFile ? 'filewrapper gt-p-1' : ''">
|
||||||
<!-- Files -->
|
<!-- Files -->
|
||||||
<SvgIcon
|
<SvgIcon
|
||||||
|
@ -425,10 +425,10 @@ export function initRepoPullRequestReview() {
|
|||||||
const groupID = commentDiv.closest('div[id^="code-comments-"]').attr('id');
|
const groupID = commentDiv.closest('div[id^="code-comments-"]').attr('id');
|
||||||
if (groupID && groupID.startsWith('code-comments-')) {
|
if (groupID && groupID.startsWith('code-comments-')) {
|
||||||
const id = groupID.slice(14);
|
const id = groupID.slice(14);
|
||||||
$(`#show-outdated-${id}`).addClass('gt-hidden');
|
$(`#show-outdated-${id}`).addClass('hide');
|
||||||
$(`#code-comments-${id}`).removeClass('gt-hidden');
|
$(`#code-comments-${id}`).removeClass('hide');
|
||||||
$(`#code-preview-${id}`).removeClass('gt-hidden');
|
$(`#code-preview-${id}`).removeClass('hide');
|
||||||
$(`#hide-outdated-${id}`).removeClass('gt-hidden');
|
$(`#hide-outdated-${id}`).removeClass('hide');
|
||||||
commentDiv[0].scrollIntoView();
|
commentDiv[0].scrollIntoView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -437,19 +437,19 @@ export function initRepoPullRequestReview() {
|
|||||||
$(document).on('click', '.show-outdated', function (e) {
|
$(document).on('click', '.show-outdated', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const id = $(this).data('comment');
|
const id = $(this).data('comment');
|
||||||
$(this).addClass('gt-hidden');
|
$(this).addClass('hide');
|
||||||
$(`#code-comments-${id}`).removeClass('gt-hidden');
|
$(`#code-comments-${id}`).removeClass('hide');
|
||||||
$(`#code-preview-${id}`).removeClass('gt-hidden');
|
$(`#code-preview-${id}`).removeClass('hide');
|
||||||
$(`#hide-outdated-${id}`).removeClass('gt-hidden');
|
$(`#hide-outdated-${id}`).removeClass('hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.hide-outdated', function (e) {
|
$(document).on('click', '.hide-outdated', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const id = $(this).data('comment');
|
const id = $(this).data('comment');
|
||||||
$(this).addClass('gt-hidden');
|
$(this).addClass('hide');
|
||||||
$(`#code-comments-${id}`).addClass('gt-hidden');
|
$(`#code-comments-${id}`).addClass('hide');
|
||||||
$(`#code-preview-${id}`).addClass('gt-hidden');
|
$(`#code-preview-${id}`).addClass('hide');
|
||||||
$(`#show-outdated-${id}`).removeClass('gt-hidden');
|
$(`#show-outdated-${id}`).removeClass('hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', 'button.comment-form-reply', async function (e) {
|
$(document).on('click', 'button.comment-form-reply', async function (e) {
|
||||||
|
@ -1807,9 +1807,16 @@ footer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: refactor to use ".gt-hidden" instead (a simple search&replace should do the trick)
|
|
||||||
.hide {
|
.hide {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
|
&.show-outdated {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.hide-outdated {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.center:not(.popup) {
|
.center:not(.popup) {
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
.show-outdated,
|
.show-outdated,
|
||||||
.hide-outdated {
|
.hide-outdated {
|
||||||
&:extend(.unselectable);
|
&:extend(.unselectable);
|
||||||
|
display: block !important;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
/* below class names match Tailwind CSS */
|
/* below class names match Tailwind CSS */
|
||||||
.gt-pointer-events-none { pointer-events: none !important; }
|
.gt-pointer-events-none { pointer-events: none !important; }
|
||||||
.gt-relative { position: relative !important; }
|
.gt-relative { position: relative !important; }
|
||||||
|
.gt-hidden { display: none !important; }
|
||||||
|
|
||||||
.gt-mono {
|
.gt-mono {
|
||||||
font-family: var(--fonts-monospace) !important;
|
font-family: var(--fonts-monospace) !important;
|
||||||
@ -180,6 +181,3 @@
|
|||||||
.gt-w-100-small { width: 100% !important; }
|
.gt-w-100-small { width: 100% !important; }
|
||||||
.gt-js-small { justify-content: flex-start !important; }
|
.gt-js-small { justify-content: flex-start !important; }
|
||||||
}
|
}
|
||||||
|
|
||||||
// gt-hidden must be placed after all other "display: xxx !important" classes to win the hidden chance
|
|
||||||
.gt-hidden { display: none !important; }
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user