Skip to content

Commit

Permalink
Merge pull request #21 from BioKIC/master
Browse files Browse the repository at this point in the history
Merge Symbiota-light developments into bryo-lichen code repository
  • Loading branch information
egbot authored Feb 11, 2021
2 parents be41b34 + f02d395 commit 1ddedee
Show file tree
Hide file tree
Showing 8 changed files with 587 additions and 561 deletions.
4 changes: 2 additions & 2 deletions classes/OccurrenceLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ private function setLabelFieldArr(){
'establishmentMeans'=>'o.establishmentmeans','lifeStage'=>'lifestage','sex'=>'sex','individualCount'=>'individualcount','samplingProtocol'=>'samplingprotocol','preparations'=>'preparations',
'country'=>'o.country', 'stateProvince'=>'o.stateprovince', 'county'=>'o.county', 'municipality'=>'o.municipality', 'locality'=>'o.locality', 'decimalLatitude'=>'o.decimallatitude',
'decimalLongitude'=>'o.decimallongitude', 'geodeticDatum'=>'o.geodeticdatum', 'coordinateUncertaintyInMeters'=>'o.coordinateuncertaintyinmeters', 'verbatimCoordinates'=>'o.verbatimcoordinates',
'minimumelevationinmeters'=>'o.minimumelevationinmeters', 'maximumelevationinmeters'=>'o.maximumelevationinmeters',
'elevationInMeters'=>'CONCAT_WS(" - ",o.minimumelevationinmeters,o.maximumelevationinmeters) AS elevationinmeters', 'verbatimElevation'=>'o.verbatimelevation',
'minimumElevationInMeters'=>'o.minimumelevationinmeters', 'maximumElevationInMeters'=>'o.maximumelevationinmeters',
'elevationInMeters'=>'CONCAT_WS(" - ",o.minimumElevationInMeters,o.maximumElevationInMeters) AS elevationinmeters', 'verbatimElevation'=>'o.verbatimelevation',
'minimumDepthInMeters'=>'minimumdepthinmeters', 'maximumDepthInMeters'=>'maximumdepthinmeters', 'verbatimDepth'=>'verbatimdepth',
'disposition'=>'o.disposition', 'storageLocation'=>'storagelocation', 'duplicateQuantity'=>'o.duplicatequantity', 'dateLastModified'=>'o.datelastmodified');
}
Expand Down
13 changes: 9 additions & 4 deletions collections/reports/labeldynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,19 @@
$headerStr = '';
if($hPrefix || $midStr || $hSuffix){
$headerStrArr = array();
$headerStrArr[] = trim($hPrefix);
// $headerStrArr[] = trim($hPrefix);
$headerStrArr[] = $hPrefix;
$headerStrArr[] = trim($midStr);
$headerStrArr[] = trim($hSuffix);
$headerStr = implode(" ",$headerStrArr);
// $headerStrArr[] = trim($hSuffix);
$headerStrArr[] = $hSuffix;
$headerStr = implode("",$headerStrArr);
}

$dupCnt = $_POST['q-'.$occid];
for($i = 0;$i < $dupCnt;$i++){
$labelCnt++;
if($columnCount == 'packet'){
echo '<div class="foldMarks1"><span style="float:left;">+</span><span style="float:right;">+</span></div>';
echo '<div class="page"><div class="foldMarks1"><span style="float:left;">+</span><span style="float:right;">+</span></div>';
echo '<div class="foldMarks2"><span style="float:left;">+</span><span style="float:right;">+</span></div>';
}
elseif($labelCnt%$columnCount == 1){
Expand Down Expand Up @@ -229,6 +231,9 @@
<?php
}
}
if($columnCount == 'packet'){
echo '</div>';
}
echo '</div>';
}
}
Expand Down
288 changes: 17 additions & 271 deletions collections/reports/labeljsongui.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,272 +18,21 @@
?>
<link rel="stylesheet" href="../../css/symb/labelhelpers.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<style>
body {
font-size: 14px;
line-height: 24px;
background-color: white;
min-width: 200px;
width: 100%;
margin: 0 auto;
}

main {
max-width: 960px;
margin: 0 auto;
display: grid;
grid-template-columns: 240px 420px 200px;
grid-gap: 1em;
align-items: start;
}

@media only screen and (max-width: 780px) {
main {
grid-template-columns: 100%;
}
}

main li {
list-style-type: none;
display: inline-block;
}


select.control {
display: block;
margin: 0.25em 0;
width: 100%;
}

input {
width: 100%;
}

h2,
h3,
h4 {
text-transform: uppercase;
font-weight: 400;
color: #909090;
letter-spacing: 2px;
}

h4,
h5 {
margin: 0.5em 0;
}

#fields-filter {
margin-bottom: 0.25em;
width: 100%;
}

#field-options>div {
display: inline-block;
margin: 1em 0;
}

#fields-list {
overflow-y: scroll;
height: 65vh;
}

