-</script>
-
-<script type="text/template" id="xosAdmin-sliceDeployment-listitem-template">
- <td class="objectLink"><%= id %></td>
- <td><%= idToName(slice,"slices","name") %></td>
- <td><%= idToName(deployment,"deployments","name") %></td>
- <td><%= tenant_id %></td>
-</script>
-
-<script type="text/template" id="xosAdmin-sliceDeployment-detail-template">
- <h3>Detail View: Slice Deployment</h3>
- <form>\r
- <table>\r
- <tr><td>Slice:</td><td><input type="text" name="slice" value="<%= slice %>"></td></tr>\r
- <tr><td>Deployment:</td><td><input type="text" name="deployment" value="<%= deployment %>"></td></tr>\r
- <tr><td>Tenant Id:</td><td><input type="text" name="tenant_id" value="<%= tenant_id %>"></td></tr>\r
- <tr><td colspan=2><button class="btn js-submit">Save</button></td></tr>\r
- </table>\r
- </form>\r
-</script>
-
-<!-- SlicePrivilege -->
-
-<script type="text/template" id="xosAdmin-slicePrivilege-list-template">
- <h3><%= title %></h3>
- <table class="test-table">
- <thead><tr>
- <th>id</th>
- <th>user</th>
- <th>slice</th>
- <th>role</th>
- </tr></thead>
- <tbody></tbody>
- </table>
-</script>
-
-<script type="text/template" id="xosAdmin-slicePrivilege-listitem-template">
- <td class="objectLink"><%= id %></td>
- <td><%= idToName(user,"users","username") %></td>
- <td><%= idToName(slice,"slices","name") %></td>
- <td><%= idToName(role,"sliceRoles","role") %></td>
-</script>
-
-<script type="text/template" id="xosAdmin-slicePrivilege-detail-template">
- <h3>Detail View: Slice Privilege</h3>
- <form>\r
- <table>\r
- <tr><td>User:</td><td><input type="text" name="user" value="<%= user %>"></td></tr>\r
- <tr><td>Slice:</td><td><input type="text" name="slice" value="<%= slice %>"></td></tr>\r
- <tr><td>Role:</td><td><input type="text" name="role" value="<%= role %>"></td></tr>\r
- <tr><td colspan=2><button class="btn js-submit">Save</button></td></tr>\r
- </table>\r
- </form>\r
-</script>
-
-<!-- Sliver -->
-
-<script type="text/template" id="xosAdmin-sliver-list-template">
- <h3><%= title %></h3>
- <table class="test-table">
- <thead><tr>
- <th>id</th>
- <th>name</th>
- <th>instance_id</th>
- <th>instance_name</th>
- <th>image</th>
- <th>creator</th>
- <th>slice</th>
- <th>node</th>
- <th>deploymentNetwork</th>
- <th>flavor</th>
- <th>userData</th>
- </tr></thead>
- <tbody></tbody>
- </table>
-</script>
-
-
-<script type="text/template" id="xosAdmin-sliver-listitem-template">
- <td class="objectLink"><%= id %></td>
- <td class="objectLink"><%= name %></td>
- <td><%= instance_id %></td>
- <td><%= instance_name %></td>
- <td><%= idToName(image,"images","name") %></td>
- <td><%= idToName(creator,"users","name") %></td>
- <td><%= idToName(slice,"slices","name") %></td>
- <td><%= idToName(node,"nodes","name") %></td>
- <td><%= idToName(deploymentNetwork,"deployments","name") %></td>
- <td><%= flavor %></td>
- <td><%= userData %></td>
-</script>
-
-<script type="text/template" id="xosAdmin-sliver-detail-template">
- <h3>Detail View: Sliver</h3>
- <form>\r
- <table>\r
- <tr><td>Name:</td><td><input type="text" name="name" value="<%= name %>"></td></tr>\r
- <tr><td>instance_id:</td><td><input type="text" name="instance_id" value="<%= instance_id %>"></td></tr>\r
- <tr><td>instance_name:</td><td><input type="text" name="instance_name" value="<%= instance_name %>"></td></tr>\r
- <tr><td>Image:</td><td><input type="text" name="image" value="<%= image %>"></td></tr>\r
- <tr><td>Creator:</td><td><input type="text" name="creator" value="<%= creator %>"></td></tr>\r
- <tr><td>Slice:</td><td><input type="text" name="slice" value="<%= slice %>"></td></tr>\r
- <tr><td colspan=2><button class="btn js-submit">Save</button></td></tr>\r
- </table>\r
- </form>\r
-</script>
-
-<!-- User -->
-
-<script type="text/template" id="xosAdmin-user-list-template">
- <h3><%= title %></h3>
- <table class="test-table">
- <thead><tr>
- <th>id</th>
- <th>username</th>
- <th>firstname</th>
- <th>lastname</th>
- <th>phone</th>
- <th>user_url</th>
- <th>site</th>
- </tr></thead>
- <tbody></tbody>
- </table>
-</script>
-
-
-<script type="text/template" id="xosAdmin-user-listitem-template">
- <td class="objectLink"><%= id %></td>
- <td class="objectLink"><%= username %></td>
- <td><%= firstname %></td>
- <td><%= lastname %></td>
- <td><%= phone %></td>
- <td><%= user_url %></td>
- <td><%= site %></td>
-</script>
-
-<script type="text/template" id="xosAdmin-user-detail-template">
- <h3>Detail View: User</h3>
- <form>\r
- <table>\r
- <tr><td>User Name:</td><td><input type="text" name="username" value="<%= username %>"></td></tr>\r
- <tr><td>First Name:</td><td><input type="text" name="firstname" value="<%= firstname %>"></td></tr>\r
- <tr><td>Last Name:</td><td><input type="text" name="lastname" value="<%= lastname %>"></td></tr>\r
- <tr><td>Phone:</td><td><input type="text" name="phone" value="<%= phone %>"></td></tr>\r
- <tr><td>Url:</td><td><input type="text" name="user_url" value="<%= user_url %>"></td></tr>\r
- <tr><td>Site:</td><td><input type="text" name="site" value="<%= site %>"></td></tr>\r
- <tr><td colspan=2><button class="btn js-submit">Save</button></td></tr>\r
- </table>\r
- </form>\r
+ <%= xosListFooterTemplate({addChildHash: addChildHash}) %>
+</script>
+
+<script type="text/template" id="xos-listitem-template">
+ <% _.each(listFields, function(fieldName) { %>
+ <% if ($.inArray(fieldName, model.detailLinkFields)>=0) { %>
+ <td><%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: model.attributes[fieldName]}) %></td>
+ <% } else if (fieldName in foreignFields) { %>
+ <td><%= idToName(model.attributes[fieldName], foreignFields[fieldName], "humanReadableName") %></td>
+ <% } else { %>
+ <td><%= model.attributes[fieldName] %></td>
+ <% } %>
+ <% }); %>
+ <td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
+</script>
+
+<script type="text/template" id="xos-savebuttons-template">
+ <div class="box save-box">
+ <button class="btn btn-high btn-info btn-xos-contentButtonPanel btn-xos-save-leave">Save</button>
+ <button class="btn btn-high btn-xos-contentButtonPanel btn-xos-save-continue">Save and continue editing</button>
+ <button class="btn btn-high btn-xos-contentButtonPanel btn-xos-save-another">Save and add another</button>
+ <button class="btn btn-danger btn-xos-contentButtonPanel btn-xos-delete">Delete</button>
+ </div>
+</script>
+
+<script type="text/template" id="xos-listbuttons-template">
+ <div class="box save-box">
+ <button class="btn btn-high btn-primary btn-xos-contentButtonPanel btn-xos-refresh">Refresh</button>
+ <button class="btn btn-high btn-success btn-xos-contentButtonPanel btn-xos-add">Add</button>
+ </div>
+</script>
+
+<script type="text/template" id="xos-datatable-spinner-template">
+ <!-- arguments: value, id, collectionName, fieldName -->
+ <%= value %> <img style="cursor: pointer;" src="/static/img/plus_circle.png" onclick='<%= app.varName %>.adjustCollectionField("<%= collectionName %>", <%= id %>, "<%= fieldName %>", 1)'>
+ <img style="cursor: pointer;" src="/static/img/minus_circle.png" onclick='<%= app.varName %>.adjustCollectionField("<%= collectionName %>", <%= id %>, "<%= fieldName %>", -1)'>
+</script>
+
+<script type="text/template" id="xos-datatable-spinner-template-old">
+ <!-- arguments: value, id, collectionName, fieldName -->
+ <%= value %> <a href="javascript:undefined" onclick='<%= app.varName %>.adjustCollectionField("<%= collectionName %>", <%= id %>, "<%= fieldName %>", 1)'> more </a>
+ <a href="javascript:undefined" onclick='<%= app.varName %>.adjustCollectionField("<%= collectionName %>", <%= id %>, "<%= fieldName %>", -1)'> less </a>
+</script>
+
+<script type="text/template" id="xos-spinner-template">
+ <!-- arguments: fieldName, id, value -->
+ <input name="<%= fieldName %>" class="xos-spinner" id="<%= id %>">
+ <% detailView.viewInitializers.push( function() { init_spinner("#" + id, value); } ); %>
+</script>
+
+<script type="text/template" id="xos-picker-template">
+ <!-- arguments: unpickedItems, pickedItems, fieldName, id -->
+ <div id="<%= id %>">
+ <div class="picker_row">
+ <div class="picker_column">\r
+ <div>Available</div>\r
+ <select name="pickerfrom" class="select-picker-from" multiple size="5">\r
+ <% _.each(unpickedItems, function(item) { %>\r
+ <option value="<%= item %>"><%= lookupFunc? lookupFunc(item) : item %></option>
+ <% });%>\r
+ </select>\r
+ </div>\r
+ <div class="picker_column">\r
+ <br>\r
+ <div class="btn btn-success btn-picker-add">Add »</div><br><br>\r
+ <div class="btn btn-success btn-picker-remove">« Remove</div>\r
+ </div>\r
+ <div class="picker_column">\r
+ <div>Selected</div>\r
+ <select name=<%= fieldName %> class="select-picker-to syphonall" multiple size="5">\r
+ <% _.each(pickedItems, function(item) { %>\r
+ <option value="<%= item %>"><%= lookupFunc ? lookupFunc(item) : item %></option>
+ <% }); %>\r
+ </select>\r
+ </div>\r
+ <div class="picker_column">\r
+ <br>\r
+ <div class="btn btn-success btn-picker-up">Up</div><br><br>\r
+ <div class="btn btn-success btn-picker-down">Down</div>\r
+ </div>\r
+ </div>
+ </div>
+ <% detailView.viewInitializers.push( function() { init_picker("#" + id); } ); %>
+</script>
+
+<script type="text/template" id="xos-sliceselector-option">
+ <%= name %>
+</script>
+
+<script type="text/template" id="xos-sliceselector-select">
+ <% if (caption) { %>
+ <table class="xos-detail-table"><tr><td class="xos-label-cell"><%= caption %>: </td><td><select></select></td></tr></table>
+ <% } else { %>
+ <select></select>
+ <% } %>
+</script>
+
+<script>
+xosInlineDetailButtonsTemplate = _.template($("#xos-inline-detail-buttons-template").html());
+xosListHeaderTemplate = _.template($("#xos-list-header-template").html());
+xosListFooterTemplate = _.template($("#xos-list-footer-template").html());
+xosDeleteButtonTemplate = _.template($("#xos-delete-button-template").html());
+xosDetailLinkTemplate = _.template($("#xos-detail-link-template").html());
+xosBackendStatusIconTemplate = _.template($("#xos-backend-status-icon-template").html());
+xosBackendStatusTextTemplate = _.template($("#xos-backend-status-text-template").html());
+xosPickerTemplate = _.template($("#xos-picker-template").html());
+xosSpinnerTemplate = _.template($("#xos-spinner-template").html());
+xosDataTableSpinnerTemplate = _.template($("#xos-datatable-spinner-template").html());