From 52560266b585e63742a81e27a3b6f1ef194470c6 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Wed, 18 May 2022 21:09:05 +1000
Subject: Add wikipedia-link to tile-info display

Add 'wiki_id' and 'from_dbp' columns to 'descs' table, adjust dbpedia
data to include wikipedia IDs, adjust data generations scripts, make
server send extra data, and make TileInfo display it.
---
 src/components/TileInfoModal.vue | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

(limited to 'src/components/TileInfoModal.vue')

diff --git a/src/components/TileInfoModal.vue b/src/components/TileInfoModal.vue
index 625f02f..0ffeb5c 100644
--- a/src/components/TileInfoModal.vue
+++ b/src/components/TileInfoModal.vue
@@ -11,8 +11,7 @@ export default defineComponent({
 	data(){
 		return {
 			tolNode: null as null | TolNode,
-			desc: null as null | string,
-			fromRedirect: false,
+			descObj: null as null | {text: string, fromRedirect: boolean, wikiId: number, fromDbp: boolean},
 			imgInfo: null as null | {eolId: string, sourceUrl: string, license: string, copyrightOwner: string},
 		};
 	},
@@ -60,10 +59,7 @@ export default defineComponent({
 			.then(obj => {
 				if (obj != null){
 					this.tolNode = obj.nodeObj;
-					if (obj.desc != null){
-						this.desc = obj.desc.text;
-						this.fromRedirect = obj.desc.fromRedirect;
-					}
+					this.descObj = obj.descObj;
 					this.imgInfo = obj.imgInfo;
 				}
 			});
@@ -97,12 +93,17 @@ export default defineComponent({
 					</ul>
 				</div>
 			</div>
-			<div v-if="desc != null">
+			<div v-if="descObj != null">
 				<div>
-					Redirected: {{fromRedirect}}
+					Redirected: {{descObj.fromRedirect}} <br/>
+					Short-description from {{descObj.fromDbp ? 'DBpedia' : 'Wikipedia'}} <br/>
+					<a :href="'https://en.wikipedia.org/?curid=' + descObj.wikiId" class="underline">
+						Wikipedia Link
+					</a>
 				</div>
+				<hr/>
 				<div>
-					{{desc}}
+					{{descObj.text}}
 				</div>
 			</div>
 			<div v-else>
-- 
cgit v1.2.3

