Add button to insert new dashboard in admin customize tab
diff --git a/xos/templates/admin/dashboard/customize.html b/xos/templates/admin/dashboard/customize.html
index d2e8a20..eb92b21 100644
--- a/xos/templates/admin/dashboard/customize.html
+++ b/xos/templates/admin/dashboard/customize.html
@@ -1,39 +1,50 @@
-<form>
+<div class="row-fluid">
+ <div class="span12 text-right">
+ <a href="core/dashboardview/add/" class="btn btn-success">
+ <i class="icon icon-plus"></i> Add
+ </a>
+ </div>
+</div>
+<form>
<div class="customize_row">
- <div class="customize_column">
- <div>Available Dashboard Views</div>
- <select name="selectfrom" id="select-from" multiple size="5">
- {% for cp in unusedDashboards %}
- <option value="{{ cp }}">{{ cp }}</option>
- {% endfor %}
- </select>
- </div>
- <div class="customize_column">
- <br>
- <div class="btn btn-success" id="customize-btn-add">Add »</div><br><br>
- <div class="btn btn-success" id="customize-btn-remove">« Remove</div>
- </div>
- <div class="customize_column">
- <div>Selected Dashboard Views</div>
- <select name="selectto" id="select-to" multiple size="5">
- {% for cp in dashboards %}
- <option value="{{ cp }}">{{ cp }}</option>
- {% endfor %}
- </select>
- <br>
- <div class="btn btn-high btn-info" id="customize-btn-save">Save</div>
- <div style="display: none" id="customize-msg-saving">Saving...</div>
- </div>
- <div class="customize_column">
- <br>
- <div class="btn btn-success" id="customize-btn-up">Up</div><br><br>
- <div class="btn btn-success" id="customize-btn-down">Down</div>
- </div>
+ <div class="customize_column">
+ <div>Available Dashboard Views</div>
+ <select name="selectfrom" id="select-from" multiple size="5">
+ {% for cp in unusedDashboards %}
+ <option value="{{ cp }}">{{ cp }}</option>
+ {% endfor %}
+ </select>
+ </div>
+ <div class="customize_column">
+ <br>
+ <div class="btn btn-success" id="customize-btn-add">Add »</div>
+ <br>
+ <br>
+ <div class="btn btn-success" id="customize-btn-remove">« Remove</div>
+ </div>
+ <div class="customize_column">
+ <div>Selected Dashboard Views</div>
+ <select name="selectto" id="select-to" multiple size="5">
+ {% for cp in dashboards %}
+ <option value="{{ cp }}">{{ cp }}</option>
+ {% endfor %}
+ </select>
+ <br>
+ <div class="btn btn-high btn-info" id="customize-btn-save">Save</div>
+ <div style="display: none" id="customize-msg-saving">Saving...</div>
+ </div>
+ <div class="customize_column">
+ <br>
+ <div class="btn btn-success" id="customize-btn-up">Up</div>
+ <br>
+ <br>
+ <div class="btn btn-success" id="customize-btn-down">Down</div>
+ </div>
</div>
</form>
-
-<script>
-$(document).ready(function() {
+
+<script>
+$(document).ready(function() {
$('#customize-btn-add').click(function(){
$('#select-from option:selected').each( function() {
$('#select-to').append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option>");
@@ -71,23 +82,22 @@
var items=[];
$("#select-to option").each(function() { items.push($(this).val()); });
$.ajax({
- url: '/customize/',
- dataType: 'json',
- data: {
- dashboards: items.join(","),
- csrfmiddlewaretoken: "{{ csrf_token }}" // < here
- },
- type: 'POST',
- error: function (jqXHR, textStatus, errorThrown) {
- errorDialog("Error", textStatus + " " + jqXHR.responseText);
- $("#customize-btn-save").show();
- $("#customize-msg-saving").hide();
- },
- success: function () {
- location.reload();
- }
+ url: '/customize/',
+ dataType: 'json',
+ data: {
+ dashboards: items.join(","),
+ csrfmiddlewaretoken: "{{ csrf_token }}" // < here
+ },
+ type: 'POST',
+ error: function (jqXHR, textStatus, errorThrown) {
+ errorDialog("Error", textStatus + " " + jqXHR.responseText);
+ $("#customize-btn-save").show();
+ $("#customize-msg-saving").hide();
+ },
+ success: function () {
+ location.reload();
+ }
});
- });
-});
-</script>
-
+ });
+});
+</script>
\ No newline at end of file