From a3222eb50ee0c3f0e797e43fa103abfa76171012 Mon Sep 17 00:00:00 2001 From: Kálmán Viktor Date: Tue, 8 Apr 2014 14:20:42 +0200 Subject: [PATCH] dashboard: make the template choose more magical --- circle/dashboard/static/dashboard/dashboard.css | 8 +++----- circle/dashboard/static/dashboard/dashboard.js | 18 ++++++++++++++++++ circle/dashboard/templates/dashboard/index-templates.html | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/circle/dashboard/static/dashboard/dashboard.css b/circle/dashboard/static/dashboard/dashboard.css index 4b3db1c..4f42b0c 100644 --- a/circle/dashboard/static/dashboard/dashboard.css +++ b/circle/dashboard/static/dashboard/dashboard.css @@ -428,10 +428,6 @@ footer a, footer a:hover, footer a:visited { max-width: 600px; } -.template-choose-list-element { - cursor: pointer; -} - .template-choose-list-element small { display: none; float: right; @@ -439,7 +435,9 @@ footer a, footer a:hover, footer a:visited { } .template-choose-list-element { - padding: 15px; + padding: 6px 10px; + cursor: pointer; + margin-bottom: 15px; /* bootstrap panel default is 20px */ } .template-choose-list input[type="radio"] { diff --git a/circle/dashboard/static/dashboard/dashboard.js b/circle/dashboard/static/dashboard/dashboard.js index a4b6e05..d65b64b 100644 --- a/circle/dashboard/static/dashboard/dashboard.js +++ b/circle/dashboard/static/dashboard/dashboard.js @@ -36,6 +36,24 @@ $(function () { }); return false; }); + + $('.template-choose').click(function(e) { + $.ajax({ + type: 'GET', + url: '/dashboard/template/choose/', + success: function(data) { + $('body').append(data); + vmCreateLoaded(); + addSliderMiscs(); + $('#create-modal').modal('show'); + $('#create-modal').on('hidden.bs.modal', function() { + $('#create-modal').remove(); + }); + } + }); + return false; + }); + $('[href=#index-graph-view]').click(function (e) { var box = $(this).data('index-box'); $("#" + box + "-list-view").hide(); diff --git a/circle/dashboard/templates/dashboard/index-templates.html b/circle/dashboard/templates/dashboard/index-templates.html index 6009977..eacbfec 100644 --- a/circle/dashboard/templates/dashboard/index-templates.html +++ b/circle/dashboard/templates/dashboard/index-templates.html @@ -25,7 +25,7 @@ {% trans "show all" %} - + {% trans "new" %}

-- libgit2 0.26.0