#build-label {
background-color: #acacac;
/* min-height: 300px; */
grid-column: 1/2;
padding: 0.5em;
margin-top: 1em;
}

#build-label .delimiter {
height: 1em;
/* background-color: white; */
/* color: black; */
}

#label-middle {
border: 1px solid white;
}

#label-middle>.field-block {
border: 1px dashed white;
min-height: 2em;
}

.field-block.container.selected {
background-color: black;
}

#preview-label {
border: 1px solid gray;
min-height: 100px;
padding: 0.5em;
}

#preview-label>.field-block>div {
display: inline;
}

#field-block-options {
margin-top: 2em;
}

/** Button stuff **/
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
line-height: 1.15;
/* 1 */
margin: 0;
/* 2 */
}

li {
color: white;
font-weight: 600;
font-size: 0.8rem !important;
/* background: #a972cb;
border: 2px solid #a972cb; */
border-radius: 2px;
font: inherit;
line-height: 1;
margin: 0.5em;
padding: 0.25em 0.5em;
}

button.btn {
/* width: 220px; */
/* // background-color: darkslategrey; */
border-color: transparent;
border-radius: 2px;
/* color: white; */
text-transform: uppercase;
padding: 0.5em;
margin-top: 0.25em;
}

button.btn:hover {
background-color: rgb(168, 167, 167);
}

button.btn:focus {
outline: none;
}

button.control:disabled {
background: lightgray;
}

button.control:disabled,
button.control[disabled],
button.control:disabled:hover {
background: lightgray;
}

button.control {
color: white;
background: darkslategrey;
border: none;
border-right: 1px solid lightslategray;
/* border-radius: 2px; */
font: inherit;
line-height: 1;
padding: 0.5em;
outline: none;
/* width: 40px; */
height: 40px;
cursor: pointer;
}

button.control:hover {
background: rgb(61, 102, 102);
border: none;
line-height: 1;
border-right: 1px solid lightslategrey;
outline: none;
}

button .material-icons {
width: 24px;
}

button>.material-icons {
pointer-events: none;
}

span.material-icons:hover {
background-color: rgb(61, 102, 102);
}

.draggable.selected {
background-color: black;
border: 1px solid white;
}

.drag-icon {
background-color: white;
cursor: move;
}

[data-category='specimen'] {
background: #0da827;
border: 2px solid #0da827;
}

[data-category='collection'] {
background: #0da827;
border: 2px solid #0da827;
}

[data-category='taxon'] {
background: #077eb6;
border: 2px solid #077eb6;
}

[data-category='determination'] {
background: #1c4eda;
border: 2px solid #1c4eda;
}

[data-category='event'] {
background: #ee7bc8;
border: 2px solid #ee7bc8;
}

[data-category='locality'] {
background: #952ed1;
border: 2px solid#952ed1;
}

button.control.selected,
button.control.selected:hover {
background-color: black;
}

.draggable.dragging {
opacity: 1;
}


