# HG changeset patch # User cavaliet # Date 1411639837 -7200 # Node ID 8a5d0b98754143d0fc8cd46d6a682b7745201c55 # Parent 2df551ebddefa1aaf1be50a835fc3519c9d9c8c1 search node in renkan diff -r 2df551ebddef -r 8a5d0b987541 src/hdalab/views/profile.py --- a/src/hdalab/views/profile.py Wed Sep 24 17:53:59 2014 +0200 +++ b/src/hdalab/views/profile.py Thu Sep 25 12:10:37 2014 +0200 @@ -344,6 +344,8 @@ related_tags = [] all_labels = [t.label for t in all_tags] title = "Recherche " + ", ".join(all_labels) + if period: + title += ", " + _("Period") + " " + period content["title"] = title related_tags_dict = {} for c in filter_output["contents"]: @@ -383,7 +385,7 @@ len_tags = len(all_tags) if period: len_tags += 1 - np.init({"tags": (1, len_tags), "datasheet": (2, len(filter_output["contents"])), "related": (3, len(related_tags))}) + np.init({"tags": (1, len_tags), "datasheet": (2, len(filter_output["contents"])), "related": (3, len(related_tags)), "northwest":(1, 1)}) for t in all_tags: img_url = t.dbpedia_fields.thumbnail if hasattr(t, 'dbpedia_fields') and t.dbpedia_fields and t.dbpedia_fields.thumbnail else None @@ -406,7 +408,7 @@ if period: content["nodes"].append({ "id": unicode(uuid.uuid1()), - "title": _("Period") + " : " + period, + "title": _("Period") + " " + period, "description": "", "uri": "", "position": np.get_place("tags"), @@ -462,6 +464,21 @@ #"created_by": "de68xf75y6hs5rgjhgghxbm217xk" }) + # Add search node + content["nodes"].append({ + "id": unicode(uuid.uuid1()), + "title": title, + "description": "", + "uri": reverse("facettes") + "?" + request.META['QUERY_STRING'], + "position": np.get_place("northwest"), + "image": "", + "size": 0, + "project_id": project_id, + "color": None, + #"created_by": "roster_user-84fe909f-ba37-48e6-a25f-9d2f129a95b7", + "shape": "circle" + }) + response = json.dumps(content) return HttpResponse(response, content_type="application/json")