Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label generator #20

Merged
merged 114 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
b00d6f2
Merge pull request #490 from BioKIC/master
egbot Jul 23, 2020
4d6ad2b
Merge pull request #491 from BioKIC/master
egbot Jul 23, 2020
b30e9e3
Merge pull request #492 from BioKIC/master
egbot Jul 24, 2020
49534a2
Merge pull request #493 from BioKIC/master
egbot Jul 24, 2020
1232c90
Merge pull request #494 from BioKIC/master
egbot Jul 24, 2020
1935004
Merge pull request #495 from BioKIC/master
egbot Jul 28, 2020
ebf067f
Merge pull request #496 from BioKIC/master
egbot Jul 30, 2020
43f7d90
Merge pull request #497 from BioKIC/master
egbot Jul 30, 2020
7ef3549
Merge pull request #498 from BioKIC/master
egbot Jul 30, 2020
1de25a6
Merge pull request #499 from BioKIC/master
egbot Jul 31, 2020
dc6c175
Merge pull request #500 from BioKIC/master
egbot Aug 14, 2020
3cc85c4
Merge pull request #501 from BioKIC/master
egbot Aug 14, 2020
c33f2c1
Merge pull request #502 from BioKIC/master
egbot Aug 14, 2020
21d0ec8
Merge pull request #503 from BioKIC/master
egbot Aug 27, 2020
0682cca
Merge pull request #504 from BioKIC/master
egbot Aug 28, 2020
2a5f07e
Merge pull request #505 from BioKIC/master
egbot Aug 28, 2020
8f573db
Merge pull request #506 from BioKIC/master
egbot Sep 1, 2020
1b741bd
Merge pull request #507 from BioKIC/master
egbot Sep 1, 2020
51bdd65
Merge pull request #508 from BioKIC/master
egbot Sep 2, 2020
9104b79
Merge pull request #509 from BioKIC/master
egbot Sep 4, 2020
b1f2906
Merge pull request #510 from BioKIC/master
egbot Sep 9, 2020
ca2c962
Merge pull request #511 from BioKIC/master
egbot Sep 11, 2020
3a0e1ee
Merge pull request #512 from BioKIC/master
egbot Sep 11, 2020
984fb11
Merge pull request #513 from BioKIC/master
egbot Sep 11, 2020
e6e649e
Merge pull request #514 from BioKIC/master
egbot Sep 11, 2020
91a35ed
Merge pull request #515 from BioKIC/master
egbot Sep 11, 2020
8313dd3
Merge pull request #516 from BioKIC/master
egbot Sep 12, 2020
4d8f856
Merge pull request #517 from BioKIC/master
egbot Sep 12, 2020
ea74748
Merge pull request #518 from BioKIC/master
egbot Sep 15, 2020
d343719
Merge pull request #519 from BioKIC/master
egbot Sep 15, 2020
683eac0
Merge pull request #520 from BioKIC/master
egbot Sep 18, 2020
7c3157e
Merge pull request #521 from BioKIC/master
egbot Sep 18, 2020
f4f1da4
Merge pull request #522 from BioKIC/master
egbot Sep 18, 2020
700419e
Merge pull request #523 from BioKIC/master
egbot Sep 18, 2020
478248c
Merge pull request #524 from BioKIC/master
egbot Sep 21, 2020
e4807dd
Merge pull request #525 from BioKIC/master
egbot Sep 23, 2020
1c572e7
Merge pull request #526 from BioKIC/master
egbot Oct 2, 2020
004d5f7
Merge pull request #527 from BioKIC/master
egbot Oct 6, 2020
6c8d2ba
Merge pull request #528 from BioKIC/master
egbot Oct 6, 2020
4fdff23
Merge pull request #529 from BioKIC/master
egbot Oct 7, 2020
5024188
Merge pull request #530 from BioKIC/master
egbot Oct 12, 2020
96eb008
Merge pull request #531 from BioKIC/master
egbot Oct 13, 2020
15dec01
Merge pull request #532 from BioKIC/master
egbot Oct 13, 2020
19c0134
Merge pull request #533 from BioKIC/master
egbot Oct 13, 2020
d82f954
Merge pull request #534 from BioKIC/master
egbot Oct 14, 2020
ecf6f5b
Merge pull request #535 from BioKIC/master
egbot Oct 15, 2020
321372f
Merge pull request #536 from BioKIC/master
egbot Oct 16, 2020
c180c08
Merge pull request #537 from BioKIC/master
egbot Oct 17, 2020
62ec93f
Merge pull request #538 from BioKIC/master
egbot Oct 17, 2020
c711d48
Merge pull request #539 from BioKIC/master
egbot Oct 17, 2020
a31c0a7
Merge pull request #540 from BioKIC/master
egbot Oct 20, 2020
bd4af31
Merge pull request #541 from BioKIC/master
egbot Oct 20, 2020
30e5e91
Merge pull request #542 from BioKIC/master
egbot Oct 21, 2020
a332a66
Merge pull request #544 from BioKIC/master
egbot Oct 24, 2020
279e76c
Merge pull request #545 from BioKIC/master
egbot Oct 28, 2020
1404a30
Merge pull request #546 from BioKIC/master
egbot Oct 28, 2020
99e706c
Merge pull request #547 from BioKIC/master
egbot Oct 30, 2020
7e50bbb
Merge pull request #548 from BioKIC/master
egbot Oct 30, 2020
37bf26c
Merge pull request #549 from BioKIC/master
egbot Oct 30, 2020
162353e
Merge pull request #550 from BioKIC/master
egbot Oct 30, 2020
29b4f2b
Merge pull request #551 from BioKIC/master
egbot Oct 30, 2020
e785a3e
Merge pull request #552 from BioKIC/master
egbot Nov 3, 2020
d5df702
Merge pull request #553 from BioKIC/master
egbot Nov 4, 2020
a5c58c6
Merge pull request #554 from BioKIC/master
egbot Nov 4, 2020
04023ab
Merge pull request #555 from BioKIC/master
egbot Nov 6, 2020
48014c0
Merge pull request #556 from BioKIC/master
egbot Nov 6, 2020
229db9f
Merge pull request #557 from BioKIC/master
egbot Nov 7, 2020
fa0fb6a
Merge pull request #558 from BioKIC/master
egbot Nov 8, 2020
d83b9be
Merge pull request #559 from BioKIC/master
egbot Nov 9, 2020
ee68421
Merge pull request #560 from BioKIC/master
egbot Nov 9, 2020
55b0834
Merge pull request #561 from BioKIC/master
egbot Nov 9, 2020
7a7d21a
Merge pull request #562 from BioKIC/master
egbot Nov 10, 2020
61e531c
Merge pull request #563 from BioKIC/master
egbot Nov 10, 2020
249b95c
Merge pull request #564 from BioKIC/master
egbot Nov 11, 2020
6b95b20
Merge pull request #565 from BioKIC/master
egbot Nov 11, 2020
f465025
Merge pull request #566 from BioKIC/master
egbot Nov 11, 2020
fa01381
Merge pull request #567 from BioKIC/master
egbot Nov 11, 2020
5cae7c9
Merge pull request #568 from BioKIC/master
egbot Nov 17, 2020
a14f373
Merge pull request #569 from BioKIC/master
egbot Nov 17, 2020
a10f21a
Merge pull request #570 from BioKIC/master
egbot Nov 18, 2020
5495bb3
Merge pull request #571 from BioKIC/master
egbot Nov 19, 2020
96794ed
Merge pull request #572 from BioKIC/master
egbot Nov 20, 2020
dee96e7
Merge pull request #573 from BioKIC/master
egbot Nov 20, 2020
760ba0f
Merge pull request #574 from BioKIC/master
egbot Nov 23, 2020
eb47092
Merge pull request #575 from BioKIC/master
egbot Nov 25, 2020
5170440
Merge pull request #576 from BioKIC/master
egbot Nov 25, 2020
1dec2f4
Merge pull request #577 from BioKIC/master
egbot Nov 26, 2020
1c7fe7d
Merge pull request #578 from BioKIC/master
egbot Nov 26, 2020
b3e5592
Merge pull request #579 from BioKIC/master
egbot Nov 30, 2020
474e63a
Merge pull request #580 from BioKIC/master
egbot Dec 1, 2020
179c544
Merge pull request #581 from BioKIC/master
egbot Dec 1, 2020
346bd6a
Merge pull request #582 from BioKIC/master
egbot Dec 1, 2020
74dd871
Merge pull request #583 from BioKIC/master
egbot Dec 1, 2020
127cce7
Merge pull request #584 from BioKIC/master
egbot Dec 4, 2020
a32bf17
Merge pull request #585 from BioKIC/master
egbot Dec 4, 2020
a8325a7
Merge pull request #586 from BioKIC/master
egbot Dec 4, 2020
7c86c31
Merge pull request #587 from BioKIC/master
egbot Dec 4, 2020
7879dae
Merge pull request #588 from BioKIC/master
egbot Dec 5, 2020
5040704
Merge pull request #589 from BioKIC/master
egbot Dec 7, 2020
6cf3962
Merge pull request #590 from BioKIC/master
egbot Dec 8, 2020
636f00f
Merge pull request #591 from BioKIC/master
egbot Dec 8, 2020
8748b64
Merge pull request #592 from BioKIC/master
egbot Dec 9, 2020
baa6982
Merge pull request #593 from BioKIC/master
egbot Dec 9, 2020
e628b2c
Merge pull request #594 from BioKIC/master
egbot Dec 9, 2020
0a40202
Merge pull request #595 from BioKIC/master
egbot Dec 9, 2020
6702b2e
Merge pull request #596 from BioKIC/master
egbot Dec 10, 2020
a255f33
Merge pull request #597 from BioKIC/master
egbot Dec 10, 2020
18090b6
Merge pull request #598 from BioKIC/master
egbot Dec 11, 2020
820e5b0
Merge pull request #599 from BioKIC/master
egbot Dec 11, 2020
2e64c03
Merge pull request #600 from BioKIC/master
egbot Dec 18, 2020
9b10141
Merge pull request #601 from BioKIC/master
egbot Dec 18, 2020
5f09cb3
Merge pull request #602 from BioKIC/master
egbot Dec 21, 2020
bbce7a6
Merge pull request #603 from BioKIC/master
egbot Dec 22, 2020
a4a4938
Implements label format visual editor
arbolitoloco Dec 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
350 changes: 350 additions & 0 deletions collections/reports/labeljsongui.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,350 @@
<?php
include_once('../../config/symbini.php');
header("Content-Type: text/html; charset=".$CHARSET);
?>
<html>
<head>
<title>Label Content Format Visual Editor</title>
<?php
$activateJQuery = false;
if(file_exists($SERVER_ROOT.'/includes/head.php')){
include_once($SERVER_ROOT.'/includes/head.php');
}
else{
echo '<link href="'.$CLIENT_ROOT.'/css/jquery-ui.css" type="text/css" rel="stylesheet" />';
echo '<link href="'.$CLIENT_ROOT.'/css/base.css?ver=1" type="text/css" rel="stylesheet" />';
echo '<link href="'.$CLIENT_ROOT.'/css/main.css?ver=1" type="text/css" rel="stylesheet" />';
}
?>
<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>
</head>
<body>
<main>
<div>
<div id="fields">
<h4>Fields Available</h4>
<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="taxon">Taxon</option>
<option value="determination">Determination</option>
<option value="event">Event</option>
<option value="locality">Locality</option>
</select>
<div id="fields-list" class="container"></div>
</div>
</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> -->
<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>
<button class="btn" onClick="addLine()">Add line (fieldBlock)</button>
<!-- <div id="label-footer">
<h5 class='area-title'>Label Footer</h5>
</div> -->
</div>
</div>
<div id="preview">
<h4>Label preview</h4>
<h5>content automatically displayed below</h5>
<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>
</div>
</div>
<div>
<div id="controls">
<div id="field-options">
<h4>Field Options</h4>
<div>
<div>
<label for="prefix">Prefix:</label>
<input type="text" name="prefix" id="prefix" class="control" disabled="true" data-group="field">
</div>
<div>
<label for="suffix">Suffix:</label>
<input type="text" name="suffix" id="suffix" class="control" disabled="true" data-group="field">
</div>
</div>
</div>
<div id="field-block-options">
<h4>Line Options</h4>
<div>
<label for="delimiter">Fields Delimiter:</label>
<input type="text" name="delimiter" id="delimiter" class="control" disabled="true" data-group="field-block">
</div>
</div>
</div>
</div>
</main>
</body>
<script src="../../js/symb/collections.labeljsongui.js"></script>
</html>
25 changes: 24 additions & 1 deletion css/symb/labelhelpers.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
.controls {
display: none;
}

.body {
width: auto;
margin-left: auto;
Expand Down Expand Up @@ -184,6 +183,18 @@
font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.font-type-sans {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

.font-type-serif {
font-family: Georgia, Cambria, 'Times New Roman', Times, serif;
}

.font-type-mono {
font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.text-center {
text-align: center;
}
Expand All @@ -196,6 +207,18 @@
text-align: justify;
}

.text-align-center {
text-align: center;
}

.text-align-right {
text-align: right;
}

.text-align-justify {
text-align: justify;
}


/* Base font size should be defined
* in points or pixels, because these are
Expand Down
Loading