Skip to content

Commit 12f0027

Browse files
author
Allan Asp Christensen
committed
Styling af Payload decoder
1 parent e66993d commit 12f0027

File tree

3 files changed

+58
-39
lines changed

3 files changed

+58
-39
lines changed
Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,41 @@
1-
<ng-container *ngIf="payloadDecoder">
2-
<app-top-bar-single [data]="payloadDecoder" [backButton]="backButton" [buttons]="buttons"></app-top-bar-single>
3-
<div class="p-5">
4-
<div class="application-component">
5-
<div class="col d-flex top-bar">
6-
<button class="btn btn-primary py-3" [routerLink]="['../../payload-decoder-edit', payloadDecoder.id]" routerLinkActive="active">{{ 'PAYLOAD-DECODER.EDIT' | translate }}</button>
7-
</div>
8-
<div class="col-12 mb-4 py-3 bottom-separator">
9-
<div class="col-8 py-4">
10-
<div class="col-12 col-sm-12">
11-
<h4>{{ 'PAYLOAD-DECODER.NAME' | translate }}</h4>
12-
</div>
13-
<div class="col-12 pt-2 col-sm-8">
14-
<p>{{payloadDecoder.name}}</p>
15-
</div>
16-
</div>
17-
<div class="col-12 py-4">
18-
<div class="col-12 col-sm-12">
19-
<h4>{{ 'PAYLOAD-DECODER.DECODINGFUNCTION' | translate }}</h4>
20-
</div>
1+
<app-top-bar-single [data]="payloadDecoder" [backButton]="backButton" [buttons]="buttons"></app-top-bar-single>
2+
<div *ngIf="payloadDecoder">
3+
<div class=" jumbotron m-md-4 p-md-3">
4+
<div class="row">
5+
<div class="col-xs-12">
6+
<div class="float-left">
7+
<h4> {{ 'PAYLOAD-DECODER.NAME' | translate }} {{payloadDecoder.name}}</h4>
218
</div>
22-
<div class="col-12 pt-2 col-sm-8">
23-
<pre>
24-
<code>
25-
{{payloadDecoder.decodingFunction}}
26-
</code>
27-
</pre>
9+
<div class="btn-group float-right">
10+
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"
11+
aria-haspopup="true" aria-expanded="false">
12+
{{'PAYLOAD-DECODER.DETAIL.DROPDOWN' | translate}} <span class="caret"></span>
13+
</button>
14+
<ul class="dropdown-menu" attr.aria-labelledby="tableRowDropdown-{{payloadDecoder.id}}">
15+
<li class="dropdown-item">
16+
<a [routerLink]="['../../payload-decoder-edit', payloadDecoder.id]"
17+
routerLinkActive="active">{{ 'PAYLOAD-DECODER.DETAIL.EDIT' | translate }}
18+
</a>
19+
</li>
20+
<!-- <li class="dropdown-item">
21+
<a (click)="onDeletePayloadDecoder()" [routerLink]="">{{ 'PAYLOAD-DECODER.DETAIL.DELETE' | translate }}
22+
</a>
23+
</li> -->
24+
</ul>
2825
</div>
2926
</div>
3027
</div>
3128
</div>
32-
</ng-container>
29+
<div class=" jumbotron m-md-4 p-md-3">
30+
<div class="row">
31+
<div class="col-xs-12">
32+
<h4>{{ 'PAYLOAD-DECODER.DECODINGFUNCTION' | translate }}</h4>
33+
<pre>
34+
<code>
35+
{{payloadDecoder.decodingFunction}}
36+
</code>
37+
</pre>
38+
</div>
39+
</div>
40+
</div>
41+
</div>

src/app/payload-decoder/payload-decoder/payload-decoder-detail/payload-decoder-detail.component.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ export class PayloadDecoderDetailComponent implements OnInit {
2020
public backButton: BackButton = { label: '', routerLink: '/datatarget-list' };
2121
public buttons: QuickActionButton[] = [
2222
{
23-
label: 'PAYLOAD-DECODER.DELETE',
24-
type: 'delete',
23+
label: 'PAYLOAD-DECODER.DELETE',
24+
type: 'delete',
2525
},
2626
{
27-
label: 'PAYLOAD-DECODER.EDIT',
28-
type: 'edit',
27+
label: 'PAYLOAD-DECODER.EDIT',
28+
type: 'edit',
2929
},
3030
];
3131
id: number;
@@ -34,24 +34,29 @@ export class PayloadDecoderDetailComponent implements OnInit {
3434
constructor(
3535
public translate: TranslateService,
3636
private route: ActivatedRoute,
37-
private payloadDecoderService: PayloadDecoderService
38-
) {
39-
}
37+
private payloadDecoderService: PayloadDecoderService,
38+
) {
39+
}
4040

4141
ngOnInit(): void {
4242
this.translate.use('da');
43+
44+
this.translate.get(['PAYLOAD-DECODER.TITLE'])
45+
.subscribe(translations => {
46+
this.backButton.label = translations['PAYLOAD-DECODER.TITLE'];
47+
});
4348
this.id = +this.route.snapshot.paramMap.get('id');
4449
if (this.id > 0) {
4550
this.getPayloadDecoder(this.id);
4651
}
4752
}
4853

4954
private getPayloadDecoder(id: number) {
50-
this.subscription = this.payloadDecoderService.getOne(id)
55+
this.subscription = this.payloadDecoderService.getOne(id)
5156
.subscribe(
5257
(response) => {
53-
this.payloadDecoder = response;
54-
});
58+
this.payloadDecoder = response;
59+
});
5560
}
5661

5762
}

src/assets/i18n/da.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,16 @@
111111
"EDIT": "Redigér"
112112
},
113113
"PAYLOAD-DECODER": {
114+
"TITLE": "Payload decoder",
114115
"SAVE": "Gem Payload Decoder",
115-
"NAME": "Navn",
116+
"NAME": "Navn: ",
116117
"ID": "Payload Decoder Id",
117118
"DECODINGFUNCTION": "Decoder funktion",
118-
"EDIT": "Redigér Payload Decoder"
119+
"DETAIL": {
120+
"DROPDOWN": "Håndter Payload Decoder",
121+
"EDIT": "Redigér",
122+
"DELETE": "Slet"
123+
}
119124
},
120125
"PAYLOAD-DECODER-TABLE-ROW": {
121126
"EDIT": "Redigér",

0 commit comments

Comments
 (0)