5 {% block head %} |
5 {% block head %} |
6 <style type="text/css">{% include "css/datastore.css" %}</style> |
6 <style type="text/css">{% include "css/datastore.css" %}</style> |
7 <style type="text/css">{% include "css/pager.css" %}</style> |
7 <style type="text/css">{% include "css/pager.css" %}</style> |
8 <script type="text/javascript"> |
8 <script type="text/javascript"> |
9 //<![CDATA[ |
9 //<![CDATA[ |
10 |
|
11 function disableCreateButton() { |
|
12 var input = document.getElementById("kind_input"); |
|
13 var button = document.getElementById("create_button"); |
|
14 if (input && button) { |
|
15 if (input.value.length == 0) { |
|
16 button.disabled = true; |
|
17 } else { |
|
18 button.disabled = false; |
|
19 } |
|
20 } |
|
21 } |
|
22 |
10 |
23 {% if entities %} |
11 {% if entities %} |
24 function checkAllEntities() { |
12 function checkAllEntities() { |
25 var allCheckBox = document.getElementById("allkeys"); |
13 var allCheckBox = document.getElementById("allkeys"); |
26 var check = allCheckBox.checked; |
14 var check = allCheckBox.checked; |
69 <div id="pagetotal"> |
57 <div id="pagetotal"> |
70 Results <span class="count">{{ start|add:1 }}</span> - <span class="count">{{ entities|length|add:start }}</span> of <span class="count">{{ total }}</span> |
58 Results <span class="count">{{ start|add:1 }}</span> - <span class="count">{{ entities|length|add:start }}</span> of <span class="count">{{ total }}</span> |
71 </div> |
59 </div> |
72 {% endif %} |
60 {% endif %} |
73 |
61 |
|
62 {% if kinds %} |
74 <form action="{{ request.path }}" method="get"> |
63 <form action="{{ request.path }}" method="get"> |
75 <div id="datastore_search"> |
64 <div id="datastore_search"> |
76 <span class="field"> |
65 <span class="field"> |
77 <span class="name">Entity Kind:</span> |
66 <span class="name">Entity Kind:</span> |
78 <span class="value"><input id="kind_input" name="kind" type="text" size="8" value="{{ kind|escape }}" onkeyup="disableCreateButton()" onkeydown="disableCreateButton()"/></span> |
67 <span class="value"> |
|
68 <select name="kind" id="kind_input"> |
|
69 {% for a_kind in kinds %} |
|
70 <option value="{{ a_kind|escape }}"{% ifequal a_kind kind %} selected="selected"{% endifequal %}>{{ a_kind|escape }}</option> |
|
71 {% endfor %} |
|
72 </select> |
|
73 </span> |
79 </span> |
74 </span> |
80 <span class="buttons"> |
75 <span class="buttons"> |
81 <input type="submit" value="List Entities"/> |
76 <input type="submit" value="List Entities"/> |
82 <input type="button" id="create_button" onclick="location.href='{{ datastore_edit_path }}?kind=' + encodeURIComponent(document.getElementById('kind_input').value) + '&next={{ request.uri|urlencode }}'" value="Create New Entity"/> |
77 <input type="button" id="create_button" onclick="location.href='{{ datastore_edit_path }}?kind=' + encodeURIComponent(document.getElementById('kind_input').value) + '&next={{ request.uri|urlencode }}'" value="Create New Entity"/> |
83 </span> |
78 </span> |
84 </div> |
79 </div> |
85 </form> |
80 </form> |
|
81 {% else %} |
|
82 <div id="datastore_empty"> |
|
83 The datastore is empty. You need to add data programatically before you can use this tool to view and edit it. |
|
84 </div> |
|
85 {% endif %} |
86 |
86 |
87 {% if entities %} |
87 {% if entities %} |
88 <form action="{{ datastore_batch_edit_path }}" method="post"> |
88 <form action="{{ datastore_batch_edit_path }}" method="post"> |
89 <input type="hidden" name="kind" value="{{ kind|escape }}"/> |
89 <input type="hidden" name="kind" value="{{ kind|escape }}"/> |
90 <input type="hidden" name="numkeys" value="{{ entities|length }}"/> |
90 <input type="hidden" name="numkeys" value="{{ entities|length }}"/> |