Created Home view for Hdalab
authorveltr
Tue, 28 Feb 2012 18:51:58 +0100
changeset 131 9d5d9e6b7fbf
parent 130 c8af52e4a047
child 132 e6483309fa52
Created Home view for Hdalab
web/hdalab/static/hdalab/css/common.css
web/hdalab/static/hdalab/css/facettes.css
web/hdalab/static/hdalab/css/style.css
web/hdalab/static/hdalab/img/bgdhdalab.png
web/hdalab/static/hdalab/img/bgmap.png
web/hdalab/static/hdalab/js/geojson_quickconv.js
web/hdalab/static/hdalab/js/gomina.js
web/hdalab/templates/base.html
web/hdalab/templates/facettes.html
web/hdalab/templates/index.html
web/hdalab/urls.py
web/hdalab/views/ajax.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/hdalab/static/hdalab/css/common.css	Tue Feb 28 18:51:58 2012 +0100
@@ -0,0 +1,95 @@
+@font-face
+{
+    font-family: "Open Sans"; src: url(OpenSans-Regular.ttf);
+}
+
+@font-face
+{
+    font-family: "Open Sans"; font-weight: bold; src: url(OpenSans-Bold.ttf);
+}
+
+@font-face
+{
+    font-family: "Open Sans"; font-style: italic; src: url(OpenSans-Italic.ttf);
+}
+
+/* Browser-reset CSS */
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed, 
+figure, figcaption, footer, header, hgroup, 
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+    margin: 0;
+    padding: 0;
+    border: 0;
+    font-size: 100%;
+    font: inherit;
+    vertical-align: baseline;
+}
+
+input::-moz-focus-inner /*Remove button padding in FF*/
+{ 
+    border: 0;
+    padding: 0;
+}
+
+table {
+    border-collapse: separate; border-spacing: 0;
+}
+
+th, td {
+    vertical-align: top;
+}
+
+/* Body */
+
+body {
+    font-family: "Open Sans", Arial, Helvetica, sans-serif; background: url(../img/bgdhdalab.png) top repeat-x #ffffff; color: #000000; font-size: 10px;
+}
+
+input, textarea {
+    font-family: "Open Sans", Arial, Helvetica, sans-serif; background: transparent;
+}
+
+a {
+    text-decoration: none;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+/* Main container */
+
+#container {
+    position: relative; width: 960px; margin: 0 auto;
+}
+
+h1 {
+    margin: 5px 0 10px; font-size: 34px; color: #ffffff;
+}
+
+#nav {
+    float: right; list-style: none; margin-top: 3px;
+}
+
+#nav li {
+    float: left; font-size: 14px; margin-left: 10px; font-weight: bold;
+}
+
+#nav a {
+    color: #ffffff;
+}
+
+#nav a:hover {
+    color: #e07000;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/hdalab/static/hdalab/css/facettes.css	Tue Feb 28 18:51:58 2012 +0100
@@ -0,0 +1,365 @@
+.barrebloc {
+    float: left; width: 473px; border: 1px solid #b0b0b0;
+     background-image: url(../img/bgdhdalab.png); background-position: 0 -22px; background-repeat: repeat-x; cursor: pointer; cursor: hand;
+    border-top-left-radius: 4px; border-top-right-radius: 4px
+}
+
+.barrebloc h2 {
+    margin: 4px 0; font-size: 16px; text-align: center; color: #ffffff; font-weight: bold;
+}
+
+.bloc, #bloc_gestvue {
+    float: left; width: 475px; margin-bottom: 10px;
+}
+
+.corpsbloc {
+    float: left; width: 465px; border: 1px solid #b0b0b0; padding: 8px 4px; border-top-style: none;
+    background-color: #ffffff; background-image: url(../img/bgdhdalab.png); background-position: 0 -62px; background-repeat: repeat-x;
+    border-bottom-left-radius: 4px; border-bottom-right-radius: 4px
+}
+
+#hdatitle {
+    float: left; width: 475px; margin: 5px 0; font-size: 20px;
+}
+
+#sessionname {
+    color: #600000; font-size: 22px;
+}
+
+#hdatitle .lectseul {
+    font-size: 17px;
+}
+
+#hdatitle input {
+    display: inline; margin: 0; padding: 0; font-size: 18px; font-weight: bold;
+}
+
+#apartager {
+    float: right; font-size: 14px;
+}
+
+#vues {
+    float: right; text-align: right; width: 475px; margin: 2px 0; padding: 0;
+}
+
+#vuestitre {
+     display: inline; padding: 2px 4px; font-size: 15px;
+}
+
+#ongletsvues {
+    display: inline; list-style: none; margin: 0; padding: 0;
+}
+
+li.lienvue {
+    display: inline; padding: 3px; font-size: 13px; font-weight: bold;
+}
+
+.lienvue a, #apartager a {
+    color: #666666;
+}
+
+.lienvue.actif a, #apartager.actif a {
+    color: #cc0066;
+}
+
+#nouvellevue a {
+    font-weight: bold; color: #ff3000; font-size: 16px;
+}
+
+#partageurls, #plusdevues {
+    float: right; text-align: right; clear: both; list-style: none; padding: 0; margin: 2px 0;
+    font-size: 13px; display: none;
+}
+
+.myurl {
+    font-weight: bold;
+}
+
+#timeline {
+    float: left; width: 100%; margin: 15px 0;
+}
+
+#dates {
+    list-style: none; float: left; width: 100%; height: 0; padding: 0; margin: 0;
+}
+
+#dates li {
+    position: absolute; width: 1px; height: 20px; background: rgba(0,0,0,.3); z-index: 2; margin: 0; padding: 0;
+}
+
+div.datelabel {
+    width: 60px; margin: 4px 0 0 -30px; font-size: 10px; text-align: center; opacity: .8;
+}
+
+#dateheat {
+    float: left; width: 100%; height: 20px; z-index: 1;
+}
+
+.handle {
+    position: absolute; width: 0; z-index: 2; cursor: pointer; cursor: hand;
+}
+
+.handleinner {
+    float: left; border: 5px solid #999; background: #fff;
+    height: 30px; width: 10px; margin-top: -10px; border-radius: 4px;
+    opacity: .8;
+}
+
+.handleinner:hover {
+    background: #ccc;
+}
+
+.ui-draggable-dragging .handleinner {
+    background: #660000; color: #ffffff;
+}
+
+#leftcol {
+    float: left; width: 475px; margin-right: 5px;
+}
+
+#bandefiltre {
+    float: left; width: 100%; margin-top: 10px;
+}
+
+#filtertitle {
+    float: left; margin: 1px 0; padding: 0; font-size: 13px; font-weight: bold;
+}
+
+#filters {
+    list-style: none; float: left; margin: 0 20px; padding: 0; font-size: 12px;
+}
+
+#filters li {
+    float: left; padding: 2px 3px; margin-right: 5px; font-weight: bold;
+}
+
+#filters a {
+    color: #666666;
+}
+
+#filters li.nofilter {
+    font-style: italic; color: #ff3030;
+}
+
+#filters li.filtag {
+    color: #ffffff; background: #000066;
+}
+
+#filters li.filcountry {
+    color: #ffffff; background: #cc0066;
+}
+
+#filters li.filperiod {
+    color: #ffffff; background: #e07000;
+}
+
+span.spyr {
+     cursor: pointer; cursor: hand;
+}
+
+.spyr input {
+    display: inline; margin: 0; padding: 0; font-size: 11px;
+}
+
+#contentcount {
+    float: left; width: 100%; text-align: right; font-size: 13px; margin: 2px 0;
+}
+
+#filters a.remfil {
+    color: #cccccc; margin-left: 2px;
+}
+
+#map {
+    height: 250px;
+}
+
+.leaflet-container {
+    background: #e3e9fd url(../img/bgmap.png);
+}
+
+#tagcloud {
+    text-align: center;
+}
+
+#tclist {
+    list-style: none; padding: 0; margin: 0;
+}
+
+#tclist li {
+    display: inline-block; margin: 2px 5px; padding: 0;
+}
+
+#tclist a {
+    color: #000000;
+}
+
+#tclist a.tagmatch {
+    color: #0000cc;
+}
+
+#tclist a:hover {
+    color: #800000;
+}
+
+
+#tagsearchwrap {
+    width: 50%;
+}
+
+#tagsearch {
+    width: 100%; font-size: 16px; font-weight: bold; border-style: none; border-bottom: 1px solid #000;
+}
+
+#tagsearch.grise {
+    color: #666; font-style: italic; font-weight: normal;
+}
+
+#rightcol {
+    float: left; width: 475px; margin-left: 5px;
+}
+
+#disciplines {
+    
+}
+
+.disc-ul {
+    float: left; clear: both; list-style: none;
+}
+
+.disc-li {
+    float: left; width: 230px; margin: 2px 0;
+}
+
+.disc-label {
+    float: left; font-size: 13px; width: 100px; text-align: right; margin-right: 5px; line-height: 13px;
+}
+
+.disc-bar {
+    float: left; height: 14px; margin: 2px 0;
+}
+
+#contentlist {
+    list-style: none; padding: 0; margin: 0;
+}
+
+li.content-item {
+    margin: 2px 0 12px;
+}
+
+.content-item h3 {
+    font-size: 18px; margin: 3px 0;
+}
+
+.content-item h4 {
+    font-size: 11px; margin: 3px 0;
+}
+
+.content-item h4 a {
+    color: #000066;
+}
+
+.maplet {
+    float: right;
+}
+
+.content-item p {
+    font-size: 12px; margin: 3px 0;
+}
+
+.content-annotation ul {
+    list-style : disc; margin: 2px 0; padding-left: 1.5em; font-size: 12px;
+    cursor: pointer; cursor: hand;
+}
+
+.content-annotation li {
+    margin: 2px 0;
+}
+
+.content-annotation textarea {
+    width: 99%; margin: 0; padding: 0; font-size: 12px;
+}
+
+ul.content-tags {
+    list-style: none; padding: 0; margin: 0;
+}
+
+li.content-tag-item {
+    display: inline-block; margin: 2px; padding: 2px; font-size: 13px; background: #666666;
+}
+
+.content-tag-item a {
+    color: #ffffff;
+}
+
+.content-tag-item a:hover {
+    color: #ff8080;
+}
+
+.content-tag-item a.tagmatch {
+    color: #ffff00; font-weight: bold;
+}
+
+#tagcount {
+    float: right; text-align: right; font-size: 14px; font-weight: bold;
+}
+
+#taginfo p, h2, h3  {
+    margin: 5px 0;
+}
+
+#taginfo h3 {
+    font-size: 14px;
+}
+
+#taginfo p {
+    font-size: 11px;
+}
+
+#img_wikipedia {
+    float: left; max-width: 160px; max-height: 120px; margin: 2px 2px 2px 0;
+}
+
+#gestvue {
+    display: none;
+}
+
+#div_titrevue {
+    margin: 5px 0;
+}
+
+#div_titrevue label {
+    font-size: 14px;
+}
+
+#titrevue {
+    font-size: 15px; margin: 0 0 0 5px; width: 220px; padding: 2px; border-style: none; border-bottom: 1px solid #000;
+}
+
+#gestvue h4 {
+    margin: 2px 0; font-size: 14px;
+}
+
+#widgetlist {
+    list-style: none; padding: 0; margin: 0; width: 100%;
+}
+
+#widgetlist li {
+    float: left; width: 48%;
+}
+
+#widgetlist label {
+    font-size: 13px;
+}
+
+#notes ul {
+    font-size: 13px; margin: 0; padding-left: 1.5em;
+}
+
+#notes textarea {
+    padding: 0; margin: 0; width: 99%; font-size: 13px;
+}
+
+#lightboxbg {
+    position: absolute; left: 0; top: 0; bottom: 0; right: 0;
+    background: rgba(0,0,0,.5); z-index: 12;
+}
--- a/web/hdalab/static/hdalab/css/style.css	Tue Feb 28 11:43:29 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,383 +0,0 @@
-@font-face
-{
-    font-family: "Open Sans"; src: url(OpenSans-Regular.ttf);
-}
-
-@font-face
-{
-    font-family: "Open Sans"; font-weight: bold; src: url(OpenSans-Bold.ttf);
-}
-
-@font-face
-{
-    font-family: "Open Sans"; font-style: italic; src: url(OpenSans-Italic.ttf);
-}
-
-body {
-    margin: 0; padding: 0; font-family: "Open Sans", Arial, Helvetica, sans-serif;
-    background: #ffffff; color: #000000;
-    font-size: 10px;
-}
-
-input, textarea {
-    font-family: "Open Sans", Arial, Helvetica, sans-serif;
-}
-
-a {
-    text-decoration: none;
-}
-
-a:hover {
-    text-decoration: underline;
-}
-
-#container {
-    position: relative; width: 960px; margin: 0 auto;
-}
-
-.barrebloc {
-    float: left; width: 473px; border: 1px solid #b0b0b0;
-    background: #e0e0e0; cursor: pointer; cursor: hand;
-}
-
-.barrebloc h2 {
-    margin: 4px 0; font-size: 16px; text-align: center;
-}
-
-.bloc, #bloc_gestvue {
-    float: left; width: 475px; margin-bottom: 10px;
-}
-
-.corpsbloc {
-    float: left; width: 465px; border: 1px solid #b0b0b0; padding: 8px 4px; border-top-style: none;
-}
-
-h1 {
-    float: left; width: 475px; margin: 5px 0; font-size: 20px;
-}
-
-#sessionname {
-    color: #600000; font-size: 22px;
-}
-
-h1 .lectseul {
-    font-size: 17px;
-}
-
-h1 input {
-    display: inline; margin: 0; padding: 0; font-size: 18px; font-weight: bold;
-}
-
-#apartager {
-    float: right; font-size: 14px;
-}
-
-#vues {
-    float: right; text-align: right; width: 475px; margin: 2px 0; padding: 0;
-}
-
-#vuestitre {
-     display: inline; padding: 2px 4px; font-size: 15px;
-}
-
-#ongletsvues {
-    display: inline; list-style: none; margin: 0; padding: 0;
-}
-
-li.lienvue {
-    display: inline; padding: 3px; font-size: 13px; font-weight: bold;
-}
-
-.lienvue a, #apartager a {
-    color: #666666;
-}
-
-.lienvue.actif a, #apartager.actif a {
-    color: #990000;
-}
-
-#nouvellevue a {
-    font-weight: bold; color: #ff3000; font-size: 16px;
-}
-
-#partageurls, #plusdevues {
-    float: right; text-align: right; clear: both; list-style: none; padding: 0; margin: 2px 0;
-    font-size: 13px; display: none;
-}
-
-.myurl {
-    font-weight: bold;
-}
-
-#timeline {
-    float: left; width: 100%; margin: 15px 0;
-}
-
-#dates {
-    list-style: none; float: left; width: 100%; height: 0; padding: 0; margin: 0;
-}
-
-#dates li {
-    position: absolute; width: 1px; height: 20px; background: rgba(0,0,0,.3); z-index: 2; margin: 0; padding: 0;
-}
-
-div.datelabel {
-    width: 60px; margin: 4px 0 0 -30px; font-size: 10px; text-align: center; opacity: .8;
-}
-
-#dateheat {
-    float: left; width: 100%; height: 20px; z-index: 1;
-}
-
-.handle {
-    position: absolute; width: 0; z-index: 2; cursor: pointer; cursor: hand;
-}
-
-.handleinner {
-    float: left; border: 5px solid #999; background: #fff;
-    height: 30px; width: 10px; margin-top: -10px; border-radius: 4px;
-    opacity: .8;
-}
-
-.handleinner:hover {
-    background: #ccc;
-}
-
-.ui-draggable-dragging .handleinner {
-    background: #660000; color: #ffffff;
-}
-
-#leftcol {
-    float: left; width: 475px; margin-right: 5px;
-}
-
-#bandefiltre {
-    float: left; width: 100%; margin-top: 10px;
-}
-
-#filtertitle {
-    float: left; margin: 1px 0; padding: 0; font-size: 13px; font-weight: bold;
-}
-
-#filters {
-    list-style: none; float: left; margin: 0 20px; padding: 0; font-size: 12px;
-}
-
-#filters li {
-    float: left; padding: 2px 3px; margin-right: 5px; font-weight: bold;
-}
-
-#filters a {
-    color: #666666;
-}
-
-#filters li.nofilter {
-    font-style: italic; color: #ff3030;
-}
-
-#filters li.filtag {
-    color: #ffffff; background: #000066;
-}
-
-#filters li.filcountry {
-    color: #ffffff; background: #cc0066;
-}
-
-#filters li.filperiod {
-    color: #ffffff; background: #e07000;
-}
-
-span.spyr {
-     cursor: pointer; cursor: hand;
-}
-
-.spyr input {
-    display: inline; margin: 0; padding: 0; font-size: 11px;
-}
-
-#contentcount {
-    float: left; width: 100%; text-align: right; font-size: 13px; margin: 2px 0;
-}
-
-#filters a.remfil {
-    color: #cccccc; margin-left: 2px;
-}
-
-#map {
-    height: 250px;
-}
-
-#tagcloud {
-    text-align: center;
-}
-
-#tclist {
-    list-style: none; padding: 0; margin: 0;
-}
-
-#tclist li {
-    display: inline-block; margin: 2px 5px; padding: 0;
-}
-
-#tclist a {
-    color: #000000;
-}
-
-#tclist a.tagmatch {
-    color: #0000cc;
-}
-
-#tclist a:hover {
-    color: #800000;
-}
-
-
-#tagsearchwrap {
-    width: 50%;
-}
-
-#tagsearch {
-    width: 100%; font-size: 16px; font-weight: bold; border-style: none; border-bottom: 1px solid #000;
-}
-
-#tagsearch.grise {
-    color: #666; font-style: italic; font-weight: normal;
-}
-
-#rightcol {
-    float: left; width: 475px; margin-left: 5px;
-}
-
-#disciplines {
-    height: 120px;
-}
-
-#disciplines g {
-    cursor: pointer; cursor: hand;
-}
-
-#contentlist {
-    list-style: none; padding: 0; margin: 0;
-}
-
-li.content-item {
-    margin: 2px 0 12px;
-}
-
-.content-item h3 {
-    font-size: 18px; margin: 3px 0;
-}
-
-.content-item h4 {
-    font-size: 11px; margin: 3px 0;
-}
-
-.content-item h4 a {
-    color: #000066;
-}
-
-.maplet {
-    float: right;
-}
-
-.content-item p {
-    font-size: 12px; margin: 3px 0;
-}
-
-.content-annotation ul {
-    list-style : disc; margin: 2px 0; padding-left: 1.5em; font-size: 12px;
-    cursor: pointer; cursor: hand;
-}
-
-.content-annotation li {
-    margin: 2px 0;
-}
-
-.content-annotation textarea {
-    width: 99%; margin: 0; padding: 0; font-size: 12px;
-}
-
-ul.content-tags {
-    list-style: none; padding: 0; margin: 0;
-}
-
-li.content-tag-item {
-    display: inline-block; margin: 2px; padding: 2px; font-size: 13px; background: #666666;
-}
-
-.content-tag-item a {
-    color: #ffffff;
-}
-
-.content-tag-item a:hover {
-    color: #ff8080;
-}
-
-.content-tag-item a.tagmatch {
-    color: #ffff00; font-weight: bold;
-}
-
-#tagcount {
-    float: right; text-align: right; font-size: 14px; font-weight: bold;
-}
-
-#taginfo p, h2, h3  {
-    margin: 5px 0;
-}
-
-#taginfo h3 {
-    font-size: 14px;
-}
-
-#taginfo p {
-    font-size: 11px;
-}
-
-#img_wikipedia {
-    float: left; max-width: 160px; max-height: 120px; margin: 2px 2px 2px 0;
-}
-
-#gestvue {
-    display: none;
-}
-
-#div_titrevue {
-    margin: 5px 0;
-}
-
-#div_titrevue label {
-    font-size: 14px;
-}
-
-#titrevue {
-    font-size: 15px; margin: 0 0 0 5px; width: 220px; padding: 2px; border-style: none; border-bottom: 1px solid #000;
-}
-
-#gestvue h4 {
-    margin: 2px 0; font-size: 14px;
-}
-
-#widgetlist {
-    list-style: none; padding: 0; margin: 0; width: 100%;
-}
-
-#widgetlist li {
-    float: left; width: 48%;
-}
-
-#widgetlist label {
-    font-size: 13px;
-}
-
-#notes ul {
-    font-size: 13px; margin: 0; padding-left: 1.5em;
-}
-
-#notes textarea {
-    padding: 0; margin: 0; width: 99%; font-size: 13px;
-}
-
-#lightboxbg {
-    position: absolute; left: 0; top: 0; bottom: 0; right: 0;
-    background: rgba(0,0,0,.5); z-index: 12;
-}
Binary file web/hdalab/static/hdalab/img/bgdhdalab.png has changed
Binary file web/hdalab/static/hdalab/img/bgmap.png has changed
--- a/web/hdalab/static/hdalab/js/geojson_quickconv.js	Tue Feb 28 11:43:29 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-function polygon_to_gmap(polycoords, dbpedia_uri) {
-    var _opts =  {
-        strokeColor: "#000000",
-        strokeWeight: .5,
-        fillColor: "#7070a0",
-        fillOpacity: .3
-    }
-    _opts.paths = polycoords.map(function(path) {
-        return path.map(function(coord) {
-            return new google.maps.LatLng(coord[1], coord[0]);
-        });
-    });
-    var _polygon = new google.maps.Polygon(_opts);
-    _polygon.setMap(gomNs.map);
-    google.maps.event.addListener(_polygon, 'click', function(a,b) {
-        addFilter('country', dbpedia_uri);
-    })
-    return _polygon;
-}
-
-function showCountriesGmap(geoJson) {
-    gomNs.countries = {};
-    _(geoJson.features).each(function(feature) {
-        var _el = { "properties" : feature.properties };
-        if (feature.id == 'ATA') {
-            _el.gPolygons = [];
-        } else {
-            switch(feature.geometry.type) {
-                case('Polygon'):
-                    _el.gPolygons = [ polygon_to_gmap(feature.geometry.coordinates, feature.properties.dbpedia_uri) ];
-                break;
-                case('MultiPolygon'):
-                    _el.gPolygons = feature.geometry.coordinates.map(function(polygon) {
-                        return polygon_to_gmap(polygon, feature.properties.dbpedia_uri);
-                    })
-                break;
-            }
-        }
-        gomNs.countries[feature.properties.dbpedia_uri] = _el;
-    });
-}
-
-function showCountriesLeaflet(geoJson) {
-    gomNs.countries = {};
-    var gJ = new L.GeoJSON();
-    gJ.on('featureparse', function(_f) {
-        var isocode = _f.id;
-        _f.layer.setStyle({
-            color: "#000000",
-            weight: .5,
-            fillColor: "#7070a0",
-            fillOpacity: .3
-        });
-        _f.layer.on('click', function() {
-            addFilter('country', _f.properties.dbpedia_uri);
-        });
-        gomNs.countries[_f.properties.dbpedia_uri] = {
-            "properties" : _f.properties,
-            "layer" : _f.layer
-        }
-    });
-    gJ.addGeoJSON(geoJson);
-    gomNs.map.addLayer(gJ);
-}
--- a/web/hdalab/static/hdalab/js/gomina.js	Tue Feb 28 11:43:29 2012 +0100
+++ b/web/hdalab/static/hdalab/js/gomina.js	Tue Feb 28 18:51:58 2012 +0100
@@ -7,9 +7,12 @@
     maxYear: 2010,
     tlPixels: 960,
     tlGamma: 6,
