diff options
author | Anthony Wang | 2023-03-04 00:03:38 +0000 |
---|---|---|
committer | Anthony Wang | 2023-03-04 00:03:38 +0000 |
commit | b4640101f3c8938ed689743606a79601201141ca (patch) | |
tree | 8469fc5ef817560db646837b41417d50e2f8ebfc /templates | |
parent | dc20c2832871f6462990751ea802e14b02bf41b0 (diff) | |
parent | 8540fc45b11eff9a73753ca139f8ea5c38509bf5 (diff) |
Merge remote-tracking branch 'origin/main' into forgejo-federation
Diffstat (limited to 'templates')
42 files changed, 178 insertions, 135 deletions
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index 36d335f32..d64ee188a 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -117,7 +117,7 @@ <input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if $cfg.GroupsEnabled}}checked{{end}}> </div> </div> - <div id="ldap-group-options" class="ui segment secondary" {{if not $cfg.GroupsEnabled}}hidden{{end}}> + <div id="ldap-group-options" class="ui segment secondary {{if not $cfg.GroupsEnabled}}gt-hidden{{end}}"> <div class="field"> <label>{{.locale.Tr "admin.auths.group_search_base"}}</label> <input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="e.g. ou=group,dc=mydomain,dc=com"> diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 7d31eb4d2..5dd1f531f 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -122,7 +122,7 @@ <input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}} {{if DisableGitHooks}}disabled{{end}}> </div> </div> - <div class="inline field" {{if or (DisableImportLocal) (.DisableMigrations)}}hidden{{end}}> + <div class="inline field {{if or (DisableImportLocal) (.DisableMigrations)}}gt-hidden{{end}}"> <div class="ui checkbox"> <label><strong>{{.locale.Tr "admin.users.allow_import_local"}}</strong></label> <input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}} {{if DisableImportLocal}}disabled{{end}}> diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 059363b72..10bbf655b 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -18,9 +18,9 @@ </span> </a> {{end}} - <div class="ui icon button mobile-only" id="navbar-expand-toggle"> + <button class="ui icon button mobile-only" id="navbar-expand-toggle"> {{svg "octicon-three-bars"}} - </div> + </button> </div> </div> diff --git a/templates/org/member/members.tmpl b/templates/org/member/members.tmpl index b76cb9778..0eae60fbf 100644 --- a/templates/org/member/members.tmpl +++ b/templates/org/member/members.tmpl @@ -39,6 +39,7 @@ </div> </div> <div class="ui two wide column center"> + {{if $.IsOrganizationOwner}} <div class="meta"> {{$.locale.Tr "admin.users.2fa"}} </div> @@ -51,6 +52,7 @@ {{end}} </strong> </div> + {{end}} </div> {{end}} <div class="ui three wide column"> diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl index ab118a7e2..507173e51 100644 --- a/templates/org/team/sidebar.tmpl +++ b/templates/org/team/sidebar.tmpl @@ -58,7 +58,7 @@ </thead> <tbody> {{range $t, $unit := $.Units}} - {{if and (lt $unit.MaxPerm 2) (not $unit.Type.UnitGlobalDisabled)}} + {{if (not $unit.Type.UnitGlobalDisabled)}} <tr> <td><strong>{{$.locale.Tr $unit.NameKey}}</strong></td> <td>{{if eq ($.Team.UnitAccessMode $.Context $unit.Type) 0 -}} diff --git a/templates/package/content/cargo.tmpl b/templates/package/content/cargo.tmpl index f78647ca6..410a81d90 100644 --- a/templates/package/content/cargo.tmpl +++ b/templates/package/content/cargo.tmpl @@ -26,7 +26,7 @@ git-fetch-with-cli = true</code></pre></div> {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Readme}} <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> {{if .PackageDescriptor.Metadata.Description}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>{{end}} - {{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml .PackageDescriptor.Metadata.Readme}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}}</div>{{end}} {{end}} {{if .PackageDescriptor.Metadata.Dependencies}} diff --git a/templates/package/content/chef.tmpl b/templates/package/content/chef.tmpl index edc175f9b..d80ecdf40 100644 --- a/templates/package/content/chef.tmpl +++ b/templates/package/content/chef.tmpl @@ -20,7 +20,7 @@ <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{if .PackageDescriptor.Metadata.Description}}<p>{{.PackageDescriptor.Metadata.Description}}</p>{{end}} - {{if .PackageDescriptor.Metadata.LongDescription}}{{RenderMarkdownToHtml .PackageDescriptor.Metadata.LongDescription}}{{end}} + {{if .PackageDescriptor.Metadata.LongDescription}}{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.LongDescription}}{{end}} </div> {{end}} diff --git a/templates/package/content/npm.tmpl b/templates/package/content/npm.tmpl index ea514c526..d0c037b38 100644 --- a/templates/package/content/npm.tmpl +++ b/templates/package/content/npm.tmpl @@ -25,7 +25,7 @@ <div class="ui attached segment"> {{if .PackageDescriptor.Metadata.Readme}} <div class="markup markdown"> - {{RenderMarkdownToHtml .PackageDescriptor.Metadata.Readme}} + {{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}} </div> {{else if .PackageDescriptor.Metadata.Description}} {{.PackageDescriptor.Metadata.Description}} diff --git a/templates/package/content/pub.tmpl b/templates/package/content/pub.tmpl index e81439d4d..d5676fca5 100644 --- a/templates/package/content/pub.tmpl +++ b/templates/package/content/pub.tmpl @@ -14,6 +14,6 @@ {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Readme}} <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> {{if .PackageDescriptor.Metadata.Description}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>{{end}} - {{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml .PackageDescriptor.Metadata.Readme}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}}</div>{{end}} {{end}} {{end}} diff --git a/templates/package/content/pypi.tmpl b/templates/package/content/pypi.tmpl index 830ba9bd6..8dbed5395 100644 --- a/templates/package/content/pypi.tmpl +++ b/templates/package/content/pypi.tmpl @@ -16,9 +16,9 @@ <div class="ui attached segment"> <p>{{if .PackageDescriptor.Metadata.Summary}}{{.PackageDescriptor.Metadata.Summary}}{{end}}</p> {{if .PackageDescriptor.Metadata.LongDescription}} - {{RenderMarkdownToHtml .PackageDescriptor.Metadata.LongDescription}} + {{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.LongDescription}} {{else if .PackageDescriptor.Metadata.Description}} - {{RenderMarkdownToHtml .PackageDescriptor.Metadata.Description}} + {{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Description}} {{end}} </div> {{end}} diff --git a/templates/projects/new.tmpl b/templates/projects/new.tmpl index 19bf50369..c96f948de 100644 --- a/templates/projects/new.tmpl +++ b/templates/projects/new.tmpl @@ -31,14 +31,16 @@ </div> {{if not .PageIsEditProjects}} - <label>{{.locale.Tr "repo.projects.template.desc"}}</label> - <div class="ui selection dropdown"> - <input type="hidden" name="board_type" value="{{.type}}"> - <div class="default text">{{.locale.Tr "repo.projects.template.desc_helper"}}</div> - <div class="menu"> - {{range $element := .BoardTypes}} - <div class="item" data-id="{{$element.BoardType}}" data-value="{{$element.BoardType}}">{{$.locale.Tr $element.Translation}}</div> - {{end}} + <div class="field"> + <label>{{.locale.Tr "repo.projects.template.desc"}}</label> + <div class="ui selection dropdown"> + <input type="hidden" name="board_type" value="{{.type}}"> + <div class="default text">{{.locale.Tr "repo.projects.template.desc_helper"}}</div> + <div class="menu"> + {{range $element := .ProjectTypes}} + <div class="item" data-id="{{$element.BoardType}}" data-value="{{$element.BoardType}}">{{$.locale.Tr $element.Translation}}</div> + {{end}} + </div> </div> </div> {{end}} @@ -47,14 +49,14 @@ <div class="ui divider"></div> <div class="ui left"> {{if .PageIsEditProjects}} - <a class="ui primary basic button" href="{{.RepoLink}}/projects"> + <a class="ui cancel button" href="{{.RepoLink}}/projects"> {{.locale.Tr "repo.milestones.cancel"}} </a> - <button class="ui green button"> + <button class="ui primary button"> {{.locale.Tr "repo.projects.modify"}} </button> {{else}} - <button class="ui green button"> + <button class="ui primary button"> {{.locale.Tr "repo.projects.create"}} </button> {{end}} diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl index b25cf2526..3d0bea35d 100644 --- a/templates/projects/view.tmpl +++ b/templates/projects/view.tmpl @@ -5,21 +5,21 @@ </div> <div class="column right aligned"> {{if .CanWriteProjects}} - <a class="ui green button show-modal item" data-modal="#new-board-item">{{.locale.Tr "new_project_board"}}</a> + <a class="ui green button show-modal item" data-modal="#new-board-item">{{.locale.Tr "new_project_column"}}</a> {{end}} <div class="ui small modal new-board-modal" id="new-board-item"> <div class="header"> - {{$.locale.Tr "repo.projects.board.new"}} + {{$.locale.Tr "repo.projects.column.new"}} </div> <div class="content"> <form class="ui form"> <div class="required field"> - <label for="new_board">{{$.locale.Tr "repo.projects.board.new_title"}}</label> + <label for="new_board">{{$.locale.Tr "repo.projects.column.new_title"}}</label> <input class="new-board" id="new_board" name="title" required> </div> <div class="field color-field"> - <label for="new_board_color">{{$.locale.Tr "repo.projects.board.color"}}</label> + <label for="new_board_color">{{$.locale.Tr "repo.projects.column.color"}}</label> <div class="color picker column"> <input class="color-picker" maxlength="7" placeholder="#c320f6" id="new_board_color_picker" name="color"> <div class="column precolors"> @@ -30,7 +30,7 @@ <div class="text right actions"> <div class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</div> - <button data-url="{{$.Link}}" class="ui green button" id="new_board_submit">{{$.locale.Tr "repo.projects.board.new_submit"}}</button> + <button data-url="{{$.Link}}" class="ui primary button" id="new_board_submit">{{$.locale.Tr "repo.projects.column.new_submit"}}</button> </div> </form> </div> @@ -92,32 +92,32 @@ <div class="menu user-menu" tabindex="-1"> <a class="item show-modal button" data-modal="#edit-project-board-modal-{{.ID}}"> {{svg "octicon-pencil"}} - {{$.locale.Tr "repo.projects.board.edit"}} + {{$.locale.Tr "repo.projects.column.edit"}} </a> {{if not .Default}} <a class="item show-modal button" data-modal="#set-default-project-board-modal-{{.ID}}"> {{svg "octicon-pin"}} - {{$.locale.Tr "repo.projects.board.set_default"}} + {{$.locale.Tr "repo.projects.column.set_default"}} </a> {{end}} <a class="item show-modal button" data-modal="#delete-board-modal-{{.ID}}"> {{svg "octicon-trash"}} - {{$.locale.Tr "repo.projects.board.delete"}} + {{$.locale.Tr "repo.projects.column.delete"}} </a> <div class="ui small modal edit-project-board" id="edit-project-board-modal-{{.ID}}"> <div class="header"> - {{$.locale.Tr "repo.projects.board.edit"}} + {{$.locale.Tr "repo.projects.column.edit"}} </div> <div class="content"> <form class="ui form"> <div class="required field"> - <label for="new_board_title">{{$.locale.Tr "repo.projects.board.edit_title"}}</label> + <label for="new_board_title">{{$.locale.Tr "repo.projects.column.edit_title"}}</label> <input class="project-board-title" id="new_board_title" name="title" value="{{.Title}}" required> </div> <div class="field color-field"> - <label for="new_board_color">{{$.locale.Tr "repo.projects.board.color"}}</label> + <label for="new_board_color">{{$.locale.Tr "repo.projects.column.color"}}</label> <div class="color picker column"> <input class="color-picker" maxlength="7" placeholder="#c320f6" id="new_board_color" name="color" value="{{.Color}}"> <div class="column precolors"> @@ -128,7 +128,7 @@ <div class="text right actions"> <div class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</div> - <button data-url="{{$.Link}}/{{.ID}}" class="ui red button">{{$.locale.Tr "repo.projects.board.edit"}}</button> + <button data-url="{{$.Link}}/{{.ID}}" class="ui primary button">{{$.locale.Tr "repo.projects.column.edit"}}</button> </div> </form> </div> @@ -136,31 +136,31 @@ <div class="ui basic modal" id="set-default-project-board-modal-{{.ID}}"> <div class="ui icon header"> - {{$.locale.Tr "repo.projects.board.set_default"}} + {{$.locale.Tr "repo.projects.column.set_default"}} </div> <div class="content center"> <label> - {{$.locale.Tr "repo.projects.board.set_default_desc"}} + {{$.locale.Tr "repo.projects.column.set_default_desc"}} </label> </div> <div class="text right actions"> <div class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</div> - <button class="ui red button set-default-project-board" data-url="{{$.Link}}/{{.ID}}/default">{{$.locale.Tr "repo.projects.board.set_default"}}</button> + <button class="ui primary button set-default-project-board" data-url="{{$.Link}}/{{.ID}}/default">{{$.locale.Tr "repo.projects.column.set_default"}}</button> </div> </div> <div class="ui basic modal" id="delete-board-modal-{{.ID}}"> <div class="ui icon header"> - {{$.locale.Tr "repo.projects.board.delete"}} + {{$.locale.Tr "repo.projects.column.delete"}} </div> <div class="content center"> <label> - {{$.locale.Tr "repo.projects.board.deletion_desc"}} + {{$.locale.Tr "repo.projects.column.deletion_desc"}} </label> </div> <div class="text right actions"> <div class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</div> - <button class="ui red button delete-project-board" data-url="{{$.Link}}/{{.ID}}">{{$.locale.Tr "repo.projects.board.delete"}}</button> + <button class="ui red button delete-project-board" data-url="{{$.Link}}/{{.ID}}">{{$.locale.Tr "repo.projects.column.delete"}}</button> </div> </div> </div> @@ -238,7 +238,7 @@ {{end}} <div class="right floated"> {{range .Assignees}} - <a class="tooltip" target="_blank" href="{{.HomeLink}}" data-content="{{$.locale.Tr "repo.projects.board.assigned_to"}} {{.Name}}">{{avatar . 28 "mini gt-mr-3"}}</a> + <a class="tooltip" target="_blank" href="{{.HomeLink}}" data-content="{{$.locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{avatar . 28 "mini gt-mr-3"}}</a> {{end}} </div> </div> diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index cfa81a0f5..a093c19de 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -5,7 +5,7 @@ {{template "base/alert" .}} {{template "repo/sub_menu" .}} {{if .DefaultBranchBranch}} - <h4 class="ui top attached header"> + <h4 class="ui top attached header gt-mt-4"> {{.locale.Tr "repo.default_branch"}} </h4> diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 0ecbf2916..028fdc7e5 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -17,7 +17,7 @@ {{$class = (printf "%s%s" $class " isWarning")}} {{end}} {{end}} - <div class="ui top attached header clearing segment gt-pr commit-header {{$class}}"> + <div class="ui top attached header clearing segment gt-relative commit-header {{$class}}"> <div class="gt-df gt-mb-4 gt-fw"> <h3 class="gt-mb-0 gt-f1"><span class="commit-summary" title="{{.Commit.Summary}}">{{RenderCommitMessage $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</span>{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses "root" $}}</h3> {{if not $.PageIsWiki}} diff --git a/templates/repo/commit_statuses.tmpl b/templates/repo/commit_statuses.tmpl index 8250a8581..8858fb840 100644 --- a/templates/repo/commit_statuses.tmpl +++ b/templates/repo/commit_statuses.tmpl @@ -1,6 +1,14 @@ -{{if eq (len .Statuses) 1}}{{$status := index .Statuses 0}}{{if $status.TargetURL}}<a class="ui link commit-statuses-trigger gt-vm" href="{{$status.TargetURL}}">{{template "repo/commit_status" .Status}}</a>{{end}}{{end}} -<div class="ui commit-statuses-popup commit-statuses tippy-target"> - <div class="ui relaxed list divided"> +{{if .Statuses}} + {{if and (eq (len .Statuses) 1) .Status.TargetURL}} + <a class="gt-vm gt-tdn" data-tippy="commit-statuses" href="{{.Status.TargetURL}}"> + {{template "repo/commit_status" .Status}} + </a> + {{else}} + <span class="gt-vm" data-tippy="commit-statuses" tabindex="0"> + {{template "repo/commit_status" .Status}} + </span> + {{end}} + <div class="tippy-target ui relaxed list divided"> {{range .Statuses}} <div class="ui item singular-status gt-df"> {{template "repo/commit_status" .}} @@ -11,4 +19,4 @@ </div> {{end}} </div> -</div> +{{end}} diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 1e7982435..4e6879650 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -24,10 +24,10 @@ {{svg "octicon-diff" 16 "gt-mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}} </div> </div> - <div class="diff-detail-actions gt-df gt-ac"> + <div class="diff-detail-actions gt-df gt-ac gt-w-100"> {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}} <progress id="viewed-files-summary" class="gt-mr-2" value="{{.Diff.NumViewedFiles}}" max="{{.Diff.NumFiles}}"></progress> - <label for="viewed-files-summary" id="viewed-files-summary-label" class="gt-mr-3" data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}"> + <label for="viewed-files-summary" id="viewed-files-summary-label" class="gt-mr-3 gt-f1" data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}"> {{.locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}} </label> {{end}} diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl index 8586cd6a5..52aff10e2 100644 --- a/templates/repo/diff/new_review.tmpl +++ b/templates/repo/diff/new_review.tmpl @@ -1,11 +1,11 @@ -<div class="ui top right pointing dropdown custom" id="review-box"> - <div class="ui tiny green button btn-review gt-ml-2 gt-mr-0"> +<div id="review-box"> + <button class="ui tiny green button gt-ml-2 gt-mr-0 js-btn-review"> {{.locale.Tr "repo.diff.review"}} <span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} - </div> - <div class="menu review-box"> - <div class="ui clearing segment"> + </button> + <div class="review-box-panel gt-hidden"> + <div class="ui segment"> <form class="ui form" action="{{.Link}}/reviews/submit" method="post"> {{.CsrfTokenHtml}} <input type="hidden" name="commit_id" value="{{.AfterCommitID}}"/> diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl index 7fac7f13b..c6c48c5a8 100644 --- a/templates/repo/editor/commit_form.tmpl +++ b/templates/repo/editor/commit_form.tmpl @@ -9,7 +9,7 @@ {{.locale.Tr "repo.editor.commit_changes"}} {{- end}}</h3> <div class="field"> - <input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.locale.Tr "repo.editor.add_tmpl"}}{{else}}{{.locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus> + <input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{.locale.Tr "repo.editor.patch"}}{{else}}{{.locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus> </div> <div class="field"> <textarea name="commit_message" placeholder="{{.locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea> diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 075b859a0..2a79c51dd 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -77,7 +77,7 @@ <a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a> {{end}} {{if or .CanAddFile .CanUploadFile}} - <button class="ui basic small compact dropdown jump icon button gt-mr-2"{{if not .Repository.CanEnableEditor}} disabled{{end}}> + <button class="ui basic compact dropdown jump icon button gt-mr-2"{{if not .Repository.CanEnableEditor}} disabled{{end}}> <span class="text">{{.locale.Tr "repo.editor.add_file"}}</span> <div class="menu"> {{if .CanAddFile}} diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl index 86efa8c83..b04a3c6bb 100644 --- a/templates/repo/issue/comment_tab.tmpl +++ b/templates/repo/issue/comment_tab.tmpl @@ -2,15 +2,15 @@ <input type="hidden" name="template-file" value="{{.TemplateFile}}"> {{range .Fields}} {{if eq .Type "input"}} - {{template "repo/issue/fields/input" .}} + {{template "repo/issue/fields/input" Dict "Context" $.Context "item" .}} {{else if eq .Type "markdown"}} - {{template "repo/issue/fields/markdown" .}} + {{template "repo/issue/fields/markdown" Dict "Context" $.Context "item" .}} {{else if eq .Type "textarea"}} - {{template "repo/issue/fields/textarea" .}} + {{template "repo/issue/fields/textarea" Dict "Context" $.Context "item" .}} {{else if eq .Type "dropdown"}} - {{template "repo/issue/fields/dropdown" .}} + {{template "repo/issue/fields/dropdown" Dict "Context" $.Context "item" .}} {{else if eq .Type "checkboxes"}} - {{template "repo/issue/fields/checkboxes" .}} + {{template "repo/issue/fields/checkboxes" Dict "Context" $.Context "item" .}} {{end}} {{end}} {{else}} diff --git a/templates/repo/issue/fields/checkboxes.tmpl b/templates/repo/issue/fields/checkboxes.tmpl index b70334681..80835b649 100644 --- a/templates/repo/issue/fields/checkboxes.tmpl +++ b/templates/repo/issue/fields/checkboxes.tmpl @@ -1,7 +1,7 @@ <div class="field"> {{template "repo/issue/fields/header" .}} {{$field := .}} - {{range $i, $opt := .Attributes.options}} + {{range $i, $opt := .item.Attributes.options}} <div class="field"> <div class="ui checkbox"> <input type="checkbox" name="form-field-{{$field.ID}}-{{$i}}" {{if $opt.required}}readonly checked{{end}}> diff --git a/templates/repo/issue/fields/dropdown.tmpl b/templates/repo/issue/fields/dropdown.tmpl index 83c2bb4aa..9adce5602 100644 --- a/templates/repo/issue/fields/dropdown.tmpl +++ b/templates/repo/issue/fields/dropdown.tmpl @@ -1,12 +1,12 @@ <div class="field"> {{template "repo/issue/fields/header" .}} {{/* FIXME: required validation */}} - <div class="ui fluid selection dropdown {{if .Attributes.multiple}}multiple clearable{{end}}"> - <input type="hidden" name="form-field-{{.ID}}" value="0"> + <div class="ui fluid selection dropdown {{if .item.Attributes.multiple}}multiple clearable{{end}}"> + <input type="hidden" name="form-field-{{.item.ID}}" value="0"> <i class="dropdown icon"></i> <div class="default text"></div> <div class="menu"> - {{range $i, $opt := .Attributes.options}} + {{range $i, $opt := .item.Attributes.options}} <div class="item" data-value="{{$i}}">{{$opt}}</div> {{end}} </div> diff --git a/templates/repo/issue/fields/header.tmpl b/templates/repo/issue/fields/header.tmpl index fb8511b4f..6034fed5f 100644 --- a/templates/repo/issue/fields/header.tmpl +++ b/templates/repo/issue/fields/header.tmpl @@ -1,6 +1,6 @@ -{{if .Attributes.label}} - <h3>{{.Attributes.label}}{{if .Validations.required}}<label class="required"></label>{{end}}</h3> +{{if .item.Attributes.label}} + <h3>{{.item.Attributes.label}}{{if .item.Validations.required}}<label class="required"></label>{{end}}</h3> {{end}} -{{if .Attributes.description}} - <span class="help">{{RenderMarkdownToHtml .Attributes.description}}</span> +{{if .item.Attributes.description}} + <span class="help">{{RenderMarkdownToHtml .Context .item.Attributes.description}}</span> {{end}} diff --git a/templates/repo/issue/fields/input.tmpl b/templates/repo/issue/fields/input.tmpl index d73354f6d..3fc8a8651 100644 --- a/templates/repo/issue/fields/input.tmpl +++ b/templates/repo/issue/fields/input.tmpl @@ -1,4 +1,4 @@ <div class="field"> {{template "repo/issue/fields/header" .}} - <input type="{{if .Validations.is_number}}number{{else}}text{{end}}" name="form-field-{{.ID}}" placeholder="{{.Attributes.placeholder}}" value="{{.Attributes.value}}" {{if .Validations.required}}required{{end}} {{if .Validations.regex}}pattern="{{.Validations.regex}}" title="{{.Validations.regex}}"{{end}}> + <input type="{{if .item.Validations.is_number}}number{{else}}text{{end}}" name="form-field-{{.item.ID}}" placeholder="{{.item.Attributes.placeholder}}" value="{{.item.Attributes.value}}" {{if .item.Validations.required}}required{{end}} {{if .item.Validations.regex}}pattern="{{.item.Validations.regex}}" title="{{.item.Validations.regex}}"{{end}}> </div> diff --git a/templates/repo/issue/fields/markdown.tmpl b/templates/repo/issue/fields/markdown.tmpl index 823617152..fd5b6afd2 100644 --- a/templates/repo/issue/fields/markdown.tmpl +++ b/templates/repo/issue/fields/markdown.tmpl @@ -1,3 +1,3 @@ <div class="field"> - <div>{{RenderMarkdownToHtml .Attributes.value}}</div> + <div>{{RenderMarkdownToHtml .Context .item.Attributes.value}}</div> </div> diff --git a/templates/repo/issue/fields/textarea.tmpl b/templates/repo/issue/fields/textarea.tmpl index 5ad82e246..4b390fc9d 100644 --- a/templates/repo/issue/fields/textarea.tmpl +++ b/templates/repo/issue/fields/textarea.tmpl @@ -2,5 +2,5 @@ {{template "repo/issue/fields/header" .}} {{/* FIXME: preview markdown result */}} {{/* FIXME: required validation for markdown editor */}} - <textarea name="form-field-{{.ID}}" placeholder="{{.Attributes.placeholder}}" class="edit_area {{if .Attributes.render}}no-easymde{{end}}" {{if and .Validations.required .Attributes.render}}required{{end}}>{{.Attributes.value}}</textarea> + <textarea name="form-field-{{.item.ID}}" placeholder="{{.item.Attributes.placeholder}}" class="edit_area {{if .item.Attributes.render}}no-easymde{{end}}" {{if and .item.Validations.required .item.Attributes.render}}required{{end}}>{{.item.Attributes.value}}</textarea> </div> diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 2b1bea822..23a8a1d0e 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -171,10 +171,11 @@ <a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.all_issues"}}</a> <a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a> <a class="{{if eq .ViewType "created_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.created_by_you"}}</a> - <a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.mentioning_you"}}</a> {{if .PageIsPullList}} <a class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.review_requested"}}</a> + <a class="{{if eq .ViewType "reviewed_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=reviewed_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.reviewed_by_you"}}</a> {{end}} + <a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.mentioning_you"}}</a> </div> </div> {{end}} diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index fca959744..d73fb56fb 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -111,8 +111,9 @@ <a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.all_issues"}}</a> <a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a> <a class="{{if eq .ViewType "created_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.created_by_you"}}</a> - <a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.mentioning_you"}}</a> <a class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.review_requested"}}</a> + <a class="{{if eq .ViewType "reviewed_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=reviewed_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.reviewed_by_you"}}</a> + <a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.mentioning_you"}}</a> </div> </div> {{end}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 887dd2c42..08ba50904 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -27,7 +27,7 @@ </a> {{end}} <div class="content comment-container"> - <div class="ui top attached header comment-header gt-df gt-ac gt-sb"> + <div class="ui top attached header comment-header gt-df gt-ac gt-sb" role="heading" aria-level="3"> <div class="comment-header-left gt-df gt-ac"> {{if .Issue.OriginalAuthor}} <span class="text black gt-bold"> @@ -69,7 +69,7 @@ {{end}} </div> </div> - <div class="ui attached segment comment-body"> + <div class="ui attached segment comment-body" role="article"> <div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission $.IsIssuePoster}}data-can-edit="true"{{end}}> {{if .Issue.RenderedContent}} {{.Issue.RenderedContent|Str2html}} @@ -85,7 +85,7 @@ </div> {{$reactions := .Issue.Reactions.GroupByType}} {{if $reactions}} - <div class="ui attached segment reactions"> + <div class="ui attached segment reactions" role="note"> {{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions}} </div> {{end}} diff --git a/templates/repo/issue/view_content/add_reaction.tmpl b/templates/repo/issue/view_content/add_reaction.tmpl index 9bd9022d2..bfa8a7e12 100644 --- a/templates/repo/issue/view_content/add_reaction.tmpl +++ b/templates/repo/issue/view_content/add_reaction.tmpl @@ -7,7 +7,7 @@ <div class="header">{{.ctx.locale.Tr "repo.pick_reaction"}}</div> <div class="divider"></div> {{range $value := AllowedReactions}} - <div class="item reaction tooltip" data-content="{{$value}}">{{ReactionToEmoji $value}}</div> + <a class="item reaction tooltip" data-content="{{$value}}">{{ReactionToEmoji $value}}</a> {{end}} </div> </div> diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index b81c3c7f0..94b46bd9f 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -22,7 +22,7 @@ </a> {{end}} <div class="content comment-container"> - <div class="ui top attached header comment-header gt-df gt-ac gt-sb"> + <div class="ui top attached header comment-header gt-df gt-ac gt-sb" role="heading" aria-level="3"> <div class="comment-header-left gt-df gt-ac"> {{if .OriginalAuthor}} <span class="text black gt-bold gt-mr-2"> @@ -69,7 +69,7 @@ {{end}} </div> </div> - <div class="ui attached segment comment-body"> + <div class="ui attached segment comment-body" role="article"> <div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission (and $.IsSigned (eq $.SignedUserID .PosterID))}}data-can-edit="true"{{end}}> {{if .RenderedContent}} {{.RenderedContent|Str2html}} @@ -85,7 +85,7 @@ </div> {{$reactions := .Reactions.GroupByType}} {{if $reactions}} - <div class="ui attached segment reactions"> + <div class="ui attached segment reactions" role="note"> {{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} </div> {{end}} @@ -399,7 +399,7 @@ {{end}} </span> </div> - {{if .Content}} + {{if or .Content .Attachments}} <div class="timeline-item comment" id="{{.HashTag}}"> <div class="content comment-container"> <div class="ui top attached header comment-header gt-df gt-ac gt-sb"> @@ -437,7 +437,7 @@ {{end}} {{if not $.Repository.IsArchived}} {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}} - {{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} + {{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" false "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} {{end}} </div> </div> diff --git a/templates/repo/issue/view_content/context_menu.tmpl b/templates/repo/issue/view_content/context_menu.tmpl index b96fd86af..b4b9403b2 100644 --- a/templates/repo/issue/view_content/context_menu.tmpl +++ b/templates/repo/issue/view_content/context_menu.tmpl @@ -10,16 +10,16 @@ {{else}} {{$referenceUrl = Printf "%s/files#%s" .ctx.Issue.Link .item.HashTag}} {{end}} - <div class="item context" data-clipboard-text-type="url" data-clipboard-text="{{AppSubUrl}}{{$referenceUrl}}">{{.ctx.locale.Tr "repo.issues.context.copy_link"}}</div> - <div class="item context quote-reply {{if .diff}}quote-reply-diff{{end}}" data-target="{{.item.HashTag}}-raw">{{.ctx.locale.Tr "repo.issues.context.quote_reply"}}</div> + <a class="item context" data-clipboard-text-type="url" data-clipboard-text="{{AppSubUrl}}{{$referenceUrl}}">{{.ctx.locale.Tr "repo.issues.context.copy_link"}}</a> + <a class="item context quote-reply {{if .diff}}quote-reply-diff{{end}}" data-target="{{.item.HashTag}}-raw">{{.ctx.locale.Tr "repo.issues.context.quote_reply"}}</a> {{if not .ctx.UnitIssuesGlobalDisabled}} - <div class="item context reference-issue" data-target="{{.item.HashTag}}-raw" data-modal="#reference-issue-modal" data-poster="{{.item.Poster.GetDisplayName}}" data-poster-username="{{.item.Poster.Name}}" data-reference="{{$referenceUrl}}">{{.ctx.locale.Tr "repo.issues.context.reference_issue"}}</div> + <a class="item context reference-issue" data-target="{{.item.HashTag}}-raw" data-modal="#reference-issue-modal" data-poster="{{.item.Poster.GetDisplayName}}" data-poster-username="{{.item.Poster.Name}}" data-reference="{{$referenceUrl}}">{{.ctx.locale.Tr "repo.issues.context.reference_issue"}}</a> {{end}} {{if or .ctx.Permission.IsAdmin .IsCommentPoster .ctx.HasIssuesOrPullsWritePermission}} <div class="divider"></div> - <div class="item context edit-content">{{.ctx.locale.Tr "repo.issues.context.edit"}}</div> + <a class="item context edit-content">{{.ctx.locale.Tr "repo.issues.context.edit"}}</a> {{if .delete}} - <div class="item context delete-comment" data-comment-id={{.item.HashTag}} data-url="{{.ctx.RepoLink}}/comments/{{.item.ID}}/delete" data-locale="{{.ctx.locale.Tr "repo.issues.delete_comment_confirm"}}">{{.ctx.locale.Tr "repo.issues.context.delete"}}</div> + <a class="item context delete-comment" data-comment-id={{.item.HashTag}} data-url="{{.ctx.RepoLink}}/comments/{{.item.ID}}/delete" data-locale="{{.ctx.locale.Tr "repo.issues.delete_comment_confirm"}}">{{.ctx.locale.Tr "repo.issues.context.delete"}}</a> {{end}} {{end}} </div> diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index cbcc163df..f0bf23c9e 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -129,6 +129,7 @@ <div class="content"> {{template "repo/pulls/status" .}} {{$canAutoMerge := false}} + {{$showGeneralMergeForm := false}} <div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}}"> {{if .Issue.PullRequest.HasMerged}} <div class="item text"> @@ -320,6 +321,7 @@ 'textAutoMergeCancelSchedule': {{$.locale.Tr "repo.pulls.auto_merge_cancel_schedule"}}, 'textClearMergeMessage': {{$.locale.Tr "repo.pulls.clear_merge_message"}}, 'textClearMergeMessageHint': {{$.locale.Tr "repo.pulls.clear_merge_message_hint"}}, + 'textMergeCommitId': {{$.locale.Tr "repo.pulls.merge_commit_id"}}, 'canMergeNow': {{$canMergeNow}}, 'allOverridableChecksOk': {{not $notAllOverridableChecksOk}}, @@ -379,6 +381,7 @@ window.config.pageData.pullRequestMergeForm = mergeForm; </script> + {{$showGeneralMergeForm = true}} <div id="pull-request-merge-form"></div> {{else}} {{/* no merge style was set in repo setting: not or ($prUnit.PullRequestsConfig.AllowMerge ...) */}} @@ -452,30 +455,21 @@ {{$.locale.Tr "repo.pulls.cannot_auto_merge_helper"}} </div> {{end}} - {{end}} + {{end}}{{/* end if: pull request status */}} - {{if $.StillCanManualMerge}} + {{if and $.StillCanManualMerge (not $showGeneralMergeForm)}} <div class="ui divider"></div> - <div class="ui form manually-merged-fields gt-hidden"> + <div class="ui form"> <form action="{{.Link}}/merge" method="post"> {{.CsrfTokenHtml}} <div class="field"> - <input type="text" name="merge_commit_id" placeholder="{{$.locale.Tr "repo.pulls.merge_commit_id"}}"> + <input type="text" name="merge_commit_id" placeholder="{{$.locale.Tr "repo.pulls.merge_commit_id"}}"> </div> <button class="ui red button" type="submit" name="do" value="manually-merged"> {{$.locale.Tr "repo.pulls.merge_manually"}} </button> - <button class="ui button merge-cancel"> - {{$.locale.Tr "cancel"}} - </button> </form> </div> - - <div class="ui red buttons merge-button"> - <button class="ui button" data-do="manually-merged"> - {{$.locale.Tr "repo.pulls.merge_manually"}} - </button> - </div> {{end}} {{if and .ShowMergeInstructions .Issue.PullRequest.HeadRepo}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 2b24825b5..d9c506243 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -121,7 +121,7 @@ <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_labels"}}"> </div> {{end}} - <div class="no-select item">{{.locale.Tr "repo.issues.new.clear_labels"}}</div> + <a class="no-select item" href="#">{{.locale.Tr "repo.issues.new.clear_labels"}}</a> {{if or .Labels .OrgLabels}} {{$previousExclusiveScope := "_no_scope"}} {{range .Labels}} diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index b43253f90..f0ac1e021 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -61,7 +61,7 @@ {{$.locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}} </span> {{end}} - <span id="pull-desc-edit gt-hidden"> + <span id="pull-desc-edit" class="gt-hidden"> <div class="ui floating filter dropdown"> <div class="ui basic small button"> <span class="text">{{.locale.Tr "repo.pulls.compare_compare"}}: {{$.HeadTarget}}</span> diff --git a/templates/repo/projects/new.tmpl b/templates/repo/projects/new.tmpl index c90fa4369..b65601c15 100644 --- a/templates/repo/projects/new.tmpl +++ b/templates/repo/projects/new.tmpl @@ -71,14 +71,14 @@ <div class="ui divider"></div> <div class="ui left"> {{if .PageIsEditProjects}} - <a class="ui primary basic button" href="{{.RepoLink}}/projects"> + <a class="ui cancel button" href="{{.RepoLink}}/projects"> {{.locale.Tr "repo.milestones.cancel"}} </a> - <button class="ui green button"> + <button class="ui primary button"> {{.locale.Tr "repo.projects.modify"}} </button> {{else}} - <button class="ui green button"> + <button class="ui primary button"> {{.locale.Tr "repo.projects.create"}} </button> {{end}} diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl index a4ada8735..1450fdac1 100644 --- a/templates/repo/projects/view.tmpl +++ b/templates/repo/projects/view.tmpl @@ -9,21 +9,21 @@ <div class="column right aligned"> {{if and .CanWriteProjects (not .Repository.IsArchived)}} <a class="ui green button show-modal item" href="{{$.RepoLink}}/issues/new/choose?project={{$.Project.ID}}">{{.locale.Tr "repo.issues.new"}}</a> - <a class="ui green button show-modal item" data-modal="#new-board-item">{{.locale.Tr "new_project_board"}}</a> + <a class="ui green button show-modal item" data-modal="#new-board-item">{{.locale.Tr "new_project_column"}}</a> {{end}} <div class="ui small modal new-board-modal" id="new-board-item"> <div class="header"> - {{$.locale.Tr "repo.projects.board.new"}} + {{$.locale.Tr "repo.projects.column.new"}} </div> <div class="content"> <form class="ui form"> <div class="required field"> - <label for="new_board">{{$.locale.Tr "repo.projects.board.new_title"}}</label> + <label for="new_board">{{$.locale.Tr "repo.projects.column.new_title"}}</label> <input class="new-board" id="new_board" name="title" required> </div> <div class="field color-field"> - <label for="new_board_color">{{$.locale.Tr "repo.projects.board.color"}}</label> + <label for="new_board_color">{{$.locale.Tr "repo.projects.column.color"}}</label> <div class="color picker column"> <input class="color-picker" maxlength="7" placeholder="#c320f6" id="new_board_color_picker" name="color"> <div class="column precolors"> @@ -34,7 +34,7 @@ <div class="text right actions"> <div class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</div> - <button data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}" class="ui green button" id="new_board_submit">{{$.locale.Tr "repo.projects.board.new_submit"}}</button> + <button data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}" class="ui primary button" id="new_board_submit">{{$.locale.Tr "repo.projects.column.new_submit"}}</button> </div> </form> </div> @@ -96,32 +96,32 @@ <div class="menu user-menu" tabindex="-1"> <a class="item show-modal button" data-modal="#edit-project-board-modal-{{.ID}}"> {{svg "octicon-pencil"}} - {{$.locale.Tr "repo.projects.board.edit"}} + {{$.locale.Tr "repo.projects.column.edit"}} </a> {{if not .Default}} <a class="item show-modal button" data-modal="#set-default-project-board-modal-{{.ID}}"> {{svg "octicon-pin"}} - {{$.locale.Tr "repo.projects.board.set_default"}} + {{$.locale.Tr "repo.projects.column.set_default"}} </a> {{end}} <a class="item show-modal button" data-modal="#delete-board-modal-{{.ID}}"> {{svg "octicon-trash"}} - {{$.locale.Tr "repo.projects.board.delete"}} + {{$.locale.Tr "repo.projects.column.delete"}} </a> <div class="ui small modal edit-project-board" id="edit-project-board-modal-{{.ID}}"> <div class="header"> - {{$.locale.Tr "repo.projects.board.edit"}} + {{$.locale.Tr "repo.projects.column.edit"}} </div> <div class="content"> <form class="ui form"> <div class="required field"> - <label for="new_board_title">{{$.locale.Tr "repo.projects.board.edit_title"}}</label> + <label for="new_board_title">{{$.locale.Tr "repo.projects.column.edit_title"}}</label> <input class="project-board-title" id="new_board_title" name="title" value="{{.Title}}" required> </div> <div class="field color-field"> - <label for="new_board_color">{{$.locale.Tr "repo.projects.board.color"}}</label> + <label for="new_board_color">{{$.locale.Tr "repo.projects.column.color"}}</label> <div class="color picker column"> <input class="color-picker" maxlength="7" placeholder="#c320f6" id="new_board_color" name="color" value="{{.Color}}"> <div class="column precolors"> @@ -132,7 +132,7 @@ <div class="text right actions"> <div class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</div> - <button data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}" class="ui red button">{{$.locale.Tr "repo.projects.board.edit"}}</button> + <button data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}" class="ui primary button">{{$.locale.Tr "repo.projects.column.edit"}}</button> </div> </form> </div> @@ -140,31 +140,31 @@ <div class="ui basic modal" id="set-default-project-board-modal-{{.ID}}"> <div class="ui icon header"> - {{$.locale.Tr "repo.projects.board.set_default"}} + {{$.locale.Tr "repo.projects.column.set_default"}} </div> <div class="content center"> <label> - {{$.locale.Tr "repo.projects.board.set_default_desc"}} + {{$.locale.Tr "repo.projects.column.set_default_desc"}} </label> </div> <div class="text right actions"> <div class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</div> - <button class="ui red button set-default-project-board" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}/default">{{$.locale.Tr "repo.projects.board.set_default"}}</button> + <button class="ui primary button set-default-project-board" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}/default">{{$.locale.Tr "repo.projects.column.set_default"}}</button> </div> </div> <div class="ui basic modal" id="delete-board-modal-{{.ID}}"> <div class="ui icon header"> - {{$.locale.Tr "repo.projects.board.delete"}} + {{$.locale.Tr "repo.projects.column.delete"}} </div> <div class="content center"> <label> - {{$.locale.Tr "repo.projects.board.deletion_desc"}} + {{$.locale.Tr "repo.projects.column.deletion_desc"}} </label> </div> <div class="text right actions"> <div class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</div> - <button class="ui red button delete-project-board" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}">{{$.locale.Tr "repo.projects.board.delete"}}</button> + <button class="ui red button delete-project-board" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}">{{$.locale.Tr "repo.projects.column.delete"}}</button> </div> </div> </div> @@ -249,7 +249,7 @@ {{end}} <div class="right floated"> {{range .Assignees}} - <a class="tooltip" target="_blank" href="{{.HomeLink}}" data-content="{{$.locale.Tr "repo.projects.board.assigned_to"}} {{.Name}}">{{avatar $.Context . 28 "mini gt-mr-3"}}</a> + <a class="tooltip" target="_blank" href="{{.HomeLink}}" data-content="{{$.locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{avatar $.Context . 28 "mini gt-mr-3"}}</a> {{end}} </div> </div> diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 6fcf60dae..9540c872c 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -8,14 +8,14 @@ {{if .LatestCommitUser}} {{avatar $.Context .LatestCommitUser 24}} {{if .LatestCommitUser.FullName}} - <a class="muted" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a> + <a class="muted author-wrapper" title="{{.LatestCommitUser.FullName}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a> {{else}} - <a class="muted" href="{{.LatestCommitUser.HomeLink}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a> + <a class="muted author-wrapper" title="{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a> {{end}} {{else}} {{if .LatestCommit.Author}} {{avatarByEmail $.Context .LatestCommit.Author.Email .LatestCommit.Author.Name 24}} - <strong>{{.LatestCommit.Author.Name}}</strong> + <span class="author-wrapper" title="{{.LatestCommit.Author.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></span> {{end}} {{end}} <a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified}} isVerified{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}Untrusted{{else}}Unmatched{{end}}{{else if .LatestCommitVerification.Warning}} isWarning{{end}}{{end}}" href="{{.RepoLink}}/commit/{{PathEscape .LatestCommit.ID.String}}"> diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index dbdec9d33..d1c0a6f18 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -2666,6 +2666,12 @@ "in": "query" }, { + "type": "boolean", + "description": "filter pulls reviewed by you, default is false", + "name": "reviewed", + "in": "query" + }, + { "type": "string", "description": "filter by owner", "name": "owner", @@ -14383,14 +14389,13 @@ "parameters": [ { "type": "string", - "x-go-name": "Name", "description": "username of user", "name": "username", "in": "path", "required": true }, { - "name": "userCreateToken", + "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateAccessTokenOption" @@ -14493,6 +14498,13 @@ "type": "string", "x-go-name": "Name" }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Scopes" + }, "sha1": { "type": "string", "x-go-name": "Token" @@ -15224,10 +15236,20 @@ "CreateAccessTokenOption": { "description": "CreateAccessTokenOption options when create access token", "type": "object", + "required": [ + "name" + ], "properties": { "name": { "type": "string", "x-go-name": "Name" + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Scopes" } }, "x-go-package": "code.gitea.io/gitea/modules/structs" diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 3f156249f..75a76db57 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -124,3 +124,5 @@ <div class="ui divider"></div> </div> {{end}} + +{{template "base/paginate" .}} diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index 049b6a168..29023d921 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -17,16 +17,20 @@ {{.locale.Tr "repo.issues.filter_type.created_by_you"}} <strong class="ui right">{{CountFmt .IssueStats.CreateCount}}</strong> </a> - <a class="{{if eq .ViewType "mentioned"}}ui basic primary button{{end}} item" href="{{.Link}}?type=mentioned&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}"> - {{.locale.Tr "repo.issues.filter_type.mentioning_you"}} - <strong class="ui right">{{CountFmt .IssueStats.MentionCount}}</strong> - </a> {{if .PageIsPulls}} <a class="{{if eq .ViewType "review_requested"}}ui basic primary button{{end}} item" href="{{.Link}}?type=review_requested&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}"> {{.locale.Tr "repo.issues.filter_type.review_requested"}} <strong class="ui right">{{CountFmt .IssueStats.ReviewRequestedCount}}</strong> </a> + <a class="{{if eq .ViewType "reviewed_by"}}ui basic primary button{{end}} item" href="{{.Link}}?type=reviewed_by&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}"> + {{.locale.Tr "repo.issues.filter_type.reviewed_by_you"}} + <strong class="ui right">{{CountFmt .IssueStats.ReviewedCount}}</strong> + </a> {{end}} + <a class="{{if eq .ViewType "mentioned"}}ui basic primary button{{end}} item" href="{{.Link}}?type=mentioned&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}"> + {{.locale.Tr "repo.issues.filter_type.mentioning_you"}} + <strong class="ui right">{{CountFmt .IssueStats.MentionCount}}</strong> + </a> <div class="ui divider"></div> <a class="{{if not $.RepoIDs}}ui basic primary button{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&q={{$.Keyword}}"> <span class="text truncate">All</span> diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl index 439ed5e14..ef9ac9a97 100644 --- a/templates/user/settings/applications.tmpl +++ b/templates/user/settings/applications.tmpl @@ -21,7 +21,14 @@ </div> <i class="icon tooltip{{if .HasRecentActivity}} green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.token_state_desc"}}"{{end}}>{{svg "fontawesome-send" 36}}</i> <div class="content"> - <strong>{{.Name}}</strong> + <details><summary><strong>{{.Name}}</strong></summary> + <p class="gt-my-2">{{$.locale.Tr "settings.scopes_list"}}</p> + <ul class="gt-my-2"> + {{range .Scope.StringSlice}} + <li>{{.}}</li> + {{end}} + </ul> + </details> <div class="activity meta"> <i>{{$.locale.Tr "settings.add_on"}} <span><time data-format="short-date" datetime="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</time></span> — {{svg "octicon-info"}} {{if .HasUsed}}{{$.locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}><time data-format="short-date" datetime="{{.UpdatedUnix.FormatLong}}">{{.UpdatedUnix.FormatShort}}</time></span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}}</i> </div> |