mirror of
https://github.com/go-gitea/gitea.git
synced 2025-02-02 15:09:33 -05:00
Dear Gitea team, first of all, thanks for the great work you're doing with this project. I'm planning to introduce Gitea at a client site, and noticed that while there is time recording, there are no project-manager-friendly reports to actually make use of that data, as were also mentioned by others in #4870 #8684 and #13531. Since I had a little time last weekend, I had put together something that I hope to be a useful contribution to this great project (while of course useful for me too). This PR adds a new "Worktime" tab to the Organisation level. There is a date range selector (by default set to the current month), and there are three possible views: - by repository, - by milestone, and - by team member. Happy to receive any feedback! There are several possible future improvements of course (predefined date ranges, charts, a member time sheet, matrix of repos/members, etc) but I hope that even in this relatively simple state this would be useful to lots of people. <img width="1161" alt="Screen Shot 2022-05-25 at 22 12 58" src="https://user-images.githubusercontent.com/118010/170366976-af00c7af-c4f3-4117-86d7-00356d6797a5.png"> Keep up the good work! Kristof --------- Co-authored-by: user <user@kk-git1> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
109 lines
3.9 KiB
Handlebars
109 lines
3.9 KiB
Handlebars
{{template "base/head" .}}
|
|
<div role="main" aria-label="{{.Title}}" class="page-content repository milestones">
|
|
{{template "repo/header" .}}
|
|
<div class="ui container">
|
|
{{template "base/alert" .}}
|
|
|
|
<div class="list-header">
|
|
{{template "repo/issue/navbar" .}}
|
|
{{template "repo/issue/search" .}}
|
|
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
|
<a class="ui small primary button" href="{{$.Link}}/new">{{ctx.Locale.Tr "repo.milestones.new"}}</a>
|
|
{{end}}
|
|
</div>
|
|
|
|
{{template "repo/issue/filters" .}}
|
|
|
|
<!-- milestone list -->
|
|
<div class="milestone-list">
|
|
{{range .Milestones}}
|
|
<li class="milestone-card">
|
|
<div class="milestone-header">
|
|
<h3 class="flex-text-block tw-m-0">
|
|
{{svg "octicon-milestone" 16}}
|
|
<a class="muted" href="{{$.RepoLink}}/milestone/{{.ID}}">{{.Name}}</a>
|
|
</h3>
|
|
<div class="tw-flex tw-items-center">
|
|
<span class="tw-mr-2">{{.Completeness}}%</span>
|
|
<progress value="{{.Completeness}}" max="100"></progress>
|
|
</div>
|
|
</div>
|
|
<div class="milestone-toolbar">
|
|
<div class="group">
|
|
<div class="flex-text-block">
|
|
{{svg "octicon-issue-opened" 14}}
|
|
{{ctx.Locale.PrettyNumber .NumOpenIssues}} {{ctx.Locale.Tr "repo.issues.open_title"}}
|
|
</div>
|
|
<div class="flex-text-block">
|
|
{{svg "octicon-check" 14}}
|
|
{{ctx.Locale.PrettyNumber .NumClosedIssues}} {{ctx.Locale.Tr "repo.issues.closed_title"}}
|
|
</div>
|
|
{{if .TotalTrackedTime}}
|
|
<div class="flex-text-block">
|
|
{{svg "octicon-clock"}}
|
|
{{.TotalTrackedTime|Sec2Hour}}
|
|
</div>
|
|
{{end}}
|
|
{{if .UpdatedUnix}}
|
|
<div class="flex-text-block">
|
|
{{svg "octicon-clock"}}
|
|
{{ctx.Locale.Tr "repo.milestones.update_ago" (DateUtils.TimeSince .UpdatedUnix)}}
|
|
</div>
|
|
{{end}}
|
|
<div class="flex-text-block">
|
|
{{if .IsClosed}}
|
|
{{$closedDate:= DateUtils.TimeSince .ClosedDateUnix}}
|
|
{{svg "octicon-clock" 14}}
|
|
{{ctx.Locale.Tr "repo.milestones.closed" $closedDate}}
|
|
{{else}}
|
|
{{if .DeadlineString}}
|
|
<span class="flex-text-inline {{if .IsOverdue}}text red{{end}}">
|
|
{{svg "octicon-calendar" 14}}
|
|
{{DateUtils.AbsoluteShort (.DeadlineString|DateUtils.ParseLegacy)}}
|
|
</span>
|
|
{{else}}
|
|
{{svg "octicon-calendar" 14}}
|
|
{{ctx.Locale.Tr "repo.milestones.no_due_date"}}
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
|
|
<div class="group">
|
|
<a class="flex-text-inline" href="{{$.Link}}/{{.ID}}/edit">{{svg "octicon-pencil" 14}}{{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
|
|
{{if .IsClosed}}
|
|
<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check" 14}}{{ctx.Locale.Tr "repo.milestones.open"}}</a>
|
|
{{else}}
|
|
<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{ctx.Locale.Tr "repo.milestones.close"}}</a>
|
|
{{end}}
|
|
<a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{if .Content}}
|
|
<div class="markup content">
|
|
{{.RenderedContent}}
|
|
</div>
|
|
{{end}}
|
|
</li>
|
|
{{end}}
|
|
|
|
{{template "base/paginate" .}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{if or .CanWriteIssues .CanWritePulls}}
|
|
<div class="ui g-modal-confirm delete modal">
|
|
<div class="header">
|
|
{{svg "octicon-trash"}}
|
|
{{ctx.Locale.Tr "repo.milestones.deletion"}}
|
|
</div>
|
|
<div class="content">
|
|
<p>{{ctx.Locale.Tr "repo.milestones.deletion_desc"}}</p>
|
|
</div>
|
|
{{template "base/modal_actions_confirm" .}}
|
|
</div>
|
|
{{end}}
|
|
{{template "base/footer" .}}
|