annotation_dashboard/commit

IMPROVED: be more robust in missing images

authorJacco van Ossenbruggen
Mon Sep 22 18:29:11 2014 +0200
committerJacco van Ossenbruggen
Mon Sep 22 18:29:11 2014 +0200
commit8919b044caa14cd716d9d4879ae77c15bd8b3e5f
tree5b0e9c541ea5ae2c3c18ecfa7d1d69ecfa13a440
parent7331032da63b91e719b0a7a8d91579cbc682ddac
Diff style: patch stat
diff --git a/components/dashboard/show_tasks.pl b/components/dashboard/show_tasks.pl
index d7a67d8..8a3ee5f 100644
--- a/components/dashboard/show_tasks.pl
+++ b/components/dashboard/show_tasks.pl
@@ -5,9 +5,8 @@
 :- use_module(library(sort)).
 :- use_module(library(http/html_write)).
 :- use_module(library(http/http_dispatch)).
-
-:- use_module(library(semweb/rdf_db)).
 :- use_module(library(semweb/rdf_label)).
+
 :- use_module(library(dashboard_util)).
 :- use_module(applications(annotation)).
 :- use_module(show_option_list).
@@ -26,19 +25,19 @@ show_task(Task) -->
 	  http_link_to_id(http_dashboard_task, [task(Task)], TaskLink),
 	  find_task_properties(Task, Props0, Representative,[]),
 	  predsort(task_compare, Props0, Props),
-	  object_image(Representative, Image),
-	  http_link_to_id(http_medium_fit, [uri(Image)], ImageHref)
-
+	  (   no_object_image(Representative)
+	  ->  Img = span('no example image for this task available')
+	  ;   object_image(Representative, Image),
+	      http_link_to_id(http_medium_fit, [uri(Image)], ImageHref),
+	      Img = img([src(ImageHref), alt('Example image for this task'),
+				 class('img-responsive')],[])
+	  )
 	},
 	html([div(class(row),
 		  [ h3([class('sub-header')],
 		       [a([href(TaskLink)],Title)]),
-		    div(class('col-sm-5'),
-			[
-			    img([src(ImageHref), alt('Example image for this task'),
-				 class('img-responsive')],[])
-			]),
-		    div(class('col-sm-7'),
+		    div([class('col-sm-5')],[ Img ]),
+		    div([class('col-sm-7')],
 			[
 			  div([class('table-responsive')],
 			      [table([class('table table-striped')],