{% extends "djmongo/console/base.html" %}
{% 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>
			  <li><a href="{% url 'djmongo_show_dbs' %}">API</a></li>
			  <li class="active"><a href="#"> {{collection_name}}</a></li>
			</ol>
            </div>
      </div>
     
     
	       <div class="row">
	           <div class="col-lg-12">
		
				       <h1>Simple Read (GET)</h1>
				
			    </div>
            </div>
	 

	 
      
      <div class="row">
              <div class="col-lg-12">
                  <h3><span class="label label-danger">Auth: None (Public)</span>
				  <a class="btn pull-right btn-primary btn-large" href="{% url 'djmongo_create_simple_api' 'public' database_name collection_name %}">
            <i class="fa fa-pencil-square-o icon-white"></i> Create GET: Public</a>
				  </h3>
              </div>
      </div>
      <div class="row">
		 <div class="col-lg-12">    
			  <table class="table  table-striped table-bordered">
			  <thead>
					 <tr>
							<th>Slug (Name)</th>
							<th>HTTP Method</th>
							<th>Endpoint</th>
							<th>Actions</th>
					 </tr>
			  </thead>
 
			  <tbody>


			  {% for a in simple_public_read_apis %}
			  
			  <tr class="danger">
					 <td>{{a.slug}}</td>
					 <td><pre>GET</pre></td>
					 <td><pre>{% url 'djmongo_api_public_simple_search' database_name collection_name a.slug 'json' %}|csv|html</pre></td>
							<td>
						  
								   <div class="btn-group-justified">
									  <a href="{% url 'djmongo_api_public_simple_search' database_name collection_name a.slug 'json' %}" >
									  <button type="button" class="btn btn-success btn-xs"> <i class="fa fa-search"></i> JSON</button>
									  </a>
									  
									  <a href="{% url 'djmongo_api_public_simple_search' database_name collection_name a.slug 'csv' %}" >
									  <button type="button" class="btn btn-success btn-xs"> <i class="fa fa-search"></i> CSV</button>
									  </a>
									  
									  <a href="{% url 'djmongo_api_public_simple_search' database_name collection_name a.slug 'html' %}" >
									  <button type="button" class="btn btn-success btn-xs"> <i class="fa fa-search"></i> HTML</button>
									  </a>
									  
									  <a href="{% url 'djmongo_edit_simple_public_read_api' database_name collection_name a.slug %}" >
									  <button type="button" class="btn btn-warning btn-xs"> <i class="fa fa-edit"></i> Edit</button>
									  </a>
									  
									  <a href="{% url 'djmongo_delete_simple_public_read_api' database_name collection_name a.slug %}" >
									  <button type="button" class="btn btn-danger btn-xs"> <i class="fa fa-remove"></i> Delete</button>
									  </a>
									  
								   </div>
							</td>
			  </tr>
			  {% endfor %}

	   </tbody>

    </table>

   </div>    
    
 </div>

      <div class="row">
			<div class="col-lg-12">
				<h3><span class="label label-info">Auth: Basic</span>
				<a class="btn pull-right btn-primary btn-large" href="{% url 'djmongo_create_simple_api' 'httpauth' database_name collection_name %}">
		        <i class="fa fa-pencil-square-o icon-white"></i> Create GET: Basic
				
				</a>
				</h3>
			</div>
      </div>
      <div class="row">
		 <div class="col-lg-12">    
			  <table class="table  table-striped table-bordered">
			  <thead>
					 <tr>
							<th>Slug (Name)</th>
							<th>HTTP Method</th>
							<th>Groups</th>
							<th>Endpoint</th>
							<th>Actions</th>
					 </tr>
			  </thead>
 
			  <tbody>


			  {% for a in simple_httpauth_read_apis %}
			  
			  <tr class="warning">
					 <td>{{a.slug}}</td>
					 <td><pre>GET</pre></td>
					 <td>{% for g in a.groups.all %}
					 {{g.name}}<br>
					  {% endfor %}
					 {% if not a.groups.all %}
					 None
					 {% endif %}
					
					 </td>
					 <td><pre>{% url 'djmongo_api_httpauth_simple_search' database_name collection_name a.slug 'json' %}|csv|html</pre></td>
							<td>
						  
								   <div class="btn-group-justified">
									  <a href="{% url 'djmongo_api_httpauth_simple_search' database_name collection_name a.slug 'json' %}" >
									  <button type="button" class="btn btn-success btn-xs"> <i class="fa fa-search"></i> JSON</button>
									  </a>
									  
									  <a href="{% url 'djmongo_api_httpauth_simple_search' database_name collection_name a.slug 'csv' %}" >
									  <button type="button" class="btn btn-success btn-xs"> <i class="fa fa-search"></i> CSV</button>
									  </a>
									  
									  <a href="{% url 'djmongo_api_httpauth_simple_search' database_name collection_name a.slug 'html'%}" >
									  <button type="button" class="btn btn-success btn-xs"> <i class="fa fa-search"></i> HTML</button>
									  </a>
									  
									  <a href="{% url 'djmongo_edit_simple_httpauth_read_api' database_name collection_name a.slug %}" >
									  <button type="button" class="btn btn-warning btn-xs"> <i class="fa fa-edit"></i> Edit</button>
									  </a>
									  
									  <a href="{% url 'djmongo_delete_simple_httpauth_read_api' database_name collection_name a.slug %}" >
									  <button type="button" class="btn btn-danger btn-xs"> <i class="fa fa-remove"></i> Delete</button>
									  </a>
									  
								   </div>
							</td>
			  </tr>
			  {% endfor %}

	   </tbody>

    </table>


   </div>    
    
 </div>	  


	       <div class="row">
	           <div class="col-lg-12">
		
				       <h1>Advanced Read (GET)</h1>
				
			    </div>
            </div>


      <div class="row">
              <div class="col-lg-12">
                  <h3><span class="label label-danger">Auth: None (Public)</span>
				  <a class="btn pull-right btn-primary btn-large" href="{% url 'djmongo_create_custom_api' 'public' database_name collection_name %}">
            <i class="fa fa-pencil-square-o icon-white"></i> Create GET: Public</a>
				  </h3>
              </div>
      </div>
      <div class="row">
		 <div class="col-lg-12">    
			  <table class="table  table-striped table-bordered">
   

			  <thead>
					 <tr>
							<th>Slug (Name)</th>
							<th>HTTP Method</th>
							<th>Endpoint</th>
							<th>Actions</th>
					 </tr>
			  </thead>
 
			  <tbody>


			  {% for a in custom_public_read_apis %}
			  
			  <tr class="danger">
					 <td>{{a.slug}}</td>
					 <td><pre>GET</pre></td>
					 <td><pre>{% url 'djmongo_run_custom_public_read_api_by_slug' a.slug %}</pre></td>
							<td>
								   <div class="btn-group-justified">
									  <a href="{% url 'djmongo_run_custom_public_read_api_by_slug' a.slug %}" >
									  <button type="button" class="btn btn-success btn-xs"> <i class="fa fa-search"></i> Run</button>
									  </a>
									  
									  
									  <a href="{% url 'djmongo_edit_custom_public_read_api'  a.slug %}" >
									  <button type="button" class="btn btn-warning btn-xs"> <i class="fa fa-edit"></i> Edit</button>
									  </a>
									  
									  <a href="{% url 'djmongo_delete_custom_public_read_api' a.slug %}" >
									  <button type="button" class="btn btn-danger btn-xs"> <i class="fa fa-remove"></i> Delete</button>
									  </a>
									  
								   </div>
							</td>
			  </tr>
			  {% endfor %}

	   </tbody>

    </table>

   </div>    
    
 </div>	  



<div class="row">
              <div class="col-lg-12">
                  <h3><span class="label label-info">Auth: Basic</span>
				  <a class="btn pull-right btn-primary btn-large" href="{% url 'djmongo_create_custom_api' 'httpauth' database_name collection_name %}">
            <i class="fa fa-pencil-square-o icon-white"></i> Create GET: Basic</a>
				  </h3>
              </div>
      </div>
   
    <div class="row">
		 <div class="col-lg-12">    
			  <table class="table  table-striped table-bordered">
   
			  <thead>
					 <tr>
							<th>Slug (Name)</th>
							<th>HTTP Method</th>
							<th>Groups</th>
							<th>Endpoint</th>
							<th>Actions</th>
					 </tr>
			  </thead>
 
			  <tbody>


			  {% for a in custom_httpauth_read_apis %}
			  
			  <tr class="warning">
					 <td>{{a.slug}}</td>
					 <td><pre>GET</pre></td>
					 <td>{% for g in a.groups.all %}
					 {{g.name}}<br>
					 {% endfor %}
					 </td>
					 <td><pre>{% url 'djmongo_run_custom_httpauth_read_api_by_slug' a.slug %}</pre></td>
							<td>
						  
								   <div class="btn-group-justified">
									  <a href="{% url 'djmongo_run_custom_httpauth_read_api_by_slug' a.slug %}" >
									  <button type="button" class="btn btn-success btn-xs"> <i class="fa fa-search"></i> Run</button>
									  </a>
									  
									  
									  <a href="{% url 'djmongo_edit_custom_httpauth_read_api' a.slug %}" >
									  <button type="button" class="btn btn-warning btn-xs"> <i class="fa fa-edit"></i> Edit..</button>
									  </a>
									  
									  <a href="{% url 'djmongo_delete_custom_httpauth_read_api' a.slug %}" >
									  <button type="button" class="btn btn-danger btn-xs"> <i class="fa fa-eraser"></i> Delete...</button>
									  </a>
									  
								   </div>
							</td>
			  </tr>
			  {% endfor %}

	   </tbody>

    </table>

   </div>    
    
 </div>
   
   
   
   
   	       <div class="row">
	           <div class="col-lg-12">
			    
						<h1>Write APIs (POST)</h1>
					
			    </div>
            </div>
	 
   
            <div class="col-lg-12">
                  <h3><span class="label label-info">Auth: Basic</span>
				  <a class="btn pull-right btn-primary btn-large" href="{% url 'djmongo_create_httpauth_write_api_w_params' database_name collection_name %}">
            <i class="fa fa-pencil-square-o icon-white"></i> Create POST: Basic </a>
				  </h3>
              </div>
   
   
   
   
   
   
   
   
      <div class="row">
		 <div class="col-lg-12">    
			  <table class="table table-striped table-bordered">
   
			  <thead>
					 <tr>
							<th>Slug (Name)</th>
							<th>HTTP Method</th>
							<th>Groups</th>
							<th>Endpoint</th>
							<th>Actions</th>
					 </tr>
			  </thead>
 
			  <tbody>


			  {% for a in httpauth_write_apis %}
			  
			  <tr class="warning">
					 <td>{{a.slug}}</td>
					 <td><pre>POST</pre></td>
					 <td>{% for g in a.groups.all %}
					 {{g.name}}<br>
					 {% endfor %}
					  {% if not a.groups.all %}
					 None
					 {% endif %}
					 </td>
					 <td><pre>{% url 'djmongo_api_write_to_collection_with_httpauth' a.slug %}</pre></td>
							<td>
						  
								   <div class="btn-group-justified">
									  
									  
									  <a href="{% url 'djmongo_api_write_to_collection_with_httpauth' a.slug %}" >
									  <button type="button" class="btn btn-success btn-xs"> <i class="fa fa-pied-piper-alt"></i> Run</button>
									  </a>
									  
									  <a href="{% url 'djmongo_edit_httpauth_write_api' a.slug %}" >
									  <button type="button" class="btn btn-warning btn-xs"> <i class="fa fa-edit"></i> Edit</button>
									  </a>
									  
									  <a href="{% url 'djmongo_delete_httpauth_write_api' a.slug %}" >
									  <button type="button" class="btn btn-danger btn-xs"> <i class="fa fa-eraser"></i> Delete</button>
									  </a>
									  
								   </div>
							</td>
			  </tr>
			  {% endfor %}

	   </tbody>

    </table>

   </div>    
    
 </div>	  

            <div class="col-lg-12">
                  <h3><span class="label label-info">Auth: IP Address</span>
				  <a class="btn pull-right btn-primary btn-large" href="{% url 'djmongo_create_ip_write_api_w_params' database_name collection_name %}">
            <i class="fa fa-pencil-square-o icon-white"></i> Create POST: IP Address</a>
				  </h3>
              </div>


      <div class="row">
		 <div class="col-lg-12">    
			  <table class="table  table-striped table-bordered">
   
			  <thead>
					 <tr>
							<th>Slug (Name)</th>
							<th>HTTP Method</th>
							<th>Endpoint</th>
							<th>Actions</th>
					 </tr>
			  </thead>
 
			  <tbody>


			  {% for a in ip_write_apis %}
			  
			  <tr class="warning">
					 <td>{{a.slug}}</td>
					 <td><pre>POST</pre></td>
					 <td><pre>{% url 'djmongo_api_write_to_collection_with_ip' a.slug %}</pre></td>
							<td>
						  
								   <div class="btn-group-justified">
  
  									  <a href="{% url 'djmongo_api_write_to_collection_with_ip' a.slug %}" >
									  <button type="button" class="btn btn-success btn-xs"> <i class="fa  fa-pied-piper-alt"></i> Edit</button>
									  </a>
  
									  <a href="{% url 'djmongo_edit_ip_write_api' a.slug %}" >
									  <button type="button" class="btn btn-warning btn-xs"> <i class="fa fa-edit"></i> Edit</button>
									  </a>
									  
									  <a href="{% url 'djmongo_delete_ip_write_api' a.slug %}" >
									  <button type="button" class="btn btn-danger btn-xs"> <i class="fa fa-eraser"></i> Delete</button>
									  </a>
									  
								   </div>
							</td>
			  </tr>
			  {% endfor %}

	   </tbody>

    </table>

   </div>    
    
 </div>	 






	  
</div>

{% endblock %}