diff options
author | Jochen Topf <jochen@topf.org> | 2014-09-05 16:55:21 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2014-09-05 16:55:21 +0200 |
commit | bf5f9f7ea67dcb49b9791825408b68d438785b4b (patch) | |
tree | c44ea1696e8c4302e56c9638639d3c32030df6e8 /web/lib | |
parent | 074e4eb4a002678e739652c1c4ff8905b00af17a (diff) | |
download | taginfo-bf5f9f7ea67dcb49b9791825408b68d438785b4b.tar taginfo-bf5f9f7ea67dcb49b9791825408b68d438785b4b.tar.gz |
Add project icons.
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/api/v4/project.rb | 8 |
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 |