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 {% if in_production %} |
|
12 function manageCreateButton() { |
|
13 var input = document.getElementById("kind_input"); |
|
14 var button = document.getElementById("create_button"); |
|
15 if (input && button) { |
|
16 if (input.value.length == 0) { |
|
17 button.disabled = true; |
|
18 } else { |
|
19 button.disabled = false; |
|
20 } |
|
21 } |
|
22 } |
|
23 {% endif %} |
10 |
24 |
11 {% if entities %} |
25 {% if entities %} |
12 function checkAllEntities() { |
26 function checkAllEntities() { |
13 var allCheckBox = document.getElementById("allkeys"); |
27 var allCheckBox = document.getElementById("allkeys"); |
14 var check = allCheckBox.checked; |
28 var check = allCheckBox.checked; |
56 {% if entities %} |
77 {% if entities %} |
57 <div id="pagetotal"> |
78 <div id="pagetotal"> |
58 Results <span class="count">{{ start|add:1 }}</span> - <span class="count">{{ entities|length|add:start }}</span> of <span class="count">{{ total }}</span> |
79 Results <span class="count">{{ start|add:1 }}</span> - <span class="count">{{ entities|length|add:start }}</span> of <span class="count">{{ total }}</span> |
59 </div> |
80 </div> |
60 {% endif %} |
81 {% endif %} |
61 |
82 |
62 {% if kinds %} |
83 {% if kinds or in_production %} |
63 <form action="{{ request.path }}" method="get"> |
84 <form action="{{ request.path }}" method="get"> |
64 <div id="datastore_search"> |
85 <div id="datastore_search"> |
65 <span class="field"> |
86 <span class="field"> |
66 <span class="name">Entity Kind:</span> |
87 <span class="name">Entity Kind:</span> |
67 <span class="value"> |
88 <span class="value"> |
|
89 {% if in_production %} |
|
90 <input id="kind_input" name="kind" type="text" size="8" value="{{ kind|escape }}" onkeyup="manageCreateButton()" onkeydown="manageCreateButton()"/> |
|
91 {% else %} |
68 <select name="kind" id="kind_input"> |
92 <select name="kind" id="kind_input"> |
69 {% for a_kind in kinds %} |
93 {% for a_kind in kinds %} |
70 <option value="{{ a_kind|escape }}"{% ifequal a_kind kind %} selected="selected"{% endifequal %}>{{ a_kind|escape }}</option> |
94 <option value="{{ a_kind|escape }}"{% ifequal a_kind kind %} selected="selected"{% endifequal %}>{{ a_kind|escape }}</option> |
71 {% endfor %} |
95 {% endfor %} |
72 </select> |
96 </select> |
|
97 {% endif %} |
73 </span> |
98 </span> |
74 </span> |
99 </span> |
75 <span class="buttons"> |
100 <span class="buttons"> |
76 <input type="submit" value="List Entities"/> |
101 <input type="submit" value="List Entities"/> |
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"/> |
102 <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"/> |