Add user if user_if is given in the template
authorrougeronj
Mon, 29 Dec 2014 17:27:43 +0100
changeset 415 bf2db1849560
parent 414 260b4fb502a6
child 416 7082f0d58696
Add user if user_if is given in the template
src/hdalab/static/hdalab/js/renkan-manual-save.js
src/hdalab/templates/renkan_edit.html
--- a/src/hdalab/static/hdalab/js/renkan-manual-save.js	Tue Dec 23 11:06:18 2014 +0100
+++ b/src/hdalab/static/hdalab/js/renkan-manual-save.js	Mon Dec 29 17:27:43 2014 +0100
@@ -23,6 +23,10 @@
             data: getdata,
             success: function(_data) {
                 _proj.set(_data, {validate: true});
+                _proj.addUser({
+            		_id:_renkan.options.user_id,
+            		title:_renkan.options.user_name
+            	});
             	_renkan.renderer.autoScale();
             	// Green color when user is authenticated
             	if(_opts.user_authenticated==true){
--- a/src/hdalab/templates/renkan_edit.html	Tue Dec 23 11:06:18 2014 +0100
+++ b/src/hdalab/templates/renkan_edit.html	Mon Dec 29 17:27:43 2014 +0100
@@ -38,7 +38,8 @@
                     manual_save: true,
                 	user_color_editable: false,
                 	{% if user.is_authenticated %}
-                	user_id:"{{ user }}",
+                	user_id:"{{ user.id }}",
+                	user_name:"{{ user }}",
                 	{% endif %}
                     static_url : "{% static 'renkanmanager/lib/renkan/' %}",
                     search: [