1<div id="documents_list">
2  <div class="warning_message documents_notice" ng-show="documentsControlCtl.state.docs.errors[0]">
3    Error: {{documentsControlCtl.state.docs.errors[0].reason}} ({{documentsControlCtl.state.docs.errors[0].error }})
4  </div>
5  <div class="shadow_box">
6    <div class="header_2 servers_header">
7      <div class="docs_title">
8        <div class="filter_container">
9          <h2>Documents Filter</h2>
10          <div
11            mn-filter="documentsListCtl.filterInitParams"
12            items="documentsListCtl.filterItems"
13            disabled="documentsControlCtl.isEmptyState()"
14            on-close="documentsListCtl.onFilterClose(params)"
15            on-reset="documentsListCtl.onFilterReset()"
16            ></div>
17        </div>
18      </div>
19      <div class="editing_ctrls">
20        <form id="search_doc" ng-submit="!documentsControlCtl.isEmptyState() && documentsListCtl.lookupSubmit()">
21          <input
22            type="text"
23            id="docs_lookup_doc_by_id"
24            placeholder="Document ID"
25            ng-model="documentsListCtl.lookupId"
26            ng-disabled="documentsControlCtl.isEmptyState() || !rbac.cluster.bucket[documentsCtl.state.bucketsNames.selected].data.read">
27          <button
28            type="submit"
29            class="btn_1"
30            ng-class="{dynamic_disabled: documentsControlCtl.isEmptyState() || !rbac.cluster.bucket[documentsCtl.state.bucketsNames.selected].data.read}"
31            id="docs_lookup_doc_by_id_btn">
32            <span>Lookup Id</span>
33          </button>
34        </form>
35        <a
36          class="btn_1 btn_create when-roadmin-avoid-me"
37          ng-class="{dynamic_disabled: documentsControlCtl.isEmptyState() || !rbac.cluster.bucket[documentsCtl.state.bucketsNames.selected].data.write}"
38          ng-click="(!documentsControlCtl.isEmptyState() && rbac.cluster.bucket[documentsCtl.state.bucketsNames.selected].data.write) && documentsListCtl.showCreateDialog()">
39            <span>Create Document</span>
40        </a>
41        <span class="staleness-notice" ng-show="adminCtl.lostConnState.isActivated">Difficulties communicating with the cluster; displaying cached information!</span>
42      </div>
43    </div>
44
45    <div id="documents_list_container" mn-spinner="!documentsControlCtl.state || documentsControlCtl.viewLoading">
46      <table class="list" style="width:100%">
47        <thead>
48          <tr>
49            <th class="keycol">ID</th>
50            <th>&#160;</th>
51            <th>Content</th>
52            <th>&#160;</th>
53            <th>&#160;</th>
54            <th>&#160;</th>
55            <th>&#160;</th>
56            <th>&#160;</th>
57            <th>&#160;</th>
58            <th>&#160;</th>
59          </tr>
60        </thead>
61        <tbody>
62          <tr class="align_text" ng-repeat="r in documentsControlCtl.state.docs.rows" ng-show="documentsControlCtl.state.docs.rows.length">
63            <td class="key ellipsis" colspan="2">
64              <a ui-sref="app.admin.documents.editing({documentId: r.id})">{{ r.id }}</a>
65            </td>
66            <td class="code ellipsis" colspan="5">
67                <code class="object">{{r.doc.json || r.doc.base64 | mnLimitTo: 200}}</code>
68            </td>
69            <td colspan="3">
70              <button class="list_button delete_btn when-roadmin-avoid-me" ng-show="rbac.cluster.bucket[documentsCtl.state.bucketsNames.selected].data.write" ng-click="documentsListCtl.deleteDocument(r.id)"><span>Delete</span></button>
71              <a class="list_button btn_edit" ui-sref="app.admin.documents.editing({documentId: r.id})">
72                <span ng-show="rbac.cluster.bucket[documentsCtl.state.bucketsNames.selected].data.write">Edit Document</span>
73                <span ng-show="rbac.cluster.bucket[documentsCtl.state.bucketsNames.selected].data.read && !rbac.cluster.bucket[documentsCtl.state.bucketsNames.selected].data.write">View Document</span>
74              </a>
75            </td>
76          </tr>
77          <tr ng-if="!documentsControlCtl.state.docs.rows.length">
78            <td colspan="9" class="empty_docs">
79              There are currently no documents in this bucket {{ searchCriteria ? ' corresponding to the search criteria.' : '.' }}
80            </td>
81          </tr>
82        </tbody>
83      </table>
84    </div>
85  </div>
86</div>
87