(www-display-object-desc): For genre `hng-card', add a link to card
authorMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 30 Oct 2019 06:18:26 +0000 (15:18 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 30 Oct 2019 06:18:26 +0000 (15:18 +0900)
image for the corresponding image-resource page.

cwiki-view.el

index ca965f2..d626714 100644 (file)
@@ -329,14 +329,21 @@ li { margin: 0 0 0 2em; }
             (setq ret (concord-object-get object '=hng-card))
             (setq ret (symbol-name ret))
             (string-match "\\([0-9]+\\)-\\([0-9]+\\)" ret))
-       (princ
-        (format
-         "<img alt=\"HNG-card:%s\"
+       (setq ret
+            (format
+             "<img alt=\"HNG-card:%s\"
 src=\"http://hng.chise.org/images/HNG/%03d/card/%04d.jpg\"
 style=\"height: 480px;\" />"
-         ret
-         (string-to-int (match-string 1 ret))
-         (string-to-int (match-string 2 ret))))
+             ret
+             (string-to-int (match-string 1 ret))
+             (string-to-int (match-string 2 ret))))
+       (princ
+        (if (setq image-cobj
+                  (car (concord-object-get object '->image-resource)))
+            (format "<a href=\"../image-resource/%s\">%s</a>"
+                    (www-uri-encode-object image-cobj)
+                    ret)
+          ret))
        )
        (t
        (setq ret (www-format-encode-string