lucassus/mongo_browser

View on GitHub
public/ng/templates/databases/index.html

Summary

Maintainability
Test Coverage
<header>
  <h2>localhost databases</h2>
</header>

<table-filter value="filterValue.name" placeholder="Enter database name"></table-filter>

<table ng-hide="isLoading()" ng-show="(databases | filter:filterValue).length" class="table table-striped table-hover databases">
  <thead>
  <tr>
    <th>Name</th>
    <th>Collections</th>
    <th>Size</th>
    <th class="actions">&nbsp;</th>
  </tr>
  </thead>
  <tbody>
  <tr ng-repeat="database in databases | orderBy:'name' | filter:filterValue"
      ng-mouseleave="showActions = false"
      ng-mouseenter="showActions = true">
    <td><a href="{{database | collectionsPath}}">{{database.name}}</a></td>
    <td>{{database.count}}</td>
    <td>{{database.size | humanSize}}</td>
    <td>
      <span class="actions" ng-show="showActions">
        <show-button path="{{database | collectionsPath}}"></show-button>
        <delete-button ng-click="delete(database)"></delete-button>
      </span>
    </td>
  </tr>
  </tbody>
</table>

<div ng-hide="(databases | filter:filterValue).length" class="alert">
  Nothing has been found.
</div>