Skip to content

Commit

Permalink
fix accordion to display devices related to the connections. rockstor…
Browse files Browse the repository at this point in the history
  • Loading branch information
priyaganti committed Apr 17, 2016
1 parent 35cdad4 commit 195fdd2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<tbody>
{{#each connections}}
<tr id="{{this.uuid}}">
<td class="accordion-toggle" data-toggle="collapse" data-parent="#OrderPackages" data-target=".packageDetails1"><a> {{this.name}}</a>&nbsp;&nbsp; <a href="#add-connection"><i class="glyphicon glyphicon-pencil"></i></a>
<td class="accordion-toggle" data-toggle="collapse" data-parent="#connections" data-target="#accordion-{{this.id}}"><a> {{this.name}}</a>&nbsp;&nbsp; <a href="#add-connection"><i class="glyphicon glyphicon-pencil"></i></a>
<a id="{{this.id}}" data-action="delete" rel="tooltip" title="Delete connection"><i class="glyphicon glyphicon-trash"></i></a></td>
<td>{{this.uuid}}</td>
<td>{{this.state}}&nbsp;&nbsp;
Expand All @@ -59,8 +59,8 @@
</tr>
<tr>
<td colspan="3" class="hiddenRow">
<div class="accordion-body collapse packageDetails1" id="accordion1">
<p>The Device Table is: </p>
<div class="accordion-body collapse" id="accordion-{{this.id}}">
<p>This connection's devices</p>
<table class="table table-bordered">
<tr>
<th>Name</th>
Expand All @@ -69,13 +69,17 @@
<th>MTU</th>
<th>State</th>
</tr>
{{#each ../devices}}
{{#if (belongsToConnection ../this.id this.connection)}}
<tr>
<td>sdskfk</td>
<td>sdjdjds</td>
<td>sdkjsdhsakjf</td>
<td>djshhsfsif</td>
<td>asdksd</td>
</tr>
<td>{{this.name}}</td>
<td>{{this.dtype}}</td>
<td>{{this.mac}}</td>
<td>{{this.mtu}}</td>
<td>{{this.state}}</td>
</tr>
{{/if}}
{{/each}}
</table>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ NewNetworksView = Backbone.View.extend({
}
return new Handlebars.SafeString(html);
});
Handlebars.registerHelper('belongsToConnection', function(connectionId, deviceConnectionId){
if(connectionId == deviceConnectionId){
return true;
}
return false;
});
}

});
Expand Down

0 comments on commit 195fdd2

Please sign in to comment.