# HG changeset patch # User durandn # Date 1467387603 -7200 # Node ID 147c8a8b66b6479124e1a9df103ff1a58c55bff5 # Parent ed9acfa5dd6e938ea452f59a7f7040b787062da5 streamlined templates for easy navigation and missing info + handled fr.dbpedia tags diff -r ed9acfa5dd6e -r 147c8a8b66b6 src/iconolab/models.py --- a/src/iconolab/models.py Fri Jul 01 15:37:42 2016 +0200 +++ b/src/iconolab/models.py Fri Jul 01 17:40:03 2016 +0200 @@ -242,10 +242,10 @@ def get_tags_json(self): - def fetch_from_dbpedia(uri, lang): + def fetch_from_dbpedia(uri, lang, source): sparql_template = 'select distinct * where { <<%uri%>> rdfs:label ?l FILTER( langMatches( lang(?l), "<%lang%>" ) ) }' sparql_query = re.sub("<%uri%>", uri, re.sub("<%lang%>", lang, sparql_template)) - sparql_query_url = "http://dbpedia.org/sparql" + sparql_query_url = source+'sparql' dbpedia_resp = requests.get( sparql_query_url, params={ @@ -275,8 +275,8 @@ "http://fr.dbpedia.org/": fetch_from_dbpedia } try: - fetch_label = next(handling_function for base_uri, handling_function in externaL_repos_fetch_dict.items() if tag_link.startswith(base_uri)) - tag_label = fetch_label(tag_link, "fr") + (source, fetch_label) = next(item for item in externaL_repos_fetch_dict.items() if tag_link.startswith(item[0])) + tag_label = fetch_label(tag_link, "fr", source) final_list.append({ "tag_label": tag_label, "tag_link": tag_link, diff -r ed9acfa5dd6e -r 147c8a8b66b6 src/iconolab/templates/iconolab/detail_annotation.html --- a/src/iconolab/templates/iconolab/detail_annotation.html Fri Jul 01 15:37:42 2016 +0200 +++ b/src/iconolab/templates/iconolab/detail_annotation.html Fri Jul 01 17:40:03 2016 +0200 @@ -30,14 +30,15 @@
Title: {{ annotation.current_revision.title }}
Description: {{ annotation.current_revision.description }}
Tags:
{{ comment.comment }}
Title: {{ revision.title }}
Description: {{ revision.description }}
Tags:
diff -r ed9acfa5dd6e -r 147c8a8b66b6 src/iconolab/templates/iconolab/home.html --- a/src/iconolab/templates/iconolab/home.html Fri Jul 01 15:37:42 2016 +0200 +++ b/src/iconolab/templates/iconolab/home.html Fri Jul 01 17:40:03 2016 +0200 @@ -6,4 +6,6 @@ {% load iconolab_tags %} -{% block content %}globalhome{% endblock %} \ No newline at end of file +{% block content %} +