Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Kanban dashboard milestone handling & UI #142

Merged
merged 1 commit into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions site/base.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@
</div>
<div id="navbarBasicExample" class="navbar-menu">
<div class="navbar-start">
{{ range .Collections }}
{{ if not .Hidden }}
{{ if eq .Display "kanban" }}
<a class="navbar-item {{ if eq $.ID .ID }}is-active{{ else }}is-inactive{{ end }}" href="/k/{{ .ID }}">{{ .Name }}</a>
{{ else }}
<a class="navbar-item {{ if eq $.ID .ID }}is-active{{ else }}is-inactive{{ end }}" href="/s/{{ .ID }}{{ $.GetVars }}">{{ .Name }}</a>
{{ end }}
{{- range .Collections }}
{{- if not .Hidden }}
{{ if eq .Display "kanban" }}<a class="navbar-item {{ if eq $.ID .ID }}is-active{{ else }}is-inactive{{ end }}" href="/k/{{ .ID }}">{{ .Name }}</a>
{{ else }}<a class="navbar-item {{ if eq $.ID .ID }}is-active{{ else }}is-inactive{{ end }}" href="/s/{{ .ID }}{{ $.GetVars }}">{{ .Name }}</a>{{ end }}
{{ end }}
{{ end }}
</div>
Expand All @@ -47,7 +44,7 @@
{{template "subnav" . }}
<section class="section">
<div class="tp-container">
{{ if ne .Warning "" }}
{{- if ne .Warning "" }}
<div class="notification is-warning">
<button class="delete"></button>
{{ .Warning }}
Expand Down
28 changes: 14 additions & 14 deletions site/collection.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
Avg age: {{ .CollectionResult.AvgAge | toDays }},
Avg wait: {{ .CollectionResult.AvgCurrentHold | toDays }}
</span>
{{ if eq .Collection.Display "kanban" }}
<span class="alt-view"><a href="/k/{{ .ID }}{{ $.GetVars }}">Kanban View</a></span>
{{ end }}

<span class="alt-view"><a href="/k/{{ .ID }}{{ $.GetVars }}">Kanban</a></span>

</div>
<script>
function openAllTabs() {
Expand Down Expand Up @@ -89,17 +89,17 @@
<table id="{{ .Rule.ID | toJSfunc }}" class="compact is-size-6">
<thead>
<tr>
<td class="col-id">ID</td>
<td class="col-author" title="Author">Au</td>
<td class="col-desc" title="Description">Desc</td>
<td class="col-assignee" title="Assignee">As</td>
<td class="col-reactions" title="Reactions">Rea</td>
<td class="col-create" title="When issue was created">Cr</td>
<td class="col-update" title="When issue was last updated">Up</td>
<td class="col-response" title="When issue was last responded to">Re</td>
<td class="col-comments" title="Commenters">Cmntrs</td>
<td class="col-labels">Labels</td>
<td class="col-tags">Tags</td>
<td class="hd col-id">ID</td>
<td class="hd col-author" title="Author">Au</td>
<td class="hd col-desc" title="Description">Desc</td>
<td class="hd col-assignee" title="Assignee">As</td>
<td class="hd col-reactions" title="Reactions">Rea</td>
<td class="hd col-create" title="When issue was created">Cr</td>
<td class="hd col-update" title="When issue was last updated">Up</td>
<td class="hd col-response" title="When issue was last responded to">Re</td>
<td class="hd col-comments" title="Commenters">Cmntrs</td>
<td class="hd col-labels">Labels</td>
<td class="hd col-tags">Tags</td>
</tr>
</thead>
<tbody>
Expand Down
67 changes: 38 additions & 29 deletions site/kanban.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Avg age: {{ .CollectionResult.AvgAge | toDays }}
{{ if .VelocityStats }}, Historical closure rate: <a href="/s/{{.VelocityStats.Collection.ID }}">{{ printf "%.1f" $.ClosedPerDay }} issue(s) per day</a>{{ end }}
</span>
<span class="alt-view"><a href="/s/{{ .ID }}{{ $.GetVars }}">Item View</a></span>
<span class="alt-view"><a href="/s/{{ .ID }}{{ $.GetVars }}">Items</a></span>
</div>
<script>
function openAllTabs() {
Expand All @@ -34,15 +34,18 @@
</div>
<div class="navbar-right">
<div class="navbar-form">
<div class="buttons">
<form style="display: inline-block;" action="/k/{{ .ID }}" method="get">
<select onchange="this.form.submit();" name="{{ .SelectorVar }}">
{{ range .SelectorOptions }}
<option value="{{ .Value }}" {{ if .Selected }}selected{{ end }}>{{ .Text }}</option>
{{ end }}
</select>
</form>
</div>
{{ if .SelectorOptions }}
<div class="buttons">
Milestone:
<form style="display: inline-block;" action="/k/{{ .ID }}" method="get">
<select onchange="this.form.submit();" name="{{ .SelectorVar }}">
{{ range .SelectorOptions }}
<option value="{{ .Value }}" {{ if .Selected }}selected{{ end }}>{{ .Text }}</option>
{{ end }}
</select>
</form>
</div>
{{ end }}
</div>
</div>
</nav>
Expand All @@ -59,33 +62,39 @@
<div class="box outcome kanban">
<div class="box-header collapsible">
<div class="box-head-left">
<h3>{{ .Milestone.Title }}</h3>
<h4 class="subtitle">Due: {{ .Milestone.DueOn.Format "2006-01-02" }} ({{.Milestone.DueOn | RoughTime }})</h4>
{{ if not .MilestoneETA.IsZero }}
<h4 class="subtitle {{ if .MilestoneVeryLate}}very-late-eta{{ else if gt .MilestoneCountOffset 0}}late-eta{{ else if lt .MilestoneCountOffset 0}}early-eta{{ end }}">Completion ETA:
<span class="eta">
{{ .MilestoneETA.Format "~2006-01-02" }}
{{ if ne .MilestoneCountOffset 0 }}({{ LateTime .MilestoneETA .Milestone.DueOn }},
{{ if gt .MilestoneCountOffset 0 }}~{{.MilestoneCountOffset}} issues over historical capacity){{ end }}
{{ if lt .MilestoneCountOffset 0 }}{{.MilestoneCountOffset}} issues off of historical capacity){{ end }}
{{ end }}
</span>
</h4>
{{ if .Milestone }}
<h3>{{ .Title }}: {{ .Milestone.Title }}</h3>
<h4 class="subtitle">Due: {{ .Milestone.DueOn.Format "2006-01-02" }} ({{.Milestone.DueOn | RoughTime }})</h4>
{{ if not .MilestoneETA.IsZero }}
<h4 class="subtitle {{ if .MilestoneVeryLate}}very-late-eta{{ else if gt .MilestoneCountOffset 0}}late-eta{{ else if lt .MilestoneCountOffset 0}}early-eta{{ end }}">Completion ETA:
<span class="eta">
{{ .MilestoneETA.Format "~2006-01-02" }}
{{ if ne .MilestoneCountOffset 0 }}({{ LateTime .MilestoneETA .Milestone.DueOn }},
{{ if gt .MilestoneCountOffset 0 }}~{{.MilestoneCountOffset}} issues over historical capacity){{ end }}
{{ if lt .MilestoneCountOffset 0 }}{{.MilestoneCountOffset}} issues off of historical capacity){{ end }}
{{ end }}
</span>
</h4>
{{ end }}
<h5 class="stats">{{ .Milestone.GetOpenIssues}} open issues, {{ .Milestone.GetClosedIssues }} closed issues</h5>
{{ else }}
<h3>{{ .Title }}</h3>
<h5 class="stats">{{ .Total }} unique items</h5>
{{ end }}
<h5 class="stats">{{ .Milestone.GetOpenIssues}} open issues, {{ .Milestone.GetClosedIssues }} closed issues</h5>
</div>
<div class="box-head-right">
<!-- just save the space -->
</div>
</div>
<table id="kanban-table" class="compact is-size-6">
<thead>
<tr>
<th id="assignee-col">Assi</th>
{{ range .CollectionResult.RuleResults }}
<th id="{{ .Rule.ID | Class }}" title="{{ .Rule | toYAML }}">{{ .Rule.Name}}</th>
{{ end }}
</tr>
<tr>
<th class="hd" id="assignee-col">Assi</th>
{{- range .CollectionResult.RuleResults }}
<th class="hd" id="{{ .Rule.ID | Class }}" title="{{ .Rule | toYAML }}">{{ .Rule.Name}}</th>
{{ end }}
</tr>
</thead>
<tbody>

{{ $col := .Collection }}
Expand Down
1 change: 0 additions & 1 deletion site/static/css/kanban.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

th {
color: #fff !important;
white-space: nowrap;
}

.sticky {
Expand Down
8 changes: 8 additions & 0 deletions site/static/css/tparty.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,15 @@ thead {

thead {
background-color: #7D68A3;
}

.hd {
border-right: 1px dashed #5D4883;
padding-left: 0.5em !important;
}

.hd:last-child {
border-right: none;
}

td { padding: 0.2rem !important; }
Expand Down