thirdparty/google_appengine/google/appengine/ext/admin/templates/datastore.html
changeset 686 df109be0567c
parent 149 f2e327a7c5de
child 828 f5fd65cc3bf3
equal deleted inserted replaced
685:a440ced9a75f 686:df109be0567c
     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;
    45 {% endblock %}
    59 {% endblock %}
    46 
    60 
    47 {% block body %}
    61 {% block body %}
    48   <h3>Datastore Viewer</h3>
    62   <h3>Datastore Viewer</h3>
    49 
    63 
       
    64   {% if in_production %}
       
    65   <div id="hint">
       
    66     The <a href="http://appengine.google.com/datastore/explorer?&app_id={{ application_name }}">Admin Console Data Viewer</a>
       
    67     allows you to run GQL queries and much more!
       
    68   </div>
       
    69   {% endif %}
       
    70 
    50   {% if message %}
    71   {% if message %}
    51   <div id="message">
    72   <div id="message">
    52     {{ message }}
    73     {{ message }}
    53   </div>
    74   </div>
    54   {% endif %}
    75   {% endif %}
    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) + '&amp;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) + '&amp;next={{ request.uri|urlencode }}'" value="Create New Entity"/>
   131               {% include "pager.html" %}
   156               {% include "pager.html" %}
   132             {% endif %}
   157             {% endif %}
   133             </div>
   158             </div>
   134           </div>
   159           </div>
   135         </div>
   160         </div>
   136     
       
   137     </form>
   161     </form>
   138   {% else %}
   162   {% else %}
   139     {% if kind %}
   163     {% if kind %}
   140       <p style="font-size: medium">Sorry, there are no entities of kind &quot;{{ kind|escape }}&quot; in your datastore.</p>
   164       <p style="font-size: medium">Sorry, there are no entities of kind &quot;{{ kind|escape }}&quot; in your datastore.</p>
   141     {% endif %}
   165     {% endif %}
   144 
   168 
   145 {% block final %}
   169 {% block final %}
   146   <script type="text/javascript">
   170   <script type="text/javascript">
   147   //<![CDATA[
   171   //<![CDATA[
   148 
   172 
       
   173   {% if in_production %}
       
   174   manageCreateButton();
       
   175   {% endif %}
   149   updateDeleteButtonAndCheckbox();
   176   updateDeleteButtonAndCheckbox();
   150   document.getElementById("kind_input").focus();
   177   document.getElementById("kind_input").focus();
   151 
   178 
   152   //]]>
   179   //]]>
   153   </script>
   180   </script>