1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-10-26 07:55:34 +03:00

Merge branch 'main' into lunny/fix_maintainer_edit_check

This commit is contained in:
Lunny Xiao 2024-06-14 10:14:01 +08:00
commit 65e9c448e8
36 changed files with 220 additions and 166 deletions

View File

@ -18,12 +18,6 @@ const (
SearchOrderByRecentUpdated SearchOrderBy = "updated_unix DESC"
SearchOrderByOldest SearchOrderBy = "created_unix ASC"
SearchOrderByNewest SearchOrderBy = "created_unix DESC"
SearchOrderBySize SearchOrderBy = "size ASC"
SearchOrderBySizeReverse SearchOrderBy = "size DESC"
SearchOrderByGitSize SearchOrderBy = "git_size ASC"
SearchOrderByGitSizeReverse SearchOrderBy = "git_size DESC"
SearchOrderByLFSSize SearchOrderBy = "lfs_size ASC"
SearchOrderByLFSSizeReverse SearchOrderBy = "lfs_size DESC"
SearchOrderByID SearchOrderBy = "id ASC"
SearchOrderByIDReverse SearchOrderBy = "id DESC"
SearchOrderByStars SearchOrderBy = "num_stars ASC"

View File

@ -193,8 +193,10 @@ func (prs PullRequestList) LoadIssues(ctx context.Context) (IssueList, error) {
return nil, nil
}
// Load issues.
issueIDs := prs.GetIssueIDs()
// Load issues which are not loaded
issueIDs := container.FilterSlice(prs, func(pr *PullRequest) (int64, bool) {
return pr.IssueID, pr.Issue == nil && pr.IssueID > 0
})
issues := make(map[int64]*Issue, len(issueIDs))
if err := db.GetEngine(ctx).
In("id", issueIDs).
@ -230,10 +232,7 @@ func (prs PullRequestList) LoadIssues(ctx context.Context) (IssueList, error) {
// GetIssueIDs returns all issue ids
func (prs PullRequestList) GetIssueIDs() []int64 {
return container.FilterSlice(prs, func(pr *PullRequest) (int64, bool) {
if pr.Issue == nil {
return pr.IssueID, pr.IssueID > 0
}
return 0, false
return pr.IssueID, pr.IssueID > 0
})
}

View File

@ -207,31 +207,6 @@ type SearchRepoOptions struct {
OnlyShowRelevant bool
}
// SearchOrderBy is used to sort the result
type SearchOrderBy string
func (s SearchOrderBy) String() string {
return string(s)
}
// Strings for sorting result
const (
SearchOrderByAlphabetically SearchOrderBy = "name ASC"
SearchOrderByAlphabeticallyReverse SearchOrderBy = "name DESC"
SearchOrderByLeastUpdated SearchOrderBy = "updated_unix ASC"
SearchOrderByRecentUpdated SearchOrderBy = "updated_unix DESC"
SearchOrderByOldest SearchOrderBy = "created_unix ASC"
SearchOrderByNewest SearchOrderBy = "created_unix DESC"
SearchOrderBySize SearchOrderBy = "size ASC"
SearchOrderBySizeReverse SearchOrderBy = "size DESC"
SearchOrderByID SearchOrderBy = "id ASC"
SearchOrderByIDReverse SearchOrderBy = "id DESC"
SearchOrderByStars SearchOrderBy = "num_stars ASC"
SearchOrderByStarsReverse SearchOrderBy = "num_stars DESC"
SearchOrderByForks SearchOrderBy = "num_forks ASC"
SearchOrderByForksReverse SearchOrderBy = "num_forks DESC"
)
// UserOwnedRepoCond returns user ownered repositories
func UserOwnedRepoCond(userID int64) builder.Cond {
return builder.Eq{

View File

@ -5,20 +5,72 @@ package repo
import "code.gitea.io/gitea/models/db"
// Strings for sorting result
const (
// only used for repos
SearchOrderByAlphabetically db.SearchOrderBy = "owner_name ASC, name ASC"
SearchOrderByAlphabeticallyReverse db.SearchOrderBy = "owner_name DESC, name DESC"
SearchOrderBySize db.SearchOrderBy = "size ASC"
SearchOrderBySizeReverse db.SearchOrderBy = "size DESC"
SearchOrderByGitSize db.SearchOrderBy = "git_size ASC"
SearchOrderByGitSizeReverse db.SearchOrderBy = "git_size DESC"
SearchOrderByLFSSize db.SearchOrderBy = "lfs_size ASC"
SearchOrderByLFSSizeReverse db.SearchOrderBy = "lfs_size DESC"
// alias as also used elsewhere
SearchOrderByLeastUpdated db.SearchOrderBy = db.SearchOrderByLeastUpdated
SearchOrderByRecentUpdated db.SearchOrderBy = db.SearchOrderByRecentUpdated
SearchOrderByOldest db.SearchOrderBy = db.SearchOrderByOldest
SearchOrderByNewest db.SearchOrderBy = db.SearchOrderByNewest
SearchOrderByID db.SearchOrderBy = db.SearchOrderByID
SearchOrderByIDReverse db.SearchOrderBy = db.SearchOrderByIDReverse
SearchOrderByStars db.SearchOrderBy = db.SearchOrderByStars
SearchOrderByStarsReverse db.SearchOrderBy = db.SearchOrderByStarsReverse
SearchOrderByForks db.SearchOrderBy = db.SearchOrderByForks
SearchOrderByForksReverse db.SearchOrderBy = db.SearchOrderByForksReverse
)
// SearchOrderByMap represents all possible search order
var SearchOrderByMap = map[string]map[string]db.SearchOrderBy{
"asc": {
"alpha": "owner_name ASC, name ASC",
"created": db.SearchOrderByOldest,
"updated": db.SearchOrderByLeastUpdated,
"size": db.SearchOrderBySize,
"id": db.SearchOrderByID,
"alpha": SearchOrderByAlphabetically,
"created": SearchOrderByOldest,
"updated": SearchOrderByLeastUpdated,
"size": SearchOrderBySize,
"git_size": SearchOrderByGitSize,
"lfs_size": SearchOrderByLFSSize,
"id": SearchOrderByID,
"stars": SearchOrderByStars,
"forks": SearchOrderByForks,
},
"desc": {
"alpha": "owner_name DESC, name DESC",
"created": db.SearchOrderByNewest,
"updated": db.SearchOrderByRecentUpdated,
"size": db.SearchOrderBySizeReverse,
"id": db.SearchOrderByIDReverse,
"alpha": SearchOrderByAlphabeticallyReverse,
"created": SearchOrderByNewest,
"updated": SearchOrderByRecentUpdated,
"size": SearchOrderBySizeReverse,
"git_size": SearchOrderByGitSizeReverse,
"lfs_size": SearchOrderByLFSSizeReverse,
"id": SearchOrderByIDReverse,
"stars": SearchOrderByStarsReverse,
"forks": SearchOrderByForksReverse,
},
}
// SearchOrderByFlatMap is similar to SearchOrderByMap but use human language keywords
// to decide between asc and desc
var SearchOrderByFlatMap = map[string]db.SearchOrderBy{
"newest": SearchOrderByMap["desc"]["created"],
"oldest": SearchOrderByMap["asc"]["created"],
"leastupdate": SearchOrderByMap["asc"]["updated"],
"reversealphabetically": SearchOrderByMap["desc"]["alpha"],
"alphabetically": SearchOrderByMap["asc"]["alpha"],
"reversesize": SearchOrderByMap["desc"]["size"],
"size": SearchOrderByMap["asc"]["size"],
"reversegitsize": SearchOrderByMap["desc"]["git_size"],
"gitsize": SearchOrderByMap["asc"]["git_size"],
"reverselfssize": SearchOrderByMap["desc"]["lfs_size"],
"lfssize": SearchOrderByMap["asc"]["lfs_size"],
"moststars": SearchOrderByMap["desc"]["stars"],
"feweststars": SearchOrderByMap["asc"]["stars"],
"mostforks": SearchOrderByMap["desc"]["forks"],
"fewestforks": SearchOrderByMap["asc"]["forks"],
}

View File

@ -49,7 +49,7 @@ var (
// hashCurrentPattern matches string that represents a commit SHA, e.g. d8a994ef243349f321568f9e36d5c3f444b99cae
// Although SHA1 hashes are 40 chars long, SHA256 are 64, the regex matches the hash from 7 to 64 chars in length
// so that abbreviated hash links can be used as well. This matches git and GitHub usability.
hashCurrentPattern = regexp.MustCompile(`(?:\s|^|\(|\[)([0-9a-f]{7,64})(?:\s|$|\)|\]|[.,](\s|$))`)
hashCurrentPattern = regexp.MustCompile(`(?:\s|^|\(|\[)([0-9a-f]{7,64})(?:\s|$|\)|\]|[.,:](\s|$))`)
// shortLinkPattern matches short but difficult to parse [[name|link|arg=test]] syntax
shortLinkPattern = regexp.MustCompile(`\[\[(.*?)\]\](\w*)`)

View File

@ -380,6 +380,7 @@ func TestRegExp_sha1CurrentPattern(t *testing.T) {
"(abcdefabcdefabcdefabcdefabcdefabcdefabcd)",
"[abcdefabcdefabcdefabcdefabcdefabcdefabcd]",
"abcdefabcdefabcdefabcdefabcdefabcdefabcd.",
"abcdefabcdefabcdefabcdefabcdefabcdefabcd:",
}
falseTestCases := []string{
"test",

View File

@ -9,9 +9,9 @@ import (
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/markup/common"
"code.gitea.io/gitea/modules/util"
"github.com/yuin/goldmark/ast"
"github.com/yuin/goldmark/util"
)
type prefixedIDs struct {
@ -36,7 +36,7 @@ func (p *prefixedIDs) GenerateWithDefault(value, dft []byte) []byte {
if !bytes.HasPrefix(result, []byte("user-content-")) {
result = append([]byte("user-content-"), result...)
}
if p.values.Add(util.BytesToReadOnlyString(result)) {
if p.values.Add(util.UnsafeBytesToString(result)) {
return result
}
for i := 1; ; i++ {
@ -49,7 +49,7 @@ func (p *prefixedIDs) GenerateWithDefault(value, dft []byte) []byte {
// Put puts a given element id to the used ids table.
func (p *prefixedIDs) Put(value []byte) {
p.values.Add(util.BytesToReadOnlyString(value))
p.values.Add(util.UnsafeBytesToString(value))
}
func newPrefixedIDs() *prefixedIDs {

View File

@ -7,10 +7,10 @@ import (
"fmt"
"code.gitea.io/gitea/modules/markup"
"code.gitea.io/gitea/modules/util"
"github.com/yuin/goldmark/ast"
"github.com/yuin/goldmark/text"
"github.com/yuin/goldmark/util"
)
func (g *ASTTransformer) transformHeading(_ *markup.RenderContext, v *ast.Heading, reader text.Reader, tocList *[]markup.Header) {
@ -21,11 +21,11 @@ func (g *ASTTransformer) transformHeading(_ *markup.RenderContext, v *ast.Headin
}
txt := v.Text(reader.Source())
header := markup.Header{
Text: util.BytesToReadOnlyString(txt),
Text: util.UnsafeBytesToString(txt),
Level: v.Level,
}
if id, found := v.AttributeString("id"); found {
header.ID = util.BytesToReadOnlyString(id.([]byte))
header.ID = util.UnsafeBytesToString(id.([]byte))
}
*tocList = append(*tocList, header)
g.applyElementDir(v)

View File

@ -14,8 +14,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/markup/mdstripper"
"code.gitea.io/gitea/modules/setting"
"github.com/yuin/goldmark/util"
"code.gitea.io/gitea/modules/util"
)
var (
@ -341,7 +340,7 @@ func FindRenderizableReferenceNumeric(content string, prOnly, crossLinkOnly bool
return false, nil
}
}
r := getCrossReference(util.StringToReadOnlyBytes(content), match[2], match[3], false, prOnly)
r := getCrossReference(util.UnsafeStringToBytes(content), match[2], match[3], false, prOnly)
if r == nil {
return false, nil
}

View File

@ -8,8 +8,7 @@ import (
"code.gitea.io/gitea/models/system"
"code.gitea.io/gitea/modules/json"
"github.com/yuin/goldmark/util"
"code.gitea.io/gitea/modules/util"
)
// DBStore can be used to store app state items in local filesystem
@ -24,7 +23,7 @@ func (f *DBStore) Get(ctx context.Context, item StateItem) error {
if content == "" {
return nil
}
return json.Unmarshal(util.StringToReadOnlyBytes(content), item)
return json.Unmarshal(util.UnsafeStringToBytes(content), item)
}
// Set saves the state item
@ -33,5 +32,5 @@ func (f *DBStore) Set(ctx context.Context, item StateItem) error {
if err != nil {
return err
}
return system.SaveAppStateContent(ctx, item.Name(), util.BytesToReadOnlyString(b))
return system.SaveAppStateContent(ctx, item.Name(), util.UnsafeBytesToString(b))
}

View File

@ -6,8 +6,6 @@ package util
import (
"bytes"
"unicode"
"github.com/yuin/goldmark/util"
)
type sanitizedError struct {
@ -33,7 +31,7 @@ var schemeSep = []byte("://")
// SanitizeCredentialURLs remove all credentials in URLs (starting with "scheme://") for the input string: "https://user:pass@domain.com" => "https://sanitized-credential@domain.com"
func SanitizeCredentialURLs(s string) string {
bs := util.StringToReadOnlyBytes(s)
bs := UnsafeStringToBytes(s)
schemeSepPos := bytes.Index(bs, schemeSep)
if schemeSepPos == -1 || bytes.IndexByte(bs[schemeSepPos:], '@') == -1 {
return s // fast return if there is no URL scheme or no userinfo
@ -70,5 +68,5 @@ func SanitizeCredentialURLs(s string) string {
schemeSepPos = bytes.Index(bs, schemeSep)
}
out = append(out, bs...)
return util.BytesToReadOnlyString(out)
return UnsafeBytesToString(out)
}

View File

@ -87,11 +87,11 @@ func ToSnakeCase(input string) string {
}
// UnsafeBytesToString uses Go's unsafe package to convert a byte slice to a string.
// TODO: replace all "goldmark/util.BytesToReadOnlyString" with this official approach
func UnsafeBytesToString(b []byte) string {
return unsafe.String(unsafe.SliceData(b), len(b))
}
// UnsafeStringToBytes uses Go's unsafe package to convert a string to a byte slice.
func UnsafeStringToBytes(s string) []byte {
return unsafe.Slice(unsafe.StringData(s), len(s))
}

View File

@ -164,6 +164,8 @@ search=Hledat...
type_tooltip=Druh vyhledávání
fuzzy=Fuzzy
fuzzy_tooltip=Zahrnout výsledky, které také úzce odpovídají hledanému výrazu
exact=Přesně
exact_tooltip=Zahrnout pouze výsledky, které přesně odpovídají hledanému výrazu
repo_kind=Hledat repozitáře...
user_kind=Hledat uživatele...
org_kind=Hledat organizace...
@ -177,6 +179,8 @@ branch_kind=Hledat větve...
commit_kind=Hledat commity...
runner_kind=Hledat runnery...
no_results=Nebyly nalezeny žádné odpovídající výsledky.
issue_kind=Hledat úkoly...
pull_kind=Hledat pull request...
keyword_search_unavailable=Hledání podle klíčového slova není momentálně dostupné. Obraťte se na správce webu.
[aria]
@ -432,6 +436,7 @@ oauth_signin_submit=Propojit účet
oauth.signin.error=Došlo k chybě při zpracování žádosti o autorizaci. Pokud tato chyba přetrvává, obraťte se na správce webu.
oauth.signin.error.access_denied=Žádost o autorizaci byla zamítnuta.
oauth.signin.error.temporarily_unavailable=Autorizace se nezdařila, protože ověřovací server je dočasně nedostupný. Opakujte akci později.
oauth_callback_unable_auto_reg=Automatická registrace je povolena, ale OAuth2 poskytovatel %[1]s vrátil chybějící pole: %[2]s, nelze vytvořit účet automaticky, vytvořte účet nebo se připojte k účtu, nebo kontaktujte správce webu.
openid_connect_submit=Připojit
openid_connect_title=Připojení k existujícímu účtu
openid_connect_desc=Zvolené OpenID URI není známé. Přidružte nový účet zde.
@ -712,8 +717,9 @@ cancel=Zrušit
language=Jazyk
ui=Motiv vzhledu
hidden_comment_types=Skryté typy komentářů
hidden_comment_types_description=Zde zaškrtnuté typy komentářů nebudou zobrazeny na stránkách úkolů. Zaškrtnutím položky „Štítek“ například odstraní všechny komentáře „{uživatel} přidal/odstranil {štítek}“.
hidden_comment_types.ref_tooltip=Komentáře, na které se odkazovalo z jiného úkolu/commitu/…
hidden_comment_types.issue_ref_tooltip=Komentáře, kde uživatel změní větev/značku spojenou s problémem
hidden_comment_types.issue_ref_tooltip=Komentáře, kde uživatel změní větev/značku spojenou s úkolem
comment_type_group_reference=Reference
comment_type_group_label=Štítek
comment_type_group_milestone=Milník
@ -758,6 +764,8 @@ manage_themes=Vyberte výchozí motiv vzhledu
manage_openid=Správa OpenID adres
email_desc=Vaše hlavní e-mailová adresa bude použita pro oznámení, obnovení hesla, a pokud není skrytá, pro operace Gitu.
theme_desc=Toto bude váš výchozí motiv vzhledu napříč stránkou.
theme_colorblindness_help=Podpora šablony pro barvoslepost
theme_colorblindness_prompt=Gitea právě získala některé motivy se základní podporou barvosleposti, které mají pouze několik barev. Práce stále probíhá. Další vylepšení by bylo možné provést definováním více barev v CSS souborů.
primary=Hlavní
activated=Aktivován
requires_activation=Vyžaduje aktivaci
@ -882,6 +890,7 @@ repo_and_org_access=Repozitář a přístup organizace
permissions_public_only=Pouze veřejnost
permissions_access_all=Vše (veřejné, soukromé a omezené)
select_permissions=Vyberte oprávnění
permission_not_set=Není nastaveno
permission_no_access=Bez přístupu
permission_read=Přečtené
permission_write=čtení i zápis
@ -1061,6 +1070,7 @@ watchers=Sledující
stargazers=Sledující
stars_remove_warning=Tímto odstraníte všechny hvězdičky z tohoto repozitáře.
forks=Rozštěpení
stars=Oblíbené
reactions_more=a %d dalších
unit_disabled=Správce webu zakázal tuto sekci repozitáře.
language_other=Jiný
@ -1108,7 +1118,7 @@ template.one_item=Musíte vybrat alespoň jednu položku šablony
template.invalid=Musíte vybrat repositář šablony
archive.title=Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly nebo pull requesty.
archive.title_date=Tento repositář byl archivován %s. Můžete zobrazit soubory a klonovat je, ale nemůžete nahrávat ani otevírat problémy nebo pull requesty.
archive.title_date=Tento repositář byl archivován %s. Můžete zobrazit soubory a klonovat je, ale nemůžete nahrávat ani otevírat úkoly nebo pull requesty.
archive.issue.nocomment=Tento repozitář je archivovaný. Nemůžete komentovat úkoly.
archive.pull.nocomment=Tento repozitář je archivovaný. Nemůžete komentovat pull requesty.
@ -1228,6 +1238,8 @@ file_view_rendered=Zobrazit vykreslené
file_view_raw=Zobrazit v surovém stavu
file_permalink=Trvalý odkaz
file_too_large=Soubor je příliš velký pro zobrazení.
code_preview_line_from_to=Řádky %[1]d do%[2]d v %[3]s
code_preview_line_in=Řádek %[1]d v %[2]s
invisible_runes_header=`Tento soubor obsahuje neviditelné znaky Unicode`
invisible_runes_description=`Tento soubor obsahuje neviditelné Unicode znaky, které jsou pro člověka nerozeznatelné, ale mohou být zpracovány jiným způsobem. Pokud si myslíte, že je to záměrné, můžete toto varování bezpečně ignorovat. Použijte tlačítko Escape sekvence k jejich zobrazení.`
ambiguous_runes_header=`Tento soubor obsahuje nejednoznačné znaky Unicode`
@ -1282,6 +1294,7 @@ editor.or=nebo
editor.cancel_lower=Zrušit
editor.commit_signed_changes=Odevzdat podepsané změny
editor.commit_changes=Odevzdat změny
editor.add_tmpl=Přidán „{nazev_souboru}“
editor.add=Přidat %s
editor.update=Aktualizovat %s
editor.delete=Odstranit %s
@ -1364,6 +1377,7 @@ commitstatus.success=Úspěch
ext_issues=Přístup k externím úkolům
ext_issues.desc=Odkaz na externí systém úkolů.
projects.desc=Spravujte úkoly a pull requesty v projektech.
projects.description=Popis (volitelné)
projects.description_placeholder=Popis
projects.create=Vytvořit projekt
@ -1391,6 +1405,7 @@ projects.column.new=Nový sloupec
projects.column.set_default=Nastavit jako výchozí
projects.column.set_default_desc=Nastavit tento sloupec jako výchozí pro nekategorizované úkoly a požadavky na natažení
projects.column.delete=Smazat sloupec
projects.column.deletion_desc=Smazání sloupce projektu přesune všechny související úkoly do výchozího sloupce. Pokračovat?
projects.column.color=Barva
projects.open=Otevřít
projects.close=Zavřít
@ -1426,6 +1441,7 @@ issues.new.clear_assignees=Smazat zpracovatele
issues.new.no_assignees=Bez zpracovatelů
issues.new.no_reviewers=Žádní posuzovatelé
issues.new.blocked_user=Nemůžete vytvořit úkol, protože jste zablokováni zadavatelem příspěvku nebo vlastníkem repozitáře.
issues.edit.already_changed=Nelze uložit změny v úkolu. Zdá se, že obsah byl již změněn jiným uživatelem. Aktualizujte stránku a zkuste ji znovu problém upravit, abyste se vyhnuli přepsání jejich změn
issues.edit.blocked_user=Nemůžete upravovat obsah, protože jste zablokováni zadavatelem příspěvku nebo vlastníkem repozitáře.
issues.choose.get_started=Začínáme
issues.choose.open_external_link=Otevřít
@ -1433,7 +1449,7 @@ issues.choose.blank=Výchozí
issues.choose.blank_about=Vytvořit úkol z výchozí šablony.
issues.choose.ignore_invalid_templates=Neplatné šablony byly ignorovány
issues.choose.invalid_templates=%v nalezených neplatných šablon
issues.choose.invalid_config=Nastavení problému obsahuje chyby:
issues.choose.invalid_config=Nastavení úkolu obsahuje chyby:
issues.no_ref=Není určena žádná větev/značka
issues.create=Vytvořit úkol
issues.new_label=Nový štítek
@ -1534,10 +1550,12 @@ issues.context.reference_issue=Odkázat v novém úkolu
issues.context.edit=Upravit
issues.context.delete=Smazat
issues.no_content=K dispozici není žádný popis.
issues.close=Zavřít problém
issues.close=Zavřít úkol
issues.comment_pull_merged_at=sloučený commit %[1]s do %[2]s %[3]s
issues.comment_manually_pull_merged_at=ručně sloučený commit %[1]s do %[2]s %[3]s
issues.close_comment_issue=Okomentovat a zavřít
issues.reopen_issue=Znovuotevřít
issues.reopen_comment_issue=Znovu otevřít s komentářem
issues.create_comment=Okomentovat
issues.comment.blocked_user=Nemůžete vytvořit nebo upravovat komentář, protože jste zablokováni zadavatelem příspěvku nebo vlastníkem repozitáře.
issues.closed_at=`uzavřel/a tento úkol <a id="%[1]s" href="#%[1]s">%[2]s</a>`
@ -1598,7 +1616,7 @@ issues.attachment.open_tab=`Klikněte pro zobrazení „%s“ v nové záložce`
issues.attachment.download=`Klikněte pro stažení „%s“`
issues.subscribe=Odebírat
issues.unsubscribe=Zrušit odběr
issues.unpin_issue=Odepnout problém
issues.unpin_issue=Odepnout úkol
issues.max_pinned=Nemůžete připnout další úkoly
issues.pin_comment=připnuto %s
issues.unpin_comment=odepnul/a tento %s
@ -1657,7 +1675,7 @@ issues.due_date_form=rrrr-mm-dd
issues.due_date_form_add=Přidat termín dokončení
issues.due_date_form_edit=Upravit
issues.due_date_form_remove=Odstranit
issues.due_date_not_writer=Potřebujete přístup k zápisu do tohoto repozitáře, abyste mohli aktualizovat datum dokončení problému.
issues.due_date_not_writer=Potřebujete přístup k zápisu do tohoto repozitáře, abyste mohli aktualizovat datum dokončení úkolu.
issues.due_date_not_set=Žádný termín dokončení.
issues.due_date_added=přidal/a termín dokončení %s %s
issues.due_date_modified=upravil/a termín termínu z %[2]s na %[1]s %[3]s
@ -1739,6 +1757,7 @@ compare.compare_head=porovnat
pulls.desc=Povolit pull requesty a posuzování kódu.
pulls.new=Nový pull request
pulls.new.blocked_user=Nemůžete vytvořit pull request, protože jste zablokování vlastníkem repozitáře.
pulls.edit.already_changed=Nelze uložit změny v pull requestu. Zdá se, že obsah byl již změněn jiným uživatelem. Aktualizujte stránku a zkuste znovu komentář upravit, abyste se vyhnuli přepsání jejich změn
pulls.view=Zobrazit pull request
pulls.compare_changes=Nový pull request
pulls.allow_edits_from_maintainers=Povolit úpravy od správců
@ -1858,6 +1877,7 @@ pulls.close=Zavřít pull request
pulls.closed_at=`uzavřel/a tento pull request <a id="%[1]s" href="#%[1]s">%[2]s</a>`
pulls.reopened_at=`znovuotevřel/a tento pull request <a id="%[1]s" href="#%[1]s">%[2]s</a>`
pulls.cmd_instruction_hint=`Zobrazit <a class="show-instruction">instrukce příkazové řádky</a>.`
pulls.cmd_instruction_checkout_title=Checkout
pulls.cmd_instruction_checkout_desc=Z vašeho repositáře projektu se podívejte na novou větev a vyzkoušejte změny.
pulls.cmd_instruction_merge_title=Sloučit
pulls.cmd_instruction_merge_desc=Slučte změny a aktualizujte je na Gitea.
@ -1883,6 +1903,7 @@ pulls.recently_pushed_new_branches=Nahráli jste větev <strong>%[1]s</strong> %
pull.deleted_branch=(odstraněno):%s
comments.edit.already_changed=Nelze uložit změny v komentáři. Zdá se, že obsah byl již změněn jiným uživatelem. Aktualizujte stránku a zkuste znovu komentář upravit, abyste se vyhnuli přepsání jejich změn
milestones.new=Nový milník
milestones.closed=Zavřen dne %s
@ -1959,6 +1980,7 @@ wiki.page_name_desc=Zadejte název této Wiki stránky. Některé speciální n
wiki.original_git_entry_tooltip=Zobrazit originální Git soubor namísto použití přátelského odkazu.
activity=Aktivita
activity.navbar.pulse=Pulz
activity.navbar.code_frequency=Frekvence kódu
activity.navbar.contributors=Přispěvatelé
activity.navbar.recent_commits=Nedávné commity
@ -2052,6 +2074,7 @@ settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning=Právě t
settings.mirror_settings.docs.disabled_push_mirror.info=Push zrcadla byla zakázána administrátorem vašeho webu.
settings.mirror_settings.docs.no_new_mirrors=Váš repozitář zrcadlí změny do nebo z jiného repozitáře. Mějte prosím na paměti, že v tuto chvíli nemůžete vytvořit žádná nová zrcadla.
settings.mirror_settings.docs.can_still_use=I když nemůžete upravit stávající zrcadla nebo vytvořit nová, stále můžete použít své stávající zrcadlo.
settings.mirror_settings.docs.pull_mirror_instructions=Chcete-li nastavit zrcadlo pro natažení, konzultujte prosím:
settings.mirror_settings.docs.more_information_if_disabled=Více informací o zrcadlech pro nahrání a natažení naleznete zde:
settings.mirror_settings.docs.doc_link_title=Jak mohu zrcadlit repozitáře?
settings.mirror_settings.docs.doc_link_pull_section=sekci "stahovat ze vzdáleného úložiště" v dokumentaci.
@ -2079,6 +2102,7 @@ settings.advanced_settings=Pokročilá nastavení
settings.wiki_desc=Povolit Wiki repozitáře
settings.use_internal_wiki=Používat vestavěnou Wiki
settings.default_wiki_branch_name=Výchozí název větve Wiki
settings.default_wiki_everyone_access=Výchozí přístupová práva pro přihlášené uživatele:
settings.failed_to_change_default_wiki_branch=Změna výchozí větve wiki se nezdařila.
settings.use_external_wiki=Používat externí Wiki
settings.external_wiki_url=URL externí Wiki
@ -2760,6 +2784,7 @@ teams.invite.by=Pozvání od %s
teams.invite.description=Pro připojení k týmu klikněte na tlačítko níže.
[admin]
maintenance=Údržba
dashboard=Přehled
self_check=Samokontrola
identity_access=Identita a přístup
@ -2782,6 +2807,7 @@ settings=Nastavení správce
dashboard.new_version_hint=Gitea %s je nyní k dispozici, právě u vás běži %s. Podívej se na <a target="_blank" rel="noreferrer" href="https://blog.gitea.io">blogu</a> pro více informací.
dashboard.statistic=Souhrn
dashboard.maintenance_operations=Operace údržby
dashboard.system_status=Status systému
dashboard.operation_name=Název operace
dashboard.operation_switch=Přepnout
@ -3067,12 +3093,14 @@ auths.tips=Tipy
auths.tips.oauth2.general=Ověřování OAuth2
auths.tips.oauth2.general.tip=Při registraci nové OAuth2 autentizace by URL callbacku/přesměrování měla být:
auths.tip.oauth2_provider=Poskytovatel OAuth2
auths.tip.bitbucket=Vytvořte nového OAuth konzumenta na https://bitbucket.org/account/user/{vase-uzivatelske-jmeno}/oauth-consumers/new a přidejte oprávnění „Account“ - „Read“
auths.tip.nextcloud=Zaregistrujte nového OAuth konzumenta na vaší instanci pomocí následujícího menu „Nastavení -> Zabezpečení -> OAuth 2.0 klient“
auths.tip.dropbox=Vytvořte novou aplikaci na https://www.dropbox.com/developers/apps
auths.tip.facebook=Registrujte novou aplikaci na https://developers.facebook.com/apps a přidejte produkt „Facebook Login“
auths.tip.github=Registrujte novou OAuth aplikaci na https://github.com/settings/applications/new
auths.tip.gitlab_new=Zaregistrujte novou aplikaci na https://gitlab.com/-/profile/applications
auths.tip.google_plus=Získejte klientské pověření OAuth2 z Google API konzole na https://console.developers.google.com/
auths.tip.openid_connect=Použijte OpenID Connect URL pro objevování spojení „https://{server}/.well-known/openid-configuration“ k nastavení koncových bodů
auths.tip.twitter=Jděte na https://dev.twitter.com/apps, vytvořte aplikaci a ujistěte se, že volba „Allow this application to be used to Sign in with Twitter“ je povolená
auths.tip.discord=Registrujte novou aplikaci na https://discordapp.com/developers/applications/me
auths.tip.gitea=Registrovat novou Oauth2 aplikaci. Návod naleznete na https://docs.gitea.com/development/oauth2-provider
@ -3285,11 +3313,13 @@ notices.op=Akce
notices.delete_success=Systémové upozornění bylo smazáno.
self_check.no_problem_found=Zatím nebyl nalezen žádný problém.
self_check.startup_warnings=Upozornění při spuštění:
self_check.database_collation_mismatch=Očekávejte, že databáze použije collation: %s
self_check.database_collation_case_insensitive=Databáze používá collation %s, což je collation nerozlišující velká a malá písmena. Ačkoli s ní Gitea může pracovat, mohou se vyskytnout vzácné případy, kdy nebude fungovat podle očekávání.
self_check.database_inconsistent_collation_columns=Databáze používá collation %s, ale tyto sloupce používají chybné collation. To může způsobit neočekávané problémy.
self_check.database_fix_mysql=Pro uživatele MySQL/MariaDB můžete použít příkaz "gitea doctor convert", který opraví problémy s collation, nebo můžete také problém vyřešit příkazem "ALTER ... COLLATE ..." SQL ručně.
self_check.database_fix_mssql=Uživatelé MSSQL mohou problém vyřešit pouze pomocí příkazu "ALTER ... COLLATE ..." SQL ručně.
self_check.location_origin_mismatch=Aktuální URL (%[1]s) se neshoduje s URL viditelnou pro Gitea (%[2]s). Pokud používáte reverzní proxy, ujistěte se, že hlavičky „Host“ a „X-Forwarded-Proto“ jsou nastaveny správně.
[action]
create_repo=vytvořil/a repozitář <a href="%s">%s</a>
@ -3301,7 +3331,7 @@ reopen_issue=`znovuotevřel/a úkol <a href="%[1]s">%[3]s#%[2]s</a>`
create_pull_request=`vytvořil/a pull request <a href="%[1]s">%[3]s#%[2]s</a>`
close_pull_request=`uzavřel/a pull request <a href="%[1]s">%[3]s#%[2]s</a>`
reopen_pull_request=`znovuotevřel/a pull request <a href="%[1]s">%[3]s#%[2]s</a>`
comment_issue=`okomentoval/a problém <a href="%[1]s">%[3]s#%[2]s</a>`
comment_issue=`okomentoval/a úkol <a href="%[1]s">%[3]s#%[2]s</a>`
comment_pull=`okomentoval/a pull request <a href="%[1]s">%[3]s#%[2]s</a>`
merge_pull_request=`sloučil/a pull request <a href="%[1]s">%[3]s#%[2]s</a>`
auto_merge_pull_request=`automaticky sloučen pull request <a href="%[1]s">%[3]s#%[2]s</a>`
@ -3317,6 +3347,7 @@ mirror_sync_create=synchronizoval/a novou referenci <a href="%[2]s">%[3]s</a> do
mirror_sync_delete=synchronizoval/a a smazal/a referenci <code>%[2]s</code> v <a href="%[1]s">%[3]s</a> ze zrcadla
approve_pull_request=`schválil/a <a href="%[1]s">%[3]s#%[2]s</a>`
reject_pull_request=`navrhl/a změny pro <a href="%[1]s">%[3]s#%[2]s</a>`
publish_release=`vydal/a <a href="%[2]s"> "%[4]s" </a> v <a href="%[1]s">%[3]s</a>`
review_dismissed=`zamítl/a posouzení z <b>%[4]s</b> pro <a href="%[1]s">%[3]s#%[2]s</a>`
review_dismissed_reason=Důvod:
create_branch=vytvořil/a větev <a href="%[2]s">%[3]s</a> v <a href="%[1]s">%[4]s</a>
@ -3383,6 +3414,7 @@ error.unit_not_allowed=Nejste oprávněni přistupovat k této části repozitá
title=Balíčky
desc=Správa balíčků repozitáře.
empty=Zatím nejsou žádné balíčky.
no_metadata=Žádná metadata.
empty.documentation=Další informace o registru balíčků naleznete v <a target="_blank" rel="noopener noreferrer" href="%s">dokumentaci</a>.
empty.repo=Nahráli jste balíček, ale nezobrazil se zde? Přejděte na <a href="%[1]s">nastavení balíčku</a> a propojte jej s tímto repozitářem.
registry.documentation=Další informace o registru %s naleznete v <a target="_blank" rel="noopener noreferrer" href="%s">dokumentaci</a>.
@ -3464,6 +3496,7 @@ npm.install=Pro instalaci balíčku pomocí npm spusťte následující příkaz
npm.install2=nebo ho přidejte do souboru package.json:
npm.dependencies=Závislosti
npm.dependencies.development=Vývojové závislosti
npm.dependencies.bundle=Vnitřní závislosti
npm.dependencies.peer=Vzájemné závislosti
npm.dependencies.optional=Volitelné závislosti
npm.details.tag=Značka
@ -3601,6 +3634,7 @@ runs.pushed_by=náhrán
runs.invalid_workflow_helper=Konfigurační soubor pracovního postupu je neplatný. Zkontrolujte prosím konfigurační soubor: %s
runs.no_matching_online_runner_helper=Žádný odpovídající online runner s popiskem: %s
runs.no_job_without_needs=Pracovní postup musí obsahovat alespoň jednu úlohu bez závislostí.
runs.no_job=Pracovní postup musí obsahovat alespoň jednu úlohu
runs.actor=Aktér
runs.status=Status
runs.actors_no_select=Všichni aktéři

View File

@ -1238,6 +1238,7 @@ file_view_rendered = View Rendered
file_view_raw = View Raw
file_permalink = Permalink
file_too_large = The file is too large to be shown.
file_is_empty = The file is empty.
code_preview_line_from_to = Lines %[1]d to %[2]d in %[3]s
code_preview_line_in = Line %[1]d in %[2]s
invisible_runes_header = `This file contains invisible Unicode characters`

View File

@ -39,7 +39,7 @@ func saveUploadChunkBase(st storage.ObjectStorage, ctx *ArtifactContext,
r = io.TeeReader(r, hasher)
}
// save chunk to storage
writtenSize, err := st.Save(storagePath, r, -1)
writtenSize, err := st.Save(storagePath, r, contentSize)
if err != nil {
return -1, fmt.Errorf("save chunk to storage error: %v", err)
}
@ -208,7 +208,7 @@ func mergeChunksForArtifact(ctx *ArtifactContext, chunks []*chunkFileItem, st st
// save merged file
storagePath := fmt.Sprintf("%d/%d/%d.%s", artifact.RunID%255, artifact.ID%255, time.Now().UnixNano(), extension)
written, err := st.Save(storagePath, mergedReader, -1)
written, err := st.Save(storagePath, mergedReader, artifact.FileCompressedSize)
if err != nil {
return fmt.Errorf("save merged file error: %v", err)
}

View File

@ -107,7 +107,7 @@ func Search(ctx *context.APIContext) {
// - name: sort
// in: query
// description: sort repos by attribute. Supported values are
// "alpha", "created", "updated", "size", and "id".
// "alpha", "created", "updated", "size", "git_size", "lfs_size", "stars", "forks" and "id".
// Default is "alpha"
// type: string
// - name: order

View File

@ -6,6 +6,7 @@ package explore
import (
"fmt"
"net/http"
"strings"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
@ -57,47 +58,18 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
orderBy db.SearchOrderBy
)
sortOrder := ctx.FormString("sort")
sortOrder := strings.ToLower(ctx.FormString("sort"))
if sortOrder == "" {
sortOrder = setting.UI.ExploreDefaultSort
}
ctx.Data["SortType"] = sortOrder
switch sortOrder {
case "newest":
orderBy = db.SearchOrderByNewest
case "oldest":
orderBy = db.SearchOrderByOldest
case "leastupdate":
orderBy = db.SearchOrderByLeastUpdated
case "reversealphabetically":
orderBy = db.SearchOrderByAlphabeticallyReverse
case "alphabetically":
orderBy = db.SearchOrderByAlphabetically
case "reversesize":
orderBy = db.SearchOrderBySizeReverse
case "size":
orderBy = db.SearchOrderBySize
case "reversegitsize":
orderBy = db.SearchOrderByGitSizeReverse
case "gitsize":
orderBy = db.SearchOrderByGitSize
case "reverselfssize":
orderBy = db.SearchOrderByLFSSizeReverse
case "lfssize":
orderBy = db.SearchOrderByLFSSize
case "moststars":
orderBy = db.SearchOrderByStarsReverse
case "feweststars":
orderBy = db.SearchOrderByStars
case "mostforks":
orderBy = db.SearchOrderByForksReverse
case "fewestforks":
orderBy = db.SearchOrderByForks
default:
ctx.Data["SortType"] = "recentupdate"
if order, ok := repo_model.SearchOrderByFlatMap[sortOrder]; ok {
orderBy = order
} else {
sortOrder = "recentupdate"
orderBy = db.SearchOrderByRecentUpdated
}
ctx.Data["SortType"] = sortOrder
keyword := ctx.FormTrim("q")

View File

@ -99,8 +99,6 @@ func RefBlame(ctx *context.Context) {
}
ctx.Data["NumLines"], err = blob.GetBlobLineCount()
ctx.Data["NumLinesSet"] = true
if err != nil {
ctx.NotFound("GetBlobLineCount", err)
return

View File

@ -303,6 +303,7 @@ func LFSFileGet(ctx *context.Context) {
rd := charset.ToUTF8WithFallbackReader(io.MultiReader(bytes.NewReader(buf), dataRc), charset.ConvertOpts{})
// Building code view blocks with line number on server side.
// FIXME: the logic is not right here: it first calls EscapeControlReader then calls HTMLEscapeString: double-escaping
escapedContent := &bytes.Buffer{}
ctx.Data["EscapeStatus"], _ = charset.EscapeControlReader(rd, escapedContent, ctx.Locale)

View File

@ -286,6 +286,7 @@ func renderReadmeFile(ctx *context.Context, subfolder string, readmeFile *git.Tr
ctx.Data["FileIsText"] = fInfo.isTextFile
ctx.Data["FileName"] = path.Join(subfolder, readmeFile.Name())
ctx.Data["FileSize"] = fInfo.fileSize
ctx.Data["IsLFSFile"] = fInfo.isLFSFile
if fInfo.isLFSFile {
@ -301,7 +302,6 @@ func renderReadmeFile(ctx *context.Context, subfolder string, readmeFile *git.Tr
// Pretend that this is a normal text file to display 'This file is too large to be shown'
ctx.Data["IsFileTooLarge"] = true
ctx.Data["IsTextFile"] = true
ctx.Data["FileSize"] = fInfo.fileSize
return
}
@ -552,7 +552,6 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry) {
} else {
ctx.Data["NumLines"] = bytes.Count(buf, []byte{'\n'}) + 1
}
ctx.Data["NumLinesSet"] = true
language, err := files_service.TryGetContentLanguage(ctx.Repo.GitRepo, ctx.Repo.CommitID, ctx.Repo.TreePath)
if err != nil {
@ -606,8 +605,8 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry) {
break
}
// TODO: this logic seems strange, it duplicates with "isRepresentableAsText=true", it is not the same as "LFSFileGet" in "lfs.go"
// maybe for this case, the file is a binary file, and shouldn't be rendered?
// TODO: this logic duplicates with "isRepresentableAsText=true", it is not the same as "LFSFileGet" in "lfs.go"
// It is used by "external renders", markupRender will execute external programs to get rendered content.
if markupType := markup.Type(blob.Name()); markupType != "" {
rd := io.MultiReader(bytes.NewReader(buf), dataRc)
ctx.Data["IsMarkup"] = true

View File

@ -4,7 +4,7 @@
{{end}}
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
<div class="navbar-left ui secondary menu">
<div class="navbar-left">
<!-- the logo -->
<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}">
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
@ -61,7 +61,7 @@
</div>
<!-- the full dropdown menus -->
<div class="navbar-right ui secondary menu">
<div class="navbar-right">
{{if and .IsSigned .MustChangePassword}}
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
<span class="text tw-flex tw-items-center">
@ -104,7 +104,7 @@
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
</span>
<div class="menu left">
<div class="menu">
<a class="item" href="{{AppSubUrl}}/repo/create">
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
</a>

View File

@ -32,6 +32,8 @@
<div class="file-view code-view unicode-escaped">
{{if .IsFileTooLarge}}
{{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}}
{{else if not .FileSize}}
{{template "shared/fileisempty"}}
{{else}}
<table>
<tbody>

View File

@ -4,12 +4,12 @@
{{ctx.Locale.Tr "repo.symbolic_link"}}
</div>
{{end}}
{{if .NumLinesSet}}{{/* Explicit attribute needed to show 0 line changes */}}
{{if ne .NumLines nil}}
<div class="file-info-entry">
{{.NumLines}} {{ctx.Locale.TrN .NumLines "repo.line" "repo.lines"}}
</div>
{{end}}
{{if .FileSize}}
{{if ne .FileSize nil}}
<div class="file-info-entry">
{{FileSize .FileSize}}{{if .IsLFSFile}} ({{ctx.Locale.Tr "repo.stored_lfs"}}){{end}}
</div>

View File

@ -1,19 +1,17 @@
<h4 class="ui top attached header">
{{ctx.Locale.Tr "repo.issues.label_count" .NumLabels}}
<div class="ui right">
<div class="ui secondary menu">
<!-- Sort -->
<div class="item ui jump dropdown tw-py-2">
<span class="text">
{{ctx.Locale.Tr "repo.issues.filter_sort"}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="?sort=alphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="?sort=reversealphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
<a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="?sort=leastissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
<a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="?sort=mostissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
</div>
<!-- Sort -->
<div class="item ui jump dropdown tw-py-2">
<span class="text">
{{ctx.Locale.Tr "repo.issues.filter_sort"}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="?sort=alphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="?sort=reversealphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
<a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="?sort=leastissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
<a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="?sort=mostissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
</div>
</div>
</div> <!-- filter menu -->

View File

@ -16,10 +16,8 @@
<div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsPlainText}} plain-text{{else if .IsTextFile}} code-view{{end}}">
{{if .IsFileTooLarge}}
{{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}}
{{else if .IsMarkup}}
{{if .FileContent}}{{.FileContent | SafeHTML}}{{end}}
{{else if .IsPlainText}}
<pre>{{if .FileContent}}{{.FileContent | SafeHTML}}{{end}}</pre>
{{else if not .FileSize}}
{{template "shared/fileisempty"}}
{{else if not .IsTextFile}}
<div class="view-raw">
{{if .IsImageFile}}

View File

@ -91,6 +91,8 @@
<div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsPlainText}} plain-text{{else if .IsTextSource}} code-view{{end}}">
{{if .IsFileTooLarge}}
{{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}}
{{else if not .FileSize}}
{{template "shared/fileisempty"}}
{{else if .IsMarkup}}
{{if .FileContent}}{{.FileContent}}{{end}}
{{else if .IsPlainText}}

View File

@ -0,0 +1,3 @@
<div class="file-not-rendered-prompt">
{{ctx.Locale.Tr "repo.file_is_empty"}}
</div>

View File

@ -1,4 +1,4 @@
<div class="tw-p-4">
<div class="file-not-rendered-prompt">
{{ctx.Locale.Tr "repo.file_too_large"}}
{{if .RawFileLink}}<a href="{{.RawFileLink}}" rel="nofollow">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>{{end}}
</div>

View File

@ -3689,7 +3689,7 @@
},
{
"type": "string",
"description": "sort repos by attribute. Supported values are \"alpha\", \"created\", \"updated\", \"size\", and \"id\". Default is \"alpha\"",
"description": "sort repos by attribute. Supported values are \"alpha\", \"created\", \"updated\", \"size\", \"git_size\", \"lfs_size\", \"stars\", \"forks\" and \"id\". Default is \"alpha\"",
"name": "sort",
"in": "query"
},

View File

@ -51,11 +51,7 @@
<input type="hidden" name="type" value="{{$.ViewType}}">
<input type="hidden" name="sort" value="{{$.SortType}}">
<input type="hidden" name="state" value="{{$.State}}">
{{if .PageIsPulls}}
{{template "shared/search/combo_fuzzy" dict "Value" $.Keyword "IsFuzzy" $.IsFuzzy "Placeholder" (ctx.Locale.Tr "search.pull_kind") "Tooltip" (ctx.Locale.Tr "explorer.go")}}
{{else}}
{{template "shared/search/combo_fuzzy" dict "Value" $.Keyword "IsFuzzy" $.IsFuzzy "Placeholder" (ctx.Locale.Tr "search.issue_kind") "Tooltip" (ctx.Locale.Tr "explorer.go")}}
{{end}}
{{template "shared/search/combo_fuzzy" dict "Value" $.Keyword "IsFuzzy" $.IsFuzzy "Placeholder" (ctx.Locale.Tr (Iif .PageIsPulls "search.pull_kind" "search.issue_kind")) "Tooltip" (ctx.Locale.Tr "explore.go_to")}}
</div>
</form>
<!-- Sort -->

View File

@ -1001,6 +1001,13 @@ overflow-menu .ui.label {
padding: 0 8px;
text-align: right !important;
color: var(--color-text-light-2);
width: 1%; /* this apparently needs to be a percentage so that code column stretches in diffs */
min-width: 72px;
white-space: nowrap;
}
.code-diff .lines-num {
min-width: 50px;
}
.lines-num span.bottom-line::after {
@ -1020,6 +1027,7 @@ overflow-menu .ui.label {
.lines-type-marker {
vertical-align: top;
white-space: nowrap;
}
.lines-num,
@ -1052,6 +1060,7 @@ overflow-menu .ui.label {
.lines-escape {
width: 0;
white-space: nowrap;
}
.lines-code {

View File

@ -134,12 +134,6 @@ h4.ui.header .sub.header {
font-weight: var(--font-weight-normal);
}
/* open dropdown menus to the left in right-attached headers */
.ui.attached.header > .ui.right .ui.dropdown .menu {
right: 0;
left: auto;
}
/* if a .top.attached.header is followed by a .segment, add some margin */
.ui.segments + .ui.top.attached.header,
.ui.attached.segment + .ui.top.attached.header {

View File

@ -19,12 +19,26 @@
margin: 0;
display: flex;
align-items: center;
gap: 5px;
}
#navbar-logo {
margin: 0;
}
.navbar-left > .item,
.navbar-right > .item {
color: var(--color-nav-text);
position: relative;
text-decoration: none;
line-height: var(--line-height-default);
flex: 0 0 auto;
font-weight: var(--font-weight-normal);
align-items: center;
padding: .78571429em .92857143em;
border-radius: .28571429rem;
}
#navbar .item {
min-height: 36px;
min-width: 36px;
@ -33,10 +47,6 @@
display: flex;
}
#navbar > .menu > .item {
color: var(--color-nav-text);
}
#navbar .dropdown .item {
justify-content: stretch;
}
@ -70,7 +80,7 @@
}
#navbar .navbar-mobile-right {
display: flex;
margin-left: auto !important;
margin: 0 0 0 auto !important;
width: auto !important;
}
#navbar .navbar-mobile-right > .item {

View File

@ -1555,8 +1555,6 @@ td .commit-summary {
.repository .diff-file-box .file-body.file-code .lines-num {
text-align: right;
width: 1%;
min-width: 50px;
}
.repository .diff-file-box .file-body.file-code .lines-num span.fold {
@ -1582,12 +1580,6 @@ td .commit-summary {
table-layout: fixed;
}
.repository .diff-file-box .code-diff tbody tr td.lines-num,
.repository .diff-file-box .code-diff tbody tr td.lines-escape,
.repository .diff-file-box .code-diff tbody tr td.lines-type-marker {
white-space: nowrap;
}
.repository .diff-file-box .code-diff tbody tr td.center {
text-align: center;
}
@ -1714,6 +1706,18 @@ td .commit-summary {
.file-view.markup {
padding: 1em 2em;
}
.file-view.markup:has(.file-not-rendered-prompt) {
padding: 0; /* let the file-not-rendered-prompt layout itself */
}
.file-not-rendered-prompt {
padding: 1rem;
text-align: center;
font-size: 1rem !important; /* use consistent styles for various containers (code, markup, etc) */
line-height: var(--line-height-default) !important; /* same as above */
}
.repository .activity-header {
display: flex;
justify-content: space-between;

View File

@ -202,7 +202,7 @@ export default {
>
<svg-icon name="octicon-git-commit"/>
</button>
<div class="menu left transition" id="diff-commit-selector-menu" :class="{visible: menuVisible}" v-show="menuVisible" v-cloak :aria-expanded="menuVisible ? 'true': 'false'">
<div class="left menu" id="diff-commit-selector-menu" :class="{visible: menuVisible}" v-show="menuVisible" v-cloak :aria-expanded="menuVisible ? 'true': 'false'">
<div class="loading-indicator is-loading" v-if="isLoading"/>
<div v-if="!isLoading" class="vertical item" id="diff-commit-list-show-all" role="menuitem" @keydown.enter="showAllChanges()" @click="showAllChanges()">
<div class="gt-ellipsis">

View File

@ -94,6 +94,22 @@ function delegateOne($dropdown) {
updateSelectionLabel($label[0]);
return $label;
});
const oldSet = dropdownCall('internal', 'set');
const oldSetDirection = oldSet.direction;
oldSet.direction = function($menu) {
oldSetDirection.call(this, $menu);
const classNames = dropdownCall('setting', 'className');
$menu = $menu || $dropdown.find('> .menu');
const elMenu = $menu[0];
// detect whether the menu is outside the viewport, and adjust the position
// there is a bug in fomantic's builtin `direction` function, in some cases (when the menu width is only a little larger) it wrongly opens the menu at right and triggers the scrollbar.
elMenu.classList.add(classNames.loading);
if (elMenu.getBoundingClientRect().right > document.documentElement.clientWidth) {
elMenu.classList.add(classNames.leftward);
}
elMenu.classList.remove(classNames.loading);
};
}
// for static dropdown elements (generated by server-side template), prepare them with necessary aria attributes