summaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorkolaente <konrad@kola-entertainments.de>2018-07-16 14:43:00 +0200
committerJonas Franz <info@jonasfranz.software>2018-07-16 14:43:00 +0200
commitef6813abc9277f29515cb571c4c4ddc373482e58 (patch)
treecba04950ada22fd5a46cb388677dc263340a93dc /templates/repo
parent55d9ddf24a2d3c608395055e47ba321a4a4739c4 (diff)
downloadgitea-ef6813abc9277f29515cb571c4c4ddc373482e58.tar.gz
gitea-ef6813abc9277f29515cb571c4c4ddc373482e58.zip
Issue due date api (#3890)
* Implemented basic api endpoint to manage deadlines * Fixed checking for permissions * Updating a deadline from the ui is now entirely done via the api * cleanup * Cosmetics * fixed lint + fmt * Added swagger model definition for deadline response * Updated gitea-sdk * Updated gitea-sdk * More cleanup * Generate swagger json * Merge branch 'master' of https://github.com/go-gitea/gitea into issue-due-date-api # Conflicts: # public/swagger.v1.json * Fixed permission to update a deadline via api * Re-added form to change a deadline * Added client-side validation + not ignore error messages from the api * Added locale for error message * Merge branch 'master' of https://github.com/go-gitea/gitea # Conflicts: # models/issue_comment.go * Proper date validation * Fixed indention * moved css to css file * added documentation for error codes * after merge cleanup * Added swagger description * DO NOTHING BUT TRIGGER THAT F*CKIN CI SO IT PICKS UP THE LATEST COMMIT AS IT SHOULD * DO NOTHING BUT TRIGGER THAT F*CKIN CI SO IT PICKS UP THE LATEST COMMIT AS IT SHOULD * regenerated stylesheets
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/issue/view_content/sidebar.tmpl67
1 files changed, 36 insertions, 31 deletions
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl
index f0e4f96cfa..11552d08d0 100644
--- a/templates/repo/issue/view_content/sidebar.tmpl
+++ b/templates/repo/issue/view_content/sidebar.tmpl
@@ -211,38 +211,43 @@
<div class="ui divider"></div>
<span class="text"><strong>{{.i18n.Tr "repo.issues.due_date"}}</strong></span>
- {{if ne .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 ne .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 ne .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 ne .Issue.DeadlineUnix 0}}
- <i class="edit icon"></i>
- {{else}}
- <i class="plus icon"></i>
+ <div class="ui form" id="deadline-loader">
+ <div class="ui negative message" id="deadline-err-invalid-date" style="display: none;">
+ <i class="close icon"></i>
+ {{.i18n.Tr "repo.issues.due_date_invalid"}}
+ </div>
+ {{if ne .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}}
- </button>
- </div>
- </form>
- {{end}}
+ {{if and .IsSigned .IsRepositoryWriter}}
+ <br/>
+ <a style="cursor:pointer;" onclick="toggleDeadlineForm();"><i class="edit icon"></i>Edit</a> -
+ <a style="cursor:pointer;" onclick="updateDeadline('');"><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}}
+ <div {{if ne .Issue.DeadlineUnix 0}} style="display: none;"{{end}} id="deadlineForm">
+ <form class="ui fluid action input" action="{{AppSubUrl}}/api/v1/repos/{{.Repository.Owner.Name}}/{{.Repository.Name}}/issues/{{.Issue.Index}}" method="post" id="update-issue-deadline-form" onsubmit="setDeadline();return false;">
+ {{$.CsrfTokenHtml}}
+ <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="deadlineDate" id="deadlineDate">
+ <button class="ui green icon button">
+ {{if ne .Issue.DeadlineUnix 0}}
+ <i class="edit icon"></i>
+ {{else}}
+ <i class="plus icon"></i>
+ {{end}}
+ </button>
+ </form>
+ </div>
+ {{end}}
+ </div>
</div>
</div>