-    heatGamma: 4,
-    displayedDates: [-5000,0,500,1000,1200,1400,1600,1700,1750,1800,1850,1900,1950,2010],
+    heatGamma: 2,
+    displayedDates: [ -5000, 0, 500, 1000, 1200, 1400, 1600, 1700, 1750, 1800, 1850, 1900, 1950, 2010 ],
     mappingLibrary: 'leaflet',
+    gradientStart: [ 255, 255, 240 ],
+    gradientEnd: [ 255, 160, 30 ],
+    zeroColor: [ 230, 230, 235 ]
 }
 
 function yearToPx(year) {
@@ -20,6 +23,84 @@
     return gomNs.minYear + ( gomNs.maxYear - gomNs.minYear ) * Math.pow( px / gomNs.tlPixels, 1 / gomNs.tlGamma );
 }
 
+function getGradient(_pos) {
+    if (_pos == 0) {
+        var _rgb = gomNs.zeroColor;
+    } else {
+        var _rgb = [],
+            _exp = Math.pow(_pos, 1/gomNs.heatGamma);
+        for (var i=0; i<3; i++) {
+            _rgb.push(Math.floor(_exp*gomNs.gradientEnd[i] + (1-_exp)*gomNs.gradientStart[i]));
+        }
+    }
+    return "rgb(" + _rgb.join(",") + ")"
+}
+
+function polygon_to_gmap(polycoords, dbpedia_uri) {
+    var _opts =  {
+        strokeColor: "#000000",
+        strokeWeight: .5,
+        fillColor: "rgb(" + gomNs.zeroColor.join(",") + ")",
+        fillOpacity: 1
+    }
+    _opts.paths = polycoords.map(function(path) {
+        return path.map(function(coord) {
+            return new google.maps.LatLng(coord[1], coord[0]);
+        });
+    });
+    var _polygon = new google.maps.Polygon(_opts);
+    _polygon.setMap(gomNs.map);
+    google.maps.event.addListener(_polygon, 'click', function(a,b) {
+        addFilter('country', dbpedia_uri);
+    })
+    return _polygon;
+}
+
+function showCountriesGmap(geoJson) {
+    gomNs.countries = {};
+    _(geoJson.features).each(function(feature) {
+        var _el = { "properties" : feature.properties };
+        if (feature.id == 'ATA') {
+            _el.gPolygons = [];
+        } else {
+            switch(feature.geometry.type) {
+                case('Polygon'):
+                    _el.gPolygons = [ polygon_to_gmap(feature.geometry.coordinates, feature.properties.dbpedia_uri) ];
+                break;
+                case('MultiPolygon'):
+                    _el.gPolygons = feature.geometry.coordinates.map(function(polygon) {
+                        return polygon_to_gmap(polygon, feature.properties.dbpedia_uri);
+                    })
+                break;
+            }
+        }
+        gomNs.countries[feature.properties.dbpedia_uri] = _el;
+    });
+}
+
+function showCountriesLeaflet(geoJson) {
+    gomNs.countries = {};
+    var gJ = new L.GeoJSON();
+    gJ.on('featureparse', function(_f) {
+        var isocode = _f.id;
+        _f.layer.setStyle({
+            color: "#000000",
+            weight: .5,
+            fillOpacity: 1,
+            fillColor: "rgb(" + gomNs.zeroColor.join(",") + ")"
+        });
+        _f.layer.on('click', function() {
+            addFilter('country', _f.properties.dbpedia_uri);
+        });
+        gomNs.countries[_f.properties.dbpedia_uri] = {
+            "properties" : _f.properties,
+            "layer" : _f.layer
+        }
+    });
+    gJ.addGeoJSON(geoJson);
+    gomNs.map.addLayer(gJ);
+}
+
 
 function tagInfo(_taglabel) {
     var _urlParam = { "label": _taglabel };
@@ -70,7 +151,6 @@
     var _curView = gomNs.sessiondata.views[gomNs.sessiondata.view];
     if (_curView.type == 'filter') {
         _curView[_type].push(_label);
-        console.log(_curView[_type]);
         updateFilters();
         debouncedSaveChanges();
     }
@@ -320,23 +400,20 @@
     }
     var _s = (data.count>1?'s':'');
     $("#contentcount").html('<b>'+data.count+'</b> notice'+_s);
-    var _sl = data.sparkline.length;
-    if (_sl) {
-        var _maxheat = _(data.sparkline).max(function(_d) { return parseInt(_d.score); }).score,
-            _exp = 1 / gomNs.heatGamma,
-            _scale = Math.pow(_maxheat, - _exp);
-        _(data.sparkline).each(function(_d, _i) {
-            var _nxt = (_i == _sl - 1) ? gomNs.maxYear + 1 : data.sparkline[_i + 1].year,
-                _x1 = yearToPx(_d.year),
-                _x2 = yearToPx(_nxt),
-                _heat = _scale * Math.pow(_d.score, _exp);
-            gomNs.dhmPaper.rect(_x1, 0, _x2 - _x1, 20).attr({
-                "fill" : "rgb(255, 128, 128)",
-                "opacity" : _heat,
-                "stroke" : "none"
-            })
-        });
+    if (!data.sparkline.length || data.sparkline[0].year != gomNs.minYear) {
+        data.sparkline.splice(0,0,{"year": gomNs.minYear, "score": 0});
     }
+    var _maxheat = _(data.sparkline).max(function(_d) { return parseInt(_d.score); }).score;
+    _(data.sparkline).each(function(_d, _i) {
+        var _nxt = (_i == data.sparkline.length - 1) ? (gomNs.maxYear + 1) : data.sparkline[_i + 1].year,
+            _x1 = yearToPx(_d.year),
+            _x2 = yearToPx(_nxt),
+            _heat = _d.score / _maxheat;
+        gomNs.dhmPaper.rect(_x1, 0, _x2 - _x1, 20).attr({
+            "fill" : getGradient(_heat),
+            "stroke" : "none"
+        })
+    });
     if (gomNs.sessiondata.view == 0) {
         var _h0 = $("#handle_0").position().left,
             _h1 = $("#handle_1").position().left;
@@ -371,22 +448,20 @@
         var _max = Math.max(1, _(data.countries).max());
         _(gomNs.countries).each(function(_country, _k) {
             var _val = data.countries[_k] || 0,
-                _gb = parseInt(255 * (1 - _val / _max )),
-                _fill = ( _val ? "rgb(255," + _gb + "," + _gb + ")" : "#7070a0" ),
-                _op = (_val ? .9 : .3);
+                _fill = getGradient(_val/_max);
             switch(gomNs.mappingLibrary) {
                 case 'gmaps':
                     _(_country.gPolygons).each(function(_p) {
                         _p.setOptions({
                             "fillColor" : _fill,
-                            "fillOpacity": _op
+                            "fillOpacity" : 1
                         });
                     });
                 break;
                 case 'leaflet':
                     _country.layer.setStyle({
                         "fillColor" : _fill,
-                        "fillOpacity": _op
+                        "fillOpacity" : 1
                     })
                 break;
             }
@@ -394,12 +469,30 @@
     }
     if (data.disciplines) {
         var _disc = data.disciplines.filter(function(_d) {
-            return +_d.score > 0;
-        }),
+                return +_d.score > 0;
+            }),
+            _max = _disc.reduce(function(_a, _b) {
+                return Math.max(_a,_b.score)
+            }, 1);
+        $("#disciplines").html(
+            '<ul class="disc-ul">'
+            + _disc.map(function(_d) {
+                var _col = getGradient(_d.score / _max);
+                return '<li class="disc-li" onclick="tagInfo($(this).find(\'.disc-label\').text()); return false;"><div class="disc-label">'
+                    + _d.label
+                    + '</div><div class="disc-bar" style="background:'
+                    + _col
+                    + '; width:'
+                    + Math.floor(120 * (_d.score / _max))
+                    + 'px">'
+            }).join("")
+            + '</ul>'
+        )
+/*            _max = d3.max(_disc, function(_d) { return +_d.score }),
             _echelle = d3.scale
                 .linear()
                 .range([0, 120])
-                .domain([0, d3.max(_disc, function(_d) { return +_d.score })]),
+                .domain([0, _max]),
             _barres = gomNs.disChart.selectAll("g.discbarre").data(_disc);
             
         var _newels = _barres.enter()
@@ -423,17 +516,24 @@
             tagInfo(_d.label);
         }).on("mouseover", function() {
             d3.select(this).select("rect").attr("fill","rgb(128,128,255)");
-        }).on("mouseout", function() {
-            d3.select(this).select("rect").attr("fill","rgb(255,128,128)");
+        }).on("mouseout", function(_d) {
+            d3.select(this).select("rect").attr("fill", function(_d) {
+                return getGradient(_d.score / _max);
+            })
         }).attr("transform",function(_d,_k) {
            return "translate(" + ( 30 + 40 * _k ) + ",120) rotate(-90)";
         });
         _barres.select("text").text(function(_d) {
             return _d.label;
         });
-        _barres.select("rect").attr("width", function(_d) {
-            return _echelle(_d.score);
-        });
+        _barres.select("rect")
+            .attr("width", function(_d) {
+                return _echelle(_d.score);
+            })
+            .attr("fill", function(_d) {
+                return getGradient(_d.score / _max);
+            }); */
+        
     }
 }
 
