summaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/view_content
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-12-10 17:19:18 +0100
committerGitHub <noreply@github.com>2020-12-10 17:19:18 +0100
commit1cb1fb8a2e86cc66a3f40f24d6f831eec90daba5 (patch)
tree43cc516c92e376f1d039226d3c026e21f91b8c7b /templates/repo/issue/view_content
parentbc1cf6e5d365265d18144a2afae25ca04df691b8 (diff)
downloadgitea-1cb1fb8a2e86cc66a3f40f24d6f831eec90daba5.tar.gz
gitea-1cb1fb8a2e86cc66a3f40f24d6f831eec90daba5.zip
Remove JS globals related to timetracking and due date (#13921)
Refactor to avoid these globals. Should work exactly as before.
Diffstat (limited to 'templates/repo/issue/view_content')
-rw-r--r--templates/repo/issue/view_content/sidebar.tmpl18
1 files changed, 9 insertions, 9 deletions
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl
index a8f0ed5ab4..c8cc454928 100644
--- a/templates/repo/issue/view_content/sidebar.tmpl
+++ b/templates/repo/issue/view_content/sidebar.tmpl
@@ -336,9 +336,9 @@
{{$.CsrfTokenHtml}}
</form>
{{if $.IsStopwatchRunning}}
- <div class="ui buttons fluid stop-cancel">
- <button onclick="this.disabled=true;window.toggleStopwatch()" class="ui button stop">{{.i18n.Tr "repo.issues.stop_tracking"}}</button>
- <button onclick="this.disabled=true;window.cancelStopwatch()" class="ui negative button cancel">{{.i18n.Tr "repo.issues.cancel_tracking"}}</button>
+ <div class="ui buttons fluid">
+ <button class="ui button issue-stop-time">{{.i18n.Tr "repo.issues.stop_tracking"}}</button>
+ <button class="ui negative button issue-cancel-time">{{.i18n.Tr "repo.issues.cancel_tracking"}}</button>
</div>
{{else}}
{{if .HasUserStopwatch}}
@@ -346,8 +346,8 @@
{{.i18n.Tr "repo.issues.tracking_already_started" .OtherStopwatchURL | Safe}}
</div>
{{end}}
- <div class="ui buttons two fluid start-add">
- <button onclick="this.disabled=true;window.toggleStopwatch()" class="ui button poping up start" data-content='{{.i18n.Tr "repo.issues.start_tracking"}}' data-position="top center" data-variation="small inverted">{{.i18n.Tr "repo.issues.start_tracking_short"}}</button>
+ <div class="ui buttons two fluid">
+ <button class="ui button poping up issue-start-time" data-content='{{.i18n.Tr "repo.issues.start_tracking"}}' data-position="top center" data-variation="small inverted">{{.i18n.Tr "repo.issues.start_tracking_short"}}</button>
<div class="ui mini modal">
<div class="header">{{.i18n.Tr "repo.issues.add_time"}}</div>
<div class="content">
@@ -362,7 +362,7 @@
<div class="ui red cancel button">{{.i18n.Tr "repo.issues.add_time_cancel"}}</div>
</div>
</div>
- <button onclick="window.timeAddManual()" class="ui button green poping up add-time" data-content='{{.i18n.Tr "repo.issues.add_time"}}' data-position="top center" data-variation="small inverted">{{.i18n.Tr "repo.issues.add_time_short"}}</button>
+ <button class="ui button green poping up issue-add-time" data-content='{{.i18n.Tr "repo.issues.add_time"}}' data-position="top center" data-variation="small inverted">{{.i18n.Tr "repo.issues.add_time_short"}}</button>
</div>
{{end}}
</div>
@@ -407,8 +407,8 @@
{{end}}
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
<br/>
- <a style="cursor:pointer;" onclick="window.toggleDeadlineForm();"><i class="edit icon"></i>{{$.i18n.Tr "repo.issues.due_date_form_edit"}}</a> -
- <a style="cursor:pointer;" onclick="window.updateDeadline('');"><i class="remove icon"></i>{{$.i18n.Tr "repo.issues.due_date_form_remove"}}</a>
+ <a class="issue-due-edit"><i class="edit icon"></i>{{$.i18n.Tr "repo.issues.due_date_form_edit"}}</a> -
+ <a class="issue-due-remove"><i class="remove icon"></i>{{$.i18n.Tr "repo.issues.due_date_form_remove"}}</a>
{{end}}
</p>
{{else}}
@@ -417,7 +417,7 @@
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
<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="window.setDeadline();return false;">
+ <form class="ui fluid action input issue-due-form" action="{{AppSubUrl}}/api/v1/repos/{{.Repository.Owner.Name}}/{{.Repository.Name}}/issues/{{.Issue.Index}}" method="post" id="update-issue-deadline-form">
{{$.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">