{% extends "djmongo/console/base.html" %}


{% block extra_head %}

<script type="text/javascript">
$('.dropdown-toggle').dropdown();
</script>
{% endblock %}


{% block Content %}

{% load i18n %}

<div class="container">
      
      <br><br>
      <div class="row">
              <div class="col-lg-12">
			<ol class="breadcrumb">
			  <li><a href="{% url 'djmongo_show_dbs' %}">Home</a></li>
			</ol>
            </div>
      </div>   
      
   <div class="row">
              

       <table class="table table-striped table-bordered">
      
       <thead>
       <tr>
         <th><h2>Database</h2></th>
         <th><h2>Collections</h2></th>
       </tr>
       </thead>
        
       <tbody>
       {% for d in dbs %}
       <tr>
       <td>
       <div class="btn-group">
           <a class="btn dropdown-toggle btn-default btn-large" data-toggle="dropdown" href="#">
          {{ d.name }}
           <span class="caret"></span>
           </a>
           <ul class="dropdown-menu">
              <li><a href="{% url 'djmongo_create_collection' d.name %}">
                   <i class="fa fa-database"></i> Create Collection</a> </li>
              <li role="presentation" class="divider"></li>   
              
			  
		      <li><a href="{% url 'djmongo_import_csv_w_db' d.name %}">
                    <i class="fa fa-arrow-right"></i> Import Data into a New Collection</a>
                </li>
			  
              <li><a href="{% url 'djmongo_drop_database' d.name %}">
                   <i class="fa fa-warning"></i> Drop Database</a>
              </li>
               
              </ul>
            </div>
       </td>
       <td>
           {% for c in d.collections %}
           <div class="btn-group">
           <div class="btn">
            <a class="btn dropdown-toggle btn-default btn-large" data-toggle="dropdown" href="#">
            {{c}}
            <span class="caret"></span>
            </a>
            <ul class="dropdown-menu">
     
	           <li> <a href="{% url 'djmongo_show_apis' d.name c %}">
                     <i class="fa fa-dashboard"></i> {% trans "API Dashboard" %}</a>
                   </li>
                   <li> <a href="{% url 'djmongo_api_wizard_w_params' d.name c %}">
                     <i class="fa fa-plus "></i> {% trans "Create API" %}</a>
             </li>
	             <li role="presentation" class="divider"></li> 
                        <li><a  href="{% url 'djmongo_create_document_in_collection_w_params' d.name  c %}">
                   <i class="fa fa-plus-circle"></i> {% trans "Create a Document" %}</a></li>
						
				            <li><a  href="{% url 'djmongo_update_document_in_collection_w_params' d.name c %}">
                   <i class="fa fa-retweet"></i> {% trans "Update a Document" %}</a></li>
			            <li><a  href="{% url 'djmongo_ensure_index' d.name c %}">
                   <i class="fa fa-fighter-jet"></i> {% trans "Create an Index" %}</a></li>
			
			<li> <a  href="{% url 'djmongo_drop_collection' d.name c %}"">
                    <i class="fa fa-warning"></i> {% trans "Drop Collection" %} </a></li>

            
            <li role="presentation" class="divider"></li> 
                  
            
            <li> <a  target=_blank href="{% url 'djmongo_build_keys' d.name c %}">
                <i class="fa fa-key"></i> {% trans "Build Key Collection" %}</a></li>
 
 
              <li>
                  <a  href="{% url 'djmongo_import_csv_w_params' d.name c %}">
                  <i class="fa fa-arrow-right"></i> {% trans "Import a CSV" %}</a>
              </li>

               <li> <a  href="{% url 'djmongo_browse_saved_aggregations_w_params' d.name c %}">
                  <i class="fa fa-cogs"></i> {% trans "Schedule Aggregations" %}</a>
              </li>
                         
            </ul>
          </div>
          
          
           {% endfor %}
         </div> 
       {% endfor %}
       </table>
    </div> 
</div>

{% endblock %}
