Skip to content

Commit 5333c18

Browse files
use Tagify in edit view close #394
for a smoother tag experience !
1 parent db242ac commit 5333c18

File tree

15 files changed

+233
-26
lines changed

15 files changed

+233
-26
lines changed

app/class/Controllerpage.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,14 @@ public function edit($page)
234234
exit;
235235
}
236236

237+
$servicetags = new Servicetags();
238+
239+
try {
240+
$datas['taglist'] = $servicetags->taglist();
241+
} catch (Filesystemexception $e) {
242+
Logger::errorex($e);
243+
}
244+
237245
$datas['faviconlist'] = $this->mediamanager->listfavicon();
238246
$datas['thumbnaillist'] = $this->mediamanager->listthumbnail();
239247
$datas['pagelist'] = $this->pagemanager->list();

app/view/templates/edit.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?php
22

3-
$this->layout('layout', ['title' => ''.$page->title(), 'stylesheets' => [$css . 'edit.css', Wcms\Model::jspath() . 'edit.bundle.css'], 'favicon' => $page->favicon()]) ?>
3+
$this->layout('layout', ['title' => ''.$page->title(), 'stylesheets' => [
4+
Wcms\Model::jspath() . 'edit.bundle.css',
5+
$css . 'edit.css',
6+
$css . 'tagcolors.css'
7+
], 'favicon' => $page->favicon()]) ?>
48

59

610

@@ -33,6 +37,7 @@
3337
const pageid = '<?= $this->e($page->id()) ?>';
3438
let pagetitle = '<?= $this->e($page->title()) ?>';
3539
let theme = '<?= $this->e($workspace->highlighttheme()) ?>';
40+
const taglist = <?= json_encode($taglist) ?>;
3641
</script>
3742
<script type="module" src="<?= Wcms\Model::jspath() ?>edit.bundle.js" async></script>
3843

app/view/templates/editleftbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class="toggle"
2121
<label for="description">Description :</label>
2222
<input type="text" name="description" id="description" value="<?= $page->description(); ?>" form="update">
2323
<label for="tag">Tag(s) :</label>
24-
<input type="text" name="tag" id="tag" value="<?= $page->tag('string'); ?>" form="update">
24+
<input type="text" name="tag" class="field" id="tag" value="<?= $page->tag('string'); ?>" form="update">
2525
<label for="secure">Privacy level :</label>
2626
<select name="secure" id="secure" form="update">
2727
<option value="0" <?= $page->secure() == Wcms\Page::PUBLIC ? 'selected' : '' ?>>public</option>

assets/css/base.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
color: var(--outline-color);
99
}
1010

11+
:focus-visible {
12+
outline: ridge 2px var(--outline-background-color);
13+
}
14+
1115
body {
1216
margin: 0;
1317
height: 100%;
@@ -21,12 +25,12 @@ body {
2125
color: var(--text-color);
2226
}
2327

24-
input, textarea, button, select {
28+
input, textarea, button, select, .field {
2529
border: none;
2630
accent-color: var(--main-color);
2731
}
2832

29-
input, textarea {
33+
input, textarea, .field {
3034
color: var(--input-color)!important;
3135
border-color: var(--input-color);
3236
background-color: var(--input-background-color);
@@ -43,7 +47,7 @@ h1, h2 {
4347
background-color: var(--main-color);
4448
}
4549

46-
a, button, input, select, textarea {
50+
a, button, input, select, textarea, .field {
4751
text-decoration: none;
4852
color: var(--text2-color);
4953
}

assets/css/edit.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,48 @@ div#geomap {
299299
height: 250px;
300300
}
301301

302+
/* __________ Tags _____________ */
303+
304+
.tagify {
305+
--tag-pad: 0 0;
306+
--tag-text-color: inherit;
307+
--tag-border-radius: 10px;
308+
--tag-inset-shadow-size: 0;
309+
--loader-size: 0;
310+
--tags-focus-border-color: transparent;
311+
display: block;
312+
}
313+
314+
:root {
315+
--tagify-dd-color-primary: var(--outline-background-color);
316+
--tagify-dd-item-pad: 5px;
317+
--tagify-dd-bg-color: var(--input-background-color);
318+
}
319+
320+
.tagify__tag {
321+
border-radius: 10px;
322+
padding-left: 4px;
323+
padding-right: 0;
324+
padding-bottom: 1px;
325+
animation: none;
326+
}
327+
328+
.tagify__tag__removeBtn {
329+
color: inherit;
330+
margin-left: 1px;
331+
}
332+
333+
.tagify__dropdown span.tag {
334+
border-radius: 10px;
335+
padding: 1px 4px;
336+
}
337+
338+
.tagify--focus {
339+
outline: ridge 2px var(--outline-background-color)
340+
}
341+
342+
343+
302344

303345
@media (max-width: 550px) {
304346
.bar{

assets/css/theme/audrey-s-book.css

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@
1717
color-scheme: light;
1818
}
1919

20-
body {
21-
/* font-family: serif; */
22-
/* font-size: 15.8px; */
23-
}
24-
25-
input, button, select, textarea {
26-
border-radius: 3px;
20+
input, button, select, textarea, .field {
21+
border-radius: 4px;
2722
}
2823

2924
.block {
@@ -37,4 +32,4 @@ input, button, select, textarea {
3732

3833
.editor #editmain, .editor #editheader, .editor #editnav, .editor #editaside, .editor #editfooter {
3934
font-family: serif;
40-
}
35+
}

assets/css/theme/blue-whale.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
color-scheme: dark;
1818
}
1919

20-
input, button, select, textarea, legend {
20+
input, button, select, textarea, legend, .field {
2121
border-radius: 10px;
2222
}
2323

@@ -29,6 +29,3 @@ button, input[type="submit"] {
2929
.submenu, .block, nav.bar {
3030
border-radius: 0 0 10px 10px;
3131
}
32-
33-
label.toogle {
34-
}

assets/css/theme/dark-doriphore.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
color-scheme: dark;
1818
}
1919

20-
input, button, select, textarea, .submenu, .block, .bar {
20+
input, button, select, textarea, .field, .submenu, .block, .bar {
2121
border-radius: 0px;
2222
border: solid 1px;
2323
}

assets/css/theme/default.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
color-scheme: light;
1818
}
1919

20-
input, button, select, textarea {
20+
input, button, select, textarea, .field {
2121
border-radius: 3px;
2222
}
2323

assets/css/theme/funky-freddy.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
color-scheme: light;
1818
}
1919

20-
input, button, select, textarea {
20+
input, button, select, textarea, .field {
2121
border-radius: 5px;
2222
}
2323

0 commit comments

Comments
 (0)