Skip to content

Commit 2eafa0e

Browse files
committed
error badge
1 parent 33dacc8 commit 2eafa0e

File tree

2 files changed

+58
-52
lines changed

2 files changed

+58
-52
lines changed

web/app/templates/accession-renewal.gts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ export default class extends Component<Signature> {
8484
</div>
8585
</dl>
8686

87+
{{#if @model.renewal.file}}
88+
<h3>File</h3>
89+
<button
90+
type="button"
91+
class="btn btn-link p-0 mb-3"
92+
{{on "click" (fn this.downloadFile @model.renewal.file.url)}}
93+
>{{@model.renewal.file.filename}}</button>
94+
{{/if}}
95+
8796
{{#if @model.renewal.validation_details.length}}
8897
<h3>Validation Results</h3>
8998

@@ -105,14 +114,5 @@ export default class extends Component<Signature> {
105114
</tbody>
106115
</table>
107116
{{/if}}
108-
109-
{{#if @model.renewal.file}}
110-
<h3>File</h3>
111-
<button
112-
type="button"
113-
class="btn btn-link p-0"
114-
{{on "click" (fn this.downloadFile @model.renewal.file.url)}}
115-
>{{@model.renewal.file.filename}}</button>
116-
{{/if}}
117117
</template>
118118
}

web/app/templates/accession/index.gts

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Component from '@glimmer/component';
22
import { LinkTo } from '@ember/routing';
33

44
import AccessionSummary from 'repository/components/accession-summary';
5+
import DetailsCount from 'repository/components/details-count';
56
import ProgressLabel from 'repository/components/progress-label';
67
import ValidityBadge from 'repository/components/validity-badge';
78
import formatDate from 'repository/helpers/format-datetime';
@@ -40,50 +41,55 @@ export default class extends Component<Signature> {
4041
Renew Accession
4142
</LinkTo>
4243

43-
<table class="table">
44-
<thead>
45-
<tr>
46-
<th>ID</th>
47-
<th>Created</th>
48-
<th>Started</th>
49-
<th>Finished</th>
50-
<th>Progress</th>
51-
<th>Validity</th>
52-
</tr>
53-
</thead>
54-
55-
<tbody>
56-
{{#each this.renewals as |renewal|}}
44+
{{#if this.renewals}}
45+
<table class="table">
46+
<thead>
5747
<tr>
58-
<td>
59-
<LinkTo @route="accession_renewal" @model={{renewal.id}}>
60-
#{{renewal.id}}
61-
</LinkTo>
62-
</td>
63-
64-
<td>{{formatDate renewal.created_at}}</td>
65-
66-
<td>
67-
{{#if renewal.started_at}}
68-
{{formatDate renewal.started_at}}
69-
{{else}}
70-
-
71-
{{/if}}
72-
</td>
73-
74-
<td>
75-
{{#if renewal.finished_at}}
76-
{{formatDate renewal.finished_at}}
77-
{{else}}
78-
-
79-
{{/if}}
80-
</td>
81-
82-
<td><ProgressLabel @progress={{renewal.progress}} /></td>
83-
<td><ValidityBadge @validity={{renewal.validity}} /></td>
48+
<th>ID</th>
49+
<th>Created</th>
50+
<th>Started</th>
51+
<th>Finished</th>
52+
<th>Progress</th>
53+
<th>Validity</th>
8454
</tr>
85-
{{/each}}
86-
</tbody>
87-
</table>
55+
</thead>
56+
57+
<tbody>
58+
{{#each this.renewals as |renewal|}}
59+
<tr>
60+
<td>
61+
<LinkTo @route="accession_renewal" @model={{renewal.id}}>
62+
#{{renewal.id}}
63+
</LinkTo>
64+
</td>
65+
66+
<td>{{formatDate renewal.created_at}}</td>
67+
68+
<td>
69+
{{#if renewal.started_at}}
70+
{{formatDate renewal.started_at}}
71+
{{else}}
72+
-
73+
{{/if}}
74+
</td>
75+
76+
<td>
77+
{{#if renewal.finished_at}}
78+
{{formatDate renewal.finished_at}}
79+
{{else}}
80+
-
81+
{{/if}}
82+
</td>
83+
84+
<td><ProgressLabel @progress={{renewal.progress}} /></td>
85+
<td>
86+
<ValidityBadge @validity={{renewal.validity}} />
87+
<DetailsCount @results={{renewal.validation_details}} />
88+
</td>
89+
</tr>
90+
{{/each}}
91+
</tbody>
92+
</table>
93+
{{/if}}
8894
</template>
8995
}

0 commit comments

Comments
 (0)