lx-scan
Version:
License eXtension to find 5-tuples of all installed packages: name, version, project home page, license (e. g. Apache v2, BSD) and required notice. It includes a GUI to edit information for each package and to enter information if necessary.
206 lines (200 loc) • 8.19 kB
HTML
<html>
<head>
<title>{{title}}</title>
<script src="/resources/scripts/jquery.min.js"></script>
<script src="/resources/dist/js/bootstrap.min.js"></script>
<script src="/resources/scripts/indexjs.js"></script>
<script>
var errortext = [];
{{#each err}}
errortext.push("{{this}}");
{{/each}}
indexJS({jfile: "{{jfile}}", path:"{{path}}",errortext:errortext});
</script>
<link rel="stylesheet" type="text/css" href="/resources/styles/indexstyle.css" />
<link rel="stylesheet" type="text/css" href="/resources/dist/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="/resources/styles/spinny.css" />
<style type="text/css">
</style>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<ul class="nav navbar-nav" id="menu">
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">File</a>
<ul class="dropdown-menu" role="menu">
<li id="menulink"><a id="openlink" href="/browse?caller=/open&jfile={{jfile}}">Open</a></li>
{{#if path}}
<li id="sbutton"><a href="/save?jfile={{jfile}}&type=json&path={{path}}">Save</a></li>
{{/if}}
<li class="dropdown-submenu">
<a href="#" tabindex="-1">Save As</a>
<ul class="dropdown-menu">
<li><a id="htmllink" href="/save/options?type=html&jfile={{jfile}}&path={{path}}&oldpath={{path}}">HTML</a></li>
<li><a id="jsonlink" href="/save/options?type=json&caller=/save&jfile={{jfile}}&path={{path}}&oldpath={{path}}">JSON</a></li>
</ul>
</li>
<li><a href="/close">Exit</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Scan</a>
<ul class="dropdown-menu" role="menu">
<li><a href="/browse?jfile={{jfile}}&path={{path}}&caller=/scan?scan=true" id="nodelink">Node package</a></li>
<li><a href="/browse?jfile={{jfile}}&path={{path}}&scantype=python&caller=/scan?scan=true">Python package</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">View</a>
<ul class="dropdown-menu">
{{#if terse}}
<li><a id="verboselink" href="/?jfile={{jfile}}&path={{path}}">All</a></li>
{{/if}}
{{#unless terse}}
<li><a id="terselink" href="/terse?jfile={{jfile}}&path={{path}}">...Only broken</a></li>
{{/unless}}
<li><a href="/log?jfile={{jfile}}&path={{path}}&terse={{terse}}" id="loglink">Save log</a></li>
</ul>
</li>
</ul>
</div>
<br /><br />
<div id="lightbox" class="modal fade" aria-hidden="true" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" style="background: #26343F;color:white;">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body" style="background: #26343F;color:white">
<form action="/upload/" method="post"
enctype="multipart/form-data" id="dialog" onsubmit="return checkpath(this);" role="form">
<div class="form-group">
<label>Editing license:</label>
<div class="input-group"> <input type="text" name="entry" id="entry" value="" class="form-control" autocomplete="off" readonly>
<div class="input-group-addon">
<select id="lnumber" name="lnumber" form="dialog"></select>
</div>
</div>
</div>
<div class="form-group filehide" id="file0">
<label>New license file: </label>
<div id="newlinkdiv" class="input-group">
<input type="text" name="newlink" id="newlink" class="form-control" autocomplete="off">
<span class="input-group-btn filetoggle">
<span class="btn btn-default input-grp-btn">Switch to file input</span>
</span>
</div>
</div>
<div class="form-group filehide" id="file1">
<label>New license file: </label>
<div id="newfilediv" class="input-group">
<span class="input-group-btn">
<span class="btn btn-default btn-file input-grp-btn">
Browse <input type="file" name="file" id="file" class="form-control">
</span>
</span>
<input class="form-control" id="filetext" type="text" disabled>
<span class="input-group-btn filetoggle">
<span class="btn btn-default input-grp-btn">Switch to URL input</span>
</span>
</div>
</div>
<div class="form-group">
<label>New homepage:</label>
<div class="input-group">
<input type="text" name="home" id="home" value="" autocomplete="off" class="form-control">
</div>
</div>
<div class="form-group">
<label>License type:</label>
<div id="ltype" class="">
<select name="type" id="type" form="dialog" onchange="toggleOtherBox()" class="form-control">
<option value="noch">No change</option>
<option value="apa">Apache v2</option>
<option value="bsd">BSD</option>
<option value="isc">ISC</option>
<option value="mit">MIT</option>
<option value="oth">Other</option>
</select>
</div>
</div>
<div class="form-group" id="change">
<label>New license type:</label>
<div class="input-group">
<input type="text" name="lchange" id="lchange" value ="" class="form-control" autocomplete="off">
</div>
</div>
<div class="form-group">
<label>Notice: </label>
<div class="input-group"><input type="text" name="notice" id="notice" value="Click to modify" autocomplete="off" class="form-control"></div>
</div>
<div class="form-group">
<div class="input-group">
<button type="submit" class="btn btn-default" onclick="subform2();">Submit</button>
</div>
</div>
<div style="display:none"><input type="text" name="jfile" id="jfile"></div>
<div style="display:none"><input type="text" name="path" id="path"></div>
</form>
</div>
</div>
</div>
</div>
{{#resCount}}{{/resCount}}
<div class="container-fluid">
{{#each packages}}
{{#2cif ../terse licensefile.0.notice}}
{{#ifmod @index 0 3}}
<div class="row">
{{/ifmod}}
<div id="{{label}}" class="col-xs-4" >
<div class="thumbnail license"
{{#n2cif ../../terse licensefile}}style="background: rgba(255,0,0,0.65)"{{/n2cif}}
{{#n2cif ../../terse licensefile.0.notice}}style="background: rgba(255,0,0,0.65)"{{/n2cif}}
id="thumbnail_{{label}}"
onclick="showbox(event,'{{label}}',[{{#each licensefile}}'{{notice}}',{{/each}}],{{licensefile.length}});">
<p>
<b> Name:</b> {{name}} <br />
<b> Label:</b> {{label}} <br />
<b> Home page: </b> <a href="{{homepage}}" target="_blank">{{homepage}}</a> <br /> <br />
<div style="">
{{#each licensefile}}
<b><u>License {{math @index "+" 1}}</u></b><br />
<div><b> License link:</b> <div style="word-wrap: break-word"><a href="/displaylicense?path={{licensepath}}&jfile={{../../../jfile}}&pack={{../label}}&index={{@index}}" id="{{../label}}/link{{math @index "+"1}}" target="_blank" class="licenselink">{{licensepath}}</a></div></div>
<br />
<div><b> Notice:</b> <span id="{{../label}}/notice{{math @index "+" 1}}"> {{notice}}</span></div><br />
{{#license}}
{{#if type}}
<b> License type:</b> {{type}} <br />
{{/if}}
{{#unless type}}
<b> License type:</b> {{this}} <br />
{{/unless}}
{{/license}}
{{/each}}
</div>
{{#license}}
{{#if type}}
<b> License type:</b> <span id="{{../../label}}/type">{{type}}</span> <br />
{{/if}}
{{#unless type}}
<b> License type:</b> <span id="{{../../label}}/type">{{this}}</span> <br />
{{/unless}}
{{/license}}
</p>
</div>
</div>
{{#ifmod @index 2 3}}
</div>
<div class="clearfix visible-xs"></div>
{{/ifmod}}
{{/2cif}}
{{/each}}
</div>
</body>
<script>
$("#file1").slideUp();
$(".filetoggle").click(function () {
$(".filehide").toggle();
});
</script>
</html>