# HG changeset patch # User durandn # Date 1467380262 -7200 # Node ID ed9acfa5dd6e938ea452f59a7f7040b787062da5 # Parent d47b3b09b15a39624cb1d987d9245403ba49f28c collection home page + tags in revision_detail view + optimization in views + fixture for demo diff -r d47b3b09b15a -r ed9acfa5dd6e src/iconolab/fixtures/demo_data.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/iconolab/fixtures/demo_data.json Fri Jul 01 15:37:42 2016 +0200 @@ -0,0 +1,136 @@ +[ + { + "model": "auth.User", + "pk": 1, + "fields": { + "username": "contributeur1", + "password": "pbkdf2_sha256$24000$4t81p9toYpfc$ufZAWaUcF51dpNqHscABIoW7UyoXxYDCRlKFI87vQJM=" + } + },{ + "model": "auth.User", + "pk": 2, + "fields": { + "username": "contributeur2", + "password": "pbkdf2_sha256$24000$b9CPP5bLU4FM$1IYIBS5y2CIEFV9jHdTdZjvj59hzx+yH5Akc5LsHo+g=" + } + },{ + "model": "iconolab.Collection", + "pk": 1, + "fields": { + "name": "ingres" + } + },{ + "model": "iconolab.Item", + "pk": 1, + "fields": { + "collection": 1 + } + },{ + "model": "iconolab.ItemMetadata", + "pk": 1, + "fields": { + "item": 1, + "domain": "dessin", + "title": "", + "description": "", + "joconde_ref": "1" + } + },{ + "model": "iconolab.Image", + "pk": 1, + "fields": { + "image_guid" : "26aec320-dcfe-4cbc-b912-6a6c13e8916e", + "name" : "MIC.8.10.jpg", + "media" : "uploads/MIC.8.10.jpg", + "item": 1, + "height": 2478, + "width": 3744, + "created": "2016-03-23 14:13:44.913765+01" + } + },{ + "model": "iconolab.ImageStats", + "pk": 1, + "fields": { + "image": 1, + "annotations_count": 0, + "submitted_revisions_count": 0, + "comments_count": 0, + "folders_inclusion_count": 0, + "tag_count": 0 + } + },{ + "model": "iconolab.Item", + "pk": 2, + "fields": { + "collection": 1 + } + },{ + "model": "iconolab.ItemMetadata", + "pk": 2, + "fields": { + "item": 2, + "domain": "dessin", + "title": "", + "description": "", + "joconde_ref": "2" + } + },{ + "model": "iconolab.Image", + "pk": 2, + "fields": { + "image_guid" : "de734457-b600-4bed-bb60-a03d906b8e6e", + "name" : "MIC.1.7.jpg", + "media" : "uploads/MIC.1.7.jpg", + "item": 2, + "height": 4672, + "width": 6171, + "created": "2016-03-23 14:13:44.913765+01" + } + },{ + "model": "iconolab.ImageStats", + "pk": 2, + "fields": { + "image": 2, + "annotations_count": 0, + "submitted_revisions_count": 0, + "comments_count": 0, + "folders_inclusion_count": 0, + "tag_count": 0 + } + },{ + "model": "iconolab.MetaCategory", + "pk": 1, + "fields": { + "collection": 1, + "label": "Appel à contribution" + } + },{ + "model": "iconolab.MetaCategory", + "pk": 2, + "fields": { + "collection": 1, + "label": "Appel à expert" + } + },{ + "model": "iconolab.MetaCategory", + "pk": 3, + "fields": { + "collection": 1, + "label": "Référence" + } + },{ + "model": "iconolab.MetaCategory", + "pk": 4, + "fields": { + "collection": 1, + "label": "Accord" + } + },{ + "model": "iconolab.MetaCategory", + "pk": 5, + "fields": { + "collection": 1, + "label": "Désaccord" + } + } +] \ No newline at end of file diff -r d47b3b09b15a -r ed9acfa5dd6e src/iconolab/models.py --- a/src/iconolab/models.py Fri Jul 01 16:47:22 2016 +0200 +++ b/src/iconolab/models.py Fri Jul 01 15:37:42 2016 +0200 @@ -272,15 +272,19 @@ #import label from external externaL_repos_fetch_dict = { "http://dbpedia.org/": fetch_from_dbpedia, + "http://fr.dbpedia.org/": fetch_from_dbpedia } - 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") - final_list.append({ - "tag_label": tag_label, - "tag_link": tag_link, - "accuracy": tagging_info.accuracy, - "relevancy": tagging_info.relevancy - }) + 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") + final_list.append({ + "tag_label": tag_label, + "tag_link": tag_link, + "accuracy": tagging_info.accuracy, + "relevancy": tagging_info.relevancy + }) + except StopIteration: + pass return json.dumps(final_list) class IconolabComment(XtdComment): diff -r d47b3b09b15a -r ed9acfa5dd6e src/iconolab/templates/iconolab/collection_home.html --- a/src/iconolab/templates/iconolab/collection_home.html Fri Jul 01 16:47:22 2016 +0200 +++ b/src/iconolab/templates/iconolab/collection_home.html Fri Jul 01 15:37:42 2016 +0200 @@ -6,4 +6,27 @@ {% load iconolab_tags %} -{% block content %}collectionhome{% endblock %} \ No newline at end of file +{% block content %} +
Images du fond
+ + {% for item in collection.items.all %} +