@@ -633,7 +733,7 @@
                 center: new L.LatLng(30, 0),
                 zoom: 1
             });
-            gomNs.map.addLayer(new L.TileLayer("http://s3.amazonaws.com/com.modestmaps.bluemarble/{z}-r{y}-c{x}.jpg", {maxZoom: 9}));
+            //gomNs.map.addLayer(new L.TileLayer("http://s3.amazonaws.com/com.modestmaps.bluemarble/{z}-r{y}-c{x}.jpg", {maxZoom: 9}));
             $.getJSON(gomNs.urls['countries'], showCountriesLeaflet);
             break;
     }
@@ -728,10 +828,10 @@
             }
         }
     });
-    gomNs.disChart = d3.select("#disciplines")
+/*    gomNs.disChart = d3.select("#disciplines")
         .append("svg:svg")
         .attr("width", 475)
-        .attr("height", 120);
+        .attr("height", 120); */
     getInitialView();
     $(".barrebloc").click(function() {
         $(this).next().slideToggle(); 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/hdalab/templates/base.html	Tue Feb 28 18:51:58 2012 +0100
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="fr">
+    <head>
+        <meta charset="utf-8" />
+        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+        <title>{% block title %}HdA Lab{% endblock %}</title>
+
+{% block css_import %}
+        <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}hdalab/css/common.css" />
+{% endblock %}
+
+{% block js_import %}
+        <script src="{{STATIC_URL}}hdalab/lib/jquery-1.7.1.min.js"></script>
+{% endblock %}
+        
+    </head>
+    <body>
+
+{% block header %}
+        <div id="container">
+            <ul id="nav">
+                <li><a href="{% url home %}">Accueil</a></li>
+                <li><a href="{% url facettes %}">Recherche par facettes</a></li>
+            </ul>
+            <h1>HdA Lab</h1>
+{% endblock %}
+
+{% block main_content %}
+
+{% endblock %}
+
+{% block footer %}
+        </div>
+{% endblock %}
+
+    </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/hdalab/templates/facettes.html	Tue Feb 28 18:51:58 2012 +0100
@@ -0,0 +1,135 @@
+{% extends "base.html" %}
+
+{% block title %}{{block.super}} &gt; Recherche par facettes{% endblock %}
+
+{% block css_import %}
+{{block.super}}
+        <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}hdalab/lib/leaflet/leaflet.css" />
+        <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}hdalab/css/ui-lightness/jquery-ui-1.8.16.custom.css" />
+        <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}hdalab/css/facettes.css" />
+{% endblock %}
+
+{% block js_import %}
+{{block.super}}
+        <script src="{{STATIC_URL}}hdalab/lib/raphael-min.js"></script>
+        <script src="{{STATIC_URL}}hdalab/lib/underscore-min.js"></script>
+        <script src="{{STATIC_URL}}hdalab/lib/jquery-ui-1.8.16.custom.min.js"></script>
+        <script src="{{STATIC_URL}}hdalab/lib/leaflet/leaflet.js"></script>
+
+        <script src="{{STATIC_URL}}hdalab/js/gomina.js?v=1"></script>
+        <script src="{{STATIC_URL}}hdalab/js/geojson_quickconv.js"></script>
+        
+        <script type="text/javascript">
+        gomNs.urls = {
+            'filter': "{% url filter %}",
+            'session_info': "{% url session_info %}",
+            'tag_search': "{% url tag_search %}",
+            'tag_info': "{% url tag_info %}",
+            'countries': "{{STATIC_URL}}hdalab/lib/countries.geo.json"
+        };
+        </script>
+{% endblock %}
+        
+{% block main_content %}
+            <h2 id="hdatitle">Recherche par facettes&nbsp;: <span id="sessionname"></span></h2>
+            <div id="apartager"><a href="#">Partager la session</a></div>
+            <ul id="partageurls">
+                <li id="partagero">Partagez en lecture seule en copiant ce lien : <span class="myurl" id="rourl">http://</span></li>
+                <li id="partagerw">Partagez en lecture-écriture en copiant ce lien : <span class="myurl" id="rwurl">http://</span></li>
+            </ul>
+            <div id="vues">
+                <h4 id="vuestitre">Mes vues :</h4>
+                <ul id="ongletsvues">
+                </ul>
+                <span id="nouvellevue"><a href="#">+</a></span>
+            </div>
+            <ul id="plusdevues">
+                <li id="nouv_resrech"><a href="#">Créer une vue sur des résultats de recherche</a></li>
+                <li id="nouv_liste"><a href="#">Créer une liste de notices</a></li>
+            </ul>
+            <div id="bandefiltre">
+                <h4 id="filtertitle">
+                    Filtres :
+                </h4>
+                <ul id="filters">
+                </ul>
+            </div>
+            <div id="timeline">
+                <ul id="dates"></ul>
+                <div id="dateheat"></div>
+                <div id="handle_0" class="handle">
+                    <div class="handleinner"></div>
+                </div>
+                <div id="handle_1" class="handle">
+                    <div class="handleinner"></div>
+                </div>
+            </div>
+            <div id="leftcol">
+                <div id="bloc_gestvue">
+                    <div class="barrebloc">
+                        <h2>Gérer la vue</h2>
+                    </div>
+                    <div class="corpsbloc" id="gestvue">
+                        <div id="div_titrevue">
+                            <label>Nom : </label>
+                            <input id="titrevue" />
+                        </div>
+                        <h4>Blocs visibles :</h4>
+                    </div>
+                </div>
+                <div class="bloc" id="bloc_map">
+                    <div class="barrebloc">
+                        <h2>Pays</h2>
+                    </div>
+                    <div class="corpsbloc" id="map"></div>
+                </div>
+                <div class="bloc" id="bloc_tagcloud">
+                    <div class="barrebloc">
+                        <h2>Nuage de mots-clés</h2>
+                    </div>
+                    <div class="corpsbloc" id="tagcloud">
+                    </div>
+                </div>
+                <div class="bloc" id="bloc_taginfo">
+                    <div class="barrebloc">
+                        <h2>Information sur un mot-clé</h2>
+                    </div>
+                    <div class="corpsbloc" id="taginfo">
+                        <div id="tagcount"></div>
+                        <div id="tagsearchwrap"><input id="tagsearch" value="Rechercher un tag" /></div>
+                        <div id="tagdata"></div>
+                    </div>
+                </div>
+            </div>
+            <div id="rightcol">
+                <div class="bloc" id="bloc_notes">
+                    <div class="barrebloc">
+                        <h2>Notes</h2>
+                    </div>
+                    <div id="notes" class="corpsbloc"></div>
+                </div>
+                <div class="bloc" id="bloc_disciplines">
+                    <div class="barrebloc">
+                        <h2>Disciplines artistiques</h2>
+                    </div>
+                    <div id="disciplines" class="corpsbloc"></div>
+                </div>
+                <div class="bloc" id="bloc_notices">
+                    <div class="barrebloc">
+                        <h2>Résultats de recherche</h2>
+                    </div>
+                    <div class="corpsbloc">
+                        <div id="contentcount"></div>
+                        <div id="contents"></div>
+                    </div>
+                </div>
+                
+            </div>
+        </div>
+
+{% endblock %}
+
+{% block footer%}
+{{block.super}}
+        <div id="lightboxbg"></div>
+{% endblock %}
--- a/web/hdalab/templates/index.html	Tue Feb 28 11:43:29 2012 +0100
+++ b/web/hdalab/templates/index.html	Tue Feb 28 18:51:58 2012 +0100
@@ -1,130 +1,7 @@
-<!DOCTYPE html>
-<html lang="en">
-    <head>
-        <meta charset="utf-8" />
-        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
-        <title>HdaLab &gt; Recherche par facettes</title>
-        <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}hdalab/css/style.css" />
-        <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}hdalab/lib/leaflet/leaflet.css" />
-        <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}hdalab/css/ui-lightness/jquery-ui-1.8.16.custom.css" />
-        <script src="{{STATIC_URL}}hdalab/lib/jquery-1.7.1.min.js"></script>
-        <script src="{{STATIC_URL}}hdalab/lib/raphael-min.js"></script>
-        <script src="{{STATIC_URL}}hdalab/lib/d3.min.js"></script>
-        <script src="{{STATIC_URL}}hdalab/lib/underscore-min.js"></script>
-        <script src="{{STATIC_URL}}hdalab/lib/jquery-ui-1.8.16.custom.min.js"></script>
-        <script src="{{STATIC_URL}}hdalab/lib/leaflet/leaflet.js"></script>
+{% extends "base.html" %}
 