</style>
<style>
:root{--main-max-size:940px}html{color:#212529}body{min-width:760px!important;margin:0auto!important;font-size:14px;line-height:24px}main{max-width:var(--main-max-size);margin:0 auto;display:grid;grid-template-columns:1fr 2fr 1fr;grid-gap:1em;align-items:start}@media only screen and (max-width:var(--main-max-size)){main{grid-template-columns:100%}}main li{list-style-type:none;display:inline-block}#fields-filter{margin-bottom:.25em;width:100%}select.control{display:block;margin:.25em 0;width:100%}input{width:100%}h1{font-weight:400;max-width:var(--main-max-size);margin:0 auto}h1.title{padding-top:.5em}h1.subtitle{padding-bottom:.5em}h2,h3,h4{text-transform:uppercase;font-weight:500;letter-spacing:1px}h4,h5{margin:.5em 0}#field-options>div{display:inline-block;margin:1em 0}#fields-list{overflow-y:scroll;height:65vh}#fields-list .material-icons{display:none}#build-label{background-color:#acacac;grid-column:1/2;padding:.5em;margin-top:1em;max-height:40vh;overflow:scroll}#build-label li .material-icons{font-size:12px;padding-left:6px}#build-label>li span.material-icons:hover{background-color:none!important}#build-label .delimiter{height:1em}#label-middle{border:1px solid #fff}#label-middle>.field-block{border:1px dashed #fff;min-height:2em;line-height:10px;text-align:left!important;margin:0!important}#label-middle .draggable{font-family:inherit!important;font-size:normal!important;font-weight:400!important;font-style:normal!important;text-transform:none!important;float:none!important}.field-block.container.selected{background-color:#004b22}#preview-label{border:1px solid gray;min-height:100px;padding:.5em}#preview-label .field-block{line-height:1.1rem;overflow:auto}#preview-label>.field-block>div{display:inline}#field-block-options{margin-top:2em}.unclickable{pointer-events:none!important}#instructions{width:100%;background-color:rgba(255,255,255,.637);position:absolute;top:0}#instructions li{color:initial;line-height:normal}.instructions-content{max-width:var(--main-max-size);background-color:#f1f6f9;margin:2em auto;padding:2em;border:1px solid #212529}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}li{color:#fff;font-weight:600;font-size:.8rem!important;border-radius:2px;font:inherit;line-height:1;margin:.5em;padding:.25em .5em}button.btn{text-transform:uppercase}button.btn:hover{background-color:#a8a7a7}button.btn:focus{outline:0}button.control:disabled{background:#d3d3d3;cursor:not-allowed}button.control:disabled,button.control:disabled:hover,button.control[disabled]{background:#d3d3d3;cursor:not-allowed}button.control{color:#fff;background:#2f4f4f;border:none;border-right:1px solid #778899;font:inherit;line-height:1;padding:.5em;outline:0;height:40px;cursor:pointer}button.control:hover{background:#3d6666;border:none;line-height:1;border-right:1px solid #778899;outline:0}button .material-icons{width:24px}button>.material-icons{pointer-events:none}.field-block>span.material-icons.disabled{background:#d3d3d3;color:gray;cursor:not-allowed}.field-block>span.material-icons.disabled:hover{background:#d3d3d3}span.material-icons{cursor:pointer}span.material-icons:hover{background-color:#949494}.draggable.selected{background-color:#004b22;border:1px solid #fff}.drag-icon{background-color:#fff;cursor:move}[data-category=specimen]{background:#0da827;border:2px solid #0da827}[data-category=collection]{background:#0da827;border:2px solid #0da827}[data-category=taxon]{background:#077eb6;border:2px solid #077eb6}[data-category=determination]{background:#1c4eda;border:2px solid #1c4eda}[data-category=event]{background:#ee7bc8;border:2px solid #ee7bc8}[data-category=locality]{background:#952ed1;border:2px solid#952ed1}button.control.selected,button.control.selected:hover{background-color:#004b22}.draggable.dragging{opacity:1}
</style>
</head>
<body>
<main>
<div>
<div id="fields">
<h4>Fields Available</h4>
<p style="font-size:0.7em;line-height:1.4em">For field definitions please refer to the <a href="https://dwc.tdwg.org/terms/">Darwin Core Quick Reference Guide</a>.</p>
<label for="fields-filter">Filter fields by category:</label>
<select name="fields-filter" id="fields-filter">
<option value="all">All</option>
<option value="specimen">Specimen</option>
<option value="collection">Collection</option>
<!-- <option value="collection">Collection</option> -->
<option value="taxon">Taxon</option>
<option value="determination">Determination</option>
<option value="event">Event</option>
Expand All @@ -294,30 +43,27 @@
</div>
<div>
<div id="build">
<!-- <h4>Label Format</h4> -->
<div id="build-label">
<h4 style="color: #212529">Label Content Area</h4>
<h5>drag, drop & reorder fields here; click fields or lines to apply formats; toggle select/deselect by clicking once; reorder lines clicking on arrows</h5>
<!-- <div id="label-header">
<h5 class='area-title'>Label Heading</h5>
</div> -->
<p style="font-size:0.7em;line-height:1.4em">drag, drop & reorder fields here; click to select fields or lines to apply formats (only one item formattable at a time); reorder lines clicking on arrows; remove lines/fields clicking on "x"</p>
<div id="label-middle">
<div class="field-block container" draggable="true">
<span class="material-icons">keyboard_arrow_up</span><span class="material-icons">keyboard_arrow_down</span></div>
<div class="field-block container" data-delimiter=" ">
<span class="material-icons">close</span><span class="material-icons">keyboard_arrow_up</span><span class="material-icons">keyboard_arrow_down</span>
</div>
</div>
<button class="btn" onClick="addLine()">Add line (fieldBlock)</button>
<!-- <div id="label-footer">
<h5 class='area-title'>Label Footer</h5>
</div> -->
<button class="btn" onClick="addLine()">Add line</button>
</div>
</div>
<div id="preview">
<h4>Label preview</h4>
<h5>content automatically displayed below</h5>
<p style="font-size:0.7em;line-height:1.4em">content automatically displayed below</p>
<div id="preview-label"></div>
<button class="btn" onclick="printJson()">Display JSON</button>
<button class="btn" id='copyBtn' onclick="copyJson()" style="display: none;">Copy JSON to clipboard</button>
<textarea id="dummy" style="display: none;"></textarea>
<!-- <button class="btn" onclick="printJson()">Display JSON</button>
<button class="btn" onclick="loadJson()">Load JSON</button> -->
<!-- <button class="btn" id='copyBtn' onclick="copyJson()" style="display: none;">Copy JSON to clipboard</button> -->
<button class="btn" onclick="saveJson()">Save format & Close</button>
<button class="btn" onclick="cancelWindow()">Cancel & Close</button>
<textarea id="dummy" style="display: none; height: 300px; width: 100%;" data-format-id=""></textarea>
</div>
</div>
<div>
Expand Down
Loading

0 comments on commit 1ddedee

Please sign in to comment.