Skip to content
Snippets Groups Projects
Commit 1ffac93e authored by tuhe's avatar tuhe
Browse files

updates

parent 3644d85a
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -11,6 +11,11 @@ urlpatterns =[
# Tue: Here we go with version 2.
# re_path(r'^present/$', TemplateView.as_view(template_name='kmap/kmap_presentation.html'), name='kmap_present'),
re_path(r'^kmap2/$', views.kmap2, name='kmap2'),
re_path(r'^kmap2_static/$', views.kmap2_static, name='kmap2_static'),
re_path(r'^mm2/$', views.mm2, name="kmap_mm2"),
# re_path(r'^mm/(?P<presentation_mode>\d+)$', views.mm, name="kmap_presentation_mode"),
]
\ No newline at end of file
......@@ -22,8 +22,53 @@ Tue: Starting over with the knowledge map using a free JS implementation (BSD).
def kmap2(request):
return render(request, 'kmap/kmap2.html')
def kmap2_static(request):
return render(request, 'kmap/kmap2_static.html')
import json
# from django.http import JsonResponse
def node():
return {}
style = {}
base = dict(elements={}, # nodes=[], edges=[]
style=[],
zoomingEnabled=True,
userZoomingEnabled=True,
zoom=0.8925320450269244,
minZoom=0.125,
maxZoom=16,
panningEnabled=True,
userPanningEnabled=True,
pan=dict(x=128.15184671589566, y=-93.65929006599106),
boxSelectionEnabled=True,
renderer=dict(name="canvas"),
wheelSensitivity=0.1,
motionBlur=True,
)
def meeting():
return {}
def mm2(request, presentation_mode=0):
response = HttpResponse(content_type='text/xml')
response = HttpResponse(content_type='application/x-javascript')
data = {'elements': {'nodes': 'myvar', 'x': 23, 'mlist': []} }
# s = json.dumps(data)
s = "uwsn = " + json.dumps(data,indent=True)
response.write(s)
return response
dictionary = {
"id": "04",
"name": "sunil",
"department": "HR"
}
# Now make the Json code.
print("Json stuff. ")
doc = Document()
map = doc.createElement("map")
map.setAttribute("version", "0.8.FA Alpha 5a")
......@@ -89,14 +134,9 @@ def font(doc, node, size=12, bold=False, italic=False):
def populate_meeting(doc, meeting):
node = create_node(doc, meeting.title(), background_color="#EEEEB4", link=meeting.get_absolute_url())
node = font(doc, node, 12, bold=False)
# tasks = models.task_in_project().filter(meeting = meeting)
# for t in tasks : node.appendChild(populate_task(doc, t))
node = populate_communication(doc, node, meeting)
node.appendChild(create_node(doc, u"%s"%meeting.red_leader, background_color="#EEaaaa"))
node.appendChild(create_node(doc, u"%s"%meeting.green_leader, background_color="#aaEEaa"))
return node
def populate_preject(doc, preject,presentation_mode):
......
......@@ -135,6 +135,7 @@ CSRF_TRUSTED_ORIGINS=['https://kubusnet.loca.lt', 'https://127.0.0.0.1']
# Application definition
INSTALLED_APPS = [
# 'livesync',
'project_admin_views.apps.ProjectadminviewsAppConfig',
'extra_admin_pages.apps.ExtraadminpagesAppConfig', # BEFPRE admin.
# 'admin_views', # Not working anymore.
......@@ -175,7 +176,9 @@ MIDDLEWARE = [
'dkbn2.middleware.dkbn2_middleware.ThreadLocalMiddleware',
'dkbn2.middleware.dkbn2_middleware.Dkbn2LoginMiddleware',
]
# MIDDLEWARE_CLASSES = [
# 'livesync.core.middleware.DjangoLiveSyncMiddleware',
# ]
ROOT_URLCONF = 'dkbn2.urls'
TEMPLATE_DIRS = [
......
{% extends "kmap/kmap_base2.html" %}
{% block kmapurl %}{% url 'kmap_mm2' %}{% endblock %}
\ No newline at end of file
{% block kmap_url %}{% url 'kmap_mm2' %}{% endblock %}
\ No newline at end of file
{% extends "kmap/kmap_base2.html" %}
{% load static %}
{% block kmapurl %}{% static 'js/uwsn.js' %}{% endblock %}
\ No newline at end of file
......@@ -30,7 +30,7 @@
<!-- <script src="https://raw.githack.com/kinimesi/cytoscape-svg/master/cytoscape-svg.js"></script> --> <!-- For svg export -->
<!-- We use a workaround here to be able to debug real world files in local by keeping json content as js variable. -->
<script type="text/javascript" src="{% static 'js/uwsn.js' %}"></script> <!-- actual data etc. -->
<script type="text/javascript" src="{% block kmap_url %}{% static 'js/uwsn.js'%}{% endblock %}"></script> <!-- actual data etc. -->
<style>
body {
font-family: helvetica neue, helvetica, liberation sans, arial, sans-serif;
......@@ -174,6 +174,10 @@
</head>
<body>
<h1> Knowledge Map </div>
<div><a href="{% url 'kmap2_static' %}">{% url 'kmap2_static' %}</a> || <a href="{% url 'kmap2' %}">{% url 'kmap2' %}</a>
||
<a href="{% url 'kmap_mm2' %}">{% url 'kmap_mm2' %}</a>
</div>
<div id="cy"></div>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment