diff --git a/js/apps/system/aardvark/frontend/js/templates/modalTable.ejs b/js/apps/system/aardvark/frontend/js/templates/modalTable.ejs index ec42539949..93ed33d06f 100644 --- a/js/apps/system/aardvark/frontend/js/templates/modalTable.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/modalTable.ejs @@ -6,7 +6,7 @@ mandatory = '*'; } %> - + <%=row.label%><%=mandatory%>: <% diff --git a/js/apps/system/aardvark/frontend/js/views/graphManagementView.js b/js/apps/system/aardvark/frontend/js/views/graphManagementView.js index e54b136b07..5fba2329d2 100644 --- a/js/apps/system/aardvark/frontend/js/views/graphManagementView.js +++ b/js/apps/system/aardvark/frontend/js/views/graphManagementView.js @@ -47,6 +47,7 @@ graphs: this.collection, searchString : '' })); + this.events["click .tableRow"] = this.showHideDefinition.bind(this); return this; }, @@ -264,6 +265,16 @@ window.modalView.show("modalTable.ejs", "Graph Properties", buttons, tableContent); }, + + showHideDefinition : function(e) { + var id = $(e.currentTarget).attr("id"); + if (id == "row_newEdgeDefinitions1") { + $('#row_fromCollections1').toggle(); + $('#row_toCollections1').toggle(); + } + }, + + createNewGraphModal2: function() { var buttons = [], tableContent = []; @@ -278,9 +289,10 @@ true ) ); + tableContent.push( window.modalView.createTextEntry( - "newEdgeDefinitions", + "newEdgeDefinitions1", "Edge definitions", "", "Some info for edge definitions", @@ -288,6 +300,29 @@ true ) ); + + tableContent.push( + window.modalView.createSelect2Entry( + "fromCollections1", + "fromCollections", + "", + "The collection that contain the start vertices of the relation.", + "", + true + ) + ); + tableContent.push( + window.modalView.createSelect2Entry( + "toCollections1", + "toCollections", + "", + "The collection that contain the end vertices of the relation.", + "", + true + ) + ); + + tableContent.push( window.modalView.createSelect2Entry( "newVertexCollections", @@ -302,7 +337,10 @@ window.modalView.createSuccessButton("Create", this.createNewGraph.bind(this)) ); - window.modalView.show("modalTable.ejs", "Add new Graph", buttons, tableContent); + + window.modalView.show("modalTable.ejs", "Add new Graph", buttons, tableContent, null, this.events); + $('#row_fromCollections1').hide(); + $('#row_toCollections1').hide(); }, createEditGraphModal2: function(name, vertices, edges) {