aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2015-12-29 12:54:14 (UTC)
committerjan <jan@ruken.pw>2015-12-29 12:54:14 (UTC)
commit5fc85b069844a4a4f242559ae76ba900bccd7ba3 (patch)
tree10eb10eda246017dd4c1e8c4a8b586deb556ae54
parent0921b37a8b3f7f97128ae447b75cffeb1d4d22dc (diff)
alternativ das thumbnail als bild anzeigen
-rw-r--r--modules/grils/grils.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/grils/grils.go b/modules/grils/grils.go
index 7cbec77..9bfd6e6 100644
--- a/modules/grils/grils.go
+++ b/modules/grils/grils.go
@@ -184,6 +184,16 @@ func (m *GrilsModule) viewGril(w http.ResponseWriter, r *http.Request, p httprou
184 break 184 break
185 } 185 }
186 } 186 }
187
188 if len(imagePath) == 0 {
189 for _, ext := range exts {
190 path := fmt.Sprintf("assets/img/gril/%d/1.%s", gril.ID, ext)
191 if _, err := os.Stat(path); err == nil {
192 imagePath = path
193 break
194 }
195 }
196 }
187 data["imagePath"] = "/" + imagePath 197 data["imagePath"] = "/" + imagePath
188 198
189 m.g.Renderer.RenderPage("gril", w, data) 199 m.g.Renderer.RenderPage("gril", w, data)