mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
ada93c9c0e
|
@ -424,8 +424,8 @@ unittests-import:
|
||||||
$(VALGRIND) @builddir@/bin/arangosh $(CLIENT_OPT) --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --javascript.unit-tests @top_srcdir@/js/server/tests/import-setup.js || test "x$(FORCE)" == "x1"
|
$(VALGRIND) @builddir@/bin/arangosh $(CLIENT_OPT) --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --javascript.unit-tests @top_srcdir@/js/server/tests/import-setup.js || test "x$(FORCE)" == "x1"
|
||||||
for i in 1 2 3 4; do $(VALGRIND) @builddir@/bin/arangoimp --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --file UnitTests/import-$$i.json --collection UnitTestsImportJson$$i --type json || test "x$(FORCE)" == "x1"; done
|
for i in 1 2 3 4; do $(VALGRIND) @builddir@/bin/arangoimp --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --file UnitTests/import-$$i.json --collection UnitTestsImportJson$$i --type json || test "x$(FORCE)" == "x1"; done
|
||||||
for i in 1 2; do $(VALGRIND) @builddir@/bin/arangoimp --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --file UnitTests/import-$$i.csv --collection UnitTestsImportCsv$$i --create-collection true --type csv || test "x$(FORCE)" == "x1"; done
|
for i in 1 2; do $(VALGRIND) @builddir@/bin/arangoimp --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --file UnitTests/import-$$i.csv --collection UnitTestsImportCsv$$i --create-collection true --type csv || test "x$(FORCE)" == "x1"; done
|
||||||
for i in 1 2; do $(VALGRIND) @builddir@/bin/arangoimp --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --file UnitTests/import-$$i.tsv --collection UnitTestsImportTsv$$i --create-collection true --type tsv --eol "\r\n" || test "x$(FORCE)" == "x1"; done
|
for i in 1 2; do $(VALGRIND) @builddir@/bin/arangoimp --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --file UnitTests/import-$$i.tsv --collection UnitTestsImportTsv$$i --create-collection true --type tsv || test "x$(FORCE)" == "x1"; done
|
||||||
$(VALGRIND) @builddir@/bin/arangoimp --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --file UnitTests/import-edges.json --collection UnitTestsImportEdge --create-collection false --type json --eol "\r\n" || test "x$(FORCE)" == "x1"
|
$(VALGRIND) @builddir@/bin/arangoimp --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --file UnitTests/import-edges.json --collection UnitTestsImportEdge --create-collection false --type json || test "x$(FORCE)" == "x1"
|
||||||
$(VALGRIND) @builddir@/bin/arangosh $(CLIENT_OPT) --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --javascript.unit-tests @top_srcdir@/js/server/tests/import.js || test "x$(FORCE)" == "x1"
|
$(VALGRIND) @builddir@/bin/arangosh $(CLIENT_OPT) --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --javascript.unit-tests @top_srcdir@/js/server/tests/import.js || test "x$(FORCE)" == "x1"
|
||||||
$(VALGRIND) @builddir@/bin/arangosh $(CLIENT_OPT) --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --javascript.unit-tests @top_srcdir@/js/server/tests/import-teardown.js || test "x$(FORCE)" == "x1"
|
$(VALGRIND) @builddir@/bin/arangosh $(CLIENT_OPT) --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --javascript.unit-tests @top_srcdir@/js/server/tests/import-teardown.js || test "x$(FORCE)" == "x1"
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.span3 a {
|
.span3 a {
|
||||||
color: black;
|
|
||||||
border: 0;
|
border: 0;
|
||||||
box-shadow: 0 0 0 !important;
|
box-shadow: 0 0 0 !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
width:280px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#searchSubmit {
|
#searchSubmit {
|
||||||
|
@ -106,6 +106,10 @@
|
||||||
margin:5px 0;
|
margin:5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#transparentHeader .pagination ul > li > a {
|
||||||
|
font-size:1.8em;
|
||||||
|
}
|
||||||
|
|
||||||
#transparentHeader .btn-group {
|
#transparentHeader .btn-group {
|
||||||
margin-top:4px;
|
margin-top:4px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#sourceDiv {
|
#sourceDiv {
|
||||||
margin-top: 10px;
|
margin-top: -40px;
|
||||||
padding: 20px 20px 20px 20px;
|
padding: 20px 20px 20px 20px;
|
||||||
min-height: 400px;
|
min-height: 400px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 900;
|
||||||
|
|
||||||
/* background-color: rgba(0, 0, 0, 0.05);*/
|
/* background-color: rgba(0, 0, 0, 0.05);*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
#tableDiv {
|
#tableDiv {
|
||||||
margin-top: 10px;
|
margin-top: -40px;
|
||||||
padding: 20px 20px 20px 20px;
|
padding: 20px 20px 20px 20px;
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
background-color: rgba(0, 0, 0, 0.05);
|
||||||
|
position: relative;
|
||||||
|
z-index: 900;
|
||||||
}
|
}
|
||||||
|
|
||||||
#addDocumentLine, #sourceView {
|
|
||||||
margin-right: 10px;
|
|
||||||
margin-right: 22px;
|
|
||||||
opacity: 0.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
#addDocumentLine:hover, #sourceView:hover{
|
#addDocumentLine:hover, #sourceView:hover{
|
||||||
opacity: 0.8;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,11 @@ body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-actions {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border:none;
|
||||||
|
}
|
||||||
|
|
||||||
/* ICONS */
|
/* ICONS */
|
||||||
.icon-info-sign:hover {
|
.icon-info-sign:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 2.9 KiB |
|
@ -2,7 +2,16 @@
|
||||||
/*global require, exports */
|
/*global require, exports */
|
||||||
window.arangoCollections = Backbone.Collection.extend({
|
window.arangoCollections = Backbone.Collection.extend({
|
||||||
url: '/_api/collection',
|
url: '/_api/collection',
|
||||||
|
|
||||||
model: arangoCollection,
|
model: arangoCollection,
|
||||||
|
|
||||||
|
searchOptions : {
|
||||||
|
searchPhrase: null,
|
||||||
|
includeSystem: false,
|
||||||
|
includeLoaded: true,
|
||||||
|
includeUnloaded: true
|
||||||
|
},
|
||||||
|
|
||||||
comparator : function(model) {
|
comparator : function(model) {
|
||||||
return model.get('name').toLowerCase();
|
return model.get('name').toLowerCase();
|
||||||
},
|
},
|
||||||
|
@ -50,6 +59,55 @@ window.arangoCollections = Backbone.Collection.extend({
|
||||||
return response.collections;
|
return response.collections;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getPosition : function (name) {
|
||||||
|
var list = this.getFiltered(this.searchOptions), i;
|
||||||
|
var prev = null;
|
||||||
|
var next = null;
|
||||||
|
|
||||||
|
for (i = 0; i < list.length; ++i) {
|
||||||
|
if (list[i].get('name') === name) {
|
||||||
|
if (i > 0) {
|
||||||
|
prev = list[i - 1];
|
||||||
|
}
|
||||||
|
if (i < list.length - 1) {
|
||||||
|
next = list[i + 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { prev: prev, next: next };
|
||||||
|
},
|
||||||
|
|
||||||
|
getFiltered : function (options) {
|
||||||
|
var result = [ ];
|
||||||
|
|
||||||
|
var searchPhrase = '';
|
||||||
|
if (options.searchPhrase !== null) {
|
||||||
|
searchPhrase = options.searchPhrase.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.models.forEach(function (model) {
|
||||||
|
if (searchPhrase !== '' && model.get('name').toLowerCase().indexOf(searchPhrase) === -1) {
|
||||||
|
// search phrase entered but current collection does not match?
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (options.includeSystem === false && model.get('isSystem')) {
|
||||||
|
// system collection?
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (options.includeLoaded === false && model.get('status') === 'loaded') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (options.includeUnloaded === false && model.get('status') === 'unloaded') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
result.push(model);
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
|
||||||
getProperties: function (id) {
|
getProperties: function (id) {
|
||||||
var data2;
|
var data2;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
|
@ -84,6 +84,7 @@ $(document).ready(function() {
|
||||||
this.newCollectionView.render();
|
this.newCollectionView.render();
|
||||||
},
|
},
|
||||||
documents: function(colid, pageid) {
|
documents: function(colid, pageid) {
|
||||||
|
window.documentsView.colid = colid;
|
||||||
window.documentsView.render();
|
window.documentsView.render();
|
||||||
window.arangoDocumentsStore.getDocuments(colid, pageid);
|
window.arangoDocumentsStore.getDocuments(colid, pageid);
|
||||||
if (!window.documentsView) {
|
if (!window.documentsView) {
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
<a href="#collection/<%= attributes.name %>/documents/1" class="thumbnail plain">
|
|
||||||
<img src="<%= attributes.picture %>" height="60" width="60" alt="" class="icon">
|
|
||||||
<span class="badge badge-success <%= attributes.status %>"><div class="cornered"><%= attributes.status %></div></span>
|
|
||||||
|
|
||||||
<h5 class="collectionName">
|
<div class="pull-right">
|
||||||
<a href="#collection/<%= attributes.id %>" class="pull-right" style="width:14px; height:14px;">
|
<a href="#collection/<%= attributes.id %>">
|
||||||
<i class="icon-info-sign icon-white"></i>
|
<i class="icon-info-sign"></i>
|
||||||
</a>
|
</a>
|
||||||
<div class="pull-left"><%= attributes.name %></div>
|
</div>
|
||||||
</h5>
|
|
||||||
|
<a href="#collection/<%= attributes.name %>/documents/1" class="plain">
|
||||||
|
<img src="img/icon_arango.png" height="60" width="60" alt="" class="icon">
|
||||||
|
<span class="badge badge-success"><div class="cornered"><%= attributes.status %></div></span>
|
||||||
|
|
||||||
|
<h5 class="collectionName">
|
||||||
|
<div class="pull-left"><%= attributes.name %></div>
|
||||||
|
</h5>
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
<!-- /btn-group -->
|
<!-- /btn-group -->
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
<button class="btn btn-small">Filter:</button>
|
<button class="btn btn-inverse btn-small">Filter:</button>
|
||||||
<button data-toggle="dropdown" class="btn btn-small dropdown-toggle"><span class="caret"></span></button>
|
<button data-toggle="dropdown" class="btn btn-inverse btn-small dropdown-toggle"><span class="caret"></span></button>
|
||||||
|
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><a href="#"><label class="checkbox"><input type="checkbox" id="checkSystem">System</label></a></li>
|
<li><a href="#"><label class="checkbox"><input type="checkbox" id="checkSystem">System</label></a></li>
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div id="transparentPlaceholder">
|
<div id="transparentPlaceholder">
|
||||||
<input type="text" id="searchInput" class="searchInput" placeholder="Search..."><img id="searchSubmit" width="16" height="16" src="/_admin/html/img/enter_icon.png" style="padding:0;">
|
<input type="text" id="searchInput" class="searchInput" placeholder="Search..."><img id="searchSubmit" width="16" height="16" src="/_admin/html/img/enter_icon.png">
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,8 +12,11 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="sourceEditor">
|
<div id="sourceEditor">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-actions">
|
||||||
|
<a href="#" class="btn btn-primary pull-right">Save</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
<div id="transparentHeader">
|
<div id="transparentHeader">
|
||||||
<div id="documentsToolbar" class="pagination pagination-small pagination-right">
|
<div id="documentsToolbar" class="pagination pagination-small pagination-right">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="enabled"><a href="#">‹</a></li>
|
<li class="enabled"><a id="collectionPrev">‹</a></li>
|
||||||
<li class="enabled"><a href="#">›</a></li>
|
<li class="enabled"><a id="collectionNext">›</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,13 +2,6 @@ var collectionsView = Backbone.View.extend({
|
||||||
el: '#content',
|
el: '#content',
|
||||||
el2: '.thumbnails',
|
el2: '.thumbnails',
|
||||||
|
|
||||||
searchOptions: {
|
|
||||||
searchPhrase: null,
|
|
||||||
includeSystem: false,
|
|
||||||
includeLoaded: true,
|
|
||||||
includeUnloaded: true
|
|
||||||
},
|
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -18,36 +11,14 @@ var collectionsView = Backbone.View.extend({
|
||||||
$(this.el).html(this.template.text);
|
$(this.el).html(this.template.text);
|
||||||
this.setFilterValues();
|
this.setFilterValues();
|
||||||
|
|
||||||
var searchPhrase = '';
|
var searchOptions = this.collection.searchOptions;
|
||||||
if (this.searchOptions.searchPhrase !== null) {
|
|
||||||
searchPhrase = this.searchOptions.searchPhrase.toLowerCase();
|
|
||||||
}
|
|
||||||
this.collection.each(function (arango_collection) {
|
|
||||||
if (arango_collection.get('name').substr(0,1) === "_") {
|
|
||||||
}
|
|
||||||
if (searchPhrase !== '' && arango_collection.get('name').toLowerCase().indexOf(searchPhrase) === -1) {
|
|
||||||
// search phrase entered but current collection does not match?
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.searchOptions.includeSystem === false && arango_collection.get('isSystem')) {
|
|
||||||
// system collection?
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.searchOptions.includeLoaded === false && arango_collection.get('status') === 'loaded') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.searchOptions.includeUnloaded === false && arango_collection.get('status') === 'unloaded') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
this.collection.getFiltered(searchOptions).forEach(function (arango_collection) {
|
||||||
$('.thumbnails', this.el).append(new window.CollectionListItemView({model: arango_collection}).render().el);
|
$('.thumbnails', this.el).append(new window.CollectionListItemView({model: arango_collection}).render().el);
|
||||||
|
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
$('.thumbnails', this.el).append('<li class="span3"><a href="#new" class="add"><img id="newCollection" src="/_admin/html/img/plus_icon.png" class="pull-left"></img>Add Collection</a></li>');
|
$('.thumbnails', this.el).append('<li class="span3"><a href="#new" class="add"><img id="newCollection" src="/_admin/html/img/plus_icon.png" class="pull-left"></img>Add Collection</a></li>');
|
||||||
$('#searchInput').val(this.searchOptions.searchPhrase);
|
$('#searchInput').val(searchOptions.searchPhrase);
|
||||||
$('#searchInput').focus();
|
$('#searchInput').focus();
|
||||||
var val = $('#searchInput').val();
|
var val = $('#searchInput').val();
|
||||||
$('#searchInput').val('');
|
$('#searchInput').val('');
|
||||||
|
@ -67,53 +38,50 @@ var collectionsView = Backbone.View.extend({
|
||||||
"click #checkUnloaded" : "checkUnloaded"
|
"click #checkUnloaded" : "checkUnloaded"
|
||||||
},
|
},
|
||||||
checkSystem: function () {
|
checkSystem: function () {
|
||||||
var oldValue = this.searchOptions.includeSystem;
|
var searchOptions = this.collection.searchOptions;
|
||||||
if ($('#checkSystem').is(":checked") === true) {
|
var oldValue = searchOptions.includeSystem;
|
||||||
this.searchOptions.includeSystem = true;
|
|
||||||
}
|
searchOptions.includeSystem = ($('#checkSystem').is(":checked") === true);
|
||||||
else {
|
|
||||||
this.searchOptions.includeSystem = false;
|
if (oldValue != searchOptions.includeSystem) {
|
||||||
}
|
|
||||||
if (oldValue != this.searchOptions.includeSystem) {
|
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkLoaded: function () {
|
checkLoaded: function () {
|
||||||
var oldValue = this.searchOptions.includeLoaded;
|
var searchOptions = this.collection.searchOptions;
|
||||||
if ($('#checkLoaded').is(":checked") === true) {
|
var oldValue = searchOptions.includeLoaded;
|
||||||
this.searchOptions.includeLoaded = true;
|
|
||||||
}
|
searchOptions.includeLoaded = ($('#checkLoaded').is(":checked") === true);
|
||||||
else {
|
|
||||||
this.searchOptions.includeLoaded = false;
|
if (oldValue != searchOptions.includeLoaded) {
|
||||||
}
|
|
||||||
if (oldValue != this.searchOptions.includeLoaded) {
|
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkUnloaded: function () {
|
checkUnloaded: function () {
|
||||||
var oldValue = this.searchOptions.includeUnloaded;
|
var searchOptions = this.collection.searchOptions;
|
||||||
if ($('#checkUnloaded').is(":checked") === true) {
|
var oldValue = searchOptions.includeUnloaded;
|
||||||
this.searchOptions.includeUnloaded = true;
|
|
||||||
}
|
searchOptions.includeUnloaded = ($('#checkUnloaded').is(":checked") === true);
|
||||||
else {
|
|
||||||
this.searchOptions.includeUnloaded = false;
|
if (oldValue != searchOptions.includeUnloaded) {
|
||||||
}
|
|
||||||
if (oldValue != this.searchOptions.includeUnloaded) {
|
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setFilterValues: function () {
|
setFilterValues: function () {
|
||||||
$('#checkLoaded').attr('checked', this.searchOptions.includeLoaded);
|
var searchOptions = this.collection.searchOptions;
|
||||||
$('#checkUnloaded').attr('checked', this.searchOptions.includeUnloaded);
|
$('#checkLoaded').attr('checked', searchOptions.includeLoaded);
|
||||||
$('#checkSystem').attr('checked', this.searchOptions.includeSystem);
|
$('#checkUnloaded').attr('checked', searchOptions.includeUnloaded);
|
||||||
|
$('#checkSystem').attr('checked', searchOptions.includeSystem);
|
||||||
},
|
},
|
||||||
search: function () {
|
search: function () {
|
||||||
|
var searchOptions = this.collection.searchOptions;
|
||||||
var searchPhrase = $('#searchInput').val().replace(/(^\s+|\s+$)/g, '');
|
var searchPhrase = $('#searchInput').val().replace(/(^\s+|\s+$)/g, '');
|
||||||
|
|
||||||
if (searchPhrase === this.searchOptions.searchPhrase) {
|
if (searchPhrase === searchOptions.searchPhrase) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.searchOptions.searchPhrase = searchPhrase;
|
searchOptions.searchPhrase = searchPhrase;
|
||||||
|
|
||||||
this.render();
|
this.render();
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,12 +4,20 @@ var documentsView = Backbone.View.extend({
|
||||||
documentsPerPage: 10,
|
documentsPerPage: 10,
|
||||||
totalPages: 1,
|
totalPages: 1,
|
||||||
|
|
||||||
|
collectionContext : {
|
||||||
|
prev: null,
|
||||||
|
next: null
|
||||||
|
},
|
||||||
|
|
||||||
alreadyClicked: false,
|
alreadyClicked: false,
|
||||||
|
|
||||||
el: '#content',
|
el: '#content',
|
||||||
table: '#documentsTableID',
|
table: '#documentsTableID',
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
|
"click #collectionPrev" : "prevCollection",
|
||||||
|
"click #collectionNext" : "nextCollection",
|
||||||
|
|
||||||
"click #documentsTableID tr" : "clicked",
|
"click #documentsTableID tr" : "clicked",
|
||||||
"click #deleteDoc" : "remove",
|
"click #deleteDoc" : "remove",
|
||||||
"click #plusIconDoc" : "addDocument",
|
"click #plusIconDoc" : "addDocument",
|
||||||
|
@ -20,6 +28,23 @@ var documentsView = Backbone.View.extend({
|
||||||
"click #documents_next" : "nextDocuments",
|
"click #documents_next" : "nextDocuments",
|
||||||
"click #confirmDeleteBtn" : "confirmDelete"
|
"click #confirmDeleteBtn" : "confirmDelete"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
buildCollectionLink : function (collection) {
|
||||||
|
return "#collection/" + encodeURIComponent(collection.get('name')) + '/documents/1';
|
||||||
|
},
|
||||||
|
|
||||||
|
prevCollection : function () {
|
||||||
|
if (this.collectionContext.prev !== null) {
|
||||||
|
window.location.hash = this.buildCollectionLink(this.collectionContext.prev);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
nextCollection : function () {
|
||||||
|
if (this.collectionContext.next !== null) {
|
||||||
|
window.location.hash = this.buildCollectionLink(this.collectionContext.next);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
addDocument: function () {
|
addDocument: function () {
|
||||||
var collid = window.location.hash.split("/")[1];
|
var collid = window.location.hash.split("/")[1];
|
||||||
window.arangoDocumentStore.addDocument(collid);
|
window.arangoDocumentStore.addDocument(collid);
|
||||||
|
@ -148,16 +173,19 @@ var documentsView = Backbone.View.extend({
|
||||||
template: new EJS({url: '/_admin/html/js/templates/documentsView.ejs'}),
|
template: new EJS({url: '/_admin/html/js/templates/documentsView.ejs'}),
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
this.collectionContext = window.arangoCollectionsStore.getPosition(this.colid);
|
||||||
|
|
||||||
$(this.el).html(this.template.text);
|
$(this.el).html(this.template.text);
|
||||||
this.breadcrumb();
|
this.breadcrumb();
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
breadcrumb: function () {
|
breadcrumb: function () {
|
||||||
var name = window.location.hash.split("/")[1];
|
var name = window.location.hash.split("/")[1];
|
||||||
$('#transparentHeader').append(
|
$('#transparentHeader').append(
|
||||||
'<div class="breadcrumb">'+
|
'<div class="breadcrumb">'+
|
||||||
'<a class="activeBread" href="#">Collections</a>'+
|
'<a class="activeBread" href="#">Collections</a>'+
|
||||||
' > '+
|
' > '+
|
||||||
'<a class="disabledBread">'+name+'</a>'+
|
'<a class="disabledBread">'+name+'</a>'+
|
||||||
'</div>'
|
'</div>'
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue