diff options
Diffstat (limited to 'templates/repo/issue/view_content')
-rw-r--r-- | templates/repo/issue/view_content/comments.tmpl | 32 | ||||
-rw-r--r-- | templates/repo/issue/view_content/sidebar.tmpl | 36 |
2 files changed, 67 insertions, 1 deletions
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 662155144f..b6d2c96bb5 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -1,7 +1,7 @@ {{range .Issue.Comments}} {{ $createdStr:= TimeSinceUnix .CreatedUnix $.Lang }} - <!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF, 5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING, 13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL --> + <!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF, 5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING, 13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL, 16 = ADDED_DEADLINE, 17 = MODIFIED_DEADLINE, 18 = REMOVED_DEADLINE --> {{if eq .Type 0}} <div class="comment" id="{{.HashTag}}"> <a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}> @@ -189,5 +189,35 @@ </a> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}</span> </div> + {{else if eq .Type 16}} + <div class="event"> + <span class="octicon octicon-primitive-dot"></span> + <a class="ui avatar image" href="{{.Poster.HomeLink}}"> + <img src="{{.Poster.RelAvatarLink}}"> + </a> + <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> + {{$.i18n.Tr "repo.issues.due_date_added" .Content $createdStr | Safe}} + </span> + </div> + {{else if eq .Type 17}} + <div class="event"> + <span class="octicon octicon-primitive-dot"></span> + <a class="ui avatar image" href="{{.Poster.HomeLink}}"> + <img src="{{.Poster.RelAvatarLink}}"> + </a> + <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> + {{$.i18n.Tr "repo.issues.due_date_modified" (.Content | ParseDeadline) $createdStr | Safe}} + </span> + </div> + {{else if eq .Type 18}} + <div class="event"> + <span class="octicon octicon-primitive-dot"></span> + <a class="ui avatar image" href="{{.Poster.HomeLink}}"> + <img src="{{.Poster.RelAvatarLink}}"> + </a> + <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> + {{$.i18n.Tr "repo.issues.due_date_remove" .Content $createdStr | Safe}} + </span> + </div> {{end}} {{end}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index dc16ba7499..648533fca1 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -191,5 +191,41 @@ </div> {{end}} {{end}} + + <div class="ui divider"></div> + <span class="text"><strong>{{.i18n.Tr "repo.issues.due_date"}}</strong></span> + {{if gt .Issue.DeadlineUnix 0}} + <p> + <span class="octicon octicon-calendar"></span> + {{.Issue.DeadlineUnix.FormatShort}} + {{if .Issue.IsOverdue}} + <span style="color: red;">{{.i18n.Tr "repo.issues.due_date_overdue"}}</span> + {{end}} + {{if and .IsSigned .IsRepositoryWriter}} + <br/> + <a style="cursor:pointer;" onclick="toggleDuedateForm();"><i class="edit icon"></i>Edit</a> - + <a style="cursor:pointer;" onclick="deleteDueDate('{{$.RepoLink}}/issues/{{.Issue.Index}}/deadline/delete');"><i class="remove icon"></i>Remove</a> + {{end}} + </p> + {{else}} + <p><i>{{.i18n.Tr "repo.issues.due_date_not_set"}}</i></p> + {{end}} + + {{if and .IsSigned .IsRepositoryWriter}} + <form method="POST"{{if gt .Issue.DeadlineUnix 0}}style="display: none;"{{end}}} id="add_deadline_form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/deadline/update" class="ui action input fluid"> + {{$.CsrfTokenHtml}} + <div class="ui fluid action input"> + <input required placeholder="{{.i18n.Tr "repo.issues.due_date_form"}}" {{if gt .Issue.DeadlineUnix 0}}value="{{.Issue.DeadlineUnix.Format "2006-01-02"}}"{{end}} type="date" name="date" style="min-width: 13.9rem;border-radius: 4px 0 0 4px;border-right: 0;white-space: nowrap;"> + <button class="ui green icon button"> + {{if gt .Issue.DeadlineUnix 0}} + <i class="edit icon"></i> + {{else}} + <i class="plus icon"></i> + {{end}} + </button> + </div> + </form> + {{end}} + </div> </div> |