mirror of
https://github.com/go-gitea/gitea
synced 2025-03-10 20:54:30 +00:00
Currently, the issue/pr sidebar is hard to read visually. One of the reason is that the gear icons make reading difficult because they are "in the way" when reading, and not aligned together. This PR proposes to align them on the right. Actions are also better highlighted this way. ## Screenshots ### Issue | Before this PR | After this PR | | --- | --- | | <img width="322" alt="Capture d’écran 2025-02-25 à 19 59 39" src="https://github.com/user-attachments/assets/efdd13af-7b22-4f2b-8e65-dd17d6f3ffad" /> | <img width="322" alt="Capture d’écran 2025-02-25 à 19 58 56" src="https://github.com/user-attachments/assets/eeacc3f4-5e2c-4558-a4b3-0f1ab4742107" /> | ### Pull Request | Before this PR | After this PR | | --- | --- | | <img width="322" alt="Capture d’écran 2025-02-25 à 20 16 12" src="https://github.com/user-attachments/assets/c274b58b-ad50-4ad8-b3da-91dbabd1b120" /> | <img width="322" alt="Capture d’écran 2025-02-25 à 20 15 54" src="https://github.com/user-attachments/assets/ecfd6d60-a525-4767-872d-2ef84030d81e" /> | Signed-off-by: Quentin Guidée <quentin.guidee@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
96 lines
3.9 KiB
Handlebars
96 lines
3.9 KiB
Handlebars
{{if .Repository.IsTimetrackerEnabled ctx}}
|
|
{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
|
|
<div class="divider"></div>
|
|
<div>
|
|
<div class="ui dropdown text-flex-grow jump">
|
|
<a class="text muted">
|
|
<div>
|
|
<strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong> {{if $.IsStopwatchRunning}}{{svg "octicon-stopwatch"}}{{end}}
|
|
</div>
|
|
{{svg "octicon-gear"}}
|
|
</a>
|
|
<div class="menu">
|
|
<a class="item issue-set-time-estimate show-modal" data-modal="#issue-time-set-estimate-modal">
|
|
{{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.issues.time_estimate_set"}}
|
|
</a>
|
|
<div class="divider"></div>
|
|
{{if $.IsStopwatchRunning}}
|
|
<a class="item issue-stop-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/toggle">
|
|
{{svg "octicon-stopwatch"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_stop"}}
|
|
</a>
|
|
<a class="item issue-cancel-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/cancel">
|
|
{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_discard"}}
|
|
</a>
|
|
{{else}}
|
|
<a class="item issue-start-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/toggle">
|
|
{{svg "octicon-stopwatch"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_start"}}
|
|
</a>
|
|
<a class="item issue-add-time show-modal" data-modal="#issue-time-manually-add-modal">
|
|
{{svg "octicon-plus"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_manually_add"}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
{{if and (not $.IsStopwatchRunning) .HasUserStopwatch}}
|
|
<div class="ui warning message">{{ctx.Locale.Tr "repo.issues.tracking_already_started" .OtherStopwatchURL}}</div>
|
|
{{end}}
|
|
|
|
{{if .Issue.TimeEstimate}}
|
|
<div class="tw-my-2">{{ctx.Locale.Tr "repo.issues.time_estimate_display" (TimeEstimateString .Issue.TimeEstimate)}}</div>
|
|
{{end}}
|
|
|
|
{{/* set time estimate modal */}}
|
|
<div class="ui mini modal" id="issue-time-set-estimate-modal">
|
|
<div class="header">{{ctx.Locale.Tr "repo.issues.time_estimate_set"}}</div>
|
|
<form method="post" class="ui form form-fetch-action" action="{{.Issue.Link}}/time_estimate">
|
|
<div class="content">
|
|
{{$.CsrfTokenHtml}}
|
|
<input name="time_estimate" placeholder="1h 2m" value="{{TimeEstimateString .Issue.TimeEstimate}}">
|
|
<div class="actions">
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "cancel"}}</button>
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.save"}}</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
{{/* manually add time modal */}}
|
|
<div class="ui mini modal" id="issue-time-manually-add-modal">
|
|
<div class="header">{{ctx.Locale.Tr "repo.issues.add_time_manually"}}</div>
|
|
<form method="post" class="ui form form-fetch-action" action="{{.Issue.Link}}/times/add">
|
|
<div class="content flex-text-block">
|
|
{{$.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">
|
|
</div>
|
|
<div class="actions">
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "cancel"}}</button>
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.timetracker_timer_manually_add"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{if .WorkingUsers}}
|
|
<div class="ui comments tw-mt-2">
|
|
{{ctx.Locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Hour)}}
|
|
<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|Sec2Hour}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|