summaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/view_content/sidebar/timetracking.tmpl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
committerDaniel Baumann <daniel@debian.org>2024-12-12 23:57:56 +0100
commite68b9d00a6e05b3a941f63ffb696f91e554ac5ec (patch)
tree97775d6c13b0f416af55314eb6a89ef792474615 /templates/repo/issue/view_content/sidebar/timetracking.tmpl
parentInitial commit. (diff)
downloadforgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.tar.xz
forgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.zip
Adding upstream version 9.0.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'templates/repo/issue/view_content/sidebar/timetracking.tmpl')
-rw-r--r--templates/repo/issue/view_content/sidebar/timetracking.tmpl73
1 files changed, 73 insertions, 0 deletions
diff --git a/templates/repo/issue/view_content/sidebar/timetracking.tmpl b/templates/repo/issue/view_content/sidebar/timetracking.tmpl
new file mode 100644
index 0000000..610600b
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/timetracking.tmpl
@@ -0,0 +1,73 @@
+{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
+ <div class="divider"></div>
+ <div class="ui timetrack">
+ <span class="text"><strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong></span>
+ <div class="tw-mt-2">
+ <form method="post" action="{{.Issue.Link}}/times/stopwatch/toggle" id="toggle_stopwatch_form">
+ {{$.CsrfTokenHtml}}
+ </form>
+ <form method="post" action="{{.Issue.Link}}/times/stopwatch/cancel" id="cancel_stopwatch_form">
+ {{$.CsrfTokenHtml}}
+ </form>
+ {{if $.IsStopwatchRunning}}
+ <button class="ui fluid button issue-stop-time">
+ {{svg "octicon-stopwatch" 16 "tw-mr-2"}}
+ {{ctx.Locale.Tr "repo.issues.stop_tracking"}}
+ </button>
+ <button class="ui fluid button issue-cancel-time tw-mt-2">
+ {{svg "octicon-trash" 16 "tw-mr-2"}}
+ {{ctx.Locale.Tr "repo.issues.cancel_tracking"}}
+ </button>
+ {{else}}
+ {{if .HasUserStopwatch}}
+ <div class="ui warning message">
+ {{ctx.Locale.Tr "repo.issues.tracking_already_started" .OtherStopwatchURL}}
+ </div>
+ {{end}}
+ <button class="ui fluid button issue-start-time" data-tooltip-content='{{ctx.Locale.Tr "repo.issues.start_tracking"}}'>
+ {{svg "octicon-stopwatch" 16 "tw-mr-2"}}
+ {{ctx.Locale.Tr "repo.issues.start_tracking_short"}}
+ </button>
+ <div class="ui mini modal issue-start-time-modal">
+ <div class="header">{{ctx.Locale.Tr "repo.issues.add_time"}}</div>
+ <div class="content">
+ <form method="post" id="add_time_manual_form" action="{{.Issue.Link}}/times/add" class="ui input fluid tw-gap-2">
+ {{$.CsrfTokenHtml}}
+ <input placeholder='{{ctx.Locale.Tr "repo.issues.add_time_hours"}}' type="number" name="hours">
+ <input placeholder='{{ctx.Locale.Tr "repo.issues.add_time_minutes"}}' type="number" name="minutes" class="ui compact">
+ </form>
+ </div>
+ <div class="actions">
+ <button class="ui primary approve button">{{ctx.Locale.Tr "repo.issues.add_time_short"}}</button>
+ <button class="ui cancel button">{{ctx.Locale.Tr "repo.issues.add_time_cancel"}}</button>
+ </div>
+ </div>
+ <button class="ui fluid button issue-add-time tw-mt-2" data-tooltip-content='{{ctx.Locale.Tr "repo.issues.add_time"}}'>
+ {{svg "octicon-plus" 16 "tw-mr-2"}}
+ {{ctx.Locale.Tr "repo.issues.add_time_short"}}
+ </button>
+ {{end}}
+ </div>
+ </div>
+{{end}}
+{{if .WorkingUsers}}
+ <div class="divider"></div>
+ <div class="ui comments">
+ <span class="text"><strong>{{ctx.Locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Time)}}</strong></span>
+ <div>
+ {{range $user, $trackedtime := .WorkingUsers}}
+ <div class="comment tw-mt-2">
+ <a class="avatar">
+ {{ctx.AvatarUtils.Avatar $user}}
+ </a>
+ <div class="content">
+ {{template "shared/user/authorlink" $user}}
+ <div class="text">
+ {{$trackedtime|Sec2Time}}
+ </div>
+ </div>
+ </div>
+ {{end}}
+ </div>
+ </div>
+{{end}}