parent
f7d0a18d69
commit
9a1819c331
@ -0,0 +1,113 @@ |
||||
{% extends 'layout/layout_1_col.tpl'|get_template %} |
||||
|
||||
{% block content %} |
||||
|
||||
<script> |
||||
mxBasePath = '{{ _p.web_lib }}mxgraph/src/'; |
||||
</script> |
||||
|
||||
<script type="text/javascript" src="{{ _p.web_lib }}mxgraph/src/js/mxClient.js"></script> |
||||
|
||||
<script> |
||||
// Overridden to define per-shape connection points |
||||
mxGraph.prototype.getAllConnectionConstraints = function(terminal, source) |
||||
{ |
||||
if (terminal != null && terminal.shape != null) |
||||
{ |
||||
if (terminal.shape.stencil != null) |
||||
{ |
||||
if (terminal.shape.stencil != null) |
||||
{ |
||||
return terminal.shape.stencil.constraints; |
||||
} |
||||
} |
||||
else if (terminal.shape.constraints != null) |
||||
{ |
||||
return terminal.shape.constraints; |
||||
} |
||||
} |
||||
|
||||
return null; |
||||
}; |
||||
|
||||
|
||||
// Edges have no connection points |
||||
mxPolyline.prototype.constraints = null; |
||||
|
||||
// Program starts here. Creates a sample graph in the |
||||
// DOM node with the specified ID. This function is invoked |
||||
// from the onLoad event handler of the document (see below). |
||||
function main(container) |
||||
{ |
||||
// Checks if the browser is supported |
||||
if (!mxClient.isBrowserSupported()) |
||||
{ |
||||
// Displays an error message if the browser is not supported. |
||||
mxUtils.error('Browser is not supported!', 200, false); |
||||
} |
||||
else |
||||
{ |
||||
// Disables the built-in context menu |
||||
mxEvent.disableContextMenu(container); |
||||
|
||||
// Creates the graph inside the given container |
||||
var graph = new mxGraph(container); |
||||
graph.setConnectable(true); |
||||
graph.setHtmlLabels(true); |
||||
|
||||
// Blocks the selection of elements |
||||
graph.setEnabled(false); |
||||
|
||||
// Enables connect preview for the default edge style |
||||
graph.connectionHandler.createEdgeState = function(me) |
||||
{ |
||||
var edge = graph.createEdge(null, null, null, null, null); |
||||
|
||||
return new mxCellState(this.graph.view, edge, this.graph.getCellStyle(edge)); |
||||
}; |
||||
|
||||
// Specifies the default edge style |
||||
graph.getStylesheet().getDefaultEdgeStyle()['edgeStyle'] = 'orthogonalEdgeStyle'; |
||||
|
||||
// Enables rubberband selection |
||||
new mxRubberband(graph); |
||||
|
||||
// Gets the default parent for inserting new cells. This |
||||
// is normally the first child of the root (ie. layer 0). |
||||
var parent = graph.getDefaultParent(); |
||||
|
||||
// Adds cells to the model in a single step |
||||
graph.getModel().beginUpdate(); |
||||
try { |
||||
//var v1 = graph.insertVertex(parent, null, 'Hello,', 20, 20, 80, 30); |
||||
//var v2 = graph.insertVertex(parent, null, 'World!', 200, 150, 80, 30); |
||||
//var e1 = graph.insertEdge(parent, null, '', v1, v2); |
||||
{% for vertex in vertex_list %} |
||||
{{ vertex }} |
||||
{% endfor %} |
||||
|
||||
{% for vertex in group_list %} |
||||
{{ vertex }} |
||||
{% endfor %} |
||||
|
||||
{% for vertex in subgroup_list %} |
||||
{{ vertex }} |
||||
{% endfor %} |
||||
|
||||
{% for vertex in connections %} |
||||
{{ vertex }} |
||||
{% endfor %} |
||||
} finally { |
||||
// Updates the display |
||||
graph.getModel().endUpdate(); |
||||
} |
||||
} |
||||
}; |
||||
|
||||
$(document).ready(function () { |
||||
main(document.getElementById('graphContainer')); |
||||
}); |
||||
</script> |
||||
|
||||
{{ content }} |
||||
{% endblock %} |
||||
@ -0,0 +1,21 @@ |
||||
{% if blocklist == '' %} |
||||
<div id="columns"> |
||||
<div class="row"> |
||||
{% if columns|length > 0 %} |
||||
{% for key, column in columns %} |
||||
<div id="{{ key }}" class="col-md-6"> |
||||
{% for item in column %} |
||||
{{ item }} |
||||
{% endfor %} |
||||
</div> |
||||
{% endfor %} |
||||
{% else %} |
||||
<div class="alert alert-info" role="alert"> |
||||
{{ 'YouHaveNotEnabledBlocks'| get_lang }} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
{% else %} |
||||
{{ blocklist }} |
||||
{% endif %} |
||||
@ -0,0 +1,67 @@ |
||||
<h3>{{ user.complete_name_with_username }}</h3> |
||||
<br /> |
||||
<script> |
||||
$(function() { |
||||
$(".assign_user_to_skill").on("click", function() { |
||||
var skillId = $(this).attr('data-skill-id'); |
||||
var link = $(this); |
||||
$.ajax({ |
||||
type: "GET", |
||||
async: false, |
||||
url: "{{ assign_user_url }}&skill_id="+skillId+"&user_id={{ user.id }}&course_id={{ course_id }}&session_id={{ session_id }}", |
||||
success: function(result) { |
||||
link.removeClass('btn-danger'); |
||||
link.removeClass('btn-success'); |
||||
if (result == 'danger') { |
||||
link.addClass('btn-danger'); |
||||
link.html('{{ 'NotYetAchieved' | get_lang }}'); |
||||
} else { |
||||
link.addClass('btn-success'); |
||||
link.html('{{ 'Achieved' | get_lang }}'); |
||||
} |
||||
} |
||||
}); |
||||
}); |
||||
}); |
||||
</script> |
||||
|
||||
<table class="table table-striped"> |
||||
<tr> |
||||
<th>{{ 'Skill' | get_lang }}</th> |
||||
<th>{{ 'Occurrences' | get_lang }}</th> |
||||
<th>{{ 'Conclusion' | get_lang }}</th> |
||||
</tr> |
||||
|
||||
{% for skill in skills %} |
||||
<tr> |
||||
<td>{{ skill.name }}</td> |
||||
<td> |
||||
{% for item in items[skill.id] %} |
||||
{% set status = 'danger' %} |
||||
{% if item.info.status %} |
||||
{% set status = 'success' %} |
||||
{% endif %} |
||||
<span class="label label-{{ status }}"> |
||||
<a href="{{ item.info.url_activity }}" target="_blank"> |
||||
{{ item.info.name }} |
||||
</a> |
||||
</span> |
||||
{% endfor %} |
||||
</td> |
||||
<td> |
||||
{% set class = 'danger' %} |
||||
{% set text = 'NotYetAchieved' %} |
||||
|
||||
{% if conclusion_list[skill.id] %} |
||||
{% set class = 'success' %} |
||||
{% set text = 'Achieved' %} |
||||
{% endif %} |
||||
|
||||
<a data-skill-id="{{ skill.id }}" href="javascript:void(0);" class="assign_user_to_skill btn btn-{{ class }}"> |
||||
{{ text | get_lang }} |
||||
</a> |
||||
|
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</table> |
||||
Loading…
Reference in new issue