Minor - format code

1.10.x
Julio Montoya 11 years ago
parent e54706f469
commit 8bc3b9a38e
  1. 3
      main/admin/skills_wheel.php
  2. 200
      main/template/default/skill/skill_wheel.js.tpl
  3. 309
      main/template/default/skill/skill_wheel.tpl

@ -40,11 +40,10 @@ if (isset($_GET['skill_id'])) {
$url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user"; $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
$tpl->assign('wheel_url', $url); $tpl->assign('wheel_url', $url);
$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1'; $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
$tpl->assign('url', $url); $tpl->assign('url', $url);
$tpl->assign('isAdministration', true); $tpl->assign('isAdministration', true);
$content = $tpl->fetch('default/skill/skill_wheel.tpl'); $content = $tpl->fetch('default/skill/skill_wheel.tpl');
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_no_layout_template(); $tpl->display_no_layout_template();

@ -13,7 +13,7 @@ var main_parent_id = 0;
// Used to split in two word or not // Used to split in two word or not
var max_size_text_length = 20; var max_size_text_length = 20;
/* ColorBrewer settings */ /* ColorBrewer settings */
var my_domain = [1,2,3,4,5,6,7,8,9]; var my_domain = [1,2,3,4,5,6,7,8,9];
var col = 9; var col = 9;
@ -22,16 +22,16 @@ var color_patterns = [];
/* /*
See colorbrewer documentation See colorbrewer documentation
color_patterns[1] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Blues[col]); color_patterns[1] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Blues[col]);
color_patterns[2] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Purples[col]); color_patterns[2] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Purples[col]);
color_patterns[2] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Blues[6]); color_patterns[2] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Blues[6]);
color_patterns[3] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Greens[col]); color_patterns[3] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Greens[col]);
color_patterns[4] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Reds[col]); color_patterns[4] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Reds[col]);
color_patterns[5] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Oranges[col]); color_patterns[5] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.Oranges[col]);
color_patterns[6] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.YlOrBr[col]); color_patterns[6] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.YlOrBr[col]);
color_patterns[7] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.YlGn[col]); color_patterns[7] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.YlGn[col]);
color_patterns[8] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.YlGnBu[col]); color_patterns[8] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.YlGnBu[col]);
color_patterns[9] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.GnBu[col]); color_patterns[9] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.GnBu[col]);
color_patterns[10] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.BuGn[col]); color_patterns[10] = d3.scale.ordinal().domain(my_domain).range(colorbrewer.BuGn[col]);
@ -58,7 +58,7 @@ var color_loops = 4;
// Generating array of colors thanks to the "$.xcolor.analogous" function we can create a rainbow style! // Generating array of colors thanks to the "$.xcolor.analogous" function we can create a rainbow style!
for (i= 0; i < color_loops; i++) { for (i= 0; i < color_loops; i++) {
//Getting the latest color hex of the 8 colors loaded //Getting the latest color hex of the 8 colors loaded
last_color = colors[colors.length-1].getHex(); last_color = colors[colors.length-1].getHex();
//Getting the complementary //Getting the complementary
glue_color = $.xcolor.complementary(last_color); glue_color = $.xcolor.complementary(last_color);
@ -116,32 +116,32 @@ function isParentOf(p, c) {
}); });
} }
return false; return false;
} }
function get_color(d) { function get_color(d) {
depth = d.depth; depth = d.depth;
if (d.family_id) { if (d.family_id) {
/*var p = color_patterns[d.family_id]; /*var p = color_patterns[d.family_id];
color = p(depth -1 + d.counter); color = p(depth -1 + d.counter);
d.color = color;*/ d.color = color;*/
if (depth > 1) { if (depth > 1) {
family1 = colors[d.family_id]; family1 = colors[d.family_id];
family2 = colors[d.family_id + 2]; family2 = colors[d.family_id + 2];
position = d.depth*d.counter; position = d.depth*d.counter;
//part_color = $.xcolor.gradientlevel(family1, family2, position, 100); //part_color = $.xcolor.gradientlevel(family1, family2, position, 100);
part_color = $.xcolor.lighten(family1, position, 15); part_color = $.xcolor.lighten(family1, position, 15);
color = part_color.getHex(); color = part_color.getHex();
//console.log(d.depth + " - " + d.name + " + "+ color+ "+ " +d.counter); //console.log(d.depth + " - " + d.name + " + "+ color+ "+ " +d.counter);
} else { } else {
color = colors[d.family_id]; color = colors[d.family_id];
} }
return color; return color;
} }
color = '#fefefe'; color = '#fefefe';
return color; //missing colors return color; //missing colors
} }
/* /*
gray tones for all skills that have no particular property ("Basic skills wheel" view) gray tones for all skills that have no particular property ("Basic skills wheel" view)
yellow tones for skills that are provided by courses in Chamilo ("Teachable skills" view) yellow tones for skills that are provided by courses in Chamilo ("Teachable skills" view)
bright blue tones for personal skills already acquired by the student currently looking at the weel ("My skills" view) bright blue tones for personal skills already acquired by the student currently looking at the weel ("My skills" view)
@ -152,7 +152,7 @@ bright red for missing skills, in the "Required skills" view for a student when
*/ */
/** /**
Manage the partition background colors Manage the partition background colors
**/ **/
function set_skill_style(d, attribute, searched_skill_id) { function set_skill_style(d, attribute, searched_skill_id) {
//Default border color (stroke) //Default border color (stroke)
@ -160,14 +160,14 @@ function set_skill_style(d, attribute, searched_skill_id) {
//0. Nice rainbow colors (Comment 1.0 to see the rainbow!) //0. Nice rainbow colors (Comment 1.0 to see the rainbow!)
return_fill = get_color(d); return_fill = get_color(d);
//1. Grey colors using colorbrewer //1. Grey colors using colorbrewer
var p = color_patterns[18]; var p = color_patterns[18];
color = p(depth -1 + d.counter); color = p(depth -1 + d.counter);
return_fill = color; return_fill = color;
//2. Yellow - If the skill has a gradebook attached //2. Yellow - If the skill has a gradebook attached
if (d.skill_has_gradebook) { if (d.skill_has_gradebook) {
return_fill = '#F89406'; return_fill = '#F89406';
//return_stroke = 'grey'; //return_stroke = 'grey';
} }
@ -176,7 +176,7 @@ function set_skill_style(d, attribute, searched_skill_id) {
if (d.isSearched) { if (d.isSearched) {
return_fill = '#B94A48'; return_fill = '#B94A48';
} }
//4. Blue - if user achieved that skill //4. Blue - if user achieved that skill
//var skill = false; //var skill = false;
$.ajax({ $.ajax({
@ -187,7 +187,7 @@ function set_skill_style(d, attribute, searched_skill_id) {
return_fill = '#3A87AD'; return_fill = '#3A87AD';
} }
} }
}); });
switch (attribute) { switch (attribute) {
case 'fill': case 'fill':
@ -203,7 +203,7 @@ function set_skill_style(d, attribute, searched_skill_id) {
/* When you click a skill partition */ /* When you click a skill partition */
function click_partition(d, path, text, icon, arc, x, y, r, p, vis) { function click_partition(d, path, text, icon, arc, x, y, r, p, vis) {
//console.log(d.depth); //console.log(d.depth);
if (debug) { if (debug) {
console.log('Clicking a partition skill id: '+d.id); console.log('Clicking a partition skill id: '+d.id);
console.log(d); console.log(d);
@ -213,27 +213,27 @@ function click_partition(d, path, text, icon, arc, x, y, r, p, vis) {
console.log('main_parent_id: ' + main_parent_id); console.log('main_parent_id: ' + main_parent_id);
} }
if (d.depth >= main_depth) { if (d.depth >= main_depth) {
//main_depth += main_depth; //main_depth += main_depth;
if (main_parent_id) { if (main_parent_id) {
load_nodes(main_parent_id, main_depth); load_nodes(main_parent_id, main_depth);
} else { } else {
load_nodes(d.id, main_depth); load_nodes(d.id, main_depth);
} }
} }
if (d.id) { if (d.id) {
console.log('Getting skill info'); console.log('Getting skill info');
skill_info = get_skill_info(d.parent_id); skill_info = get_skill_info(d.parent_id);
console.log(skill_info); console.log(skill_info);
main_parent_id = skill_info.extra.parent_id; main_parent_id = skill_info.extra.parent_id;
main_parent_id = d.parent_id; main_parent_id = d.parent_id;
console.log('Setting main_parent_id: ' + main_parent_id); console.log('Setting main_parent_id: ' + main_parent_id);
} }
//console.log(main_parent_id); //console.log(main_parent_id);
/* "No id" means that we reach the center of the wheel go to the root*/ /* "No id" means that we reach the center of the wheel go to the root*/
if (!d.id) { if (!d.id) {
load_nodes(main_parent_id, main_depth); load_nodes(main_parent_id, main_depth);
} }
@ -285,7 +285,7 @@ function click_partition(d, path, text, icon, arc, x, y, r, p, vis) {
return x(d.x + d.dx / 2) > Math.PI ? "end" : "start"; return x(d.x + d.dx / 2) > Math.PI ? "end" : "start";
}; };
}) })
.attrTween("transform", function(d) { .attrTween("transform", function(d) {
return function() { return function() {
var angle = x(d.x + d.dx / 2) * 180 / Math.PI - 90, var angle = x(d.x + d.dx / 2) * 180 / Math.PI - 90,
rotate = angle; rotate = angle;
@ -300,12 +300,12 @@ function click_partition(d, path, text, icon, arc, x, y, r, p, vis) {
});*/ });*/
} }
/* /*
Open a popup in order to modify the skill Open a popup in order to modify the skill
*/ */
function open_popup(skill_id, parent_id) { function open_popup(skill_id, parent_id) {
//Cleaning selects // Cleaning selects
$("#gradebook_id").find('option').remove(); $("#gradebook_id").find('option').remove();
$("#parent_id").find('option').remove(); $("#parent_id").find('option').remove();
//Cleaning lists //Cleaning lists
$("#gradebook_holder").find('li').remove(); $("#gradebook_holder").find('li').remove();
@ -335,15 +335,15 @@ function open_popup(skill_id, parent_id) {
$("#description").text(skill.description); $("#description").text(skill.description);
} }
//Filling parent_id // Filling parent_id
$("#parent_id").append('<option class="selected" value="'+skill.extra.parent_id+'" selected="selected" >'); $("#parent_id").append('<option class="selected" value="'+skill.extra.parent_id+'" selected="selected" >');
$("#skill_edit_holder").append('<li class="bit-box">'+parent_info.name+'</li>'); $("#skill_edit_holder").append('<li class="bit-box">'+parent_info.name+'</li>');
//Filling the gradebook_id //Filling the gradebook_id
jQuery.each(skill.gradebooks, function(index, data) { jQuery.each(skill.gradebooks, function(index, data) {
$("#gradebook_id").append('<option class="selected" value="'+data.id+'" selected="selected" >'); $("#gradebook_id").append('<option class="selected" value="'+data.id+'" selected="selected" >');
$("#gradebook_holder").append('<li id="gradebook_item_'+data.id+'" class="bit-box">'+data.name+' <a rel="'+data.id+'" class="closebutton" href="#"></a> </li>'); $("#gradebook_holder").append('<li id="gradebook_item_'+data.id+'" class="bit-box">'+data.name+' <a rel="'+data.id+'" class="closebutton" href="#"></a> </li>');
}); });
if ("{{ isAdministration }}") { if ("{{ isAdministration }}") {
@ -377,7 +377,7 @@ function open_popup(skill_id, parent_id) {
}); });
$("#dialog-form").dialog("open"); $("#dialog-form").dialog("open");
} }
if (parent) { if (parent) {
$("#id").attr('value',''); $("#id").attr('value','');
@ -385,31 +385,31 @@ function open_popup(skill_id, parent_id) {
$("#short_code").attr('value', ''); $("#short_code").attr('value', '');
$("#description").attr('value', ''); $("#description").attr('value', '');
//Filling parent_id //Filling parent_id
$("#parent_id").append('<option class="selected" value="'+parent.id+'" selected="selected" >'); $("#parent_id").append('<option class="selected" value="'+parent.id+'" selected="selected" >');
$("#skill_edit_holder").append('<li class="bit-box">'+parent.name+'</li>'); $("#skill_edit_holder").append('<li class="bit-box">'+parent.name+'</li>');
//Filling the gradebook_id //Filling the gradebook_id
jQuery.each(parent.gradebooks, function(index, data) { jQuery.each(parent.gradebooks, function(index, data) {
$("#gradebook_id").append('<option class="selected" value="'+data.id+'" selected="selected" >'); $("#gradebook_id").append('<option class="selected" value="'+data.id+'" selected="selected" >');
$("#gradebook_holder").append('<li id="gradebook_item_'+data.id+'" class="bit-box">'+data.name+' <a rel="'+data.id+'" class="closebutton" href="#"></a> </li>'); $("#gradebook_holder").append('<li id="gradebook_item_'+data.id+'" class="bit-box">'+data.name+' <a rel="'+data.id+'" class="closebutton" href="#"></a> </li>');
}); });
$("#dialog-form").dialog({ $("#dialog-form").dialog({
buttons: { buttons: {
"{{ "Save"|get_lang }}" : function() { "{{ "Save"|get_lang }}" : function() {
var params = $("#add_item").find(':input').serialize(); var params = $("#add_item").find(':input').serialize();
add_skill(params); add_skill(params);
} }
}, },
close: function() { close: function() {
$("#name").attr('value', ''); $("#name").attr('value', '');
$("#description").attr('value', ''); $("#description").attr('value', '');
load_nodes(0, main_depth); load_nodes(0, main_depth);
} }
}); });
$("#dialog-form").dialog("open"); $("#dialog-form").dialog("open");
} }
return false; return false;
} }
@ -417,24 +417,24 @@ function open_popup(skill_id, parent_id) {
/* Handles mouse clicks */ /* Handles mouse clicks */
function handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis) { function handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis) {
switch (d3.event.which) { switch (d3.event.which) {
case 1: case 1:
//alert('Left mouse button pressed'); //alert('Left mouse button pressed');
click_partition(d, path, text, icon, arc, x, y, r, padding, vis); click_partition(d, path, text, icon, arc, x, y, r, padding, vis);
break; break;
case 2: case 2:
//alert('Middle mouse button pressed'); //alert('Middle mouse button pressed');
break; break;
case 3: case 3:
open_popup(d.id); open_popup(d.id);
//alert('Right mouse button pressed'); //alert('Right mouse button pressed');
break; break;
default: default:
//alert('You have a strange mouse :D '); // //alert('You have a strange mouse :D '); //
} }
} }
/*
/*
Loads the skills partitions thanks to a json call Loads the skills partitions thanks to a json call
*/ */
function load_nodes(load_skill_id, main_depth, extra_parent_id) { function load_nodes(load_skill_id, main_depth, extra_parent_id) {
@ -444,20 +444,20 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
console.log('main_parent_id before: ' + main_parent_id); console.log('main_parent_id before: ' + main_parent_id);
} }
//"Root partition" on click switch //"Root partition" on click switch
if (main_parent_id && load_skill_id) { if (main_parent_id && load_skill_id) {
skill_info = get_skill_info(load_skill_id); skill_info = get_skill_info(load_skill_id);
if (skill_info && skill_info.extra) { if (skill_info && skill_info.extra) {
main_parent_id = skill_info.extra.parent_id; main_parent_id = skill_info.extra.parent_id;
} else { } else {
main_parent_id = 0; main_parent_id = 0;
} }
console.log('main_parent_id after: ' + main_parent_id); console.log('main_parent_id after: ' + main_parent_id);
} }
if (load_skill_id && load_skill_id == 1) { if (load_skill_id && load_skill_id == 1) {
main_parent_id = 0; main_parent_id = 0;
} }
/** Define constants and size of the wheel */ /** Define constants and size of the wheel */
@ -469,7 +469,7 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
x = d3.scale.linear().range([0, 2 * Math.PI]), x = d3.scale.linear().range([0, 2 * Math.PI]),
y = d3.scale.pow().exponent(1.1).domain([0, 1]).range([0, r]), y = d3.scale.pow().exponent(1.1).domain([0, 1]).range([0, r]),
/** Padding in pixels before the string starts */ /** Padding in pixels before the string starts */
padding = 3, padding = 3,
/** Levels to show */ /** Levels to show */
levels_to_show = 3; levels_to_show = 3;
reduce_top = 1; reduce_top = 1;
@ -534,22 +534,22 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
} }
//The JS load //The JS load
if (load_skill_id != 0) { if (load_skill_id != 0) {
load_skill_condition = 'skill_id=' + load_skill_id; load_skill_condition = 'skill_id=' + load_skill_id;
} }
d3.json("{{ wheel_url }}&main_depth="+main_depth+"&"+load_skill_condition, function(json) { d3.json("{{ wheel_url }}&main_depth="+main_depth+"&"+load_skill_condition, function(json) {
/** Define the list of nodes based on the JSON */ /** Define the list of nodes based on the JSON */
var nodes = partition.nodes({ var nodes = partition.nodes({
children: json children: json
}); });
/* Setting all skills */ /* Setting all skills */
var path = vis.selectAll("path").data(nodes); var path = vis.selectAll("path").data(nodes);
/* Setting all texts */ /* Setting all texts */
var text = vis.selectAll("text").data(nodes); var text = vis.selectAll("text").data(nodes);
/* Setting icons */ /* Setting icons */
var icon = vis.selectAll("icon").data(nodes); var icon = vis.selectAll("icon").data(nodes);
@ -570,20 +570,20 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
return set_skill_style(d, 'stroke'); return set_skill_style(d, 'stroke');
}) })
.on("mouseover", function(d, i) { .on("mouseover", function(d, i) {
//$("#icon-" + i).show(); //$("#icon-" + i).show();
}) })
.on("mouseout", function(d, i) { .on("mouseout", function(d, i) {
//$("#icon-" + i).hide(); //$("#icon-" + i).hide();
}) })
.on("contextmenu", function(d, i) { .on("contextmenu", function(d, i) {
//Handles mouse clicks //Handles mouse clicks
handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis); handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis);
//Blocks "right click menu" //Blocks "right click menu"
d3.event.preventDefault(); d3.event.preventDefault();
return false; return false;
}) })
.on("mousedown", function(d, i) { .on("mousedown", function(d, i) {
}) })
.on("click", function(d) { .on("click", function(d) {
//Simple click //Simple click
handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis); handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis);
@ -597,14 +597,14 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
click_partition(d, path, text, icon, arc, x, y, r, padding, vis); click_partition(d, path, text, icon, arc, x, y, r, padding, vis);
});*/ });*/
/* End setting skills */ /* End setting skills */
/* Text settings */ /* Text settings */
var textEnter = text.enter().append("text") var textEnter = text.enter().append("text")
.style("fill-opacity", 1) .style("fill-opacity", 1)
.style("fill", function(d) { .style("fill", function(d) {
return brightness(d3.rgb(d.color)) < 125 ? "#eee" : "#000"; return brightness(d3.rgb(d.color)) < 125 ? "#eee" : "#000";
}) })
.attr("text-anchor", function(d) { .attr("text-anchor", function(d) {
return x(d.x + d.dx / 2) > Math.PI ? "end" : "start"; return x(d.x + d.dx / 2) > Math.PI ? "end" : "start";
}) })
@ -620,47 +620,47 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
rotate = angle + (multiline ? -.5 : 0); rotate = angle + (multiline ? -.5 : 0);
return "rotate(" + rotate + ")translate(" + (y(d.y) + padding) + ")rotate(" + (angle > 90 ? -180 : 0) + ")"; return "rotate(" + rotate + ")translate(" + (y(d.y) + padding) + ")rotate(" + (angle > 90 ? -180 : 0) + ")";
}) })
.on("mouseover", function(d, i) { .on("mouseover", function(d, i) {
//$("#icon-" + i).show(); //$("#icon-" + i).show();
}) })
.on("mouseout", function(d, i) { .on("mouseout", function(d, i) {
//$("#icon-" + i).hide(); //$("#icon-" + i).hide();
}) })
.on("contextmenu", function(d, i) { .on("contextmenu", function(d, i) {
handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis); handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis);
d3.event.preventDefault(); d3.event.preventDefault();
}) })
.on("mousedown", function(d, i) { .on("mousedown", function(d, i) {
}) })
.on("click", function(d) { .on("click", function(d) {
handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis); handle_mousedown_event(d, path, text, icon, arc, x, y, r, padding, vis);
}); });
/** Managing text - maximum two words */ /** Managing text - maximum two words */
var insert_two_words = false; var insert_two_words = false;
textEnter.append("tspan") textEnter.append("tspan")
.attr("x", 0) .attr("x", 0)
.text(function(d) { .text(function(d) {
if (d.depth && d.name.length > max_size_text_length) { if (d.depth && d.name.length > max_size_text_length) {
if (d.depth) { if (d.depth) {
first_part = d.name.split(" ")[0]; first_part = d.name.split(" ")[0];
second_part = d.name.split(" ")[1]; second_part = d.name.split(" ")[1];
if (first_part.length >= max_size_text_length) { if (first_part.length >= max_size_text_length) {
insert_two_words = false; insert_two_words = false;
return first_part.substring(0, max_size_text_length -3) + ' ... '; return first_part.substring(0, max_size_text_length -3) + ' ... ';
} else { } else {
return first_part; return first_part;
} }
} else { } else {
return ""; return "";
} }
} else { } else {
insert_two_words = false; insert_two_words = false;
return d.depth ? d.name : ""; return d.depth ? d.name : "";
} }
}); });
if (insert_two_words) { if (insert_two_words) {
textEnter.append("tspan") textEnter.append("tspan")
.attr("x", 0) .attr("x", 0)
@ -677,13 +677,13 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
/* /*
var icon_click = icon.enter().append("text") var icon_click = icon.enter().append("text")
.style("fill-opacity", 1) .style("fill-opacity", 1)
.style("fill", function(d) { .style("fill", function(d) {
//return "#000"; //return "#000";
}) })
.attr("text-anchor", function(d) { .attr("text-anchor", function(d) {
return x(d.x + d.dx / 2) > Math.PI ? "end" : "start"; return x(d.x + d.dx / 2) > Math.PI ? "end" : "start";
}) })
.attr("dy", ".2em") .attr("dy", ".2em")
.attr("transform", function(d) { .attr("transform", function(d) {
///Get the text details and define the rotation and general position ///Get the text details and define the rotation and general position
angle = x(d.x + d.dx / 2) * 180 / Math.PI - 90, angle = x(d.x + d.dx / 2) * 180 / Math.PI - 90,
@ -695,11 +695,11 @@ function load_nodes(load_skill_id, main_depth, extra_parent_id) {
}); });
icon_click.append("tspan") icon_click.append("tspan")
.attr("id", function(d, i) { .attr("id", function(d, i) {
return "icon-" + i; return "icon-" + i;
}) })
.attr("x", 0) .attr("x", 0)
.attr("display", 'none') .attr("display", 'none')
.text(function(d) { .text(function(d) {
//return "Click"; //return "Click";
});*/ });*/
@ -717,7 +717,7 @@ function get_skill_info(my_id) {
var skill = false; var skill = false;
$.ajax({ $.ajax({
url: url+'&a=get_skill_info&id='+my_id, url: url+'&a=get_skill_info&id='+my_id,
async: false, async: false,
success: function(json) { success: function(json) {
skill = jQuery.parseJSON(json); skill = jQuery.parseJSON(json);
return skill; return skill;
@ -730,12 +730,12 @@ function get_gradebook_info(id) {
var item = false; var item = false;
$.ajax({ $.ajax({
url: url+'&a=get_gradebook_info&id='+id, url: url+'&a=get_gradebook_info&id='+id,
async: false, async: false,
success: function(json) { success: function(json) {
item = jQuery.parseJSON(json); item = jQuery.parseJSON(json);
return item; return item;
} }
}); });
return item; return item;
} }

@ -8,54 +8,53 @@ function add_skill(params) {
url: url+'&a=add&'+params, url: url+'&a=add&'+params,
success:function(my_id) { success:function(my_id) {
//Close dialog //Close dialog
$("#dialog-form").dialog("close"); $("#dialog-form").dialog("close");
} }
}); });
} }
/* Skill search input in the left menu */ /* Skill search input in the left menu */
function check_skills_sidebar() { function check_skills_sidebar() {
//Selecting only selected skills //Selecting only selected skills
$("#skill_id option:selected").each(function() { $("#skill_id option:selected").each(function() {
var skill_id = $(this).val(); var skill_id = $(this).val();
if (skill_id != "" ) { if (skill_id != "" ) {
$.ajax({ $.ajax({
url: "{{ url }}&a=skill_exists", url: "{{ url }}&a=skill_exists",
data: "skill_id="+skill_id, data: "skill_id="+skill_id,
// async: false, // async: false,
success: function(return_value) { success: function(return_value) {
if (return_value == 0 ) { if (return_value == 0 ) {
alert("{{ 'SkillDoesNotExist'|get_lang }}"); alert("{{ 'SkillDoesNotExist'|get_lang }}");
//Deleting select option tag //Deleting select option tag
//$("#skill_id option[value="+skill_id+"]").remove(); //$("#skill_id option[value="+skill_id+"]").remove();
$("#skill_id").empty(); $("#skill_id").empty();
//Deleting holder //Deleting holder
$("#skill_search .holder li").each(function () { $("#skill_search .holder li").each(function () {
if ($(this).attr("rel") == skill_id) { if ($(this).attr("rel") == skill_id) {
$(this).remove(); $(this).remove();
} }
}); });
} else { } else {
$("#skill_id option[value="+skill_id+"]").remove(); $("#skill_id option[value="+skill_id+"]").remove();
//Deleting holder //Deleting holder
$("#skill_search .holder li").each(function () { $("#skill_search .holder li").each(function () {
if ($(this).attr("rel") == skill_id) { if ($(this).attr("rel") == skill_id) {
$(this).remove(); $(this).remove();
} }
}); });
if ($('#skill_to_select_id_'+skill_id).length == 0) { if ($('#skill_to_select_id_'+skill_id).length == 0) {
skill_info = get_skill_info(skill_id); skill_info = get_skill_info(skill_id);
li = fill_skill_search_li(skill_id, skill_info.name); li = fill_skill_search_li(skill_id, skill_info.name);
$("#skill_holder").append(li); $("#skill_holder").append(li);
} }
} }
}, }
}); });
} }
}); });
} }
@ -64,23 +63,23 @@ function fill_skill_search_li(skill_id, skill_name, checked) {
checked_condition = ''; checked_condition = '';
if (checked == 1) { if (checked == 1) {
checked_condition = 'checked=checked'; checked_condition = 'checked=checked';
} }
return '<li><input id="skill_to_select_id_'+skill_id+'" rel="'+skill_id+'" name="'+skill_name+'" class="skill_to_select" '+checked_condition+' type="checkbox" value=""> <a href="#" class="load_wheel" rel="'+skill_id+'">'+skill_name+'</a></li>'; return '<li><input id="skill_to_select_id_'+skill_id+'" rel="'+skill_id+'" name="'+skill_name+'" class="skill_to_select" '+checked_condition+' type="checkbox" value=""> <a href="#" class="load_wheel" rel="'+skill_id+'">'+skill_name+'</a></li>';
} }
function check_skills_edit_form() { function check_skills_edit_form() {
//selecting only selected parents //selecting only selected parents
$("#parent_id option:selected").each(function() { $("#parent_id option:selected").each(function() {
var skill_id = $(this).val(); var skill_id = $(this).val();
if (skill_id != "" ) { if (skill_id != "" ) {
$.ajax({ $.ajax({
async: false, async: false,
url: "{{ url }}&a=skill_exists", url: "{{ url }}&a=skill_exists",
data: "skill_id="+skill_id, data: "skill_id="+skill_id,
success: function(return_value) { success: function(return_value) {
if (return_value == 0 ) { if (return_value == 0 ) {
alert("{{ 'SkillDoesNotExist'|get_lang }}"); alert("{{ 'SkillDoesNotExist'|get_lang }}");
//Deleting select option tag //Deleting select option tag
$("#parent_id").find('option').remove(); $("#parent_id").find('option').remove();
//Deleting holder //Deleting holder
@ -88,25 +87,25 @@ function check_skills_edit_form() {
if ($(this).attr("rel") == skill_id) { if ($(this).attr("rel") == skill_id) {
$(this).remove(); $(this).remove();
} }
}); });
} else { } else {
$("#parent_id").empty(); $("#parent_id").empty();
$("#skill_edit_holder").find('li').remove(); $("#skill_edit_holder").find('li').remove();
//Deleting holder //Deleting holder
$("#skill_row .holder li").each(function () { $("#skill_row .holder li").each(function () {
if ($(this).attr("rel") == skill_id) { if ($(this).attr("rel") == skill_id) {
$(this).remove(); $(this).remove();
} }
}); });
skill = get_skill_info(skill_id); skill = get_skill_info(skill_id);
$("#skill_edit_holder").append('<li class="bit-box" id="skill_option_'+skill_id+'"> '+skill.name+'</li>'); $("#skill_edit_holder").append('<li class="bit-box" id="skill_option_'+skill_id+'"> '+skill.name+'</li>');
$("#parent_id").append('<option class="selected" selected="selected" value="'+skill_id+'"></option>'); $("#parent_id").append('<option class="selected" selected="selected" value="'+skill_id+'"></option>');
} }
}, }
}); });
} }
}); });
} }
@ -115,39 +114,39 @@ function check_gradebook() {
//selecting only selected users //selecting only selected users
$("#gradebook_id option:selected").each(function() { $("#gradebook_id option:selected").each(function() {
var gradebook_id = $(this).val(); var gradebook_id = $(this).val();
if (gradebook_id != "" ) { if (gradebook_id != "" ) {
$.ajax({ $.ajax({
url: "{{ url }}&a=gradebook_exists", url: "{{ url }}&a=gradebook_exists",
data: "gradebook_id="+gradebook_id, data: "gradebook_id="+gradebook_id,
success: function(return_value) { success: function(return_value) {
if (return_value == 0 ) { if (return_value == 0 ) {
alert("{{ 'GradebookDoesNotExist'|get_lang }}"); alert("{{ 'GradebookDoesNotExist'|get_lang }}");
//Deleting select option tag //Deleting select option tag
$("#gradebook_id option[value="+gradebook_id+"]").remove(); $("#gradebook_id option[value="+gradebook_id+"]").remove();
//Deleting holder //Deleting holder
$("#gradebook_row .holder li").each(function () { $("#gradebook_row .holder li").each(function () {
if ($(this).attr("rel") == gradebook_id) { if ($(this).attr("rel") == gradebook_id) {
$(this).remove(); $(this).remove();
} }
}); });
} else { } else {
//Deleting holder //Deleting holder
$("#gradebook_row .holder li").each(function () { $("#gradebook_row .holder li").each(function () {
if ($(this).attr("rel") == gradebook_id) { if ($(this).attr("rel") == gradebook_id) {
$(this).remove(); $(this).remove();
} }
}); });
if ($('#gradebook_item_'+gradebook_id).length == 0) { if ($('#gradebook_item_'+gradebook_id).length == 0) {
gradebook = get_gradebook_info(gradebook_id); gradebook = get_gradebook_info(gradebook_id);
if (gradebook) { if (gradebook) {
$("#gradebook_holder").append('<li id="gradebook_item_'+gradebook_id+'" class="bit-box"> '+gradebook.name+' <a rel="'+gradebook_id+'" class="closebutton" href="#"></a></li>'); $("#gradebook_holder").append('<li id="gradebook_item_'+gradebook_id+'" class="bit-box"> '+gradebook.name+' <a rel="'+gradebook_id+'" class="closebutton" href="#"></a></li>');
} }
} }
} }
}, }
}); });
} }
}); });
} }
@ -155,7 +154,7 @@ function check_gradebook() {
function delete_gradebook_from_skill(skill_id, gradebook_id) { function delete_gradebook_from_skill(skill_id, gradebook_id) {
$.ajax({ $.ajax({
url: url+'&a=delete_gradebook_from_skill&skill_id='+skill_id+'&gradebook_id='+gradebook_id, url: url+'&a=delete_gradebook_from_skill&skill_id='+skill_id+'&gradebook_id='+gradebook_id,
async: false, async: false,
success: function(result) { success: function(result) {
//if (result == 1) { //if (result == 1) {
$('#gradebook_item_'+gradebook_id).remove(); $('#gradebook_item_'+gradebook_id).remove();
@ -172,29 +171,29 @@ function delete_gradebook_from_skill(skill_id, gradebook_id) {
function return_skill_list_from_profile_search() { function return_skill_list_from_profile_search() {
var skill_list = {}; var skill_list = {};
if ($("#profile_search li").length != 0) { if ($("#profile_search li").length != 0) {
$("#profile_search li").each(function(index) { $("#profile_search li").each(function(index) {
id = $(this).attr("id").split('_')[3]; id = $(this).attr("id").split('_')[3];
if (id) { if (id) {
skill_list[index] = id; skill_list[index] = id;
} }
}); });
} }
return skill_list; return skill_list;
} }
function submit_profile_search_form() { function submit_profile_search_form() {
$("#skill_wheel").remove(); $("#skill_wheel").remove();
var skill_list = return_skill_list_from_profile_search(); var skill_list = return_skill_list_from_profile_search();
if (skill_list.length != 0) { if (skill_list.length != 0) {
skill_list = { 'skill_id' : skill_list }; skill_list = { 'skill_id' : skill_list };
skill_params = $.param(skill_list); skill_params = $.param(skill_list);
$.ajax({ $.ajax({
url: url+'&a=profile_matches&'+skill_params, url: url+'&a=profile_matches&'+skill_params,
async: false, async: false,
success: function (html) { success: function (html) {
//users = jQuery.parseJSON(users); //users = jQuery.parseJSON(users);
$('#wheel_container').html(html); $('#wheel_container').html(html);
@ -206,104 +205,100 @@ function submit_profile_search_form() {
} }
function add_skill_in_profile_list(skill_id, skill_name) { function add_skill_in_profile_list(skill_id, skill_name) {
if ($('#profile_match_item_'+skill_id).length == 0 ) { if ($('#profile_match_item_'+skill_id).length == 0 ) {
$('#profile_search').append('<li class="bit-box" id="profile_match_item_'+skill_id+'">'+skill_name+' <a rel="'+skill_id+'" class="closebutton" href="#"></a> </li>'); $('#profile_search').append('<li class="bit-box" id="profile_match_item_'+skill_id+'">'+skill_name+' <a rel="'+skill_id+'" class="closebutton" href="#"></a> </li>');
} else { } else {
$('#profile_match_item_'+skill_id).remove(); $('#profile_match_item_'+skill_id).remove();
} }
toogle_save_profile_form(); toogle_save_profile_form();
} }
function toogle_save_profile_form() { function toogle_save_profile_form() {
//Hiding showing the save this search //Hiding showing the save this search
if ($('#profile_search li').length == 0) { if ($('#profile_search li').length == 0) {
$('#profile-options-container').hide(); $('#profile-options-container').hide();
} else { } else {
$('#profile-options-container').show(); $('#profile-options-container').show();
} }
} }
$(document).ready(function() { $(document).ready(function() {
/* Skill search */ /* Skill search */
//Tool tip (in exercises) //Tool tip (in exercises)
var tip_options = { var tip_options = {
placement : 'right' placement : 'right'
} }
$('.tooltip_skill').tooltip(tip_options); $('.tooltip_skill').tooltip(tip_options);
/* Skill item list onclick */ /* Skill item list onclick */
$("#skill_holder").on("click", "input.skill_to_select", function() { $("#skill_holder").on("click", "input.skill_to_select", function() {
skill_id = $(this).attr('rel'); skill_id = $(this).attr('rel');
skill_name = $(this).attr('name'); skill_name = $(this).attr('name');
add_skill_in_profile_list(skill_id, skill_name); add_skill_in_profile_list(skill_id, skill_name);
}); });
/* URL link when searching skills */ /* URL link when searching skills */
$("#skill_holder").on("click", "a.load_wheel", function() { $("#skill_holder").on("click", "a.load_wheel", function() {
skill_id = $(this).attr('rel'); skill_id = $(this).attr('rel');
skill_to_load_from_get = 0; skill_to_load_from_get = 0;
load_nodes(skill_id, main_depth); load_nodes(skill_id, main_depth);
}); });
/* URL link when searching skills */ /* URL link when searching skills */
$("#skill_search").on("click", "a.load_root", function() { $("#skill_search").on("click", "a.load_root", function() {
skill_id = $(this).attr('rel'); skill_id = $(this).attr('rel');
skill_to_load_from_get = 0; skill_to_load_from_get = 0;
load_nodes(skill_id, main_depth); load_nodes(skill_id, main_depth);
}); });
/*$("#skill_search").on("click", "a#clear_selection", function() {
});*/
/* Profile matcher */ /* Profile matcher */
/* Submit button */ /* Submit button */
$("#search_profile_form").submit(function() { $("#search_profile_form").submit(function() {
submit_profile_search_form(); submit_profile_search_form();
return false; return false;
}); });
$("#save_profile_form_button").submit(function() { $("#save_profile_form_button").submit(function() {
open_save_profile_popup(); open_save_profile_popup();
return false; return false;
}); });
/* Close button in profile matcher items */ /* Close button in profile matcher items */
$("#profile_search").on("click", "a.closebutton", function() { $("#profile_search").on("click", "a.closebutton", function() {
skill_id = $(this).attr('rel'); skill_id = $(this).attr('rel');
$('input[id=skill_to_select_id_'+skill_id+']').attr('checked', false); $('input[id=skill_to_select_id_'+skill_id+']').attr('checked', false);
$('#profile_match_item_'+skill_id).remove(); $('#profile_match_item_'+skill_id).remove();
submit_profile_search_form(); submit_profile_search_form();
toogle_save_profile_form(); toogle_save_profile_form();
}); });
//Fill saved profiles list // Fill saved profiles list
update_my_saved_profiles(); update_my_saved_profiles();
/* Click in profile */ /* Click in profile */
$("#saved_profiles").on("click", "li.load_profile", function() { $("#saved_profiles").on("click", "li.load_profile", function() {
profile_id = $(this).attr('rel'); profile_id = $(this).attr('rel');
$('#profile_id').attr('value',profile_id); $('#profile_id').attr('value',profile_id);
$.ajax({ $.ajax({
url: '{{ url }}&a=get_skills_by_profile&profile_id='+profile_id, url: '{{ url }}&a=get_skills_by_profile&profile_id='+profile_id,
success:function(json) { success:function(json) {
skill_list = jQuery.parseJSON(json); skill_list = jQuery.parseJSON(json);
$('#profile_search').empty(); $('#profile_search').empty();
$('#skill_holder').empty(); $('#skill_holder').empty();
jQuery.each(skill_list, function(index, skill_id) { jQuery.each(skill_list, function(index, skill_id) {
skill_info = get_skill_info(skill_id); skill_info = get_skill_info(skill_id);
li = fill_skill_search_li(skill_id, skill_info.name, 1); li = fill_skill_search_li(skill_id, skill_info.name, 1);
$("#skill_holder").append(li); $("#skill_holder").append(li);
add_skill_in_profile_list(skill_id, skill_info.name); add_skill_in_profile_list(skill_id, skill_info.name);
}); });
submit_profile_search_form(); submit_profile_search_form();
} }
}); });
}); });
$("#saved_profiles").on('click', 'li.load_profile button.close', function () { $("#saved_profiles").on('click', 'li.load_profile button.close', function () {
var $parent = $(this).parent(); var $parent = $(this).parent();
var profileId = $parent.attr('rel'); var profileId = $parent.attr('rel');
@ -318,13 +313,13 @@ $(document).ready(function() {
}); });
/* Wheel skill popup form */ /* Wheel skill popup form */
/* Close button in gradebook select */ /* Close button in gradebook select */
$("#gradebook_holder").on("click", "a.closebutton", function() { $("#gradebook_holder").on("click", "a.closebutton", function() {
gradebook_id = $(this).attr('rel'); gradebook_id = $(this).attr('rel');
skill_id = $('#id').attr('value'); skill_id = $('#id').attr('value');
delete_gradebook_from_skill(skill_id, gradebook_id); delete_gradebook_from_skill(skill_id, gradebook_id);
}); });
$("#skill_id").fcbkcomplete({ $("#skill_id").fcbkcomplete({
json_url: "{{ url }}&a=find_skills", json_url: "{{ url }}&a=find_skills",
@ -337,8 +332,8 @@ $(document).ready(function() {
onselect:"check_skills_sidebar", onselect:"check_skills_sidebar",
filter_selected: true, filter_selected: true,
newel: true newel: true
}); });
$("#parent_id").fcbkcomplete({ $("#parent_id").fcbkcomplete({
json_url: "{{ url }}&a=find_skills", json_url: "{{ url }}&a=find_skills",
cache: false, cache: false,
@ -350,8 +345,8 @@ $(document).ready(function() {
onselect:"check_skills_edit_form", onselect:"check_skills_edit_form",
filter_selected: true, filter_selected: true,
newel: true newel: true
}); });
$("#gradebook_id").fcbkcomplete({ $("#gradebook_id").fcbkcomplete({
json_url: "{{ url }}&a=find_gradebooks", json_url: "{{ url }}&a=find_gradebooks",
cache: false, cache: false,
@ -368,21 +363,21 @@ $(document).ready(function() {
//Skill popup (edit, create child... ) //Skill popup (edit, create child... )
$("#dialog-form").dialog({ $("#dialog-form").dialog({
autoOpen: false, autoOpen: false,
modal : true, modal : true,
width : 600, width : 600,
height : 630 height : 630
}); });
//Save search profile dialog //Save search profile dialog
$("#dialog-form-profile").dialog({ $("#dialog-form-profile").dialog({
autoOpen: false, autoOpen: false,
modal : true, modal : true,
width : 500, width : 500,
height : 400 height : 400
}); });
load_nodes(0, main_depth); load_nodes(0, main_depth);
function open_save_profile_popup() { function open_save_profile_popup() {
var profileId = $("#profile_id").val(); var profileId = $("#profile_id").val();
$.ajax({ $.ajax({
@ -395,16 +390,16 @@ $(document).ready(function() {
} }
} }
}); });
$("#dialog-form-profile").dialog({ $("#dialog-form-profile").dialog({
buttons: { buttons: {
"{{ "Save"|get_lang }}" : function() { "{{ "Save"|get_lang }}" : function() {
var name = $("#name_profile").val(); var name = $("#name_profile").val();
var description = $("#description_profile").val(); var description = $("#description_profile").val();
var skill_list = return_skill_list_from_profile_search(); var skill_list = return_skill_list_from_profile_search();
skill_list = { 'skill_id' : skill_list }; skill_list = { 'skill_id' : skill_list };
skill_params = $.param(skill_list); skill_params = $.param(skill_list);
$.ajax({ $.ajax({
url: '{{ url }}&a=save_profile&name='+name+'&description='+description+'&'+skill_params+'&profile='+profileId, url: '{{ url }}&a=save_profile&name='+name+'&description='+description+'&'+skill_params+'&profile='+profileId,
success:function(data) { success:function(data) {
@ -414,33 +409,34 @@ $(document).ready(function() {
} else { } else {
alert("{{ "Error"|get_lang }}"); alert("{{ "Error"|get_lang }}");
} }
$("#dialog-form-profile").dialog("close"); $("#dialog-form-profile").dialog("close");
$("#name_profile").attr('value', ''); $("#name_profile").attr('value', '');
$("#description_profile").attr('value', ''); $("#description_profile").attr('value', '');
$("#profile_id").attr('value', '0'); $("#profile_id").attr('value', '0');
} }
}); });
} }
}, },
close: function() { close: function() {
$("#name_profile").attr('value', ''); $("#name_profile").attr('value', '');
$("#description_profile").attr('value', ''); $("#description_profile").attr('value', '');
$("#profile_id").attr('value', '0'); $("#profile_id").attr('value', '0');
} }
}); });
$("#dialog-form-profile").dialog("open"); $("#dialog-form-profile").dialog("open");
} }
function update_my_saved_profiles() { function update_my_saved_profiles() {
$.ajax({ $.ajax({
url: '{{ url }}&a=get_saved_profiles', url: '{{ url }}&a=get_saved_profiles',
success:function(data) { success:function(data) {
$("#saved_profiles").html(data); $("#saved_profiles").html(data);
} }
}); });
} }
/* change background color */
/* change background color */
$(document).ready(function () { $(document).ready(function () {
$("#celestial").click(function () { $("#celestial").click(function () {
$("#page-back").css("background","#A9E2F3"); $("#page-back").css("background","#A9E2F3");
@ -458,10 +454,11 @@ $(document).ready(function() {
$("#page-back").css("background","#F7F8E0"); $("#page-back").css("background","#F7F8E0");
}); });
}); });
/* Generated random colour */ /* Generated random colour */
/* /*
function colour(d) { function colour(d) {
if (d.children) { if (d.children) {
// There is a maximum of two children! // There is a maximum of two children!
var colours = d.children.map(colour), var colours = d.children.map(colour),
@ -469,7 +466,7 @@ $(document).ready(function() {
b = d3.hsl(colours[1]); b = d3.hsl(colours[1]);
// L*a*b* might be better here... // L*a*b* might be better here...
return d3.hsl((a.h + b.h) / 2, a.s * 1.2, a.levels_to_show / 1.2); return d3.hsl((a.h + b.h) / 2, a.s * 1.2, a.levels_to_show / 1.2);
} }
return d.colour || "#fff"; return d.colour || "#fff";
}*/ }*/
}); });
@ -483,7 +480,6 @@ $(document).ready(function() {
<a class="btn btn-large btn-block btn-success" href="{{ _p.web }}user_portal.php">{{ "ReturnToCourseList"|get_lang }}</a> <a class="btn btn-large btn-block btn-success" href="{{ _p.web }}user_portal.php">{{ "ReturnToCourseList"|get_lang }}</a>
</div> </div>
<!-- ACCORDION --> <!-- ACCORDION -->
<div class="panel-group" id="accordion2"> <div class="panel-group" id="accordion2">
@ -585,72 +581,73 @@ $(document).ready(function() {
<form id="add_item" class="form-horizontal" name="form"> <form id="add_item" class="form-horizontal" name="form">
<fieldset> <fieldset>
<input type="hidden" name="id" id="id"/> <input type="hidden" name="id" id="id"/>
<div class="control-group"> <div class="form-group">
<label class="control-label" for="name">{{ 'Name' | get_lang }}</label> <label class="col-sm-2 control-label" for="name">{{ 'Name' | get_lang }}</label>
<div class="controls"> <div class="col-sm-8">
<input type="text" name="name" id="name" class="col-md-4" /> <input type="text" name="name" id="name" />
</div> </div>
</div> </div>
<div class="control-group"> <div class="form-group">
<label class="control-label">{{ 'ShortCode' | get_lang }}</label> <label class="col-sm-2 control-label">{{ 'ShortCode' | get_lang }}</label>
<div class="controls"> <div class="col-sm-8">
<input type="text" name="short_code" id="short_code" class="span2" /> <input type="text" name="short_code" id="short_code" />
</div> </div>
</div> </div>
<div id="skill_row" class="control-group"> <div id="skill_row" class="form-group">
<label class="control-label" for="name">{{'Parent'|get_lang}}</label> <label class="col-sm-2 control-label" for="name">{{'Parent'|get_lang}}</label>
<div class="controls"> <div class="col-sm-8">
<select id="parent_id" name="parent_id" /> <select id="parent_id" name="parent_id" />
</select> </select>
<ul id="skill_edit_holder" class="holder holder_simple"> <ul id="skill_edit_holder" class="holder holder_simple">
</ul> </ul>
</div> </div>
</div> </div>
<div id="gradebook_row" class="control-group"> <div id="gradebook_row" class="form-group">
<label class="control-label" for="name">{{'Gradebook'|get_lang}}</label> <label class="col-sm-2 control-label" for="name">{{'Gradebook'|get_lang}}</label>
<div class="controls"> <div class="col-sm-8">
<select id="gradebook_id" name="gradebook_id" multiple="multiple"/> <select id="gradebook_id" name="gradebook_id" multiple="multiple"/>
</select> </select>
<ul id="gradebook_holder" class="holder holder_simple"> <ul id="gradebook_holder" class="holder holder_simple">
</ul> </ul>
<span class="help-block"> <span class="help-block">
{{ 'WithCertificate'|get_lang }} {{ 'WithCertificate'|get_lang }}
</span> </span>
</div> </div>
</div> </div>
<div class="control-group"> <div class="form-group">
<label class="control-label" for="name">{{ 'Description'|get_lang }}</label> <label class="col-sm-2 control-label" for="name">{{ 'Description'|get_lang }}</label>
<div class="controls"> <div class="col-sm-8">
<textarea name="description" id="description" class="col-md-4" rows="7"></textarea> <textarea name="description" id="description" rows="7"></textarea>
</div> </div>
</div> </div>
</fieldset> </fieldset>
</form> </form>
</div> </div>
<div id="dialog-form-profile" style="display:none;"> <div id="dialog-form-profile" style="display:none;">
<form id="save_profile_form" class="form-horizontal" name="form"> <form id="save_profile_form" class="form-horizontal" name="form">
<input type="hidden" id="profile_id" name="profile_id"/> <input type="hidden" id="profile_id" name="profile_id"/>
<fieldset> <fieldset>
<div class="control-group"> <div class="form-group">
<label class="control-label" for="name">{{"Name"|get_lang}}</label> <label class="col-sm-2 control-label" for="name">{{"Name"|get_lang}}</label>
<div class="controls"> <div class="col-sm-8">
<input type="text" name="name" id="name_profile" size="40" /> <input type="text" name="name" id="name_profile" size="40" />
</div> </div>
</div> </div>
<div class="control-group"> <div class="form-group">
<label class="control-label" for="name">{{"Description"|get_lang}}</label> <label class="col-sm-2 control-label" for="name">{{"Description"|get_lang}}</label>
<div class="controls"> <div class="col-sm-8">
<textarea name="description" id="description_profile" class="span2" rows="7"></textarea> <textarea name="description" id="description_profile" rows="7"></textarea>
</div> </div>
</div> </div>
</fieldset> </fieldset>
</form> </form>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save