aboutsummaryrefslogtreecommitdiff
path: root/web/lib
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2014-09-05 16:55:21 +0200
committerJochen Topf <jochen@topf.org>2014-09-05 16:55:21 +0200
commitbf5f9f7ea67dcb49b9791825408b68d438785b4b (patch)
treec44ea1696e8c4302e56c9638639d3c32030df6e8 /web/lib
parent074e4eb4a002678e739652c1c4ff8905b00af17a (diff)
downloadtaginfo-bf5f9f7ea67dcb49b9791825408b68d438785b4b.tar
taginfo-bf5f9f7ea67dcb49b9791825408b68d438785b4b.tar.gz
Add project icons.
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/api/v4/project.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/web/lib/api/v4/project.rb b/web/lib/api/v4/project.rb
index 94eeadc..b461b72 100644
--- a/web/lib/api/v4/project.rb
+++ b/web/lib/api/v4/project.rb
@@ -57,10 +57,14 @@ class Taginfo < Sinatra::Base
:ui => '/projects'
}) do
project_id = params[:project]
- content_type :png
- @db.select('SELECT icon FROM projects.projects').
+ url = @db.select('SELECT icon_url FROM projects.projects').
condition('id = ?', project_id).
get_first_value()
+ if url.nil? || url == ''
+ redirect '/img/generic_project_icon.png'
+ else
+ redirect url
+ end
end
end