<!-- 
    Security Knowledge Framework is an expert system application 
    that uses OWASP Application Security Verification Standard, code examples,
    helps developers in pre-development and post-development.  
    Copyright (C) 2015  Glenn ten Cate, Riccardo ten Cate

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

 {% include 'header.html' %}

 
<!-- **********************************************************************************************************************************************************
      MAIN CONTENT
      *********************************************************************************************************************************************************** -->
      <!--main content start-->
      <section id="main-content">
          <section class="wrapper">

		  		<div class="row mt">
			  		<div class="col-lg-12">
						<div class="-panel">
          	<h3><i class="fa fa-angle-right"></i> Function results</h3>
            <br>
						{% if entries -%}
						    <div class="alert alert-info">Summary of all functions results.</div>
						{% else %}
    						<div class="alert alert-danger">There were no function lists found. <br/>Create a list in order to create results.</div>
						{% endif %}


            {% if entries -%}

      				<div class="showback">


		  	<div class="row mt">
                  <div class="col-md-12">
                      <div style='margin-top:-25px;' class="content-panel">
                          <table class="table table-striped table-advance table-hover">
	                  	  	  <h4><i class="fa fa-angle-right"></i>Functions</h4>
	                  	  	  <hr>
                              <thead>
                              <tr>
                                  <th><i class="fa fa-bulhorn"></i> <b>Functions Project</b></th>
                                  <th><i class="fa fa-bulhorn"></i> <b>Functions list name</b></th>

                                  <th class="hidden-phne"><i class="fa fa-qustion-circle"></i><b>Version</b></th>
                                  <th><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Download</b></th>
                              </tr>
                              </thead>
                              <tbody>
                              
                  {% set counter = 0 -%}
                  {% for entry in entries -%}
                             
                              <tr>
                                  <td>{{entry.projectName|safe}}</td>
                                  <td>{{entry.functionName|safe}}</td>

                                  <td class="hidden-phone">&nbsp;&nbsp;&nbsp;{{entry.projectVersion|safe}}</td>
                                  <td>
                                       &nbsp;&nbsp;&nbsp;&nbsp;<a href='/results-function-report/{{entry.projectID|safe}}' target='_self' >  
                                  <button class='btn btn-success btn-xs'><center>View Results</center></button></a>
                                             				           
      						      <!-- Button trigger modal -->
					         	  <button class="btn btn-danger btn-xs" data-toggle="modal" data-target="#myModal{{counter|safe}}">
						          <i class="fa fa-times "></i>                  
					              </button>
						
						          <!-- Modal -->
						          <div class="modal fade" id="myModal{{counter|safe}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						          <div class="modal-dialog">
						          <div class="modal-content">
						          <div class="modal-header">
						          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						          <h4 class="modal-title" id="myModalLabel">Warning</h4>
						          </div>
						          <div   class="modal-body">
						          <table id='checklist' style="width:525px">
						          
						<p>When you press the "Remove functions" button, all the functions which this project contains will be deleted from the documentation<br/>
						Are you sure you want to continue.
						</p>


								  </table>
						          </div>
						          <div class="modal-footer">
						          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                     			<a href="/results-functions"><button class="btn btn-danger" onClick="delFunctionList('{{entry.entryDate|safe}}', '{{csrf_token|safe}}')">Remove Function List</button></a>
						          </form>
						          </div>
						          </div>
						  		  </div>
								  </div>      				
      							  </div>                
      							  
      							  </td>
                              </tr>
		         			  {% endfor %}				
		         			  {% endif %}
                              </tbody>
                          </table>
                      </div><!-- /content-panel -->
                  </div><!-- /col-md-12 -->
              </div><!-- /row -->
         		</div><!-- /showback -->      				
				</div>	
               </div><!-- /col-lg-4 -->			
		  	</div><!-- /row -->
		</section><!--/wrapper -->
      </section><!-- /MAIN CONTENT -->
         
 {% include 'footer.html' %}