Add right click modal to profile skill wheel - refs BT#9413

1.10.x
Imanol Losada 10 years ago
parent 4e25291aee
commit 1d23e75bdf
  1. 1
      main/admin/skills_wheel.php
  2. 57
      main/template/default/skill/skill_wheel.js.tpl
  3. 50
      main/template/default/skill/skill_wheel_student.tpl

@ -46,6 +46,7 @@ $tpl->assign('wheel_url', $url);
$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
$tpl->assign('url', $url);
$tpl->assign('isAdministration', true);
$content = $tpl->fetch('default/skill/skill_wheel.tpl');
$tpl->assign('content', $content);

@ -324,10 +324,16 @@ function open_popup(skill_id, parent_id) {
if (skill) {
var parent_info = get_skill_info(skill.extra.parent_id);
$("#id").attr('value', skill.id);
$("#name").attr('value', skill.name);
$("#short_code").attr('value', skill.short_code);
$("#description").attr('value', skill.description);
if ("{{ isAdministration }}") {
$("#id").attr('value', skill.id);
$("#name").attr('value', skill.name);
$("#short_code").attr('value', skill.short_code);
$("#description").attr('value', skill.description);
} else {
$("#name").text(skill.name);
$("#short_code").text(skill.short_code);
$("#description").text(skill.description);
}
//Filling parent_id
$("#parent_id").append('<option class="selected" value="'+skill.extra.parent_id+'" selected="selected" >');
@ -338,32 +344,37 @@ function open_popup(skill_id, parent_id) {
jQuery.each(skill.gradebooks, function(index, data) {
$("#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>');
});
});
if ("{{ isAdministration }}") {
$("#dialog-form").dialog({
buttons: {
"{{ "Edit"|get_lang }}": function () {
var params = $("#add_item").find(':input').serialize();
add_skill(params);
},
/*"{{ "Delete"|get_lang }}" : function() {
},*/
"{{ "CreateChildSkill"|get_lang }}": function () {
open_popup(0, skill.id);
},
"{{ "AddSkillToProfileSearch"|get_lang }}": function () {
add_skill_in_profile_list(skill.id, skill.name);
}
}
});
}
$("#dialog-form").dialog({
buttons: {
"{{ "Edit"|get_lang }}" : function() {
var params = $("#add_item").find(':input').serialize();
add_skill(params);
},
/*"{{ "Delete"|get_lang }}" : function() {
},*/
"{{ "CreateChildSkill"|get_lang }}" : function() {
open_popup(0, skill.id);
},
"{{ "AddSkillToProfileSearch"|get_lang }}" : function() {
add_skill_in_profile_list(skill.id, skill.name);
}
},
close: function() {
close: function() {
$("#name").attr('value','');
$("#description").attr('value', '');
//Redirect to the main root
load_nodes(0, main_depth);
}
});
$("#dialog-form").dialog("open");
});
$("#dialog-form").dialog("open");
}
if (parent) {

@ -388,3 +388,53 @@ $(document).ready(function() {
</div>
</div>
</div>
<div id="dialog-form" style="">
<p class="validateTips"></p>
<form id="add_item" class="form-horizontal" name="form">
<fieldset>
<div class="control-group">
<label class="control-label" for="name">{{ 'Name' | get_lang }}</label>
<div class="controls">
<!--<input type="text" name="name" id="name" class="span4" readonly />-->
<p id="name" class="span4">
</p>
</div>
</div>
<div class="control-group">
<label class="control-label">{{ 'ShortCode' | get_lang }}</label>
<div class="controls">
<!--<input type="text" name="short_code" id="short_code" class="span2" readonly />-->
<p id="short_code" class="span4">
</p>
</div>
</div>
<div id="skill_row" class="control-group">
<label class="control-label" for="name">{{'Parent'|get_lang}}</label>
<div class="controls">
<ul id="skill_edit_holder" class="holder holder_simple">
</ul>
</div>
</div>
<div id="gradebook_row" class="control-group">
<label class="control-label" for="name">{{'Gradebook'|get_lang}}</label>
<div class="controls">
<ul id="gradebook_holder" class="holder holder_simple">
</ul>
<span class="help-block">
{{ 'WithCertificate'|get_lang }}
</span>
</div>
</div>
<div class="control-group">
<label class="control-label" for="name">{{ 'Description'|get_lang }}</label>
<div class="controls">
<!--<textarea name="description" id="description" class="span4" rows="7" readonly>
</textarea>-->
<p id="description" class="span4">
</p>
</div>
</div>
</fieldset>
</form>
</div>

Loading…
Cancel
Save