diff options
author | Adam Strzelecki <ono@java.pl> | 2015-12-07 23:30:52 +0100 |
---|---|---|
committer | Adam Strzelecki <ono@java.pl> | 2015-12-08 00:57:46 +0100 |
commit | da2585c11e11023ffa7a8c69d21c6fecac520a8e (patch) | |
tree | 1c2a575dfc00e0e78f47c497a6d9347b3edeca9a /templates/repo/issue | |
parent | dd8a06a397e26c46639eba1313102560dfa49c95 (diff) | |
download | gitea-da2585c11e11023ffa7a8c69d21c6fecac520a8e.tar.gz gitea-da2585c11e11023ffa7a8c69d21c6fecac520a8e.zip |
Indent all templates with tabs
This commit improves templates readability, since all of them use consistent
indent with all template command blocks indented too.
1. Indents both HTML containers such as <div>, <p> and Go HTML template blocks
such as {{if}} {{with}}
2. Cleans all trailing white-space
3. Adds trailing last line-break to each file
Diffstat (limited to 'templates/repo/issue')
-rw-r--r-- | templates/repo/issue/comment_tab.tmpl | 26 | ||||
-rw-r--r-- | templates/repo/issue/label_precolors.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/labels.tmpl | 126 | ||||
-rw-r--r-- | templates/repo/issue/list.tmpl | 164 | ||||
-rw-r--r-- | templates/repo/issue/milestone_new.tmpl | 88 | ||||
-rw-r--r-- | templates/repo/issue/milestones.tmpl | 180 | ||||
-rw-r--r-- | templates/repo/issue/navbar.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/issue/new.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/new_form.tmpl | 118 | ||||
-rw-r--r-- | templates/repo/issue/view.tmpl | 18 | ||||
-rw-r--r-- | templates/repo/issue/view_content.tmpl | 508 | ||||
-rw-r--r-- | templates/repo/issue/view_title.tmpl | 52 |
12 files changed, 644 insertions, 646 deletions
diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl index a3f80edfb5..8f6c8ca778 100644 --- a/templates/repo/issue/comment_tab.tmpl +++ b/templates/repo/issue/comment_tab.tmpl @@ -1,16 +1,16 @@ <div class="field"> - <div class="ui top attached tabular menu" data-write="write" data-preview="preview"> - <a class="active item" data-tab="write">{{.i18n.Tr "repo.release.write"}}</a> - <a class="item" data-tab="preview" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}">{{.i18n.Tr "repo.release.preview"}}</a> - </div> - <div class="ui bottom attached active tab segment" data-tab="write"> - <textarea id="content" name="content" tabindex="4"></textarea> - </div> - <div class="ui bottom attached tab segment markdown" data-tab="preview"> - {{.i18n.Tr "repo.release.loading"}} - </div> + <div class="ui top attached tabular menu" data-write="write" data-preview="preview"> + <a class="active item" data-tab="write">{{.i18n.Tr "repo.release.write"}}</a> + <a class="item" data-tab="preview" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}">{{.i18n.Tr "repo.release.preview"}}</a> + </div> + <div class="ui bottom attached active tab segment" data-tab="write"> + <textarea id="content" name="content" tabindex="4"></textarea> + </div> + <div class="ui bottom attached tab segment markdown" data-tab="preview"> + {{.i18n.Tr "repo.release.loading"}} + </div> </div> {{if .IsAttachmentEnabled}} -<div class="attachments"></div> -<div class="ui basic button dropzone" id="dropzone" data-upload-url="{{AppSubUrl}}/issues/attachments" data-accepts="{{.AttachmentAllowedTypes}}" data-max-file="{{.AttachmentMaxFiles}}" data-max-size="{{.AttachmentMaxSize}}" data-default-message="{{.i18n.Tr "dropzone.default_message"}}" data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}" data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}" data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}"></div> -{{end}}
\ No newline at end of file + <div class="attachments"></div> + <div class="ui basic button dropzone" id="dropzone" data-upload-url="{{AppSubUrl}}/issues/attachments" data-accepts="{{.AttachmentAllowedTypes}}" data-max-file="{{.AttachmentMaxFiles}}" data-max-size="{{.AttachmentMaxSize}}" data-default-message="{{.i18n.Tr "dropzone.default_message"}}" data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}" data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}" data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}"></div> +{{end}} diff --git a/templates/repo/issue/label_precolors.tmpl b/templates/repo/issue/label_precolors.tmpl index 378281b303..d0e165068d 100644 --- a/templates/repo/issue/label_precolors.tmpl +++ b/templates/repo/issue/label_precolors.tmpl @@ -13,4 +13,4 @@ <a class="color" style="background-color:#bfdadc" data-color-hex="#bfdadc"></a> <a class="color" style="background-color:#c7def8" data-color-hex="#c7def8"></a> <a class="color" style="background-color:#bfd4f2" data-color-hex="#bfd4f2"></a> -<a class="color" style="background-color:#d4c5f9" data-color-hex="#d4c5f9"></a>
\ No newline at end of file +<a class="color" style="background-color:#d4c5f9" data-color-hex="#d4c5f9"></a> diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl index dd84ce416c..d7f758ae65 100644 --- a/templates/repo/issue/labels.tmpl +++ b/templates/repo/issue/labels.tmpl @@ -5,9 +5,9 @@ <div class="navbar"> {{template "repo/issue/navbar" .}} {{if .IsRepositoryAdmin}} - <div class="ui right"> - <div class="ui green new-label button">{{.i18n.Tr "repo.issues.new_label"}}</div> - </div> + <div class="ui right"> + <div class="ui green new-label button">{{.i18n.Tr "repo.issues.new_label"}}</div> + </div> {{end}} </div> <div class="ui new-label segment hide"> @@ -16,11 +16,11 @@ <div class="ui grid"> <div class="five wide column"> <div class="ui small input"> - <input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required> + <input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required> </div> </div> <div class="color picker column"> - <input class="color-picker" name="color" value="#70c24a" required> + <input class="color-picker" name="color" value="#70c24a" required> </div> <div class="column precolors"> {{template "repo/issue/label_precolors"}} @@ -38,72 +38,72 @@ <div class="label list"> {{range .Labels}} - <li class="item"> - <div class="ui label" style="background-color: {{.Color}}"><i class="octicon octicon-tag"></i> {{.Name}}</div> - {{if $.IsRepositoryAdmin}} - <a class="ui right delete-button" href="#" data-url="{{$.RepoLink}}/labels/delete" data-id="{{.ID}}"><i class="octicon octicon-trashcan"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a> - <a class="ui right edit-label-button" href="#" data-id={{.ID}} data-title={{.Name}} data-color={{.Color}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a> - {{end}} - <a class="ui right open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a> - </li> + <li class="item"> + <div class="ui label" style="background-color: {{.Color}}"><i class="octicon octicon-tag"></i> {{.Name}}</div> + {{if $.IsRepositoryAdmin}} + <a class="ui right delete-button" href="#" data-url="{{$.RepoLink}}/labels/delete" data-id="{{.ID}}"><i class="octicon octicon-trashcan"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a> + <a class="ui right edit-label-button" href="#" data-id={{.ID}} data-title={{.Name}} data-color={{.Color}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a> + {{end}} + <a class="ui right open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a> + </li> {{end}} </div> </div> </div> {{if .IsRepositoryAdmin}} -<div class="ui small basic delete modal"> - <div class="ui icon header"> - <i class="trash icon"></i> - {{.i18n.Tr "repo.issues.label_deletion"}} - </div> - <div class="content"> - <p>{{.i18n.Tr "repo.issues.label_deletion_desc"}}</p> - </div> - <div class="actions"> - <div class="ui red basic inverted cancel button"> - <i class="remove icon"></i> - {{.i18n.Tr "modal.no"}} - </div> - <div class="ui green basic inverted ok button"> - <i class="checkmark icon"></i> - {{.i18n.Tr "modal.yes"}} - </div> - </div> -</div> + <div class="ui small basic delete modal"> + <div class="ui icon header"> + <i class="trash icon"></i> + {{.i18n.Tr "repo.issues.label_deletion"}} + </div> + <div class="content"> + <p>{{.i18n.Tr "repo.issues.label_deletion_desc"}}</p> + </div> + <div class="actions"> + <div class="ui red basic inverted cancel button"> + <i class="remove icon"></i> + {{.i18n.Tr "modal.no"}} + </div> + <div class="ui green basic inverted ok button"> + <i class="checkmark icon"></i> + {{.i18n.Tr "modal.yes"}} + </div> + </div> + </div> -<div class="ui small edit-label modal"> - <div class="header"> - {{.i18n.Tr "repo.issues.label_modify"}} - </div> - <div class="content"> - <form class="ui edit-label form" action="{{$.RepoLink}}/labels/edit" method="post"> - {{.CsrfTokenHtml}} - <input id="label-modal-id" name="id" type="hidden"> - <div class="ui grid"> - <div class="five wide column"> - <div class="ui small input"> - <input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required> + <div class="ui small edit-label modal"> + <div class="header"> + {{.i18n.Tr "repo.issues.label_modify"}} + </div> + <div class="content"> + <form class="ui edit-label form" action="{{$.RepoLink}}/labels/edit" method="post"> + {{.CsrfTokenHtml}} + <input id="label-modal-id" name="id" type="hidden"> + <div class="ui grid"> + <div class="five wide column"> + <div class="ui small input"> + <input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required> + </div> + </div> + <div class="color picker column"> + <input class="color-picker" name="color" value="#70c24a" required> + </div> + <div class="column precolors"> + {{template "repo/issue/label_precolors"}} </div> </div> - <div class="color picker column"> - <input class="color-picker" name="color" value="#70c24a" required> - </div> - <div class="column precolors"> - {{template "repo/issue/label_precolors"}} - </div> + </form> + </div> + <div class="actions"> + <div class="ui negative button"> + {{.i18n.Tr "modal.no"}} </div> - </form> - </div> - <div class="actions"> - <div class="ui negative button"> - {{.i18n.Tr "modal.no"}} - </div> - <div class="ui positive right labeled icon button"> - {{.i18n.Tr "modal.modify"}} - <i class="checkmark icon"></i> - </div> - </div> -</div> + <div class="ui positive right labeled icon button"> + {{.i18n.Tr "modal.modify"}} + <i class="checkmark icon"></i> + </div> + </div> + </div> {{end}} -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 5b1ad1d026..66bd2ae298 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -6,22 +6,22 @@ {{template "repo/issue/navbar" .}} <div class="ui right"> {{if .PageIsIssueList}} - <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a> + <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a> {{else}} - <a class="ui green button {{if not .HasForkedRepo}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName}}...{{.SignedUserName}}:{{.BranchName}}">{{.i18n.Tr "repo.pulls.new"}}</a> + <a class="ui green button {{if not .HasForkedRepo}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName}}...{{.SignedUserName}}:{{.BranchName}}">{{.i18n.Tr "repo.pulls.new"}}</a> {{end}} </div> </div> <div class="ui divider"></div> <div class="ui tiny basic status buttons"> - <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}"> - <i class="octicon octicon-issue-opened"></i> - {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}} - </a> - <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{$.Link}}?type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}"> - <i class="octicon octicon-issue-closed"></i> - {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}} - </a> + <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}"> + <i class="octicon octicon-issue-opened"></i> + {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}} + </a> + <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{$.Link}}?type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}"> + <i class="octicon octicon-issue-closed"></i> + {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}} + </a> </div> <div class="ui right floated secondary filter menu"> <!-- Label --> @@ -30,11 +30,11 @@ {{.i18n.Tr "repo.issues.filter_label"}} <i class="dropdown icon"></i> </span> - <div class="menu"> - <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a> - {{range .Labels}} - <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}"><span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a> - {{end}} + <div class="menu"> + <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a> + {{range .Labels}} + <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}"><span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a> + {{end}} </div> </div> @@ -44,11 +44,11 @@ {{.i18n.Tr "repo.issues.filter_milestone"}} <i class="dropdown icon"></i> </span> - <div class="menu"> - <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_milestone_no_select"}}</a> - {{range .Milestones}} - <a class="{{if eq $.MilestoneID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&assignee={{$.AssigneeID}}">{{.Name}}</a> - {{end}} + <div class="menu"> + <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_milestone_no_select"}}</a> + {{range .Milestones}} + <a class="{{if eq $.MilestoneID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&assignee={{$.AssigneeID}}">{{.Name}}</a> + {{end}} </div> </div> @@ -58,11 +58,11 @@ {{.i18n.Tr "repo.issues.filter_assignee"}} <i class="dropdown icon"></i> </span> - <div class="menu"> - <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a> - {{range .Assignees}} - <a class="{{if eq $.AssigneeID .Id}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{.Id}}"><img src="{{.AvatarLink}}"> {{.Name}}</a> - {{end}} + <div class="menu"> + <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a> + {{range .Assignees}} + <a class="{{if eq $.AssigneeID .Id}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{.Id}}"><img src="{{.AvatarLink}}"> {{.Name}}</a> + {{end}} </div> </div> @@ -72,11 +72,11 @@ {{.i18n.Tr "repo.issues.filter_type"}} <i class="dropdown icon"></i> </span> - <div class="menu"> - <a class="{{if eq .ViewType "all"}}active{{end}} item" href="{{$.Link}}?type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.all_issues"}}</a> - <a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{$.Link}}?type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}</a> - <a class="{{if eq .ViewType "created_by"}}active{{end}} item" href="{{$.Link}}?type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.created_by_you"}}</a> - <a class="{{if eq .ViewType "mentioned"}}active{{end}} item" href="{{$.Link}}?type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.mentioning_you"}}</a> + <div class="menu"> + <a class="{{if eq .ViewType "all"}}active{{end}} item" href="{{$.Link}}?type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.all_issues"}}</a> + <a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{$.Link}}?type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}</a> + <a class="{{if eq .ViewType "created_by"}}active{{end}} item" href="{{$.Link}}?type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.created_by_you"}}</a> + <a class="{{if eq .ViewType "mentioned"}}active{{end}} item" href="{{$.Link}}?type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.mentioning_you"}}</a> </div> </div> @@ -86,68 +86,68 @@ {{.i18n.Tr "repo.issues.filter_sort"}} <i class="dropdown icon"></i> </span> - <div class="menu"> - <a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> - <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> - <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> - <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> - <a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a> - <a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a> + <div class="menu"> + <a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> + <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> + <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> + <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> + <a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a> + <a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a> </div> </div> </div> <div class="issue list"> {{range .Issues}} - {{ $timeStr:= TimeSince .Created $.Lang }} - <li class="item"> - <div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Index}}</div> - <a class="title" href="{{$.Link}}/{{.Index}}">{{.Name}}</a> - - {{range .Labels}} - <a class="ui label" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="background-color: {{.Color}}">{{.Name}}</a> - {{end}} + {{ $timeStr:= TimeSince .Created $.Lang }} + <li class="item"> + <div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Index}}</div> + <a class="title" href="{{$.Link}}/{{.Index}}">{{.Name}}</a> - {{if .NumComments}} - <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span> - {{end}} - - <p class="desc"> - {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}} - {{if .Milestone}} - <a class="milestone" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}"> - <span class="octicon octicon-milestone"></span> {{.Milestone.Name}} - </a> - {{end}} - {{if .Assignee}} - <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center"> - <img class="ui avatar image" src="{{.Assignee.AvatarLink}}"> - </a> - {{end}} - </p> - </li> - {{end}} - - {{with .Page}} - {{if gt .TotalPages 1}} - <div class="center page buttons"> - <div class="ui borderless pagination menu"> - <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Previous}}"{{end}}> - <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}} - </a> - {{range .Pages}} - {{if eq .Num -1}} - <a class="disabled item">...</a> - {{else}} - <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Num}}"{{end}}>{{.Num}}</a> + {{range .Labels}} + <a class="ui label" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="background-color: {{.Color}}">{{.Name}}</a> {{end}} + + {{if .NumComments}} + <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span> {{end}} - <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Next}}"{{end}}> - {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i> - </a> - </div> - </div> + + <p class="desc"> + {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}} + {{if .Milestone}} + <a class="milestone" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}"> + <span class="octicon octicon-milestone"></span> {{.Milestone.Name}} + </a> + {{end}} + {{if .Assignee}} + <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center"> + <img class="ui avatar image" src="{{.Assignee.AvatarLink}}"> + </a> + {{end}} + </p> + </li> {{end}} + + {{with .Page}} + {{if gt .TotalPages 1}} + <div class="center page buttons"> + <div class="ui borderless pagination menu"> + <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Previous}}"{{end}}> + <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}} + </a> + {{range .Pages}} + {{if eq .Num -1}} + <a class="disabled item">...</a> + {{else}} + <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Num}}"{{end}}>{{.Num}}</a> + {{end}} + {{end}} + <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Next}}"{{end}}> + {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i> + </a> + </div> + </div> + {{end}} {{end}} </div> </div> diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl index 383e54dd8f..88dc806b4e 100644 --- a/templates/repo/issue/milestone_new.tmpl +++ b/templates/repo/issue/milestone_new.tmpl @@ -5,64 +5,64 @@ <div class="navbar"> {{template "repo/issue/navbar" .}} {{if and .IsRepositoryAdmin .PageIsEditMilestone}} - <div class="ui right floated secondary menu"> - <a class="ui green button" href="{{$.RepoLink}}/milestones/new">{{.i18n.Tr "repo.milestones.new"}}</a> - </div> + <div class="ui right floated secondary menu"> + <a class="ui green button" href="{{$.RepoLink}}/milestones/new">{{.i18n.Tr "repo.milestones.new"}}</a> + </div> {{end}} </div> <div class="ui divider"></div> - <h2 class="ui dividing header"> - {{if .PageIsEditMilestone}} - {{.i18n.Tr "repo.milestones.edit"}} - <div class="sub header">{{.i18n.Tr "repo.milestones.edit_subheader"}}</div> - {{else}} - {{.i18n.Tr "repo.milestones.new"}} - <div class="sub header">{{.i18n.Tr "repo.milestones.new_subheader"}}</div> - {{end}} - </h2> - {{template "base/alert" .}} - <form class="ui form grid" action="{{.Link}}" method="post"> - {{.CsrfTokenHtml}} - <div class="eleven wide column"> - <div class="field {{if .Err_Title}}error{{end}}"> - <label>{{.i18n.Tr "repo.milestones.title"}}</label> - <input name="title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required> - </div> - <div class="field"> - <label>{{.i18n.Tr "repo.milestones.desc"}}</label> - <textarea name="content">{{.content}}</textarea> - </div> + <h2 class="ui dividing header"> + {{if .PageIsEditMilestone}} + {{.i18n.Tr "repo.milestones.edit"}} + <div class="sub header">{{.i18n.Tr "repo.milestones.edit_subheader"}}</div> + {{else}} + {{.i18n.Tr "repo.milestones.new"}} + <div class="sub header">{{.i18n.Tr "repo.milestones.new_subheader"}}</div> + {{end}} + </h2> + {{template "base/alert" .}} + <form class="ui form grid" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <div class="eleven wide column"> + <div class="field {{if .Err_Title}}error{{end}}"> + <label>{{.i18n.Tr "repo.milestones.title"}}</label> + <input name="title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required> + </div> + <div class="field"> + <label>{{.i18n.Tr "repo.milestones.desc"}}</label> + <textarea name="content">{{.content}}</textarea> </div> - <div class="four wide column"> - <div class="field {{if .Err_Deadline}}error{{end}}"> - <label> - {{.i18n.Tr "repo.milestones.due_date"}} - <a id="clear-date" href="#">{{.i18n.Tr "repo.milestones.clear"}}</a> - </label> - <input id="deadline" name="deadline" value="{{.deadline}}"> - </div> - <div class="field"> - <input class="milestone datepicker" data-lang="{{.DateLang}}" data-start-date="{{.deadline}}"> - </div> + </div> + <div class="four wide column"> + <div class="field {{if .Err_Deadline}}error{{end}}"> + <label> + {{.i18n.Tr "repo.milestones.due_date"}} + <a id="clear-date" href="#">{{.i18n.Tr "repo.milestones.clear"}}</a> + </label> + <input id="deadline" name="deadline" value="{{.deadline}}"> + </div> + <div class="field"> + <input class="milestone datepicker" data-lang="{{.DateLang}}" data-start-date="{{.deadline}}"> </div> - <div class="ui container"> - <div class="ui divider"></div> - <div class="ui right"> - {{if .PageIsEditMilestone}} + </div> + <div class="ui container"> + <div class="ui divider"></div> + <div class="ui right"> + {{if .PageIsEditMilestone}} <a class="ui blue basic button" href="{{.RepoLink}}/milestones"> {{.i18n.Tr "repo.milestones.cancel"}} </a> <button class="ui green button"> {{.i18n.Tr "repo.milestones.modify"}} </button> - {{else}} + {{else}} <button class="ui green button"> {{.i18n.Tr "repo.milestones.create"}} </button> - {{end}} - </div> + {{end}} </div> - </form> + </div> + </form> </div> </div> -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index 248b81e242..fe247d80c0 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -5,113 +5,113 @@ <div class="navbar"> {{template "repo/issue/navbar" .}} {{if .IsRepositoryAdmin}} - <div class="ui right"> - <a class="ui green button" href="{{$.Link}}/new">{{.i18n.Tr "repo.milestones.new"}}</a> - </div> + <div class="ui right"> + <a class="ui green button" href="{{$.Link}}/new">{{.i18n.Tr "repo.milestones.new"}}</a> + </div> {{end}} </div> <div class="ui divider"></div> {{template "base/alert" .}} <div class="ui tiny basic buttons"> - <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{.RepoLink}}/milestones?state=open"> - <i class="octicon octicon-milestone"></i> - {{.i18n.Tr "repo.milestones.open_tab" .OpenCount}} - </a> - <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{.RepoLink}}/milestones?state=closed"> - <i class="octicon octicon-milestone"></i> - {{.i18n.Tr "repo.milestones.close_tab" .ClosedCount}} - </a> + <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{.RepoLink}}/milestones?state=open"> + <i class="octicon octicon-milestone"></i> + {{.i18n.Tr "repo.milestones.open_tab" .OpenCount}} + </a> + <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{.RepoLink}}/milestones?state=closed"> + <i class="octicon octicon-milestone"></i> + {{.i18n.Tr "repo.milestones.close_tab" .ClosedCount}} + </a> </div> - + <div class="milestone list"> {{range .Milestones}} - <li class="item"> - <i class="octicon octicon-milestone"></i> <a href="{{$.RepoLink}}/issues?state={{$.State}}&milestone={{.ID}}">{{.Name}}</a> - <div class="ui right green progress" data-percent="{{.Completeness}}"> - <div class="bar" {{if not .Completeness}}style="background-color: transparent"{{end}}> - <div class="progress"></div> - </div> - </div> - <div class="meta"> - {{ $closedDate:= TimeSince .ClosedDate $.Lang }} - {{if .IsClosed}} - <span class="octicon octicon-clock"></span> {{$.i18n.Tr "repo.milestones.closed" $closedDate|Str2html}} - {{else}} - <span class="octicon octicon-calendar"></span> - {{if .DeadlineString}} - <span {{if .IsOverDue}}class="overdue"{{end}}>{{.DeadlineString}}</span> + <li class="item"> + <i class="octicon octicon-milestone"></i> <a href="{{$.RepoLink}}/issues?state={{$.State}}&milestone={{.ID}}">{{.Name}}</a> + <div class="ui right green progress" data-percent="{{.Completeness}}"> + <div class="bar" {{if not .Completeness}}style="background-color: transparent"{{end}}> + <div class="progress"></div> + </div> + </div> + <div class="meta"> + {{ $closedDate:= TimeSince .ClosedDate $.Lang }} + {{if .IsClosed}} + <span class="octicon octicon-clock"></span> {{$.i18n.Tr "repo.milestones.closed" $closedDate|Str2html}} {{else}} - {{$.i18n.Tr "repo.milestones.no_due_date"}} + <span class="octicon octicon-calendar"></span> + {{if .DeadlineString}} + <span {{if .IsOverDue}}class="overdue"{{end}}>{{.DeadlineString}}</span> + {{else}} + {{$.i18n.Tr "repo.milestones.no_due_date"}} + {{end}} + {{end}} + <span class="issue-stats"> + <i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.open_tab" .NumOpenIssues}} + <i class="octicon octicon-issue-closed"></i> {{$.i18n.Tr "repo.issues.close_tab" .NumClosedIssues}} + </span> + </div> + {{if $.IsRepositoryAdmin}} + <div class="ui right operate"> + <a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a> + {{if .IsClosed}} + <a href="{{$.Link}}/{{.ID}}/open" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-check"></i> {{$.i18n.Tr "repo.milestones.open"}}</a> + {{else}} + <a href="{{$.Link}}/{{.ID}}/close" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-x"></i> {{$.i18n.Tr "repo.milestones.close"}}</a> + {{end}} + <a class="delete-button" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}"><i class="octicon octicon-trashcan"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a> + </div> + {{if .Content}} + <div class="content"> + {{.RenderedContent|Str2html}} + </div> {{end}} {{end}} - <span class="issue-stats"> - <i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.open_tab" .NumOpenIssues}} - <i class="octicon octicon-issue-closed"></i> {{$.i18n.Tr "repo.issues.close_tab" .NumClosedIssues}} - </span> - </div> - {{if $.IsRepositoryAdmin}} - <div class="ui right operate"> - <a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a> - {{if .IsClosed}} - <a href="{{$.Link}}/{{.ID}}/open" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-check"></i> {{$.i18n.Tr "repo.milestones.open"}}</a> - {{else}} - <a href="{{$.Link}}/{{.ID}}/close" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-x"></i> {{$.i18n.Tr "repo.milestones.close"}}</a> - {{end}} - <a class="delete-button" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}"><i class="octicon octicon-trashcan"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a> - </div> - {{if .Content}} - <div class="content"> - {{.RenderedContent|Str2html}} - </div> - {{end}} - {{end}} - </li> + </li> {{end}} - + {{with .Page}} - {{if gt .TotalPages 1}} - <div class="center page buttons"> - <div class="ui borderless pagination menu"> - <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?state={{$.State}}&page={{.Previous}}"{{end}}> - <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}} - </a> - {{range .Pages}} - {{if eq .Num -1}} - <a class="disabled item">...</a> - {{else}} - <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?state={{$.State}}&page={{.Num}}"{{end}}>{{.Num}}</a> - {{end}} - {{end}} - <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?state={{$.State}}&page={{.Next}}"{{end}}> - {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i> - </a> - </div> - </div> - {{end}} + {{if gt .TotalPages 1}} + <div class="center page buttons"> + <div class="ui borderless pagination menu"> + <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?state={{$.State}}&page={{.Previous}}"{{end}}> + <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}} + </a> + {{range .Pages}} + {{if eq .Num -1}} + <a class="disabled item">...</a> + {{else}} + <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?state={{$.State}}&page={{.Num}}"{{end}}>{{.Num}}</a> + {{end}} + {{end}} + <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?state={{$.State}}&page={{.Next}}"{{end}}> + {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i> + </a> + </div> + </div> + {{end}} {{end}} </div> </div> </div> {{if .IsRepositoryAdmin}} -<div class="ui small basic delete modal"> - <div class="ui icon header"> - <i class="trash icon"></i> - {{.i18n.Tr "repo.milestones.deletion"}} - </div> - <div class="content"> - <p>{{.i18n.Tr "repo.milestones.deletion_desc"}}</p> - </div> - <div class="actions"> - <div class="ui red basic inverted cancel button"> - <i class="remove icon"></i> - {{.i18n.Tr "modal.no"}} - </div> - <div class="ui green basic inverted ok button"> - <i class="checkmark icon"></i> - {{.i18n.Tr "modal.yes"}} - </div> - </div> -</div> + <div class="ui small basic delete modal"> + <div class="ui icon header"> + <i class="trash icon"></i> + {{.i18n.Tr "repo.milestones.deletion"}} + </div> + <div class="content"> + <p>{{.i18n.Tr "repo.milestones.deletion_desc"}}</p> + </div> + <div class="actions"> + <div class="ui red basic inverted cancel button"> + <i class="remove icon"></i> + {{.i18n.Tr "modal.no"}} + </div> + <div class="ui green basic inverted ok button"> + <i class="checkmark icon"></i> + {{.i18n.Tr "modal.yes"}} + </div> + </div> + </div> {{end}} -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/repo/issue/navbar.tmpl b/templates/repo/issue/navbar.tmpl index 3f76947c16..a3e9d2660d 100644 --- a/templates/repo/issue/navbar.tmpl +++ b/templates/repo/issue/navbar.tmpl @@ -1,4 +1,4 @@ <div class="ui compact small menu"> - <a class="{{if .PageIsLabels}}active{{end}} item" href="{{.RepoLink}}/labels">{{.i18n.Tr "repo.labels"}}</a> - <a class="{{if .PageIsMilestones}}active{{end}} item" href="{{.RepoLink}}/milestones">{{.i18n.Tr "repo.milestones"}}</a> -</div>
\ No newline at end of file + <a class="{{if .PageIsLabels}}active{{end}} item" href="{{.RepoLink}}/labels">{{.i18n.Tr "repo.labels"}}</a> + <a class="{{if .PageIsMilestones}}active{{end}} item" href="{{.RepoLink}}/milestones">{{.i18n.Tr "repo.milestones"}}</a> +</div> diff --git a/templates/repo/issue/new.tmpl b/templates/repo/issue/new.tmpl index bb45c3b743..3c6bc05b10 100644 --- a/templates/repo/issue/new.tmpl +++ b/templates/repo/issue/new.tmpl @@ -9,4 +9,4 @@ {{template "repo/issue/new_form" .}} </div> </div> -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index 8576d7db8d..c023643eb9 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -1,32 +1,32 @@ <form class="ui comment form grid" action="{{.Link}}" method="post"> - {{.CsrfTokenHtml}} - {{if .Flash}} - <div class="sixteen wide column"> - {{template "base/alert" .}} - </div> - {{end}} - <div class="twelve wide column"> + {{.CsrfTokenHtml}} + {{if .Flash}} + <div class="sixteen wide column"> + {{template "base/alert" .}} + </div> + {{end}} + <div class="twelve wide column"> <div class="ui comments"> - <div class="comment"> - <a class="avatar" href="{{.SignedUser.HomeLink}}"> - <img src="{{.SignedUser.AvatarLink}}"> - </a> - <div class="ui segment content"> - <div class="field"> - <input name="title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" tabindex="3" autofocus required> - </div> + <div class="comment"> + <a class="avatar" href="{{.SignedUser.HomeLink}}"> + <img src="{{.SignedUser.AvatarLink}}"> + </a> + <div class="ui segment content"> + <div class="field"> + <input name="title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" tabindex="3" autofocus required> + </div> {{template "repo/issue/comment_tab" .}} - <div class="text right"> + <div class="text right"> <button class="ui green button"> {{if .PageIsComparePull}} - {{.i18n.Tr "repo.pulls.create"}} + {{.i18n.Tr "repo.pulls.create"}} {{else}} - {{.i18n.Tr "repo.issues.create"}} + {{.i18n.Tr "repo.issues.create"}} {{end}} </button> - </div> - </div> - </div> + </div> + </div> + </div> </div> </div> @@ -38,18 +38,18 @@ <strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong> <span class="octicon octicon-gear"></span> </span> - <div class="filter menu" data-id="#label_ids"> - <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div> - {{range .Labels}} - <a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a> - {{end}} + <div class="filter menu" data-id="#label_ids"> + <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div> + {{range .Labels}} + <a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a> + {{end}} </div> </div> <div class="ui labels list"> <span class="no-select item {{if .HasSelectedLabel}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_label"}}</span> - {{range .Labels}} - <a class="{{if not .IsChecked}}hide{{end}} item" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name}}</span></a> - {{end}} + {{range .Labels}} + <a class="{{if not .IsChecked}}hide{{end}} item" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name}}</span></a> + {{end}} </div> <div class="ui divider"></div> @@ -60,35 +60,35 @@ <strong>{{.i18n.Tr "repo.issues.new.milestone"}}</strong> <span class="octicon octicon-gear"></span> </span> - <div class="menu"> - <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_milestone"}}</div> - {{if .OpenMilestones}} - <div class="divider"></div> - <div class="header"> - <i class="octicon octicon-milestone"></i> - {{.i18n.Tr "repo.issues.new.open_milestone"}} - </div> - {{range .OpenMilestones}} - <div class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</div> - {{end}} - {{end}} - {{if .ClosedMilestones}} - <div class="divider"></div> - <div class="header"> - <i class="octicon octicon-milestone"></i> - {{.i18n.Tr "repo.issues.new.closed_milestone"}} - </div> - {{range .ClosedMilestones}} - <a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</a> - {{end}} - {{end}} + <div class="menu"> + <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_milestone"}}</div> + {{if .OpenMilestones}} + <div class="divider"></div> + <div class="header"> + <i class="octicon octicon-milestone"></i> + {{.i18n.Tr "repo.issues.new.open_milestone"}} + </div> + {{range .OpenMilestones}} + <div class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</div> + {{end}} + {{end}} + {{if .ClosedMilestones}} + <div class="divider"></div> + <div class="header"> + <i class="octicon octicon-milestone"></i> + {{.i18n.Tr "repo.issues.new.closed_milestone"}} + </div> + {{range .ClosedMilestones}} + <a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</a> + {{end}} + {{end}} </div> </div> <div class="ui select-milestone list"> <span class="no-select item {{if .Milestone}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_milestone"}}</span> <div class="selected"> {{if .Milestone}} - <a class="item" href="{{.RepoLink}}/issues?milestone={{.Milestone.ID}}"> {{.Milestone.Name}}</a> + <a class="item" href="{{.RepoLink}}/issues?milestone={{.Milestone.ID}}"> {{.Milestone.Name}}</a> {{end}} </div> </div> @@ -101,21 +101,21 @@ <strong>{{.i18n.Tr "repo.issues.new.assignee"}}</strong> <span class="octicon octicon-gear"></span> </span> - <div class="menu"> - <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignee"}}</div> - {{range .Assignees}} - <div class="item" data-id="{{.Id}}" data-href="{{$.RepoLink}}/issues?assignee={{.Id}}" data-avatar="{{.AvatarLink}}"><img src="{{.AvatarLink}}"> {{.Name}}</div> - {{end}} + <div class="menu"> + <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignee"}}</div> + {{range .Assignees}} + <div class="item" data-id="{{.Id}}" data-href="{{$.RepoLink}}/issues?assignee={{.Id}}" data-avatar="{{.AvatarLink}}"><img src="{{.AvatarLink}}"> {{.Name}}</div> + {{end}} </div> </div> <div class="ui select-assignee list"> <span class="no-select item {{if .Assignee}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_assignee"}}</span> <div class="selected"> {{if .Assignee}} - <a class="item" href="{{.RepoLink}}/issues?assignee={{.Assignee.Id}}"><img class="ui avatar image" src="{{.Assignee.AvatarLink}}"> {{.Assignee.Name}}</a> + <a class="item" href="{{.RepoLink}}/issues?assignee={{.Assignee.Id}}"><img class="ui avatar image" src="{{.Assignee.AvatarLink}}"> {{.Assignee.Name}}</a> {{end}} </div> </div> </div> </div> -</form>
\ No newline at end of file +</form> diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl index 506e4e3f04..1f25f1535b 100644 --- a/templates/repo/issue/view.tmpl +++ b/templates/repo/issue/view.tmpl @@ -6,22 +6,22 @@ {{template "repo/issue/navbar" .}} <div class="ui right"> {{if .PageIsIssueList}} - <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a> + <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a> {{else}} - <a class="ui green button {{if not .HasForkedRepo}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName}}...{{.SignedUserName}}:{{.BranchName}}">{{.i18n.Tr "repo.pulls.new"}}</a> + <a class="ui green button {{if not .HasForkedRepo}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName}}...{{.SignedUserName}}:{{.BranchName}}">{{.i18n.Tr "repo.pulls.new"}}</a> {{end}} </div> </div> <div class="ui divider"></div> {{if .Issue.IsPull}} - {{template "repo/issue/view_title" .}} - {{template "repo/pulls/tab_menu" .}} - <div class="ui bottom attached tab pull segment active" data-tab="request-{{.ID}}"> - {{template "repo/issue/view_content" .}} - </div> + {{template "repo/issue/view_title" .}} + {{template "repo/pulls/tab_menu" .}} + <div class="ui bottom attached tab pull segment active" data-tab="request-{{.ID}}"> + {{template "repo/issue/view_content" .}} + </div> {{else}} - {{template "repo/issue/view_content" .}} + {{template "repo/issue/view_content" .}} {{end}} </div> </div> -{{template "base/footer" .}}
\ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 0f4a6d07ed..c641d7a8ff 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -1,234 +1,232 @@ <div class="ui grid"> {{if .Flash}} - <div class="sixteen wide column"> - {{template "base/alert" .}} - </div> - {{end}} - {{if not .Issue.IsPull}} - {{template "repo/issue/view_title" .}} - {{end}} - - {{ $createdStr:= TimeSince .Issue.Created $.Lang }} + <div class="sixteen wide column"> + {{template "base/alert" .}} + </div> + {{end}} + {{if not .Issue.IsPull}} + {{template "repo/issue/view_title" .}} + {{end}} + + {{ $createdStr:= TimeSince .Issue.Created $.Lang }} <div class="twelve wide column comment-list"> - <ui class="ui comments"> - <div class="comment"> - <a class="avatar" {{if gt .Issue.Poster.Id 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}> - <img src="{{.Issue.Poster.AvatarLink}}"> - </a> - <div class="content"> + <ui class="ui comments"> + <div class="comment"> + <a class="avatar" {{if gt .Issue.Poster.Id 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}> + <img src="{{.Issue.Poster.AvatarLink}}"> + </a> + <div class="content"> <div class="ui top attached header"> <span class="text grey"><a {{if gt .Issue.Poster.Id 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span> - <div class="ui right actions"> - {{if .IsIssueOwner}} - <a class="edit-content item" href="#"><i class="octicon octicon-pencil"></i></a> - {{end}} - </div> + <div class="ui right actions"> + {{if .IsIssueOwner}} + <a class="edit-content item" href="#"><i class="octicon octicon-pencil"></i></a> + {{end}} + </div> </div> - <div class="ui attached segment"> - <div class="render-content markdown emojify"> - {{if .Issue.RenderedContent}} - {{.Issue.RenderedContent|Str2html}} - {{else}} - <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span> - {{end}} - </div> - <div class="raw-content hide">{{.Issue.Content}}</div> - <div class="edit-content-zone hide" data-write="issue-{{.Issue.ID}}-write" data-preview="issue-{{.Issue.ID}}-preview" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/content" data-context="{{.RepoLink}}"></div> - </div> - {{if .Issue.Attachments}} - <div class="ui bottom attached segment"> - <div class="ui small images"> - {{range .Issue.Attachments}} - <a target="_blank" href="{{AppSubUrl}}/attachments/{{.UUID}}"><img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}"></a> - {{end}} + <div class="ui attached segment"> + <div class="render-content markdown emojify"> + {{if .Issue.RenderedContent}} + {{.Issue.RenderedContent|Str2html}} + {{else}} + <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span> + {{end}} </div> + <div class="raw-content hide">{{.Issue.Content}}</div> + <div class="edit-content-zone hide" data-write="issue-{{.Issue.ID}}-write" data-preview="issue-{{.Issue.ID}}-preview" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/content" data-context="{{.RepoLink}}"></div> </div> - {{end}} - </div> - </div> + {{if .Issue.Attachments}} + <div class="ui bottom attached segment"> + <div class="ui small images"> + {{range .Issue.Attachments}} + <a target="_blank" href="{{AppSubUrl}}/attachments/{{.UUID}}"><img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}"></a> + {{end}} + </div> + </div> + {{end}} + </div> + </div> - {{range .Issue.Comments}} - {{ $createdStr:= TimeSince .Created $.Lang }} + {{range .Issue.Comments}} + {{ $createdStr:= TimeSince .Created $.Lang }} - <!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF, 5 = COMMENT_REF, 6 = PULL_REF --> - {{if eq .Type 0}} - <div class="comment"> - <a class="avatar" {{if gt .Poster.Id 0}}href="{{.Poster.HomeLink}}"{{end}}> - <img src="{{.Poster.AvatarLink}}"> - </a> - <div class="content"> - <div class="ui top attached header"> - <span class="text grey"><a {{if gt .Poster.Id 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span> - <div class="ui right actions"> - {{if gt .ShowTag 0}} - <div class="item tag"> - {{if eq .ShowTag 1}} - {{$.i18n.Tr "repo.issues.poster"}} - {{else if eq .ShowTag 2}} - {{$.i18n.Tr "repo.issues.admin"}} - {{else if eq .ShowTag 3}} - {{$.i18n.Tr "repo.issues.owner"}} - {{end}} - </div> - {{end}} - {{if or $.IsRepositoryAdmin (eq .Poster.Id $.SignedUserID)}} - <a class="edit-content item" href="#"><i class="octicon octicon-pencil"></i></a> - {{end}} - </div> + <!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF, 5 = COMMENT_REF, 6 = PULL_REF --> + {{if eq .Type 0}} + <div class="comment"> + <a class="avatar" {{if gt .Poster.Id 0}}href="{{.Poster.HomeLink}}"{{end}}> + <img src="{{.Poster.AvatarLink}}"> + </a> + <div class="content"> + <div class="ui top attached header"> + <span class="text grey"><a {{if gt .Poster.Id 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span> + <div class="ui right actions"> + {{if gt .ShowTag 0}} + <div class="item tag"> + {{if eq .ShowTag 1}} + {{$.i18n.Tr "repo.issues.poster"}} + {{else if eq .ShowTag 2}} + {{$.i18n.Tr "repo.issues.admin"}} + {{else if eq .ShowTag 3}} + {{$.i18n.Tr "repo.issues.owner"}} + {{end}} + </div> + {{end}} + {{if or $.IsRepositoryAdmin (eq .Poster.Id $.SignedUserID)}} + <a class="edit-content item" href="#"><i class="octicon octicon-pencil"></i></a> + {{end}} + </div> + </div> + <div class="ui attached segment"> + <div class="render-content markdown emojify"> + {{if .RenderedContent}} + {{.RenderedContent|Str2html}} + {{else}} + <span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span> + {{end}} + </div> + <div class="raw-content hide">{{.Content}}</div> + <div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}"></div> + </div> + {{if .Attachments}} + <div class="ui bottom attached segment"> + <div class="ui small images"> + {{range .Attachments}} + <a target="_blank" href="{{AppSubUrl}}/attachments/{{.UUID}}"><img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}"></a> + {{end}} + </div> + </div> + {{end}} + </div> + </div> + {{else if eq .Type 1}} + <div class="event"> + <span class="octicon octicon-primitive-dot"></span> + <a class="ui avatar image" href="{{.Poster.HomeLink}}"> + <img src="{{.Poster.AvatarLink}}"> + </a> + <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}</span> + </div> + {{else if eq .Type 2}} + <div class="event"> + <span class="octicon octicon-circle-slash"></span> + <a class="ui avatar image" href="{{.Poster.HomeLink}}"> + <img src="{{.Poster.AvatarLink}}"> + </a> + <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}</span> </div> - <div class="ui attached segment"> - <div class="render-content markdown emojify"> - {{if .RenderedContent}} - {{.RenderedContent|Str2html}} - {{else}} - <span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span> - {{end}} - </div> - <div class="raw-content hide">{{.Content}}</div> - <div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}"></div> - </div> - {{if .Attachments}} - <div class="ui bottom attached segment"> - <div class="ui small images"> - {{range .Attachments}} - <a target="_blank" href="{{AppSubUrl}}/attachments/{{.UUID}}"><img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}"></a> - {{end}} + {{else if eq .Type 4}} + <div class="event"> + <span class="octicon octicon-bookmark"></span> + <a class="ui avatar image" href="{{.Poster.HomeLink}}"> + <img src="{{.Poster.AvatarLink}}"> + </a> + <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}</span> + + <div class="detail"> + <span class="octicon octicon-git-commit"></span> + <span class="text grey">{{.Content | Str2html}}</span> </div> </div> - {{end}} - </div> - </div> - {{else if eq .Type 1}} - <div class="event"> - <span class="octicon octicon-primitive-dot"></span> - <a class="ui avatar image" href="{{.Poster.HomeLink}}"> - <img src="{{.Poster.AvatarLink}}"> - </a> - <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}</span> - </div> - {{else if eq .Type 2}} - <div class="event"> - <span class="octicon octicon-circle-slash"></span> - <a class="ui avatar image" href="{{.Poster.HomeLink}}"> - <img src="{{.Poster.AvatarLink}}"> - </a> - <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}</span> - </div> - {{else if eq .Type 4}} - <div class="event"> - <span class="octicon octicon-bookmark"></span> - <a class="ui avatar image" href="{{.Poster.HomeLink}}"> - <img src="{{.Poster.AvatarLink}}"> - </a> - <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}</span> + {{end}} - <div class="detail"> - <span class="octicon octicon-git-commit"></span> - <span class="text grey">{{.Content | Str2html}}</span> - </div> - </div> {{end}} - {{end}} - - {{if .Issue.IsPull}} - <div class="comment merge box"> - <a class="avatar text - {{if .Issue.HasMerged}}purple - {{else if .Issue.IsClosed}}grey - {{else if .IsPullReuqestBroken}}red - {{else if .Issue.IsChecking}}yellow - {{else if .Issue.CanAutoMerge}}green - {{else}}red{{end}}"> - <span class="mega-octicon octicon-git-merge"></span> - </a> - <div class="content"> - <div class="ui merge segment"> - {{if .Issue.HasMerged}} - <div class="item text purple"> - {{$.i18n.Tr "repo.pulls.has_merged"}} - </div> - {{else if .Issue.IsClosed}} - <div class="item text grey"> - {{$.i18n.Tr "repo.pulls.reopen_to_merge"}} - </div> - {{else if .IsPullReuqestBroken}} - <div class="item text red"> - <span class="octicon octicon-x"></span> - {{$.i18n.Tr "repo.pulls.data_broken"}} - </div> - {{else if .Issue.IsChecking}} - <div class="item text yellow"> - <span class="octicon octicon-sync"></span> - {{$.i18n.Tr "repo.pulls.is_checking"}} - </div> - {{else if .Issue.CanAutoMerge}} - <div class="item text green"> - <span class="octicon octicon-check"></span> - {{$.i18n.Tr "repo.pulls.can_auto_merge_desc"}} - </div> - {{if .IsRepositoryAdmin}} - <div class="ui divider"></div> - <div> - <form class="ui form" action="{{.Link}}/merge" method="post"> - {{.CsrfTokenHtml}} - <button class="ui green button"> - <span class="octicon octicon-git-merge"></span> {{$.i18n.Tr "repo.pulls.merge_pull_request"}} - </button> - </form> - </div> - {{end}} - {{else}} - <div class="item text red"> - <span class="octicon octicon-x"></span> - {{$.i18n.Tr "repo.pulls.cannot_auto_merge_desc"}} - </div> - <div class="item text grey"> - <span class="octicon octicon-info"></span> - {{$.i18n.Tr "repo.pulls.cannot_auto_merge_helper"}} - </div> - {{end}} - </div> - </div> - </div> - {{end}} - - {{if .IsSigned}} - <div class="comment form"> - <a class="avatar" href="{{.SignedUser.HomeLink}}"> - <img src="{{.SignedUser.AvatarLink}}"> - </a> - <div class="content"> - <form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post"> - {{template "repo/issue/comment_tab" .}} - {{.CsrfTokenHtml}} - <input id="status" name="status" type="hidden"> - <div class="text right"> - {{if and .IsIssueOwner (not .DisableStatusChange)}} - {{if .Issue.IsClosed}} - <div id="status-button" class="ui green basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.reopen_comment_issue"}}" data-status-val="reopen"> - {{.i18n.Tr "repo.issues.reopen_issue"}} + {{if .Issue.IsPull}} + <div class="comment merge box"> + <a class="avatar text + {{if .Issue.HasMerged}}purple + {{else if .Issue.IsClosed}}grey + {{else if .IsPullReuqestBroken}}red + {{else if .Issue.IsChecking}}yellow + {{else if .Issue.CanAutoMerge}}green + {{else}}red{{end}}"><span class="mega-octicon octicon-git-merge"></span></a> + <div class="content"> + <div class="ui merge segment"> + {{if .Issue.HasMerged}} + <div class="item text purple"> + {{$.i18n.Tr "repo.pulls.has_merged"}} + </div> + {{else if .Issue.IsClosed}} + <div class="item text grey"> + {{$.i18n.Tr "repo.pulls.reopen_to_merge"}} </div> - {{else}} - <div id="status-button" class="ui red basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.close_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.close_comment_issue"}}" data-status-val="close"> - {{.i18n.Tr "repo.issues.close_issue"}} + {{else if .IsPullReuqestBroken}} + <div class="item text red"> + <span class="octicon octicon-x"></span> + {{$.i18n.Tr "repo.pulls.data_broken"}} </div> + {{else if .Issue.IsChecking}} + <div class="item text yellow"> + <span class="octicon octicon-sync"></span> + {{$.i18n.Tr "repo.pulls.is_checking"}} + </div> + {{else if .Issue.CanAutoMerge}} + <div class="item text green"> + <span class="octicon octicon-check"></span> + {{$.i18n.Tr "repo.pulls.can_auto_merge_desc"}} + </div> + {{if .IsRepositoryAdmin}} + <div class="ui divider"></div> + <div> + <form class="ui form" action="{{.Link}}/merge" method="post"> + {{.CsrfTokenHtml}} + <button class="ui green button"> + <span class="octicon octicon-git-merge"></span> {{$.i18n.Tr "repo.pulls.merge_pull_request"}} + </button> + </form> + </div> {{end}} + {{else}} + <div class="item text red"> + <span class="octicon octicon-x"></span> + {{$.i18n.Tr "repo.pulls.cannot_auto_merge_desc"}} + </div> + <div class="item text grey"> + <span class="octicon octicon-info"></span> + {{$.i18n.Tr "repo.pulls.cannot_auto_merge_helper"}} + </div> {{end}} - <button class="ui green button" tabindex="5"> - {{.i18n.Tr "repo.issues.create_comment"}} - </button> - </div> - </form> - </div> - </div> - {{else}} - <div class="ui warning message"> - <a href="{{AppSubUrl}}/user/sign_up" class="ui green button">{{.i18n.Tr "repo.issues.sign_up_for_free"}}</a> - {{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}} - </div> - {{end}} - </ui> + </div> + </div> + </div> + {{end}} + + {{if .IsSigned}} + <div class="comment form"> + <a class="avatar" href="{{.SignedUser.HomeLink}}"> + <img src="{{.SignedUser.AvatarLink}}"> + </a> + <div class="content"> + <form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post"> + {{template "repo/issue/comment_tab" .}} + {{.CsrfTokenHtml}} + <input id="status" name="status" type="hidden"> + <div class="text right"> + {{if and .IsIssueOwner (not .DisableStatusChange)}} + {{if .Issue.IsClosed}} + <div id="status-button" class="ui green basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.reopen_comment_issue"}}" data-status-val="reopen"> + {{.i18n.Tr "repo.issues.reopen_issue"}} + </div> + {{else}} + <div id="status-button" class="ui red basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.close_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.close_comment_issue"}}" data-status-val="close"> + {{.i18n.Tr "repo.issues.close_issue"}} + </div> + {{end}} + {{end}} + <button class="ui green button" tabindex="5"> + {{.i18n.Tr "repo.issues.create_comment"}} + </button> + </div> + </form> + </div> + </div> + {{else}} + <div class="ui warning message"> + <a href="{{AppSubUrl}}/user/sign_up" class="ui green button">{{.i18n.Tr "repo.issues.sign_up_for_free"}}</a> + {{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}} + </div> + {{end}} + </ui> </div> <div class="four wide column"> @@ -238,18 +236,18 @@ <strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong> <span class="octicon octicon-gear"></span> </span> - <div class="filter menu" data-action="update" data-update-url="{{$.RepoLink}}/issues/{{$.Issue.Index}}/label"> - <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div> - {{range .Labels}} - <a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a> - {{end}} + <div class="filter menu" data-action="update" data-update-url="{{$.RepoLink}}/issues/{{$.Issue.Index}}/label"> + <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div> + {{range .Labels}} + <a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a> + {{end}} </div> </div> <div class="ui labels list"> <span class="no-select item {{if .HasSelectedLabel}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_label"}}</span> - {{range .Labels}} - <a class="{{if not .IsChecked}}hide{{end}} item" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name}}</span></a> - {{end}} + {{range .Labels}} + <a class="{{if not .IsChecked}}hide{{end}} item" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name}}</span></a> + {{end}} </div> <div class="ui divider"></div> @@ -259,35 +257,35 @@ <strong>{{.i18n.Tr "repo.issues.new.milestone"}}</strong> <span class="octicon octicon-gear"></span> </span> - <div class="menu" data-action="update" data-update-url="{{$.RepoLink}}/issues/{{$.Issue.Index}}/milestone"> - <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_milestone"}}</div> - {{if .OpenMilestones}} - <div class="divider"></div> - <div class="header"> - <i class="octicon octicon-milestone"></i> - {{.i18n.Tr "repo.issues.new.open_milestone"}} - </div> - {{range .OpenMilestones}} - <div class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</div> - {{end}} - {{end}} - {{if .ClosedMilestones}} - <div class="divider"></div> - <div class="header"> - <i class="octicon octicon-milestone"></i> - {{.i18n.Tr "repo.issues.new.closed_milestone"}} - </div> - {{range .ClosedMilestones}} - <a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</a> - {{end}} - {{end}} + <div class="menu" data-action="update" data-update-url="{{$.RepoLink}}/issues/{{$.Issue.Index}}/milestone"> + <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_milestone"}}</div> + {{if .OpenMilestones}} + <div class="divider"></div> + <div class="header"> + <i class="octicon octicon-milestone"></i> + {{.i18n.Tr "repo.issues.new.open_milestone"}} + </div> + {{range .OpenMilestones}} + <div class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</div> + {{end}} + {{end}} + {{if .ClosedMilestones}} + <div class="divider"></div> + <div class="header"> + <i class="octicon octicon-milestone"></i> + {{.i18n.Tr "repo.issues.new.closed_milestone"}} + </div> + {{range .ClosedMilestones}} + <a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</a> + {{end}} + {{end}} </div> </div> <div class="ui select-milestone list"> <span class="no-select item {{if .Issue.Milestone}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_milestone"}}</span> <div class="selected"> {{if .Issue.Milestone}} - <a class="item" href="{{.RepoLink}}/issues?milestone={{.Issue.Milestone.ID}}"> {{.Issue.Milestone.Name}}</a> + <a class="item" href="{{.RepoLink}}/issues?milestone={{.Issue.Milestone.ID}}"> {{.Issue.Milestone.Name}}</a> {{end}} </div> </div> @@ -300,18 +298,18 @@ <strong>{{.i18n.Tr "repo.issues.new.assignee"}}</strong> <span class="octicon octicon-gear"></span> </span> - <div class="menu" data-action="update" data-update-url="{{$.RepoLink}}/issues/{{$.Issue.Index}}/assignee"> - <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignee"}}</div> - {{range .Assignees}} - <div class="item" data-id="{{.Id}}" data-href="{{$.RepoLink}}/issues?assignee={{.Id}}" data-avatar="{{.AvatarLink}}"><img src="{{.AvatarLink}}"> {{.Name}}</div> - {{end}} + <div class="menu" data-action="update" data-update-url="{{$.RepoLink}}/issues/{{$.Issue.Index}}/assignee"> + <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignee"}}</div> + {{range .Assignees}} + <div class="item" data-id="{{.Id}}" data-href="{{$.RepoLink}}/issues?assignee={{.Id}}" data-avatar="{{.AvatarLink}}"><img src="{{.AvatarLink}}"> {{.Name}}</div> + {{end}} </div> </div> <div class="ui select-assignee list"> <span class="no-select item {{if .Issue.Assignee}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_assignee"}}</span> <div class="selected"> {{if .Issue.Assignee}} - <a class="item" href="{{$.RepoLink}}/issues?assignee={{.Issue.Assignee.Id}}"><img class="ui avatar image" src="{{.Issue.Assignee.AvatarLink}}"> {{.Issue.Assignee.Name}}</a> + <a class="item" href="{{$.RepoLink}}/issues?assignee={{.Issue.Assignee.Id}}"><img class="ui avatar image" src="{{.Issue.Assignee.AvatarLink}}"> {{.Issue.Assignee.Name}}</a> {{end}} </div> </div> @@ -322,22 +320,22 @@ <div class="hide" id="edit-content-form"> <div class="ui comment form"> <div class="ui top attached tabular menu"> - <a class="active write item">{{$.i18n.Tr "repo.release.write"}}</a> - <a class="preview item" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{$.RepoLink}}">{{$.i18n.Tr "repo.release.preview"}}</a> + <a class="active write item">{{$.i18n.Tr "repo.release.write"}}</a> + <a class="preview item" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{$.RepoLink}}">{{$.i18n.Tr "repo.release.preview"}}</a> </div> <div class="ui bottom attached active write tab segment"> - <textarea tabindex="1" id="content" name="content"></textarea> + <textarea tabindex="1" id="content" name="content"></textarea> </div> <div class="ui bottom attached tab preview segment markdown emojify"> - {{$.i18n.Tr "repo.release.loading"}} + {{$.i18n.Tr "repo.release.loading"}} </div> - <div class="text right edit buttons"> + <div class="text right edit buttons"> <div class="ui basic blue cancel button" tabindex="3">{{.i18n.Tr "repo.issues.cancel"}}</div> <div class="ui green save button" tabindex="2">{{.i18n.Tr "repo.issues.save"}}</div> - </div> + </div> </div> </div> <div class="hide" id="no-content"> <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span> -</div>
\ No newline at end of file +</div> diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index ef6e4f8c1c..f8d93a0bc0 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -3,47 +3,47 @@ <h1 class="twelve wide column"> <span class="index">#{{.Issue.Index}}</span> <span id="issue-title">{{.Issue.Name}}</span> <div id="edit-title-input" class="ui input" style="display: none"> - <input value="{{.Issue.Name}}"> + <input value="{{.Issue.Name}}"> </div> </h1> {{if .IsIssueOwner}} - <div class="four wide column"> - <div class="edit-zone text right"> - <div id="edit-title" class="ui basic green not-in-edit button">{{.i18n.Tr "repo.issues.edit"}}</div> - <div id="cancel-edit-title" class="ui basic blue in-edit button" style="display: none">{{.i18n.Tr "repo.issues.cancel"}}</div> - <div id="save-edit-title" class="ui green in-edit button" style="display: none" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title">{{.i18n.Tr "repo.issues.save"}}</div> + <div class="four wide column"> + <div class="edit-zone text right"> + <div id="edit-title" class="ui basic green not-in-edit button">{{.i18n.Tr "repo.issues.edit"}}</div> + <div id="cancel-edit-title" class="ui basic blue in-edit button" style="display: none">{{.i18n.Tr "repo.issues.cancel"}}</div> + <div id="save-edit-title" class="ui green in-edit button" style="display: none" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title">{{.i18n.Tr "repo.issues.save"}}</div> + </div> </div> - </div> {{end}} </div> {{if .HasMerged}} - <div class="ui purple large label"><i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "repo.pulls.merged"}}</div> + <div class="ui purple large label"><i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "repo.pulls.merged"}}</div> {{else if .Issue.IsClosed}} - <div class="ui red large label"><i class="octicon octicon-issue-closed"></i> {{.i18n.Tr "repo.issues.closed_title"}}</div> + <div class="ui red large label"><i class="octicon octicon-issue-closed"></i> {{.i18n.Tr "repo.issues.closed_title"}}</div> {{else}} - <div class="ui green large label"><i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues.open_title"}}</div> + <div class="ui green large label"><i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues.open_title"}}</div> {{end}} {{if .Issue.IsPull}} {{if .Issue.HasMerged}} - {{ $mergedStr:= TimeSince .Issue.Merged $.Lang }} - <a {{if gt .Issue.Merger.Id 0}}href="{{.Issue.Merger.HomeLink}}"{{end}}>{{.Issue.Merger.Name}}</a> - <span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Safe}}</span> + {{ $mergedStr:= TimeSince .Issue.Merged $.Lang }} + <a {{if gt .Issue.Merger.Id 0}}href="{{.Issue.Merger.HomeLink}}"{{end}}>{{.Issue.Merger.Name}}</a> + <span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Safe}}</span> {{else}} - <a {{if gt .Issue.Poster.Id 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> - <span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span> + <a {{if gt .Issue.Poster.Id 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> + <span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span> {{end}} {{else}} - {{ $createdStr:= TimeSince .Issue.Created $.Lang }} - <span class="time-desc"> - {{if gt .Issue.Poster.Id 0}} - {{$.i18n.Tr "repo.issues.opened_by" $createdStr .Issue.Poster.HomeLink .Issue.Poster.Name | Safe}} - {{else}} - {{$.i18n.Tr "repo.issues.opened_by_fake" $createdStr .Issue.Poster.Name | Safe}} - {{end}} - · - {{$.i18n.Tr "repo.issues.num_comments" .Issue.NumComments}} - </span> + {{ $createdStr:= TimeSince .Issue.Created $.Lang }} + <span class="time-desc"> + {{if gt .Issue.Poster.Id 0}} + {{$.i18n.Tr "repo.issues.opened_by" $createdStr .Issue.Poster.HomeLink .Issue.Poster.Name | Safe}} + {{else}} + {{$.i18n.Tr "repo.issues.opened_by_fake" $createdStr .Issue.Poster.Name | Safe}} + {{end}} + · + {{$.i18n.Tr "repo.issues.num_comments" .Issue.NumComments}} + </span> {{end}} <div class="ui divider"></div> -</div>
\ No newline at end of file +</div> |