-        <script src="{{STATIC_URL}}hdalab/js/gomina.js?v=1"></script>
-        <script src="{{STATIC_URL}}hdalab/js/geojson_quickconv.js"></script>
-        
-        <script type="text/javascript">
-        gomNs.urls = {
-            'filter': "{% url filter %}",
-            'session_info': "{% url session_info %}",
-            'tag_search': "{% url tag_search %}",
-            'tag_info': "{% url tag_info %}",
-            'countries': "{{STATIC_URL}}hdalab/lib/countries.geo.json"
-        };
-        </script>
+{% block title %}{{block.super}} &gt; Accueil{% endblock %}
         
-    </head>
-    <body>
-        <div id="container">
-            <h1>HDA Lab: <span id="sessionname"></span></h1>
-            <div id="apartager"><a href="#">Partager la session</a></div>
-            <ul id="partageurls">
-                <li id="partagero">Partagez en lecture seule en copiant ce lien : <span class="myurl" id="rourl">http://</span></li>
-                <li id="partagerw">Partagez en lecture-écriture en copiant ce lien : <span class="myurl" id="rwurl">http://</span></li>
-            </ul>
-            <div id="vues">
-                <h4 id="vuestitre">Mes vues :</h4>
-                <ul id="ongletsvues">
-                </ul>
-                <span id="nouvellevue"><a href="#">+</a></span>
-            </div>
-            <ul id="plusdevues">
-                <li id="nouv_resrech"><a href="#">Créer une vue sur des résultats de recherche</a></li>
-                <li id="nouv_liste"><a href="#">Créer une liste de notices</a></li>
-            </ul>
-            <div id="bandefiltre">
-                <h4 id="filtertitle">
-                    Filtres :
-                </h4>
-                <ul id="filters">
-                </ul>
-            </div>
-            <div id="timeline">
-                <ul id="dates"></ul>
-                <div id="dateheat"></div>
-                <div id="handle_0" class="handle">
-                    <div class="handleinner"></div>
-                </div>
-                <div id="handle_1" class="handle">
-                    <div class="handleinner"></div>
-                </div>
-            </div>
-            <div id="leftcol">
-                <div id="bloc_gestvue">
-                    <div class="barrebloc">
-                        <h2>Gérer la vue</h2>
-                    </div>
-                    <div class="corpsbloc" id="gestvue">
-                        <div id="div_titrevue">
-                            <label>Nom : </label>
-                            <input id="titrevue" />
-                        </div>
-                        <h4>Blocs visibles :</h4>
-                    </div>
-                </div>
-                <div class="bloc" id="bloc_map">
-                    <div class="barrebloc">
-                        <h2>Pays</h2>
-                    </div>
-                    <div class="corpsbloc" id="map"></div>
-                </div>
-                <div class="bloc" id="bloc_tagcloud">
-                    <div class="barrebloc">
-                        <h2>Nuage de mots-clés</h2>
-                    </div>
-                    <div class="corpsbloc" id="tagcloud">
-                    </div>
-                </div>
-                <div class="bloc" id="bloc_taginfo">
-                    <div class="barrebloc">
-                        <h2>Information sur un mot-clé</h2>
-                    </div>
-                    <div class="corpsbloc" id="taginfo">
-                        <div id="tagcount"></div>
-                        <div id="tagsearchwrap"><input id="tagsearch" value="Rechercher un tag" /></div>
-                        <div id="tagdata"></div>
-                    </div>
-                </div>
-            </div>
-            <div id="rightcol">
-                <div class="bloc" id="bloc_notes">
-                    <div class="barrebloc">
-                        <h2>Notes</h2>
-                    </div>
-                    <div id="notes" class="corpsbloc"></div>
-                </div>
-                <div class="bloc" id="bloc_disciplines">
-                    <div class="barrebloc">
-                        <h2>Disciplines artistiques</h2>
-                    </div>
-                    <div id="disciplines" class="corpsbloc"></div>
-                </div>
-                <div class="bloc" id="bloc_notices">
-                    <div class="barrebloc">
-                        <h2>Notices du portail HDA</h2>
-                    </div>
-                    <div class="corpsbloc">
-                        <div id="contentcount"></div>
-                        <div id="contents"></div>
-                    </div>
-                </div>
-                
-            </div>
-        </div>
-        <div id="lightboxbg"></div>
-    </body>
-</html>
+{% block main_content %}
+            <h2>À compléter...</h2>
+{% endblock %}
\ No newline at end of file
--- a/web/hdalab/urls.py	Tue Feb 28 11:43:29 2012 +0100
+++ b/web/hdalab/urls.py	Tue Feb 28 18:51:58 2012 +0100
@@ -19,7 +19,8 @@
     # Uncomment the next line to enable the admin:
     url(r'^admin/', include(admin.site.urls)),
     
