Commit 9f94b2ef authored by Luko van der Maas's avatar Luko van der Maas
Browse files

Merge branch 'fix/albums-grayscale' into 'master'

Fix grayscaling of unavailable albums

Closes #834

See merge request !1197
parents c19fde14 e2ea656a
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
{% block body %} {% block body %}
{% with keys=keywords|join:" " %} {% with keys=keywords|join:" " %}
<section id="photos-albums" class="page-section"> <section id="photos-index" class="page-section">
<div class="container"> <div class="container">
<h1 class="text-center section-title">{% trans "Photos" %}</h1> <h1 class="text-center section-title">{% trans "Photos" %}</h1>
......
...@@ -20,13 +20,15 @@ def album_card(album): ...@@ -20,13 +20,15 @@ def album_card(album):
if album.cover.rotation > 0: if album.cover.rotation > 0:
class_name += ' rotate{}'.format(album.cover.rotation) class_name += ' rotate{}'.format(album.cover.rotation)
url = album.get_absolute_url
if not album.accessible: if not album.accessible:
class_name += ' grayscale' class_name += ' grayscale'
url = None
return grid_item( return grid_item(
title=album.title, title=album.title,
meta_text='<p>{}</p>'.format(date(album.date, 'Y-m-d')), meta_text='<p>{}</p>'.format(date(album.date, 'Y-m-d')),
url=album.get_absolute_url, url=url,
image_url=image_url, image_url=image_url,
class_name=class_name, class_name=class_name,
) )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment