This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
univcloud/univcloud/templates/univcloud/homepage.html

111 lines
2.9 KiB
HTML
Raw Normal View History

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>
<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>
{% for app in apps %}
<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 %}"
{% if app.background_color %}style="background-color: {{app.background_color}}; border-color: {{app.background_color}};"{% endif %}>
<span class="color">o</span>
2013-03-14 12:50:26 +01:00
<span class="close">×</span>
{{ app.content }}
2013-02-28 12:07:42 +01:00
</li>
{% 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>
<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');
});
$('.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() {
$(li).css('background-color', $('.simple_color').val()).css('border-color', $('.simple_color').val());
$.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 %}