<div class="col-lg-8 pl-1">
<ul class="list-group">
<ng-container *ngIf="summary.staffViewMetabibAttributes.icon_format">
- <li class="list-group-item" *ngFor="let _x of summary.staffViewMetabibAttributes.icon_format.label | keyvalue">
- <span>{{_x.key}} ({{_x.value}})</span>
+ <li class="list-group-item" *ngFor="let _x of summary.staffViewMetabibAttributes.icon_format | keyvalue">
+ <a href="/eg2/staff/catalog/search?query=from_metarecord({{summary.staffViewMetabibId}}) icon_format({{_x.key}})">
+ {{_x.value.label}}
+ </a>
+ {{_x.value.count}}
</li>
</ng-container>
<ng-container *ngIf="summary.staffViewMetabibAttributes.item_lang">
- <li class="list-group-item" *ngFor="let _x of summary.staffViewMetabibAttributes.item_lang.label | keyvalue">
- <span>{{_x.key}} ({{_x.value}})</span>
+ <li class="list-group-item" *ngFor="let _x of summary.staffViewMetabibAttributes.item_lang | keyvalue">
+ <a href="/eg2/staff/catalog/search?query=from_metarecord({{summary.staffViewMetabibId}}) item_lang({{_x.key}})">
+ {{_x.value.label}}
+ </a>
+ {{_x.value.count}}
</li>
</ng-container>
</ul>
foreach my $bib_id ( keys %{ $attributes } ) {
foreach my $ctype ( keys %{ $attributes->{$bib_id} } ) {
# we want {
- # "srce":{
- # "code": { " ":1, ... } # leaf value is the bib count
- # "label": { "National bibliographic agency":1, ... }
- # }, ...}
+ # "srce":{ " ": { "label": "National bibliographic agency", "count" : 1 } },
+ # ...
+ # }
+ my $current_code = $attributes->{$bib_id}->{$ctype}->{code};
+ my $code_label = $attributes->{$bib_id}->{$ctype}->{label};
$metabib_attr->{$ctype} = {} unless $metabib_attr->{$ctype};
- $metabib_attr->{$ctype}->{code} = {} unless $metabib_attr->{$ctype}->{code};
- $metabib_attr->{$ctype}->{label} = {} unless $metabib_attr->{$ctype}->{label};
- if ( $metabib_attr->{$ctype}->{code}->{ $attributes->{$bib_id}->{$ctype}->{code} } ) {
- $metabib_attr->{$ctype}->{code}->{ $attributes->{$bib_id}->{$ctype}->{code} } += 1;
- } else {
- $metabib_attr->{$ctype}->{code}->{ $attributes->{$bib_id}->{$ctype}->{code} } = 1;
- }
- if ( $metabib_attr->{$ctype}->{label}->{ $attributes->{$bib_id}->{$ctype}->{label} } ) {
- $metabib_attr->{$ctype}->{label}->{ $attributes->{$bib_id}->{$ctype}->{label} } += 1;
+ if (! $metabib_attr->{$ctype}->{ $current_code }) {
+ $metabib_attr->{$ctype}->{ $current_code } = {
+ "label" => $code_label,
+ "count" => 1
+ }
} else {
- $metabib_attr->{$ctype}->{label}->{ $attributes->{$bib_id}->{$ctype}->{label} } = 1;
+ $metabib_attr->{$ctype}->{ $current_code }->{count}++;
}
}
}