Skip to content

Commit c6bc983

Browse files
committed
use new parentAndChildDetails property on an image response, to add extra sections (with thumbnails) in the bottom left of the sidebar (below crops etc.)
1 parent 6171958 commit c6bc983

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

kahuna/public/js/image/controller.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ image.controller('ImageCtrl', [
169169
ctrl.canUserEdit = editable;
170170
});
171171

172+
ctrl.objectHasEntries = obj => obj && Object.keys(obj).length > 0;
173+
172174
const usages = imageUsagesService.getUsages(ctrl.image);
173175
const usagesCount$ = usages.count$;
174176

kahuna/public/js/image/view.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,29 @@
151151
class="image-details__delete-crops"
152152
gr-image="ctrl.image"
153153
gr-on-delete="ctrl.onCropsDeleted()"></gr-delete-crops>
154+
155+
<div class="image-info image-details--scroll" style="margin-top: auto; max-height: 50%">
156+
<div ng-repeat="(title, idToDetailMap) in ctrl.image.data.parentAndChildDetails">
157+
<div class="image-info__group image-info__group--bottom" aria-label="{{title}}"
158+
ng-if="ctrl.objectHasEntries(idToDetailMap)">
159+
<dl class="image-info__group--dl">
160+
<dt class="image-info__heading">{{title}}</dt>
161+
<dd class="image-info__heading--crops"
162+
ng-repeat="(id, detail) in idToDetailMap">
163+
<a ui-sref="image({imageId: id})"
164+
aria-label="View {{title}}">
165+
<img class="image-crop__image"
166+
alt="{{title}} {{id}} thumbnail"
167+
ng-src="{{detail.thumbnail}}" />
168+
</a>
169+
<!-- <div class="image-crop__aspect-ratio">-->
170+
<!-- Added by {{detail.addedBy}}-->
171+
<!-- </div>-->
172+
</dd>
173+
</dl>
174+
</div>
175+
</div>
176+
</div>
154177
</div>
155178

156179
<div class="image-details image-details--full-image" role="complementary" aria-label="Image information">

kahuna/public/stylesheets/main.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,8 @@ FIXME: what to do with touch devices
21012101
}
21022102

21032103
.image-details__delete-crops {
2104-
width: 100%;
2104+
width: 100%;
2105+
outline: 1px solid #565656;
21052106
}
21062107

21072108
.image-details:after {
@@ -2121,6 +2122,11 @@ FIXME: what to do with touch devices
21212122
border-bottom: 1px solid #565656;
21222123
}
21232124

2125+
.image-info__group--bottom {
2126+
border-bottom: 0;
2127+
border-top: 1px solid #565656;
2128+
}
2129+
21242130
.image-info__group--last {
21252131
border-bottom: 0;
21262132
clear: both;

0 commit comments

Comments
 (0)