pezcurrel 4 years ago
parent
commit
71e86eac48
8 changed files with 409 additions and 426 deletions
  1. 1 0
      README.md
  2. 49 392
      web/admin/edinst.php
  3. 104 0
      web/admin/imgs/cerca_off.svg
  4. 117 0
      web/admin/imgs/cerca_on.svg
  5. 76 0
      web/admin/imgs/esci.svg
  6. 8 15
      web/admin/index.html
  7. 10 11
      web/admin/instances.php
  8. 44 8
      web/admin/theme.css

+ 1 - 0
README.md

@@ -1 +1,2 @@
 Progetto per un sito di introduzione a mastodon ([al momento pubblicato qui](https://rame.altervista.org/mastostart/)) che dia inoltre la possibilità di scegliere un’istanza in base a vari criteri, da una base di istanze sufficientemente occhei.
+Se vuoi saperne di più puoi leggere il [wiki](wiki).

+ 49 - 392
web/admin/edinst.php

@@ -31,7 +31,7 @@ mysqli_close($link);
 <!DOCTYPE HTML>
 <html lang="it">
 <head>
-<title>Mastodon Startpage Admin - Modifica di «<?php echo($data['URI']); ?>»</title>
+<title>Mastodon Startpage Admin - Modifica di «<?php //echo($data['URI']); ?>»</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <meta name="description" content="Admin pages for Mastodon Startpage">
 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
@@ -56,388 +56,6 @@ function ulsh(el,sh) {
 	else
 		el.style.display='none';
 }
-
-function shideplancia() {
-	var plancia=document.getElementById('plancia');
-	var plctrl=document.getElementById('plctrl');
-	if (plancia.style.display=='block') {
-		plancia.style.display='none';
-		plctrl.innerHTML='Mostra plancia';
-	} else {
-		plancia.style.display='block';
-		plctrl.innerHTML='Nascondi plancia';
-	}
-}
-
-function truncsel(el) {
-	var sel=document.getElementById(el), len=sel.length, i=0;
-	for (i=len-1; i>=0; i--)
-		sel.remove(i);
-}
-function addselopt(el,val,txt) {
-	option=new Option(txt,val);
-	el.add(option);
-}
-function inpdisif(index) {
-	console.log('inpdisif index: '+index);
-	var source=document.getElementById('condsel-'+index);
-	var inp=document.getElementById('valueinp-'+index);
-	var sel=document.getElementById('valuesel-'+index);
-	var conds=['IS NULL','IS NOT NULL'];
-	if (conds.includes(source.value)) {
-		inp.disabled=true;
-		sel.disabled=true;
-	} else {
-		if (inp.style.display!='none') inp.disabled=false;
-		if (sel.style.display!='none') sel.disabled=false;
-	}
-}
-function popusels(index,valselval) {
-	console.log('popusels index: '+index);
-	var key=document.getElementById('fieldsel-'+index).value;
-	var type=key.replace(/^.*:(.*):.*$/,'$1');
-	var subtype=key.replace(/^.*:.*:(.*)$/,'$1');
-	key=key.replace(/^(.*):.*:.*$/,'$1');
-	var condsel=document.getElementById('condsel-'+index);
-	var valsel=document.getElementById('valuesel-'+index);
-	var valinp=document.getElementById('valueinp-'+index);
-	condsel.setAttribute('onchange','inpdisif('+index+');');
-	if (type=='joini')
-		type=subtype;
-	if (type=='bool') {
-		truncsel('condsel-'+index);
-		addselopt(condsel,'IS','è');
-		truncsel('valuesel-'+index);
-		addselopt(valsel,'TRUE','vero');
-		addselopt(valsel,'FALSE','falso');
-		addselopt(valsel,'NOT NULL','definit@');
-		addselopt(valsel,'NULL','non definit@');
-		if (valselval!==false)
-			selind('valuesel-'+index,valselval);
-		valinp.style.display='none';
-		valinp.disabled=true;
-		valsel.style.display='block';
-		valsel.disabled=false;
-	} else if (type=='text') {
-		truncsel('condsel-'+index);
-		addselopt(condsel,'LIKE','contiene');
-		addselopt(condsel,'NOT LIKE','non contiene');
-		addselopt(condsel,'=','è uguale a');
-		addselopt(condsel,'!=','è divers@ da');
-		addselopt(condsel,'>=','è maggiore o uguale a');
-		addselopt(condsel,'<=','è minore o uguale a');
-		addselopt(condsel,'>','è maggiore di');
-		addselopt(condsel,'<','è minore di');
-		addselopt(condsel,'IS NOT NULL','è definit@');
-		addselopt(condsel,'IS NULL','non è definit@');
-		valsel.style.display='none';
-		valsel.disabled=true;
-		valinp.style.display='block';
-		valinp.disabled=false;
-	} else if (type=='int' || type=='time') {
-		truncsel('condsel-'+index);
-		addselopt(condsel,'>=','è maggiore o uguale a');
-		addselopt(condsel,'<=','è minore o uguale a');
-		addselopt(condsel,'>','è maggiore di');
-		addselopt(condsel,'<','è minore di');
-		addselopt(condsel,'=','è uguale a');
-		addselopt(condsel,'!=','è divers@ da');
-		addselopt(condsel,'IS NOT NULL','è definit@');
-		addselopt(condsel,'IS NULL','non è definit@');
-		valsel.style.display='none';
-		valsel.disabled=true;
-		valinp.style.display='block';
-		valinp.disabled=false;
-	} else if (type=='join') {
-		truncsel('condsel-'+index);
-		addselopt(condsel,'=','è uguale a');
-		addselopt(condsel,'!=','è divers@ da');
-		addselopt(condsel,'IS NOT NULL','è definit@');
-		addselopt(condsel,'IS NULL','non è definit@');
-		valsel.style.display='block';
-		valsel.disabled=false;
-		valinp.style.display='none';
-		valinp.disabled=true;
-		truncsel('valuesel-'+index);
-		pupwait(true);
-		let xhr=new XMLHttpRequest();
-		xhr.open('GET','instancesh.php?key='+key);
-		xhr.responseType='json';
-		xhr.send();
-		xhr.onload=function() {
-			let jarr=xhr.response;
-			for (i=0; i<jarr.length; i++)
-				addselopt(valsel,jarr[i][0],jarr[i][1]);
-			console.log('valsel pronto!');
-			if (valselval!==false)
-				selind('valuesel-'+index,valselval);
-			pupwait(false);
-		};
-		xhr.onerror=function() {
-			alert('Request failed');
-		};
-	} else {
-		alert('Attenziò: non so che farmene del tipo "'+type+'": diglielo, al programmatore.');
-	}
-}
-function addrow(index,refresh) {
-	var table=document.getElementById('planciafil');
-	var newrow=table.insertRow(index);
-	var newcell0=newrow.insertCell(0);
-	var newcell1=newrow.insertCell(1);
-	var newcell2=newrow.insertCell(2);
-	var newcell3=newrow.insertCell(3);
-	var newcell4=newrow.insertCell(4);
-	var newcell5=newrow.insertCell(5);
-	var newcell6=newrow.insertCell(6);
-	var newcell7=newrow.insertCell(7);
-	newcell0.innerHTML='<select class="openpar"><option value="null"></option><option value="(">(</option><option value="((">((</option><option value="(((">(((</option></select>';
-	newcell1.innerHTML='<select class="fieldsel"></select>';
-	newcell2.innerHTML='<select class="condsel"></select>';
-	newcell3.innerHTML='<select class="valuesel" style="display:none;"></select><input type="text" class="valueinp" maxlength="256" style="display:none;">';
-	newcell4.innerHTML='<select class="closepar"><option value="null"></option><option value=")">)</option><option value="))">))</option><option value=")))">)))</option></select>';
-	newcell5.innerHTML='<select class="andor"><option value="AND">E</option><option value="OR">O</option></select>';
-	newcell6.innerHTML='<img class="plus" src="imgs/plus.svg">';
-	newcell7.innerHTML='<img class="minus" src="imgs/minus.svg">';
-	if (refresh) {
-		synctai();
-		popusels(index,false);
-	}
-}
-function ordaddrow(index,refresh) {
-	var table=document.getElementById('planciaord');
-	var newrow=table.insertRow(index);
-	var newcell0=newrow.insertCell(0);
-	var newcell1=newrow.insertCell(1);
-	var newcell2=newrow.insertCell(2);
-	var newcell3=newrow.insertCell(3);
-	newcell0.style.width='97%';
-	newcell1.style.width='1%';
-	newcell2.style.width='1%';
-	newcell3.style.width='1%';
-	newcell0.innerHTML='<select class="ordfieldsel"></select>';
-	newcell1.innerHTML='<select class="ascdesc"><option value="ASC">Crescente</option><option value="DESC">Decrescente</option></select>';
-	newcell2.innerHTML='<img class="plus" src="imgs/plus.svg">';
-	newcell3.innerHTML='<img class="minus" src="imgs/minus.svg">';
-	if (refresh)
-		synctoi();
-}
-function synctai() {
-	var i=0;
-	var table=document.getElementById('planciafil');
-	var nodes=table.querySelectorAll('.minus');
-	var cnodes=nodes.length;
-	for (i=0; i<cnodes; i++)
-		// +1 sempre per via della row iniziale
-		nodes[i].setAttribute('onclick','remrow('+(i+1)+');');
-	nodes=table.querySelectorAll('.plus');
-	for (i=0; i<cnodes; i++)
-		// +2 perché la devi aggiungere dopo la corrente
-		nodes[i].setAttribute('onclick','addrow('+(i+2)+',true);');
-// da qui in poi faccio a scendere per non avere mai id e nomi duplicati
-	cnodes--;
-	nodes=table.querySelectorAll('.openpar');
-	for (i=cnodes; i>-1; i--) {
-		nodes[i].setAttribute('id','openpar-'+(i+1));
-		nodes[i].setAttribute('name','openpar-'+(i+1));
-	}
-	nodes=table.querySelectorAll('.fieldsel');
-	for (i=cnodes; i>-1; i--) {
-		nodes[i].setAttribute('id','fieldsel-'+(i+1));
-		nodes[i].setAttribute('name','fieldsel-'+(i+1));
-		nodes[i].setAttribute('onchange','popusels('+(i+1)+',false);');
-	}
-	nodes=table.querySelectorAll('.condsel');
-	for (i=cnodes; i>-1; i--) {
-		nodes[i].setAttribute('id','condsel-'+(i+1));
-		nodes[i].setAttribute('name','condsel-'+(i+1));
-		nodes[i].setAttribute('onchange','inpdisif('+(i+1)+');');
-	}
-	nodes=table.querySelectorAll('.valuesel');
-	for (i=cnodes; i>-1; i--) {
-		nodes[i].setAttribute('id','valuesel-'+(i+1));
-		nodes[i].setAttribute('name','valuesel-'+(i+1));
-	}
-	nodes=table.querySelectorAll('.valueinp');
-	for (i=cnodes; i>-1; i--) {
-		nodes[i].setAttribute('id','valueinp-'+(i+1));
-		nodes[i].setAttribute('name','valueinp-'+(i+1));
-	}
-	nodes=table.querySelectorAll('.closepar');
-	for (i=cnodes; i>-1; i--) {
-		nodes[i].setAttribute('id','closepar-'+(i+1));
-		nodes[i].setAttribute('name','closepar-'+(i+1));
-	}
-	nodes=table.querySelectorAll('.andor');
-	for (i=cnodes; i>-1; i--) {
-		nodes[i].setAttribute('id','andor-'+(i+1));
-		nodes[i].setAttribute('name','andor-'+(i+1));
-		nodes[i].disabled=false;
-	}
-	if (cnodes>=0)
-		nodes[cnodes].disabled=true;
-}
-function synctoi() {
-	var i=0;
-	var table=document.getElementById('planciaord');
-	var nodes=table.querySelectorAll('.minus');
-	var cnodes=nodes.length;
-	for (i=0; i<cnodes; i++)
-		// +1 sempre per via della row iniziale
-		nodes[i].setAttribute('onclick','ordremrow('+(i+1)+');');
-	nodes=table.querySelectorAll('.plus');
-	for (i=0; i<cnodes; i++)
-		// +2 perché la devi aggiungere dopo la corrente
-		nodes[i].setAttribute('onclick','ordaddrow('+(i+2)+',true);');
-// da qui in poi faccio a scendere per non avere mai id e nomi duplicati
-	cnodes--;
-	nodes=table.querySelectorAll('.ordfieldsel');
-	for (i=cnodes; i>-1; i--) {
-		nodes[i].setAttribute('id','ordfieldsel-'+(i+1));
-		nodes[i].setAttribute('name','ordfieldsel-'+(i+1));
-	}
-	nodes=table.querySelectorAll('.ascdesc');
-	for (i=cnodes; i>-1; i--) {
-		nodes[i].setAttribute('id','ascdesc-'+(i+1));
-		nodes[i].setAttribute('name','ascdesc-'+(i+1));
-	}
-}
-function selind(id,val) {
-	var el=document.getElementById(id), i=0, found=false;
-	while (!found && i<el.length) {
-		if (el[i].value==val) {
-			el.selectedIndex=i;
-			found=true;
-		}
-		i++;
-	}
-	if (!found)
-		console.log('"'+val+'" non è stato trovato in "'+id+'"');
-}
-function setrow(index,openparv,fieldselv,condselv,valueselv,valueinpv,closeparv,andorv) {
-	selind('openpar-'+index,openparv);
-	selind('fieldsel-'+index,fieldselv);
-	popusels(index,valueselv);
-	selind('condsel-'+index,condselv);
-//	selind('valuesel-'+index,valueselv);
-	document.getElementById('valueinp-'+index).value=valueinpv;
-	if (condselv=='IS NULL' || condselv=='IS NOT NULL') {
-		document.getElementById('valueinp-'+index).disabled=true;
-		document.getElementById('valuesel-'+index).disabled=true;
-	}
-	selind('closepar-'+index,closeparv);
-	selind('andor-'+index,andorv);
-}
-function ordsetrow(index,ordfieldselv,ascdescv) {
-	selind('ordfieldsel-'+index,ordfieldselv);
-	selind('ascdesc-'+index,ascdescv);
-}
-function remrow(index) {
-	var table=document.getElementById('planciafil');
-	table.deleteRow(index);
-	synctai();
-	if (table.rows.length<2)
-		document.getElementById('filbut').value='Aggiungi criteri di ricerca';
-}
-function ordremrow(index) {
-	var table=document.getElementById('planciaord');
-	table.deleteRow(index);
-	synctoi();
-	if (table.rows.length<2)
-		document.getElementById('ordbut').value='Aggiungi criteri di ordinamento';
-}
-function truncfil() {
-	var table=document.getElementById('planciafil');
-	while (table.rows.length>1)
-		remrow(1);
-}
-function truncord() {
-	var table=document.getElementById('planciaord');
-	while (table.rows.length>1)
-		ordremrow(1);
-}
-function manfil() {
-	var filbut=document.getElementById('filbut');
-	var table=document.getElementById('planciafil');
-	var crows=table.rows.length;
-	if (crows<2) {
-		addrow(1,true);
-		filbut.value='Rimuovi tutti i criteri di ricerca';
-	} else {
-		confirma('<p>Confermi di voler rimuovere tutti i criteri di ricerca?</p>','truncfil();filbut.value=\'Aggiungi criteri di ricerca\'');
-	}
-}
-function manord() {
-	var ordbut=document.getElementById('ordbut');
-	var table=document.getElementById('planciaord');
-	var crows=table.rows.length;
-	if (crows<2) {
-		ordaddrow(1,true);
-		ordbut.value='Rimuovi tutti i criteri di ordinamento';
-	} else {
-		confirma('<p>Confermi di voler rimuovere tutti i criteri di ordinamento?</p>','truncord();ordbut.value=\'Aggiungi criteri di ordinamento\'');
-	}
-}
-function ckpar() {
-	var i=0;
-	var table=document.getElementById('planciafil');
-	var nodes=table.querySelectorAll('.openpar');
-	var cnodes=nodes.length;
-	var opars=[];
-	var cpars=[];
-	for (i=0; i<cnodes; i++)
-		opars.push(nodes[i].value);
-	nodes=table.querySelectorAll('.closepar');
-	for (i=0; i<cnodes; i++)
-		cpars.push(nodes[i].value);
-	var spars='';
-	for (i=0; i<cnodes; i++) {
-		if (opars[i]!='null') spars+=opars[i];
-		if (cpars[i]!='null') spars+=cpars[i];
-	}
-	var opq=0, cpq=0, ok=true;
-	for (i=0; i<spars.length; i++) {
-		if (spars[i]=='(') {
-			opq++;
-		} else if (spars[i]==')') {
-			cpq++;
-		}
-		if (cpq>opq)
-			break;
-	}
-	if (opq!=cpq)
-		ok=false;
-	console.log(i+'/'+spars.length+': '+ok);
-	return ok;
-}
-function ckf() {
-	var emsg='';
-	if (!ckpar()) emsg+='Qualcosa non va con le parentesi!<br>\n';
-//	emsg+='Comunque NO!<br>\n';
-	if (emsg=='') {
-		var table=document.getElementById('planciafil');
-		var crows=table.rows.length;
-		if (crows>1)
-			document.getElementById('andor-'+(crows-1)).disabled=false;
-		document.getElementById('f').submit();
-	} else {
-		alerta('<p>'+emsg+'</p>');
-	}
-}
-function pupwait(on) {
-	var pup=document.getElementById('popup'), inpup=document.getElementById('inpopup');
-	if (on) {
-		if (pup.style.display!='table') {
-			inpup.innerHTML='<div class="waitbub"><img src="imgs/loading.gif"><br>&nbsp;<br>Caricamento in corso...</div>';
-			pup.style.display='table';
-		} else {
-			console.log('Sto già aspettando...');
-		}
-	} else {
-		inpup.innerHTML='<div id="popupcont">...</div>';
-		pup.style.display='none';
-	}
-}
 //-->
 </script>
 </head>
@@ -449,8 +67,7 @@ function pupwait(on) {
 <?php echo($menuout); ?>
 </ul>
 <div id="rightdiv">
-<div id="logout" class="rlinks" onclick="document.location.href='logout.php'"><a href="logout.php">Esci</a></div>
-</div>
+<a href="logout.php" class="rlinks"><img src="imgs/esci.svg" title="Esci"></a>
 </div>
 </nav>
 
@@ -475,14 +92,54 @@ function pupwait(on) {
 <tr><td class="insthead">Ciao sono una istanza</td></tr>
 <tr><td>
 <table class="cbtab">
-<tr><td><label for="Blacklisted">Blacklistata:</label></td><td>&nbsp;<input type="checkbox" name="Blacklisted" id="Blacklisted"></td></tr>
-<tr><td><label for="New">Nuova:</label></td><td>&nbsp;<input type="checkbox" name="New" id="New"></td></tr>
-<tr><td><label for="Good">Papabile:</label></td><td>&nbsp;<input type="checkbox" name="Good" id="Good"></td></tr>
-<tr><td><label for="Chosen">Scelta:</label></td><td>&nbsp;<input type="checkbox" name="Chosen" id="Chosen"></td></tr>
-<tr><td><label for="Visible">Visibile:</label></td><td>&nbsp;<input type="checkbox" name="Visible" id="Visible"></td></tr>
+<tr><td><label for="Blacklisted">Blacklistata</label></td><td>&nbsp;<input type="checkbox" name="Blacklisted" id="Blacklisted"></td></tr>
+<tr><td><label for="New">Nuova</label></td><td>&nbsp;<input type="checkbox" name="New" id="New"></td></tr>
+<tr><td><label for="Good">Papabile</label></td><td>&nbsp;<input type="checkbox" name="Good" id="Good"></td></tr>
+<tr><td><label for="Chosen">Scelta</label></td><td>&nbsp;<input type="checkbox" name="Chosen" id="Chosen"></td></tr>
+<tr><td><label for="Visible">Visibile</label></td><td>&nbsp;<input type="checkbox" name="Visible" id="Visible"></td></tr>
+</table>
+<div class="ruler"></div>
+<div class="tit"><label for="OurDesc">Descrizione nostra</label></div>
+<textarea name="OurDesc" id="OurDesc" rows="10" class="tarea"></textarea>
+<div class="ruler"></div>
+<div class="tit"><label for="LocalityID">Località</label></div>
+<input type="text" placeholder="Cerca ..." class="search">
+<select id="LocalityID" size="10" class="mselect">
+<option value="1">Giamaica</option>
+<option value="2">Angariate</option>
+</select>
+<div class="ruler"></div>
+<div class="tit"><label for="Languages">Lingue</label></div>
+<input type="text" placeholder="Cerca ..." class="search">
+<table class="picktab">
+<tr>
+<td style="width:99%;">
+<select id="DispLangs" multiple size="10" class="mselect">
+<option value="1">Inglese</option>
+<option value="2">Esperanto</option>
+</select>
+<img src="imgs/carica.svg" style="float:left;"><img src="imgs/salva.svg" style="float:right;">
+</td>
+<td style="width:1%;">
+<div style="width:22px;"><img src="imgs/carica.svg"></div>
+<div style="width:22px;"><img src="imgs/carica.svg"></div>
+<div style="width:22px;"><img src="imgs/carica.svg"></div>
+</td>
+</tr>
+<tr>
+<td style="width:99%;">
+<select id="ChosenLangs" multiple size="10" class="mselect">
+<option value="3">Italiano</option>
+<option value="4">Lappone</option>
+</select>
+</td>
+<td style="width:1%;">
+<div style="width:22px;"><img src="imgs/carica.svg"></div>
+<div style="width:22px;"><img src="imgs/carica.svg"></div>
+<div style="width:22px;"><img src="imgs/carica.svg"></div>
+</td>
+</tr>
 </table>
-<label for="OurDesc">Descrizione nostra:</label><textarea name="OurDesc" id="OurDesc" rows="10" class="tarea"></textarea><br>
-<label for="LocalityID">Località:</label> Orpo
 </td></tr>
 </table>
 </div>

+ 104 - 0
web/admin/imgs/cerca_off.svg

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32"
+   height="32"
+   viewBox="0 0 8.4666659 8.4666659"
+   version="1.1"
+   id="svg8"
+   inkscape:version="0.92.4 5da689c313, 2019-01-14"
+   sodipodi:docname="cerca_off.svg">
+  <defs
+     id="defs2">
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient842">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0.32028469"
+         offset="0"
+         id="stop838" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop840" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient842"
+       id="radialGradient844"
+       cx="4.6095376"
+       cy="290.89627"
+       fx="4.6095376"
+       fy="290.89627"
+       r="1.8892902"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.1490804,0,0,1.1490804,-208.85235,-125.74979)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#000000"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="16"
+     inkscape:cx="12.745219"
+     inkscape:cy="-1.9244315"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     units="px"
+     inkscape:window-width="3840"
+     inkscape:window-height="2037"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata5">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Livello 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-288.53334)">
+    <circle
+       style="opacity:1;vector-effect:none;fill:url(#radialGradient844);fill-opacity:1;stroke:#78b1e2;stroke-width:0.52916664;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
+       id="path815"
+       cx="-204.02388"
+       cy="208.25554"
+       r="2.0189326"
+       transform="rotate(-45)" />
+    <rect
+       style="opacity:1;vector-effect:none;fill:#78b1e2;fill-opacity:1;stroke:none;stroke-width:0.25695357;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
+       id="rect817"
+       width="0.88468486"
+       height="3.6048934"
+       x="-204.46622"
+       y="210.94218"
+       ry="0.098359987"
+       transform="rotate(-45)" />
+    <path
+       style="fill:none;stroke:#78b1e2;stroke-width:0.52916664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="m 4.3892585,292.9226 0.7184244,0.71841"
+       id="path848"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>

+ 117 - 0
web/admin/imgs/cerca_on.svg

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32"
+   height="32"
+   viewBox="0 0 8.4666659 8.4666659"
+   version="1.1"
+   id="svg8"
+   inkscape:version="0.92.4 5da689c313, 2019-01-14"
+   sodipodi:docname="cerca_on.svg">
+  <defs
+     id="defs2">
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient842">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0.32028469"
+         offset="0"
+         id="stop838" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop840" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient842"
+       id="radialGradient844"
+       cx="4.6095376"
+       cy="290.89627"
+       fx="4.6095376"
+       fy="290.89627"
+       r="1.8892902"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.1490804,0,0,1.1490804,-208.85235,-125.74979)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#000000"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="16"
+     inkscape:cx="26.946815"
+     inkscape:cy="-0.91629272"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     units="px"
+     inkscape:window-width="3840"
+     inkscape:window-height="2037"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     showguides="true"
+     inkscape:guide-bbox="true">
+    <sodipodi:guide
+       position="3.0623451,7.7597324"
+       orientation="0,1"
+       id="guide2158"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="7.8424147,0.74000644"
+       orientation="0,1"
+       id="guide2160"
+       inkscape:locked="false" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata5">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Livello 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-288.53334)">
+    <circle
+       style="opacity:1;vector-effect:none;fill:url(#radialGradient844);fill-opacity:1;stroke:#ffffff;stroke-width:0.52916664;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
+       id="path815"
+       cx="-204.02388"
+       cy="208.25554"
+       r="2.0189326"
+       transform="rotate(-45)" />
+    <rect
+       style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.25691039;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
+       id="rect817"
+       width="0.88468486"
+       height="3.6048934"
+       x="-204.46622"
+       y="210.94218"
+       ry="0.098359987"
+       transform="rotate(-45)" />
+    <path
+       style="fill:none;stroke:#ffffff;stroke-width:0.52916664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="m 4.3892585,292.9226 0.7184244,0.71841"
+       id="path848"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>

+ 76 - 0
web/admin/imgs/esci.svg

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32"
+   height="32"
+   viewBox="0 0 8.4666659 8.4666659"
+   version="1.1"
+   id="svg8"
+   inkscape:version="0.92.4 5da689c313, 2019-01-14"
+   sodipodi:docname="esci.svg">
+  <defs
+     id="defs2" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#000000"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="16"
+     inkscape:cx="26.946815"
+     inkscape:cy="-0.91629272"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     units="px"
+     inkscape:window-width="3840"
+     inkscape:window-height="2037"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     showguides="true"
+     inkscape:guide-bbox="true">
+    <sodipodi:guide
+       position="3.0623451,7.7597324"
+       orientation="0,1"
+       id="guide2158"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="7.8424147,0.74000644"
+       orientation="0,1"
+       id="guide2160"
+       inkscape:locked="false" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata5">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Livello 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-288.53334)">
+    <path
+       inkscape:connector-curvature="0"
+       style="opacity:1;fill:#78b1e2;fill-opacity:1;stroke:none;stroke-width:2.43416643;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
+       d="M 1.6121621,289.27385 V 296.26 h 5.2423418 v -6.98615 z m 2.8858015,1.96623 1.9202317,1.52661 -1.9202317,1.5266 v -0.77634 h -2.449493 v -1.50052 h 2.449493 z"
+       id="rect3380" />
+  </g>
+</svg>

+ 8 - 15
web/admin/index.html

@@ -9,25 +9,18 @@
 <link rel="icon" type="image/png" href="imgs/icona-192.png" sizes="192x192">
 <link rel="icon" type="image/png" href="imgs/icona-512.png" sizes="512x512">
 <link rel="apple-touch-icon-precomposed" href="imgs/icona-180.png">
-<link rel="stylesheet" type="text/css" href="theme.css?v=0">
+<link rel="stylesheet" type="text/css" href="theme.css?v=1">
 </head>
 <body>
+<div id="fullscreen">
+<div id="middlerow">
 <div id="intro">
 <p>Ciao,<br>
-<a href="index.php">qui</a>, con nome utente “bida” e password uguale, puoi testare quel che c’è della sezione di admin per il “suggeritore d’istanze mastodon” che sto sviluppando per la <a href="https://rame.altervista.org/mastostart">Mastodon Startpage</a>. Quel che c’è, al momento, è il “browser di istanze lato admin”, uno strumento che permette di “sfogliare” e cercare-ordinare secondo tanti criteri un database di metadati relativi a tante istanze mastodon.<br>
-Qualche parola sul progetto nel suo insieme, per come l’avevamo pensato io che son <a href="https://mastodon.bida.im/@pongrebio">pongrebio</a> e <a href="https://mastodon.bida.im/@Ca_Gi">Ca_Gi</a>. In pratica si dovrebbe comporre di vari aggeggi, alcuni dei quali ci sono già, altri no:</p>
-<ul>
-<li>un crawler (c’è) che periodicamente recupera e salva-aggiorna in un database tutti i metadati disponibili relativi alle istanze note a cinque istanze italiane amiche, che al momento sono <a href="https://mastodon.bida.im">bida</a>, <a href="https://mastodon.cisti.org">cisti</a>, <a href="https://nebbia.fail">nebbia</a> (da un po’ di tempo è rotta), <a href="https://snapj.saja.freemyip.com">snapj</a> e <a href="https://stereodon.social">stereodon</a>, tenendo conto delle rispettive “blacklist” (liste di istanze bloccate), ovvero marcando come tali le istanze blacklistate da una qualsiasi delle cinque istanze amiche, e marcando inoltre come “papabili” le istanze che corrispondono a certi criteri, al momento questi: l’istanza non è blacklistata, la registrazione di nuovi account è aperta, il numero di utenti è compreso tra 10 e 30.000, il numero di istanze note all’istanza è maggiore di 500, il numero di utenti attivi negli ultimi 30 giorni è maggiore di 10;</li>
-<li>una sezione di admin con:</li>
-<ul>
-<li>un “browser di istanze lato admin” (c’è);</li>
-<li>una pagina (non c’è) che dia la possibilità, per ciascuna istanza, di scegliere se renderla visibile tramite il “browser di istanze lato utente” e se mostrarla sulla “prima pagina” dello stesso, e di poterne editare alcuni metadati aggiuntivi/alternativi rispetto a quelli “standard” recuperati dal crawler: una descrizione alternativa (perché quella impostata dagli admin e disponibile tra i metadati “standard” recuperabili dal crawler è spesso troppo vaga o troppo scarna o troppo lunga), una localizzazione geografica (relativa al collettivo o al singolo che gestisce l’istanza, non alla collocazione del server; metadato non presente tra quelli “standard”), le lingue più impiegate sull’istanza (quella dichiarata nei metadati “standard” recuperabili dal crawler spesso non corrisponde a quella maggiormente impiegata realmente sull’istanza, e ci sono istanze multilingue), modalità di finanziamento (metadato non presente tra quelli “standard”), restrizioni (policy) sui contenuti postabili (metadato non presente tra quelli “standard”), tag descrittive riassuntive del tipo di istanza (metadato non presente tra quelli “standard”); tutti questi metadati aggiuntivi/alternativi sono già strutturati nel database e sono visibili-ricercabili tramite il “browser di istanze lato admin”;</li>
-<li>una pagina (non c’è) per la gestione degli account admin;</li>
-</ul>
-<li>un “browser di istanze lato utente” (non c’è).</li>
-</ul>
-<p>Se vuoi darmi una mano sullo sviluppo, il codice si trova <a href="https://git.lattuga.net/pongrebio/MastodonStartpage">qui</a>, nella cartella web/admin.<br>
-Per segnalare bachi o chiedere qualsiasi info aggiuntiva <a href="https://mastodon.bida.im/@pongrebio">scrivimi su mastodon</a>.</p>
+<a href="index.php">qui</a>, con nome utente “bida” e password uguale, puoi provare quel che c’è della sezione di admin per il “suggeritore d’istanze mastodon” della <a href="https://rame.altervista.org/mastostart">Mastodon Startpage</a>.<br>
+Quel che c’è, al momento, è il “browser di istanze lato admin”, uno strumento che permette di “sfogliare” e cercare-ordinare secondo tanti criteri un database di metadati relativi a tante istanze mastodon (per visualizzare il pannello di ricerca e ordinamento clicca sull’icona con la lente in alto a destra).<br>
+Se vuoi segnalare bachi e/o collaborare in altro modo al progetto della Mastodon Startpage, <a href="https://git.lattuga.net/pongrebio/MastodonStartpage">qui c’è il repo git del progetto</a>; nel wiki trovi una spiegazione abbastanza dettagliata di come si pensa di svilupparlo, quel che c’è e quel che manca.</p>
+</div>
+</div>
 </div>
 </body>
 </html>

+ 10 - 11
web/admin/instances.php

@@ -439,14 +439,14 @@ if ($cinstsp<1) {
 		$out.='<table class="bigtab">'.N;
 //		$out.='<thead><tr><th class="tdattr">Attributi</th><th>Info</th></thead>'.N;
 		$out.='<tbody>'.N;
-		$out.='<tr><td colspan="2" class="insthead">'.$row['URI'].' ('.($finst+$ci).'/'.$cinsts.')<!-- - <a href="edinst.php?id='.$row['IID'].'">Modifica</a>--></td></tr>'.N;
+		$out.='<tr><td colspan="2" class="insthead">'.$row['URI'].' ('.($finst+$ci).'/'.$cinsts.') - <a href="edinst.php?id='.$row['IID'].'">Modifica</a></td></tr>'.N;
 		$attr=booly(trimname($cols['Instances.Blacklisted']['name']).': ',$row['Blacklisted'],false,true).N;
 		$attr.=booly(trimname($cols['Instances.New']['name']).': ',$row['New'],true).N;
 		$attr.=booly(trimname($cols['Instances.Good']['name']).': ',$row['Good']).N;
 		$attr.=booly(trimname($cols['Instances.Chosen']['name']).': ',$row['Chosen']).N;
 		$attr.=booly(trimname($cols['Instances.Visible']['name']).': ',$row['Visible']).N;
-/*		$attr.=booly(trimname($cols['Instances.RegOpen']['name']).': ',$row['RegOpen']).N;
-		$attr.=booly(trimname($cols['Instances.RegReqApproval']['name']).': ',$row['RegReqApproval'],true,true).N;*/
+/*		$attr.=booly($cols['Instances.RegOpen']['name'].': ',$row['RegOpen']).N;
+		$attr.=booly($cols['Instances.RegReqApproval']['name'].': ',$row['RegReqApproval'],true,true).N;*/
 		$sres=mysqli_query($link,'SELECT * FROM InstChecks WHERE InstID='.$row['IID'].' ORDER BY Time DESC')
 			or muoribene(mysqli_error($link),true);
 		$csres=mysqli_num_rows($sres);
@@ -664,13 +664,15 @@ function ulsh(el,sh) {
 }
 function shideplancia() {
 	var plancia=document.getElementById('plancia');
-	var plctrl=document.getElementById('plctrl');
+	var plctrl=document.getElementById('lente');
 	if (plancia.style.display=='block') {
 		plancia.style.display='none';
-		plctrl.innerHTML='Mostra plancia';
+		lente.src='imgs/cerca_off.svg';
+		lente.title='Mostra il pannello di ricerca e ordinamento';
 	} else {
 		plancia.style.display='block';
-		plctrl.innerHTML='Nascondi plancia';
+		lente.src='imgs/cerca_on.svg';
+		lente.title='Nascondi il pannello di ricerca e ordinamento';
 	}
 }
 function hent(str) {
@@ -1226,8 +1228,8 @@ function gotopage(pi) {
 <?php echo($menuout); ?>
 </ul>
 <div id="rightdiv">
-	<div id="plctrl" class="rlinks" onclick="shideplancia();">Mostra plancia</div>
-	<div id="logout" class="rlinks" onclick="document.location.href='logout.php'"><a href="logout.php">Esci</a></div>
+	<img src="imgs/cerca_off.svg" id="lente" class="rlinks" title="Mostra il pannello di ricerca e ordinamento" onclick="shideplancia();">
+	<a href="logout.php" class="rlinks"><img src="imgs/esci.svg" title="Esci"></a>
 </div>
 </div>
 </nav>
@@ -1242,9 +1244,6 @@ function gotopage(pi) {
 
 <div id="footer">
 <?php echo($pgout); ?>
-<!-- <form action="edinst.php" name="addinst" method="post">
-<table><tr><td>Aggiungi un’istanza:</td><td><input type="text" name="URI" maxlength="512"></td><td><input type="button" value="Vai" onClick="ckaif();"></td></tr></table>
-</form> -->
 </div>
 
 <div id="debug">

+ 44 - 8
web/admin/theme.css

@@ -404,8 +404,8 @@ input {
 }
 .rlinks {
 	float: left;
-	padding-left: 10px;
-	padding-right: 10px;
+	padding-left: 5px;
+	padding-right: 5px;
 	text-align: center;
 }
 .rlinks a {
@@ -496,7 +496,8 @@ input {
 }
 /*720x1280*/
 .edtab td {
-	padding: 3px;
+	padding: 6px;
+	line-height: 14pt;
 	text-align: left;
 	vertical-align: top;
 /*	word-break: break-word;*/
@@ -510,22 +511,52 @@ input {
 .edtab .right {
 	width: 99%;
 }
-.edtab .tarea {
+.edtab .tarea, .mselect {
+	display: block;
 	width: 100%;
 	resize: none;
 	padding: 3px;
 	border-radius: 3px;
-	border: 1px;
+	border: 1px solid darkgrey;
+}
+.edtab .search {
+	width: 100%;
+	padding: 3px;
+	border-radius: 3px;
+	border: 1px solid darkgrey;
+	margin-bottom: 1px;
+	font-size: 9pt;
+}
+.edtab label {
+	font-weight: bold;
+}
+.ruler {
+	width: 100%;
+	height: 12px;
+}
+.tit {
+	background-color: #6f916f;
+	color: white;
+	text-align: center;
+	border-radius: 3px;
+	margin-bottom: 6px;
 }
 
 .cbtab {
-	background-color: red;
 	border-spacing: 0;
 }
 .cbtab td {
 	border-radius: 0;
 	padding: 0;
-	border: none;
+}
+
+.picktab {
+	border-spacing: 0;
+	width: 100%;
+}
+.picktab td {
+	border-radius: 0;
+	padding: 0;
 }
 
 #pageselect {
@@ -547,13 +578,15 @@ input {
 }
 
 #intro {
-	width:800px;
+	width:720px;
 	margin-left:auto;
 	margin-right:auto;
 	padding:10px;
+	text-align: left;
 	font-size:14pt;
 	line-height: 18pt;
 	background-color:lightgrey;
+	border-radius: 6px;
 }
 #intro p, ul {
 	margin-bottom: 10px;
@@ -564,4 +597,7 @@ input {
 		width: 244px;
 		min-width: 244px;
 	}
+	#intro {
+		width: 360px;
+	}
 }