feat: integrate Tagify for multi-tag support and add a new view-note modal across the application
This commit is contained in:
@@ -7,6 +7,26 @@
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="public/css/style.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/@yaireo/tagify"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.tags-look .tagify__dropdown__item{ display: inline-block; border-radius: 3px; padding: .3em .5em; border: 1px solid var(--border); background: var(--surface); margin: .2em; font-size: .85em; transition: 0s; color: var(--text); }
|
||||
.tags-look .tagify__dropdown__item--active{ color: black; }
|
||||
.tags-look .tagify__dropdown__item:hover{ background: var(--primary); color: white; border-color: var(--primary); }
|
||||
</style>
|
||||
<?php
|
||||
$all_app_tags = [];
|
||||
try {
|
||||
$rows = $pdo->query("SELECT label_name as tag FROM notes WHERE label_name IS NOT NULL AND label_name != ''")->fetchAll();
|
||||
foreach($rows as $r) { foreach(explode(',', $r['tag']) as $p) { $all_app_tags[trim($p)] = 1; } }
|
||||
$rows = $pdo->query("SELECT tags as tag FROM tasks WHERE tags IS NOT NULL AND tags != ''")->fetchAll();
|
||||
foreach($rows as $r) { foreach(explode(',', $r['tag']) as $p) { $all_app_tags[trim($p)] = 1; } }
|
||||
} catch(Exception $e) {}
|
||||
$global_tags = array_keys($all_app_tags);
|
||||
?>
|
||||
<script>
|
||||
window.APP_GLOBAL_TAGS = <?= json_encode(array_filter($global_tags)) ?>;
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
@@ -45,7 +65,7 @@
|
||||
<form method="POST">
|
||||
<input type="hidden" name="delete_profile_pic" value="1">
|
||||
<input type="hidden" name="redirect_to" value="<?= htmlspecialchars($action) ?>">
|
||||
<button type="submit" class="btn btn-danger" style="width:100%;" onclick="return confirm('Delete profile picture?')">Delete Picture</button>
|
||||
<button type="button" class="btn btn-danger" style="width:100%;" onclick="appConfirm('Delete profile picture?').then(y => { if(y) this.form.submit(); })">Delete Picture</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<button class="btn btn-secondary" style="width:100%; margin-top:0.5rem;" onclick="document.getElementById('profile-pic-modal').classList.remove('active')">Close</button>
|
||||
@@ -234,7 +254,7 @@
|
||||
<i class="fa fa-key"></i> Change Password
|
||||
</button>
|
||||
<div class="user-dropdown-divider"></div>
|
||||
<a href="?action=logout" class="user-dropdown-item user-dropdown-logout" onclick="return confirm('Logout?')">
|
||||
<a href="?action=logout" class="user-dropdown-item user-dropdown-logout" onclick="appConfirmUrl(event, this.href, 'Logout?')">
|
||||
<i class="fa fa-right-from-bracket"></i> Logout
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user