Skip to content

Commit 8218106

Browse files
Merge branch 'main' into fix-mirror-sanitize
2 parents edb5d95 + d1dbbf4 commit 8218106

File tree

9 files changed

+76
-11
lines changed

9 files changed

+76
-11
lines changed

modules/setting/indexer.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package setting
66

77
import (
8-
"path"
98
"path/filepath"
109
"strings"
1110
"time"
@@ -68,23 +67,23 @@ var (
6867
func newIndexerService() {
6968
sec := Cfg.Section("indexer")
7069
Indexer.IssueType = sec.Key("ISSUE_INDEXER_TYPE").MustString("bleve")
71-
Indexer.IssuePath = sec.Key("ISSUE_INDEXER_PATH").MustString(path.Join(AppDataPath, "indexers/issues.bleve"))
70+
Indexer.IssuePath = filepath.ToSlash(sec.Key("ISSUE_INDEXER_PATH").MustString(filepath.ToSlash(filepath.Join(AppDataPath, "indexers/issues.bleve"))))
7271
if !filepath.IsAbs(Indexer.IssuePath) {
73-
Indexer.IssuePath = path.Join(AppWorkPath, Indexer.IssuePath)
72+
Indexer.IssuePath = filepath.ToSlash(filepath.Join(AppWorkPath, Indexer.IssuePath))
7473
}
7574
Indexer.IssueConnStr = sec.Key("ISSUE_INDEXER_CONN_STR").MustString(Indexer.IssueConnStr)
7675
Indexer.IssueIndexerName = sec.Key("ISSUE_INDEXER_NAME").MustString(Indexer.IssueIndexerName)
7776

7877
Indexer.IssueQueueType = sec.Key("ISSUE_INDEXER_QUEUE_TYPE").MustString(LevelQueueType)
79-
Indexer.IssueQueueDir = sec.Key("ISSUE_INDEXER_QUEUE_DIR").MustString(path.Join(AppDataPath, "queues/common"))
78+
Indexer.IssueQueueDir = filepath.ToSlash(sec.Key("ISSUE_INDEXER_QUEUE_DIR").MustString(filepath.ToSlash(filepath.Join(AppDataPath, "queues/common"))))
8079
Indexer.IssueQueueConnStr = sec.Key("ISSUE_INDEXER_QUEUE_CONN_STR").MustString("")
8180
Indexer.IssueQueueBatchNumber = sec.Key("ISSUE_INDEXER_QUEUE_BATCH_NUMBER").MustInt(20)
8281

8382
Indexer.RepoIndexerEnabled = sec.Key("REPO_INDEXER_ENABLED").MustBool(false)
8483
Indexer.RepoType = sec.Key("REPO_INDEXER_TYPE").MustString("bleve")
85-
Indexer.RepoPath = sec.Key("REPO_INDEXER_PATH").MustString(path.Join(AppDataPath, "indexers/repos.bleve"))
84+
Indexer.RepoPath = filepath.ToSlash(sec.Key("REPO_INDEXER_PATH").MustString(filepath.ToSlash(filepath.Join(AppDataPath, "indexers/repos.bleve"))))
8685
if !filepath.IsAbs(Indexer.RepoPath) {
87-
Indexer.RepoPath = path.Join(AppWorkPath, Indexer.RepoPath)
86+
Indexer.RepoPath = filepath.ToSlash(filepath.Join(AppWorkPath, Indexer.RepoPath))
8887
}
8988
Indexer.RepoConnStr = sec.Key("REPO_INDEXER_CONN_STR").MustString("")
9089
Indexer.RepoIndexerName = sec.Key("REPO_INDEXER_NAME").MustString("gitea_codes")

modules/setting/queue.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func GetQueueSettings(name string) QueueSettings {
4848
q.Name = name
4949

5050
// DataDir is not directly inheritable
51-
q.DataDir = filepath.Join(Queue.DataDir, "common")
51+
q.DataDir = filepath.ToSlash(filepath.Join(Queue.DataDir, "common"))
5252
// QueueName is not directly inheritable either
5353
q.QueueName = name + Queue.QueueName
5454
for _, key := range sec.Keys() {
@@ -91,9 +91,9 @@ func GetQueueSettings(name string) QueueSettings {
9191
// This is exported for tests to be able to use the queue
9292
func NewQueueService() {
9393
sec := Cfg.Section("queue")
94-
Queue.DataDir = sec.Key("DATADIR").MustString("queues/")
94+
Queue.DataDir = filepath.ToSlash(sec.Key("DATADIR").MustString("queues/"))
9595
if !filepath.IsAbs(Queue.DataDir) {
96-
Queue.DataDir = filepath.Join(AppDataPath, Queue.DataDir)
96+
Queue.DataDir = filepath.ToSlash(filepath.Join(AppDataPath, Queue.DataDir))
9797
}
9898
Queue.QueueLength = sec.Key("LENGTH").MustInt(20)
9999
Queue.BatchLength = sec.Key("BATCH_LENGTH").MustInt(20)

options/locale/locale_de-DE.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,8 @@ issues.review.resolved_by=markierte diese Unterhaltung als gelöst
12851285
issues.assignee.error=Aufgrund eines unerwarteten Fehlers konnten nicht alle Beauftragten hinzugefügt werden.
12861286
issues.reference_issue.body=Beschreibung
12871287

1288+
compare.compare_base=Basis
1289+
compare.compare_head=vergleichen
12881290

12891291
pulls.desc=Pull-Requests und Code-Reviews aktivieren.
12901292
pulls.new=Neuer Pull-Request
@@ -1547,6 +1549,7 @@ settings.email_notifications.disable=E-Mail Benachrichtigungen deaktivieren
15471549
settings.email_notifications.submit=E-Mail-Einstellungen festlegen
15481550
settings.site=Webseite
15491551
settings.update_settings=Einstellungen speichern
1552+
settings.branches.update_default_branch=Standardbranch aktualisieren
15501553
settings.advanced_settings=Erweiterte Einstellungen
15511554
settings.wiki_desc=Repository-Wiki aktivieren
15521555
settings.use_internal_wiki=Eingebautes Wiki verwenden
@@ -1887,6 +1890,7 @@ diff.file_image_width=Breite
18871890
diff.file_image_height=Höhe
18881891
diff.file_byte_size=Größe
18891892
diff.file_suppressed=Datei-Diff unterdrückt, da er zu groß ist
1893+
diff.file_suppressed_line_too_long=Dateidiff unterdrückt, weil mindestens eine Zeile zu lang ist
18901894
diff.too_many_files=Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.
18911895
diff.comment.placeholder=Kommentieren...
18921896
diff.comment.markdown_info=Styling mit Markdown wird unterstützt.
@@ -1972,6 +1976,10 @@ branch.restore=Branch „%s“ wiederherstellen
19721976
branch.download=Branch „%s“ herunterladen
19731977
branch.included_desc=Dieser Branch ist im Standard-Branch enthalten
19741978
branch.included=Enthalten
1979+
branch.create_new_branch=Branch aus Branch erstellen:
1980+
branch.confirm_create_branch=Branch erstellen
1981+
branch.new_branch=Neue Branch erstellen
1982+
branch.new_branch_from=Neue Branch von '%s' erstellen
19751983

19761984
tag.create_tag=Tag <strong>%s</strong> erstellen
19771985
tag.create_success=Tag "%s" wurde erstellt.
@@ -2308,6 +2316,7 @@ auths.allowed_domains_helper=Leer lassen, um alle Domains zuzulassen. Trenne meh
23082316
auths.enable_tls=TLS-Verschlüsselung aktivieren
23092317
auths.skip_tls_verify=TLS-Verifikation überspringen
23102318
auths.pam_service_name=PAM-Dienstname
2319+
auths.pam_email_domain=PAM E-Mail-Domain (optional)
23112320
auths.oauth2_provider=OAuth2-Anbieter
23122321
auths.oauth2_icon_url=Icon URL
23132322
auths.oauth2_clientID=Client-ID (Schlüssel)

options/locale/locale_en-US.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,10 @@ branch.restore = Restore Branch '%s'
19771977
branch.download = Download Branch '%s'
19781978
branch.included_desc = This branch is part of the default branch
19791979
branch.included = Included
1980+
branch.create_new_branch = Create branch from branch:
1981+
branch.confirm_create_branch = Create branch
1982+
branch.new_branch = Create new branch
1983+
branch.new_branch_from = Create new branch from '%s'
19801984

19811985
tag.create_tag = Create tag <strong>%s</strong>
19821986
tag.create_success = Tag '%s' has been created.

options/locale/locale_it-IT.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ users=Utenti
240240
organizations=Organizzazioni
241241
search=Cerca
242242
code=Codice
243+
search.fuzzy=Fuzzy
243244
search.match=Corrispondenze
244245
repo_no_results=Nessuna repository corrispondente.
245246
user_no_results=Nessun utente corrispondente.
@@ -366,6 +367,7 @@ password_not_match=Le password non corrispondono.
366367
lang_select_error=Selezionare una lingua dall'elenco.
367368
368369
username_been_taken=Il Nome utente esiste già.
370+
username_change_not_local_user=Gli utenti non locali non sono autorizzati a modificare il proprio nome utente.
369371
repo_name_been_taken=Il nome del repository esiste già.
370372
repository_files_already_exist=File già esistenti per questo repository. Contatta l'amministratore di sistema.
371373
repository_files_already_exist.adopt=I file esistono già per questo repository e possono essere solo Adottati.
@@ -455,6 +457,7 @@ update_language_not_found=La lingua '%s' non è disponibile.
455457
update_profile_success=Il tuo profilo è stato aggiornato.
456458
change_username=Il tuo nome utente è stato modificato.
457459
change_username_prompt=Nota: i cambiamenti al nome utente vanno a modificare anche l'URL del tuo account.
460+
change_username_redirect_prompt=Il vecchio nome utente verrà reindirizzato fino a quando non verrà richiesto da un nuovo utente.
458461
continue=Continua
459462
cancel=Annulla
460463
language=Lingua
@@ -542,6 +545,7 @@ add_principal_success=Il certificato SSH '%s' è stato aggiunto.
542545
delete_key=Rimuovi
543546
ssh_key_deletion=Rimuovi chiave SSH
544547
gpg_key_deletion=Rimuovi chiave GPG
548+
ssh_principal_deletion=Rimuovi certificato SSH principale
545549
ssh_key_deletion_desc=Rimuovere una chiave SSH ne revoca l'accesso al tuo account. Continuare?
546550
gpg_key_deletion_desc=La rimozione di una chiave GPG invalida i commits firmati da essa. Continuare?
547551
ssh_key_deletion_success=La chiave SSH è stata rimossa.
@@ -687,6 +691,7 @@ license=Licenza
687691
license_helper=Seleziona un file di licenza.
688692
readme=LEGGIMI
689693
readme_helper=Seleziona un template per il file LEGGIMI.
694+
readme_helper_desc=Qui puoi scrivere una descrizione completa del progetto.
690695
auto_init=Inizializza Repository (Aggiungi .gitignore, Licenza e LEGGIMI)
691696
trust_model_helper=Seleziona il modello di fiducia per la verifica della firma. Le opzioni possibili sono:
692697
trust_model_helper_collaborator=Collaboratore: Fidati delle firme da parte dei collaboratori
@@ -1024,6 +1029,7 @@ issues.filter_type.all_issues=Tutti i problemi
10241029
issues.filter_type.assigned_to_you=Assegnati a te
10251030
issues.filter_type.created_by_you=Creati da te
10261031
issues.filter_type.mentioning_you=Che ti riguardano
1032+
issues.filter_type.review_requested=Richiesta revisione
10271033
issues.filter_sort=Ordina
10281034
issues.filter_sort.latest=Più recenti
10291035
issues.filter_sort.oldest=Più vecchi
@@ -1229,6 +1235,7 @@ pulls.reopen_to_merge=Riapri questa pull request per effettuare l'unione.
12291235
pulls.cant_reopen_deleted_branch=Questa pull request non può essere riaperta perché il branch è stato eliminato.
12301236
pulls.merged=Unito
12311237
pulls.merged_as=La pull request è stata unita come <a rel="nofollow" class="ui sha" href="%[1]s"><code>%[2]s</code></a>.
1238+
pulls.manually_merged=Unito manualmente
12321239
pulls.is_closed=La pull request è stata chiusa.
12331240
pulls.has_merged=La pull request è stata unita.
12341241
pulls.title_wip_desc=`<a href="#">Inizia il titolo con <strong>%s</strong></a> per evitare che la pull request venga unita accidentalmente.`
@@ -1424,6 +1431,7 @@ activity.git_stats_deletion_n=%d cancellazioni
14241431
14251432
search=Ricerca
14261433
search.search_repo=Ricerca repository
1434+
search.fuzzy=Fuzzy
14271435
search.results=Risultati della ricerca per "%s" in <a href="%s">%s</a>
14281436
14291437
settings=Impostazioni
@@ -1766,10 +1774,12 @@ diff.protected=Protetto
17661774

17671775
releases.desc=Tenere traccia di versioni e download del progetto.
17681776
release.releases=Rilasci
1777+
release.detail=Dettagli rilascio
17691778
release.new_release=Nuovo Rilascio
17701779
release.draft=Bozza
17711780
release.prerelease=Pre-Rilascio
17721781
release.stable=Stabile
1782+
release.compare=Confronta
17731783
release.edit=modifica
17741784
release.source_code=Codice Sorgente
17751785
release.new_subheader=Le release organizzano le versioni del progetto.

templates/repo/branch/list.tmpl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
{{end}}
2525
</td>
2626
<td class="right aligned overflow-visible">
27+
{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
28+
<div class="ui basic jump button icon poping up show-create-branch-modal" data-content="{{$.i18n.Tr "repo.branch.new_branch_from" ($.DefaultBranch)}}" data-variation="tiny inverted" data-branch-from="{{EscapePound $.DefaultBranch}}" data-modal="#create-branch-modal" data-position="top right">
29+
{{svg "octicon-git-branch"}}
30+
</div>
31+
{{end}}
2732
<div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" ($.DefaultBranch)}}" data-variation="tiny inverted" data-position="top right">
2833
{{svg "octicon-download"}}
2934
<div class="menu">
@@ -102,6 +107,11 @@
102107
{{end}}
103108
</td>
104109
<td class="two wide right aligned overflow-visible">
110+
{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
111+
<div class="ui basic jump button icon poping up show-create-branch-modal" data-branch-from="{{EscapePound .Name}}" data-content="{{$.i18n.Tr "repo.branch.new_branch_from" .Name}}" data-variation="tiny inverted" data-position="top right" data-modal="#create-branch-modal" data-name="{{.Name}}">
112+
{{svg "octicon-git-branch"}}
113+
</div>
114+
{{end}}
105115
{{if (not .IsDeleted)}}
106116
<div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" (.Name)}}" data-variation="tiny inverted" data-position="top right">
107117
{{svg "octicon-download"}}
@@ -142,4 +152,30 @@
142152
</div>
143153
{{template "base/delete_modal_actions" .}}
144154
</div>
155+
156+
<div class="ui small modal" id="create-branch-modal">
157+
<div class="header">
158+
{{.i18n.Tr "repo.branch.new_branch"}}
159+
</div>
160+
<div class="content">
161+
<form class="ui form" id="create-branch-form" action="" data-base-action="{{.Link}}/_new/branch/" method="post">
162+
{{.CsrfTokenHtml}}
163+
<div class="field">
164+
<label>
165+
{{.i18n.Tr "repo.branch.create_new_branch"}}
166+
<span class="text" id="modal-create-branch-from-span"></span>
167+
</label>
168+
</div>
169+
<div class="required field">
170+
<label for="new_branch_name">{{.i18n.Tr "repo.branch.name"}}</label>
171+
<input id="new_branch_name" name="new_branch_name" required>
172+
</div>
173+
174+
<div class="text right actions">
175+
<div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
176+
<button class="ui green button">{{.i18n.Tr "repo.branch.confirm_create_branch"}}</button>
177+
</div>
178+
</form>
179+
</div>
180+
</div>
145181
{{template "base/footer" .}}

templates/repo/create.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<div class="ui attached segment">
1111
{{template "base/alert" .}}
1212

13-
<p class="ui center">{{.i18n.Tr "repo.new_repo_helper" (printf "%s%s" AppSubUrl "/repo/migrate") | Safe}}</p>
13+
{{if not $.DisableMigrations}}
14+
<p class="ui center">{{.i18n.Tr "repo.new_repo_helper" (printf "%s%s" AppSubUrl "/repo/migrate") | Safe}}</p>
15+
{{end}}
1416

1517
{{if not .CanCreateRepo}}
1618
<div class="ui negative message">

templates/shared/issuelist.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
</a>
6868
{{end}}
6969
{{if .Ref}}
70-
<a class="ref" {{if $.RepoLink}}href="{{$.RepoLink}}{{index $.IssueRefURLs .ID}}"{{else}}href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{index $.IssueRefURLs .ID}}"{{end}}>
70+
<a class="ref" {{if $.RepoLink}}href="{{index $.IssueRefURLs .ID}}"{{else}}href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{index $.IssueRefURLs .ID}}"{{end}}>
7171
{{svg "octicon-git-branch" 14 "mr-2"}}{{index $.IssueRefEndNames .ID}}
7272
</a>
7373
{{end}}

web_src/js/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2658,6 +2658,11 @@ $(document).ready(async () => {
26582658
$('.show-panel.button').on('click', function () {
26592659
$($(this).data('panel')).show();
26602660
});
2661+
$('.show-create-branch-modal.button').on('click', function () {
2662+
$('#create-branch-form')[0].action = $('#create-branch-form').data('base-action') + $(this).data('branch-from');
2663+
$('#modal-create-branch-from-span').text($(this).data('branch-from'));
2664+
$($(this).data('modal')).modal('show');
2665+
});
26612666
$('.show-modal.button').on('click', function () {
26622667
$($(this).data('modal')).modal('show');
26632668
});

0 commit comments

Comments
 (0)