1
0
Fork 0
forgejo/templates/repo/issue/milestones.tmpl

111 lines
3.9 KiB
Go HTML Template
Raw Permalink Normal View History

2015-08-03 05:42:09 -04:00
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content repository milestones">
2015-08-03 05:42:09 -04:00
{{template "repo/header" .}}
2015-08-09 10:45:38 -04:00
<div class="ui container">
{{template "base/alert" .}}
<div class="list-header list-header-issues">
2015-08-03 05:42:09 -04:00
{{template "repo/issue/navbar" .}}
{{template "repo/issue/search" .}}
2019-01-23 13:58:38 -05:00
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
<div class="button-row">
<a class="ui small primary button" href="{{$.Link}}/new">{{ctx.Locale.Tr "repo.milestones.new"}}</a>
</div>
2015-08-05 03:27:22 -04:00
{{end}}
2015-08-03 05:42:09 -04:00
</div>
{{template "repo/issue/filters" .}}
<!-- milestone list -->
<div class="milestone-list">
2015-08-09 10:45:38 -04:00
{{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}}
2023-09-25 08:42:40 -04:00
{{ctx.Locale.PrettyNumber .NumOpenIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
</div>
<div class="flex-text-block">
{{svg "octicon-check" 14}}
2023-09-25 08:42:40 -04:00
{{ctx.Locale.PrettyNumber .NumClosedIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
</div>
{{if .TotalTrackedTime}}
<div class="flex-text-block">
{{svg "octicon-clock"}}
{{.TotalTrackedTime|Sec2Time}}
</div>
{{end}}
{{if .UpdatedUnix}}
<div class="flex-text-block">
{{svg "octicon-clock"}}
{{ctx.Locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix ctx.Locale)}}
</div>
{{end}}
<div class="flex-text-block">
{{if .IsClosed}}
2023-09-25 08:42:40 -04:00
{{$closedDate:= TimeSinceUnix .ClosedDateUnix ctx.Locale}}
{{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}}
{{DateTime "short" .DeadlineString}}
</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>
2015-12-15 21:25:38 -05:00
{{if .Content}}
<div class="markup content">
{{.RenderedContent}}
2015-12-15 21:25:38 -05:00
</div>
2015-08-03 05:42:09 -04:00
{{end}}
</li>
2015-08-09 10:45:38 -04:00
{{end}}
{{template "base/paginate" .}}
2015-08-03 05:42:09 -04:00
</div>
</div>
2014-05-07 09:01:00 -04:00
</div>
2015-08-05 08:23:08 -04:00
{{if or .CanWriteIssues .CanWritePulls}}
<div class="ui g-modal-confirm delete modal">
Refactor delete_modal_actions template and use it for project column related actions (#24097) Co-Author: @wxiaoguang This PR is to fix https://github.com/go-gitea/gitea/issues/23318#issuecomment-1506275446 . The way to fix this in this PR is to use `delete_modal_actions.tmpl` here both to fix this issue and keep ui consistency (as suggested by [TODO here](https://github.com/go-gitea/gitea/blob/4299c3b7db61f8741eca0ba3d663bb65745a4acc/templates/projects/view.tmpl#L161)) And this PR also refactors `delete_modal_actions.tmpl` and its related styles, and use the template for more modal actions: 1. Added template attributes: * locale * ModalButtonStyle: "yes" (default) or "confirm" * ModalButtonCancelText * ModalButtonOkText 2. Rename `delete_modal_actions.tmpl` template to `modal_actions_confirm.tmpl` because it is not only used for action modals deletion now. 3. Refactored css related to modals into `web_src/css/modules/modal.css` and improved the styles. 4. Also use the template for PR deletion modal and remove issue dependency modal. 5. Some modals should also use the template, but not sure how to open them, so mark these modal actions by `{{/* TODO: Convert to base/modal_actions_confirm */}}` After (Also tested on arc green): Hovering on the left buttons <img width="711" alt="Screen Shot 2023-04-23 at 15 17 12" src="https://user-images.githubusercontent.com/17645053/233825650-76307e65-9255-44bb-80e8-7062f58ead1b.png"> <img width="786" alt="Screen Shot 2023-04-23 at 15 17 21" src="https://user-images.githubusercontent.com/17645053/233825652-4dc6f7d1-a180-49fb-a468-d60950eaee0d.png"> Test for functionalities: https://user-images.githubusercontent.com/17645053/233826857-76376fda-022c-42d0-b0f3-339c17ca4e59.mov --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-04-23 05:24:19 -04:00
<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>
Refactor delete_modal_actions template and use it for project column related actions (#24097) Co-Author: @wxiaoguang This PR is to fix https://github.com/go-gitea/gitea/issues/23318#issuecomment-1506275446 . The way to fix this in this PR is to use `delete_modal_actions.tmpl` here both to fix this issue and keep ui consistency (as suggested by [TODO here](https://github.com/go-gitea/gitea/blob/4299c3b7db61f8741eca0ba3d663bb65745a4acc/templates/projects/view.tmpl#L161)) And this PR also refactors `delete_modal_actions.tmpl` and its related styles, and use the template for more modal actions: 1. Added template attributes: * locale * ModalButtonStyle: "yes" (default) or "confirm" * ModalButtonCancelText * ModalButtonOkText 2. Rename `delete_modal_actions.tmpl` template to `modal_actions_confirm.tmpl` because it is not only used for action modals deletion now. 3. Refactored css related to modals into `web_src/css/modules/modal.css` and improved the styles. 4. Also use the template for PR deletion modal and remove issue dependency modal. 5. Some modals should also use the template, but not sure how to open them, so mark these modal actions by `{{/* TODO: Convert to base/modal_actions_confirm */}}` After (Also tested on arc green): Hovering on the left buttons <img width="711" alt="Screen Shot 2023-04-23 at 15 17 12" src="https://user-images.githubusercontent.com/17645053/233825650-76307e65-9255-44bb-80e8-7062f58ead1b.png"> <img width="786" alt="Screen Shot 2023-04-23 at 15 17 21" src="https://user-images.githubusercontent.com/17645053/233825652-4dc6f7d1-a180-49fb-a468-d60950eaee0d.png"> Test for functionalities: https://user-images.githubusercontent.com/17645053/233826857-76376fda-022c-42d0-b0f3-339c17ca4e59.mov --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-04-23 05:24:19 -04:00
{{template "base/modal_actions_confirm" .}}
</div>
2015-08-05 08:23:08 -04:00
{{end}}
{{template "base/footer" .}}