2013-02-28 12:07:42 +01:00
|
|
|
|
{% extends "univcloud/base.html" %}
|
|
|
|
|
{% load i18n %}
|
|
|
|
|
{% load url from future %}
|
|
|
|
|
|
|
|
|
|
{% block extrascripts %}
|
|
|
|
|
<script src="{{ STATIC_URL }}js/jquery.gridster.min.js"></script>
|
|
|
|
|
<script src="{{ STATIC_URL }}js/jquery.simpleWeather.js"></script>
|
|
|
|
|
<script src="{{ STATIC_URL }}js/jquery.zrssfeed.js"></script>
|
2013-03-14 12:28:15 +01:00
|
|
|
|
<script src="{{ STATIC_URL }}js/jquery.clock.js"></script>
|
2013-03-14 15:18:40 +01:00
|
|
|
|
<script src="{{ STATIC_URL }}js/jquery.simple-color.js"></script>
|
2013-02-28 12:07:42 +01:00
|
|
|
|
<script src="{{ STATIC_URL }}js/jquery-ui.js"></script>
|
|
|
|
|
<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/jquery.gridster.css">
|
2013-03-14 12:28:15 +01:00
|
|
|
|
<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/analog.css">
|
2013-02-28 12:07:42 +01:00
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block page-title %}
|
|
|
|
|
Univcloud
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
<div class="gridster">
|
|
|
|
|
<ul>
|
2013-03-06 14:15:07 +01:00
|
|
|
|
{% for app in apps %}
|
2013-03-14 15:18:40 +01:00
|
|
|
|
<li data-row="{{ app.row }}" data-col="{{ app.col }}"
|
|
|
|
|
data-sizex="{{ app.sizex }}" data-sizey="{{ app.sizey }}"
|
2013-03-15 09:43:29 +01:00
|
|
|
|
class="{% if app.scroll %}scroll {% endif %}"
|
2013-07-31 13:40:24 +02:00
|
|
|
|
{% if app.background_color %}style="background-color: {{app.background_color}}; border-color: {{app.background_color}};"{% endif %}>
|
2013-03-14 15:18:40 +01:00
|
|
|
|
<span class="color">o</span>
|
2013-03-14 12:50:26 +01:00
|
|
|
|
<span class="close">×</span>
|
2013-03-06 14:15:07 +01:00
|
|
|
|
{{ app.content }}
|
2013-02-28 12:07:42 +01:00
|
|
|
|
</li>
|
2013-03-06 14:15:07 +01:00
|
|
|
|
{% endfor %}
|
2013-02-28 12:07:42 +01:00
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
|
2013-03-14 12:08:35 +01:00
|
|
|
|
<div id="iframes">
|
2013-02-28 12:07:42 +01:00
|
|
|
|
</div>
|
|
|
|
|
|
2013-03-14 15:18:40 +01:00
|
|
|
|
<div id="dialog-color" title="Couleur" style="display: none">
|
|
|
|
|
<p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
|
|
|
|
<input class='simple_color' value='#cc3333'/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-28 12:07:42 +01:00
|
|
|
|
<script>
|
|
|
|
|
$(function(){ //DOM Ready
|
|
|
|
|
var gridster = $(".gridster ul").gridster({
|
2013-03-14 11:41:13 +01:00
|
|
|
|
widget_margins: [10, 10],
|
|
|
|
|
widget_base_dimensions: [140, 140],
|
|
|
|
|
min_cols: 5,
|
|
|
|
|
serialize_params: function($w, wgd) {
|
|
|
|
|
return {
|
|
|
|
|
x: wgd.col,
|
|
|
|
|
y: wgd.row,
|
|
|
|
|
id: $($w).find('div').attr('id'),
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
draggable: {
|
|
|
|
|
stop: function(event, ui) {
|
|
|
|
|
oWidgets = this.serialize_changed();
|
|
|
|
|
$.ajax('dragstop', {
|
|
|
|
|
data: {'T': JSON.stringify(oWidgets)},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).data('gridster');
|
2013-02-28 12:07:42 +01:00
|
|
|
|
|
|
|
|
|
$('#portal').click(function() {
|
|
|
|
|
$('div.gridster').show('blind', {duration: 800});
|
2013-03-14 12:08:35 +01:00
|
|
|
|
$('.iframe').hide();
|
2013-02-28 12:07:42 +01:00
|
|
|
|
$('#portal').hide('fade');
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
2013-03-14 12:50:26 +01:00
|
|
|
|
$('.close').click(function() {
|
|
|
|
|
window.location = window.location + 'remove/' + $(this).next().attr('id');
|
|
|
|
|
});
|
|
|
|
|
|
2013-03-14 15:18:40 +01:00
|
|
|
|
$('.simple_color').simpleColor();
|
|
|
|
|
|
|
|
|
|
$('.color').click(function() {
|
|
|
|
|
console.log('parent:', $(this).parent());
|
|
|
|
|
var app_id = $(this).next().next().attr('id');
|
|
|
|
|
var li = $(this).parent();
|
|
|
|
|
|
|
|
|
|
$('#dialog-color').dialog({
|
|
|
|
|
resizable: false,
|
|
|
|
|
height: 300,
|
|
|
|
|
width: 370,
|
|
|
|
|
modal: true,
|
|
|
|
|
buttons: {
|
|
|
|
|
"Sélectionner": function() {
|
2013-07-31 13:40:24 +02:00
|
|
|
|
$(li).css('background-color', $('.simple_color').val()).css('border-color', $('.simple_color').val());
|
2013-03-14 15:18:40 +01:00
|
|
|
|
$.ajax('color/' + app_id, {data: {'bg': $('.simple_color').val()}});
|
|
|
|
|
$( this ).dialog( "close" );
|
|
|
|
|
},
|
|
|
|
|
"Annuler": function() {
|
|
|
|
|
$( this ).dialog( "close" );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
2013-02-28 12:07:42 +01:00
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
{% endblock %}
|