init
This commit is contained in:
templates
admin
actions.tmpl
applications
auth
config.tmplconfig_settings.tmplcron.tmpldashboard.tmplemails
hook_new.tmplhooks.tmpllayout_footer.tmpllayout_head.tmplnavbar.tmplnotice.tmplorg
packages
queue.tmplqueue_manage.tmplrepo
runners
self_check.tmplstacktrace-row.tmplstacktrace.tmplstats.tmplsystem_status.tmpluser
api
packages
pypi
base
alert.tmplalert_details.tmpldisable_form_autofill.tmplfooter.tmplfooter_content.tmplhead.tmplhead_navbar.tmplhead_opengraph.tmplhead_script.tmplhead_style.tmplmarkup_codepreview.tmplmodal_actions_confirm.tmplpaginate.tmpl
custom
body_inner_post.tmplbody_inner_pre.tmplbody_outer_post.tmplbody_outer_pre.tmplextra_links.tmplextra_links_footer.tmplextra_tabs.tmplfooter.tmplheader.tmpl
devtest
fetch-action.tmplflex-list.tmplfomantic-dropdown.tmplfomantic-modal.tmplgitea-ui.tmpllabel.tmpllist.tmpltmplerr-sub.tmpltmplerr.tmpl
explore
home.tmplinstall.tmplmail
org
create.tmplfollow_unfollow.tmplheader.tmplhome.tmpl
member
menu.tmplprojects
settings
actions.tmplapplications.tmplapplications_oauth2_edit.tmplblocked_users.tmpldelete.tmplhook_new.tmplhooks.tmpllabels.tmpllayout_footer.tmpllayout_head.tmplnavbar.tmploptions.tmplpackages.tmplpackages_cleanup_rules_edit.tmplpackages_cleanup_rules_preview.tmplrunners_edit.tmpl
team
package
content
alpine.tmplcargo.tmplchef.tmplcomposer.tmplcomposer_dependencies.tmplconan.tmplconda.tmplcontainer.tmplcran.tmpldebian.tmplgeneric.tmplgo.tmplhelm.tmplmaven.tmplnpm.tmplnpm_dependencies.tmplnuget.tmplpub.tmplpypi.tmplrpm.tmplrubygems.tmplrubygems_dependencies.tmplswift.tmplvagrant.tmpl
metadata
alpine.tmplcargo.tmplchef.tmplcomposer.tmplconan.tmplconda.tmplcontainer.tmplcran.tmpldebian.tmplgeneric.tmplhelm.tmplmaven.tmplnpm.tmplnuget.tmplpub.tmplpypi.tmplrpm.tmplrubygems.tmplswift.tmplvagrant.tmpl
settings.tmplshared
view.tmplprojects
repo
actions
activity.tmplblame.tmplbranch
branch_dropdown.tmplcite
clone_buttons.tmplclone_script.tmplcode
code_frequency.tmplcommit_load_branches_and_tags.tmplcommit_page.tmplcommit_status.tmplcommit_statuses.tmplcommits.tmplcommits_list.tmplcommits_list_small.tmplcommits_search_dropdown.tmplcommits_table.tmplcontributors.tmplcreate.tmplcreate_helper.tmpldiff
blob_excerpt.tmplbox.tmplcomment_form.tmplcomment_form_datahandler.tmplcomments.tmplcompare.tmplconversation.tmplconversation_outdated.tmplcsv_diff.tmplescape_title.tmplimage_diff.tmplnew_comment.tmplnew_review.tmploptions_dropdown.tmplsection_code.tmplsection_split.tmplsection_unified.tmplstats.tmplwhitespace_dropdown.tmpl
editor
empty.tmplfile_info.tmplfind
forks.tmplgraph.tmplgraph
header.tmplhome.tmplicon.tmplissue
branch_selector_field.tmplcard.tmplchoose.tmplcomment_tab.tmpl
latest_commit.tmplfields
filter_actions.tmplfilter_list.tmplfilters.tmpllabel_precolors.tmpllabels.tmpllabels
edit_delete_label.tmpllabel.tmpllabel_archived.tmpllabel_list.tmpllabel_load_template.tmpllabel_new.tmpllabels_selector_field.tmpllabels_sidebar.tmpl
list.tmplmilestone
milestone_issues.tmplmilestone_new.tmplmilestones.tmplnavbar.tmplnew.tmplnew_form.tmplopenclose.tmplsearch.tmplview.tmplview_content.tmplview_content
add_reaction.tmplattachments.tmplcomments.tmplcomments_authorlink.tmplcomments_delete_time.tmplcontext_menu.tmplconversation.tmplpull.tmplpull_merge_instruction.tmplreactions.tmplreference_issue_dialog.tmplshow_role.tmplsidebar.tmplupdate_branch_by_merge.tmplwatching.tmpl
view_title.tmplmigrate
codebase.tmplgit.tmplgitbucket.tmplgitea.tmplgithub.tmplgitlab.tmplgogs.tmplhelper.tmplmigrate.tmplmigrating.tmplonedev.tmploptions.tmpl
navbar.tmplpackages.tmplprojects
pulls
pulse.tmplrecent_commits.tmplrelease
release_tag_header.tmplsearch.tmplsearch_name.tmplsettings
actions.tmplbranches.tmplcollaboration.tmpldeploy_keys.tmplgithook_edit.tmplgithooks.tmpllayout_footer.tmpllayout_head.tmpllfs.tmpllfs_file.tmpllfs_file_find.tmpllfs_locks.tmpllfs_pointers.tmplnavbar.tmploptions.tmplprotected_branch.tmplpush_mirror_sync_modal.tmplrunner_edit.tmplsecrets.tmpltags.tmpl
shabox_badge.tmplstar_unstar.tmplsub_menu.tmplwebhook
tag
unicode_escape_prompt.tmplupload.tmpluser_cards.tmplview_file.tmplview_list.tmplwatch_unwatch.tmplwatchers.tmplwiki
shared
actions
combomarkdowneditor.tmplfiletoolarge.tmplissueicon.tmplissuelist.tmplmisc
repo_search.tmplsearch
searchbottom.tmplsearchfile.tmplsecrets
user
authorlink.tmplavatarlink.tmplblock_user_dialog.tmplblocked_users.tmplname.tmplnamelink.tmplorg_profile_avatar.tmplprofile_big_avatar.tmpl
variables
webhook
status
swagger
user
auth
activate.tmplactivate_prompt.tmplcaptcha.tmplchange_passwd.tmplchange_passwd_inner.tmplfinalize_openid.tmplforgot_passwd.tmplgrant.tmplgrant_error.tmpllink_account.tmploidc_wellknown.tmplprohibit_login.tmplreset_passwd.tmplsignin.tmplsignin_inner.tmplsignin_navbar.tmplsignin_openid.tmplsignup.tmplsignup_inner.tmplsignup_openid_connect.tmplsignup_openid_navbar.tmplsignup_openid_register.tmpltwofa.tmpltwofa_scratch.tmplwebauthn.tmplwebauthn_error.tmpl
code.tmpldashboard
heatmap.tmplnotification
overview
profile.tmplsettings
account.tmplactions.tmplappearance.tmplapplications.tmplapplications_oauth2.tmplapplications_oauth2_edit.tmplapplications_oauth2_edit_form.tmplapplications_oauth2_list.tmplblocked_users.tmplgrants_oauth2.tmplhook_new.tmplhooks.tmplkeys.tmplkeys_gpg.tmplkeys_principal.tmplkeys_ssh.tmpllayout_footer.tmpllayout_head.tmplnavbar.tmplorganization.tmplpackages.tmplpackages_cleanup_rules_edit.tmplpackages_cleanup_rules_preview.tmplprofile.tmplrepos.tmplrunner_edit.tmpl
security
webhook
30
templates/repo/editor/cherry_pick.tmpl
Normal file
30
templates/repo/editor/cherry_pick.tmpl
Normal file
@ -0,0 +1,30 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository file editor edit">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<form class="ui edit form" method="post" action="{{.RepoLink}}/_cherrypick/{{.SHA}}/{{.BranchName | PathEscapeSegments}}">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="last_commit" value="{{.last_commit}}">
|
||||
<input type="hidden" name="page_has_posted" value="true">
|
||||
<input type="hidden" name="revert" value="{{if eq .CherryPickType "revert"}}true{{else}}false{{end}}">
|
||||
<div class="repo-editor-header">
|
||||
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
|
||||
{{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}}
|
||||
{{$shalink := HTMLFormat `<a class="ui primary sha label" href="%s">%s</a>` $shaurl (ShortSha .SHA)}}
|
||||
{{if eq .CherryPickType "revert"}}
|
||||
{{ctx.Locale.Tr "repo.editor.revert" $shalink}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.editor.cherry_pick" $shalink}}
|
||||
{{end}}
|
||||
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
|
||||
<div class="breadcrumb-divider">:</div>
|
||||
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
|
||||
<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$shaurl}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
|
||||
</div>
|
||||
</div>
|
||||
{{template "repo/editor/commit_form" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
74
templates/repo/editor/commit_form.tmpl
Normal file
74
templates/repo/editor/commit_form.tmpl
Normal file
@ -0,0 +1,74 @@
|
||||
<div class="commit-form-wrapper">
|
||||
{{ctx.AvatarUtils.Avatar .SignedUser 48 "commit-avatar"}}
|
||||
<div class="commit-form">
|
||||
<h3>{{- if .CanCommitToBranch.WillSign}}
|
||||
<span title="{{ctx.Locale.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span>
|
||||
{{ctx.Locale.Tr "repo.editor.commit_signed_changes"}}
|
||||
{{- else}}
|
||||
<span title="{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .CanCommitToBranch.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span>
|
||||
{{ctx.Locale.Tr "repo.editor.commit_changes"}}
|
||||
{{- end}}</h3>
|
||||
<div class="field">
|
||||
<input name="commit_summary" maxlength="100" placeholder="{{if .PageIsDelete}}{{ctx.Locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{ctx.Locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{ctx.Locale.Tr "repo.editor.patch"}}{{else}}{{ctx.Locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>
|
||||
</div>
|
||||
<div class="field">
|
||||
<textarea name="commit_message" placeholder="{{ctx.Locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="signoff" type="checkbox">
|
||||
<label>{{ctx.Locale.Tr "repo.editor.signoff_desc"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="quick-pull-choice js-quick-pull-choice">
|
||||
<div class="field">
|
||||
<div class="ui radio checkbox {{if not .CanCommitToBranch.CanCommitToBranch}}disabled{{end}}">
|
||||
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}>
|
||||
<label>
|
||||
{{svg "octicon-git-commit"}}
|
||||
{{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" .BranchName}}
|
||||
{{if not .CanCommitToBranch.CanCommitToBranch}}
|
||||
<div class="ui visible small warning message">
|
||||
{{ctx.Locale.Tr "repo.editor.no_commit_to_branch"}}
|
||||
<ul>
|
||||
{{if not .CanCommitToBranch.UserCanPush}}<li>{{ctx.Locale.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}}
|
||||
{{if and .CanCommitToBranch.RequireSigned (not .CanCommitToBranch.WillSign)}}<li>{{ctx.Locale.Tr "repo.editor.require_signed_commit"}}</li>{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
{{end}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{{if and (not .Repository.IsEmpty) (not .IsEditingFileOnly)}}
|
||||
<div class="field">
|
||||
<div class="ui radio checkbox">
|
||||
{{if .CanCreatePullRequest}}
|
||||
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{ctx.Locale.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
|
||||
{{else}}
|
||||
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
|
||||
{{end}}
|
||||
<label>
|
||||
{{svg "octicon-git-pull-request"}}
|
||||
{{if .CanCreatePullRequest}}
|
||||
{{ctx.Locale.Tr "repo.editor.create_new_branch"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.editor.create_new_branch_np"}}
|
||||
{{end}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}tw-hidden{{end}}">
|
||||
<div class="new-branch-name-input field {{if .Err_NewBranchName}}error{{end}}">
|
||||
{{svg "octicon-git-branch"}}
|
||||
<input type="text" name="new_branch_name" maxlength="100" value="{{.new_branch_name}}" class="input-contrast tw-mr-1 js-quick-pull-new-branch-name" placeholder="{{ctx.Locale.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}} title="{{ctx.Locale.Tr "repo.editor.new_branch_name"}}">
|
||||
<span class="text-muted js-quick-pull-normalization-info"></span>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<button id="commit-button" type="submit" class="ui primary button">
|
||||
{{if eq .commit_choice "commit-to-new-branch"}}{{ctx.Locale.Tr "repo.editor.propose_file_change"}}{{else}}{{ctx.Locale.Tr "repo.editor.commit_changes"}}{{end}}
|
||||
</button>
|
||||
<a class="ui button red" href="{{if .ReturnURI}}{{.ReturnURI}}{{else}}{{$.BranchLink}}/{{PathEscapeSegments .TreePath}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel"}}</a>
|
||||
</div>
|
13
templates/repo/editor/delete.tmpl
Normal file
13
templates/repo/editor/delete.tmpl
Normal file
@ -0,0 +1,13 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository file editor delete">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<form class="ui form" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="last_commit" value="{{.last_commit}}">
|
||||
{{template "repo/editor/commit_form" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
17
templates/repo/editor/diff_preview.tmpl
Normal file
17
templates/repo/editor/diff_preview.tmpl
Normal file
@ -0,0 +1,17 @@
|
||||
{{if .File}}
|
||||
<div class="diff-file-box">
|
||||
<div class="ui attached table segment">
|
||||
<div class="file-body file-code code-diff code-diff-unified unicode-escaped">
|
||||
<table>
|
||||
<tbody>
|
||||
{{template "repo/diff/section_unified" dict "file" .File "root" $}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="tw-p-6 tw-text-center">
|
||||
{{ctx.Locale.Tr "repo.editor.no_changes_to_show"}}
|
||||
</div>
|
||||
{{end}}
|
78
templates/repo/editor/edit.tmpl
Normal file
78
templates/repo/editor/edit.tmpl
Normal file
@ -0,0 +1,78 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository file editor edit">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<form class="ui edit form" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="last_commit" value="{{.last_commit}}">
|
||||
<input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}">
|
||||
<div class="repo-editor-header">
|
||||
<div class="ui breadcrumb field{{if .Err_TreePath}} error{{end}}">
|
||||
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
|
||||
{{$n := len .TreeNames}}
|
||||
{{$l := Eval $n "-" 1}}
|
||||
{{range $i, $v := .TreeNames}}
|
||||
<div class="breadcrumb-divider">/</div>
|
||||
{{if eq $i $l}}
|
||||
<input id="file-name" maxlength="255" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.name_your_file"}}" data-editorconfig="{{$.EditorconfigJson}}" required autofocus>
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
|
||||
{{else}}
|
||||
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{if .ReturnURI}}{{.ReturnURI}}{{else}}{{$.BranchLink}}{{if not .IsNewFile}}/{{PathEscapeSegments .TreePath}}{{end}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
|
||||
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui top attached header">
|
||||
<div class="ui compact small menu small-menu-items repo-editor-menu">
|
||||
<a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{ctx.Locale.Tr "repo.editor.edit_file"}}{{end}}</a>
|
||||
<a class="item" data-tab="preview" data-url="{{.Repository.Link}}/markup" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL}}" data-markup-mode="file">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a>
|
||||
{{if not .IsNewFile}}
|
||||
<a class="item" data-tab="diff" hx-params="context,content" hx-vals='{"context":"{{.BranchLink}}"}' hx-include="#edit_area" hx-swap="innerHTML" hx-target=".tab[data-tab='diff']" hx-indicator=".tab[data-tab='diff']" hx-post="{{.RepoLink}}/_preview/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">{{svg "octicon-diff"}} {{ctx.Locale.Tr "repo.editor.preview_changes"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui bottom attached segment tw-p-0">
|
||||
<div class="ui active tab tw-rounded" data-tab="write">
|
||||
<textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
|
||||
data-url="{{.Repository.Link}}/markup"
|
||||
data-context="{{.RepoLink}}"
|
||||
data-previewable-extensions="{{.PreviewableExtensions}}"
|
||||
data-line-wrap-extensions="{{.LineWrapExtensions}}">{{.FileContent}}</textarea>
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
<div class="ui tab markup tw-px-4 tw-py-3" data-tab="preview">
|
||||
{{ctx.Locale.Tr "loading"}}
|
||||
</div>
|
||||
<div class="ui tab diff edit-diff" data-tab="diff">
|
||||
<div class="tw-p-16"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "repo/editor/commit_form" .}}
|
||||
</form>
|
||||
</div>
|
||||
<div class="ui g-modal-confirm modal" id="edit-empty-content-modal">
|
||||
<div class="header">
|
||||
{{svg "octicon-file"}}
|
||||
{{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}}
|
||||
</div>
|
||||
<div class="center content">
|
||||
<p>{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="ui cancel button">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.editor.cancel"}}
|
||||
</button>
|
||||
<button class="ui primary ok button">
|
||||
{{svg "fontawesome-save"}}
|
||||
{{ctx.Locale.Tr "repo.editor.commit_changes"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
57
templates/repo/editor/patch.tmpl
Normal file
57
templates/repo/editor/patch.tmpl
Normal file
@ -0,0 +1,57 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository file editor edit">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<form class="ui edit form" method="post" action="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="last_commit" value="{{.last_commit}}">
|
||||
<input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}">
|
||||
<div class="repo-editor-header">
|
||||
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
|
||||
{{ctx.Locale.Tr "repo.editor.patching"}}
|
||||
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
|
||||
<div class="breadcrumb-divider">:</div>
|
||||
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
|
||||
<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
|
||||
<input type="hidden" name="tree_path" value="__dummy_for_EditRepoFileForm.TreePath(Required)__">
|
||||
<input id="file-name" type="hidden" value="diff.patch">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui compact small menu small-menu-items repo-editor-menu">
|
||||
<a class="active item" data-tab="write">{{svg "octicon-code" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.editor.new_patch"}}</a>
|
||||
</div>
|
||||
<div class="ui active tab segment tw-rounded tw-p-0" data-tab="write">
|
||||
<textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-patch"
|
||||
data-context="{{.RepoLink}}"
|
||||
data-line-wrap-extensions="{{.LineWrapExtensions}}">
|
||||
{{.FileContent}}</textarea>
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "repo/editor/commit_form" .}}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="ui g-modal-confirm modal" id="edit-empty-content-modal">
|
||||
<div class="header">
|
||||
{{svg "octicon-file"}}
|
||||
{{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}}
|
||||
</div>
|
||||
<div class="center content">
|
||||
<p>{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="ui cancel button">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.editor.cancel"}}
|
||||
</button>
|
||||
<button class="ui primary ok button">
|
||||
{{svg "fontawesome-save"}}
|
||||
{{ctx.Locale.Tr "repo.editor.commit_changes"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
33
templates/repo/editor/upload.tmpl
Normal file
33
templates/repo/editor/upload.tmpl
Normal file
@ -0,0 +1,33 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository file editor upload">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<form class="ui comment form" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="repo-editor-header">
|
||||
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
|
||||
<a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
|
||||
{{$n := len .TreeNames}}
|
||||
{{$l := Eval $n "-" 1}}
|
||||
{{range $i, $v := .TreeNames}}
|
||||
<div class="breadcrumb-divider">/</div>
|
||||
{{if eq $i $l}}
|
||||
<input type="text" id="file-name" maxlength="255" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.add_subdir"}}" autofocus>
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
|
||||
{{else}}
|
||||
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{.TreePath | PathEscapeSegments}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
|
||||
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
{{template "repo/upload" .}}
|
||||
</div>
|
||||
{{template "repo/editor/commit_form" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
Reference in New Issue
Block a user