Only show screenshots for items that are actually images

This commit is contained in:
Sebastiaan Janssen
2017-01-01 13:13:02 +01:00
parent c50775d788
commit 4b49b0d52d
@@ -145,9 +145,15 @@
<h2>Screenshots</h2>
@foreach (var image in Project.ScreenShots)
{
<a href="@image.Path" class="projectscreenshot" rel="shadowbox[gallery]">
<img src="@image.Path?bgcolor=fff&width=100&height=100&format=png" style="border:0;" />
</a>
if (image.Path.EndsWith("gif") ||
image.Path.EndsWith("png") ||
image.Path.EndsWith("jpg") ||
image.Path.EndsWith("jpeg"))
{
<a href="@image.Path" class="projectscreenshot" rel="shadowbox[gallery]">
<img src="@image.Path?bgcolor=fff&width=100&height=100&format=png" style="border: 0;"/>
</a>
}
}
</div>