#!/usr/bin/python3
# encoding=utf-8
# -*- coding: utf-8 -*-

import os
import cgi
fs = cgi.FieldStorage()

print ("Content-Type: text/html; charset=UTF-8")
print()
print ("""<html lang="fr">
  <head>
    <meta charset="utf-8">
    <title>open-elab FabLab</title>
	<script src="plotly-latest.min.js"></script>
	<script src="curve_plotly.js"></script>
	<script>
	  function getUrlVars() {
	  var vars = {};
	  var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,    
	  function(m,key,value) {
	  vars[key] = value;
	  });
	  return vars;
	  }
	</script>
	<link rel="stylesheet" media="screen" href="/css/214.css">
	<style>
	   /* Dropdown Button */
.dropbtn {
    background-color: #4CAF50;
    color: white;
    padding: 16px;
    font-size: 16px;
    border: none;
    cursor: pointer;
}
.dropbtnsmall {
    background-color: #4CAF50;
    color: white;
    padding: 8px;
    font-size: 12px;
    border: none;
    cursor: pointer;
}

/* Dropdown button on hover & focus */
.dropbtn:hover, .dropbtn:focus {
    background-color: #3e8e41;
}

/* The container  - needed to position the dropdown content */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Content (Hidden by Default) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}

/* Links inside the dropdown */
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #f1f1f1}

/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
.show {display:block;}
.hide {display:none;}
	</style>
  </head>
  <body>
    <div>
""")

print("""
      <h2>Prez</h2>
""")

ldir = os.listdir('.')
ll = []
for f in ldir:
    if '.' in f and ( '.JPG' in f or '.jpg' in f)  and 'mini' in f:
        ll.append(f)
ll.sort()

for name in ll:
    print("""<img src="%s">"""%name);
print("""</div>    
  </body>
</html>
""");
