You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
2.5 KiB
PHP
66 lines
2.5 KiB
PHP
<?php
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
$noteids = $database->select('notes', 'noteid', ['ownerid' => $_SESSION['uid']]);
|
|
|
|
$notes = [];
|
|
|
|
foreach ($noteids as $n) {
|
|
$notes[] = Note::loadNote($n);
|
|
}
|
|
?>
|
|
|
|
<style nonce="<?php echo $SECURE_NONCE; ?>">
|
|
<?php
|
|
foreach ($notes as $note) {
|
|
echo "#notecard_" . $note->getID() . ", #notecard_" . $note->getID() . " a {\n"
|
|
. " background-color: #" . $note->getColor() . ";\n"
|
|
. " color: #" . $note->getTextColor() . ";\n"
|
|
. " border: 1px solid #" . $note->getColor() . ";\n"
|
|
. "}\n";
|
|
}
|
|
?>
|
|
</style>
|
|
|
|
<div class="btn-group mb-4">
|
|
<a href="app.php?page=editnote" class="btn btn-success"><i class="fas fa-plus"></i> <?php $Strings->get("New note"); ?></a>
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<?php
|
|
foreach ($notes as $note) {
|
|
?>
|
|
<div class="col-12 col-sm-6 col-md-6 col-lg-4">
|
|
<div class="card notecard mb-3" data-color="<?php echo $note->getColor(); ?>" id="notecard_<?php echo $note->getID(); ?>" data-note="<?php echo $note->getID(); ?>">
|
|
<div class="card-body">
|
|
<div class="float-right">
|
|
<a href="./action.php?action=favoritenote¬eid=<?php echo $note->getID(); ?>" class="favorite-btn <?php echo $note->getFavorite() ? "text-warning": ""; ?>">
|
|
<i class="fa<?php echo $note->getFavorite() ? "s" : "r"; ?> fa-star"></i>
|
|
</a>
|
|
</div>
|
|
<div class="card-text note-text">
|
|
<?php echo $note->getHTML(); ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-footer">
|
|
<a href="./app.php?page=editnote¬e=<?php echo $note->getID(); ?>" class="mr-2">
|
|
<i class="fas fa-edit"></i> <?php $Strings->get('Edit'); ?>
|
|
</a>
|
|
<a href="./action.php?action=downloadnote¬eid=<?php echo $note->getID(); ?>" class="mr-2">
|
|
<i class="fas fa-download"></i> <?php $Strings->get('Download'); ?>
|
|
</a>
|
|
<a href="./action.php?action=deletenote¬eid=<?php echo $note->getID(); ?>">
|
|
<i class="fas fa-trash"></i> <?php $Strings->get('Delete'); ?>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
</div>
|