Skip to content

Commit 7d43b70

Browse files
authored
remove ability to view a photo when not logged in (#989)
1 parent d33c083 commit 7d43b70

File tree

1 file changed

+25
-19
lines changed
  • app/templates/photo-albums/photo-album/photos

1 file changed

+25
-19
lines changed

app/templates/photo-albums/photo-album/photos/index.hbs

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,32 @@
1818

1919
<div class='row'>
2020
{{#each sortedPhotos as |photo|}}
21-
<div class='col-md-3 col-xs-6 photo-album-image-card'>
22-
<LinkTo
23-
@route='photo-albums.photo-album.photos.photo'
24-
@model={{photo.id}}
25-
>
26-
{{#if (or (and photo.amountOfComments (can 'show photo-comment')) (and photo.amountOfTags (can 'show photo-tag')))}}
27-
<span class='comments-counter badge bg-info bottom-0 start-0'>
28-
{{#if (and photo.amountOfComments (can 'show photo-comment'))}}
29-
<FaIcon @icon='comments' />
30-
{{photo.amountOfComments}}
31-
{{/if}}
32-
{{#if (and photo.amountOfTags (can 'show photo-tag'))}}
33-
<FaIcon @icon='tag' />
34-
{{photo.amountOfTags}}
35-
{{/if}}
36-
</span>
37-
{{/if}}
21+
{{#if this.session.isAuthenticated}}
22+
<div class='col-md-3 col-xs-6 photo-album-image-card'>
23+
<LinkTo
24+
@route='photo-albums.photo-album.photos.photo'
25+
@model={{photo.id}}
26+
>
27+
{{#if (or (and photo.amountOfComments (can 'show photo-comment')) (and photo.amountOfTags (can 'show photo-tag')))}}
28+
<span class='comments-counter badge bg-info bottom-0 start-0'>
29+
{{#if (and photo.amountOfComments (can 'show photo-comment'))}}
30+
<FaIcon @icon='comments' />
31+
{{photo.amountOfComments}}
32+
{{/if}}
33+
{{#if (and photo.amountOfTags (can 'show photo-tag'))}}
34+
<FaIcon @icon='tag' />
35+
{{photo.amountOfTags}}
36+
{{/if}}
37+
</span>
38+
{{/if}}
39+
<img class='image' src='{{photo.imageThumbUrl}}' />
40+
</LinkTo>
41+
</div>
42+
{{else}}
43+
<div class='col-md-3 col-xs-6 photo-album-image-card'>
3844
<img class='image' src='{{photo.imageThumbUrl}}' />
39-
</LinkTo>
40-
</div>
45+
</div>
46+
{{/if}}
4147
{{else}}
4248
<div class='alert alert-warning'>
4349
<LinkTo @route='photo-albums.photo-album.edit' @model={{model.id}}>

0 commit comments

Comments
 (0)