-    url(r'^$', TemplateView.as_view(template_name="index.html")),
+    url(r'^facettes/', TemplateView.as_view(template_name="facettes.html"), name='facettes'),
+    url(r'^$', TemplateView.as_view(template_name="index.html"), name='home'),
 
 )
 
--- a/web/hdalab/views/ajax.py	Tue Feb 28 11:43:29 2012 +0100
+++ b/web/hdalab/views/ajax.py	Tue Feb 28 18:51:58 2012 +0100
@@ -138,15 +138,15 @@
                 globalids += [t.id for t in taglblqs if t.id not in globalids]
                 contentqs = contentqs.filter(taggedsheet__tag__in = taglblqs,
                                taggedsheet__order__lte = max_tag_order)
-
+        if contentlist:
+            contentqs = contentqs.filter(id__in = contentlist.split(","))
+            
         tagqs = tagqs.filter(datasheet__in = contentqs)
         countryqs = countryqs.filter(includes__tag__taggedsheet__datasheet__in = contentqs)
         discqs = discqs.filter(datasheet__in = contentqs)
         yearqs = yearqs.filter(tag__taggedsheet__datasheet__in = contentqs)
         
-    if contentlist is not None:
-        contentqs = contentqs.filter(id__in = contentlist.split(","))
-    else:
+    if contentlist is None:
         contentqs.order_by('?')
             
     cont_count = contentqs.count()
@@ -184,7 +184,7 @@
     yearqs = yearqs.annotate(nb=Count('tag__taggedsheet'))
     for ty in yearqs:
         for year in range(ty.start_year, ty.end_year):
-            years[year] = ty.nb + years[year] if year in years else 0
+            years[year] = ty.nb + (years[year] if year in years else 0)
             
     yearchange = []
     for year in sorted(years.keys()):