This commit is contained in:
Ryan Prather 2024-05-01 00:10:54 -04:00
parent d579d5381c
commit 73cccfa538
11 changed files with 153 additions and 56 deletions

View File

@ -236,4 +236,19 @@ div#refQuery #search {
width: 150px; width: 150px;
height: 25px; height: 25px;
cursor: pointer; cursor: pointer;
}
#passage-popup {
display: none;
position: absolute;
z-index: 100;
background-color: #fff;
color: black;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
width: 300px;
height: 300px;
overflow-x: scroll;
}/*# sourceMappingURL=style.css.map */ }/*# sourceMappingURL=style.css.map */

View File

@ -1 +1 @@
{"version":3,"sources":["style.scss","style.css"],"names":[],"mappings":"AAAA,kCAAA;AACA;EACI,SAAA;ACCJ;;ADEA;EACI,aAAA;EACA,mBAAA;EACA,eAAA;EACA,6BAAA;EACA,oBAAA;EACA,yBAAA;EACA,iBAAA;EACA,iCAAA;EACA,cAAA;ACCJ;;ADEA;EACI,YAAA;EACA,WAAA;ACCJ;;ADEA,6BAAA;AAEA;EACI,aAAA;EACA,8BAAA;EACA,mBAAA;EACA,wBAAA;EACA,uBAAA;EACA,eAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;EACA,YAAA;EACA,wCAAA;ACAJ;;ADGA;EACI,YAAA;ACAJ;;ADGA;;EAEI,YAAA;ACAJ;;ADIA;EACI,yBAAA;EACA,yBAAA;EACA,aAAA;EACA,YAAA;EACA,gBAAA;EACA,qBAAA;EACA,eAAA;ACDJ;;ADIA;EACI,WAAA;ACDJ;;ADIA,GAAA;AACA;EACI,aAAA;EACA,uBAAA;EACA,mBAAA;EACA,aAAA;EACA,WAAA;EACA,kBAAA;EACA,yBAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,wCAAA;EACA,eAAA;ACDJ;ADGI;EACI,yBAAA;ACDR;;ADKA;EACI,SAAA;EACA,UAAA;ACFJ;;ADKA;EACI,gBAAA;EACA,qBAAA;ACFJ;;ADKA;EACI,UAAA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AA;EACA,kBAAA;EACA,qBAAA;EACA,qBAAA;EACA,eAAA;EACA,eAAA;EAGA,6BAAA;ACFJ;ADII;EACI,yBAAA;EACA,iBAAA;ACFR;ADKI;EACI,eAAA;EACA,eAAA;ACHR;;ADOA;EACI,eAAA;EACA,eAAA;EACA,sCAAA;ACJJ;;ADOA;EACI,4BAAA;ACJJ;;ADOA;EACI,cAAA;ACJJ;;ADOA;EACI,UAAA;ACJJ;;ADOA;EACI,WAAA;EACA,YAAA;EACA,eAAA;ACJJ;;ADOA;EACI,aAAA;EACA,kBAAA;ACJJ;;ADOA;;EAEI,oBAAA;EACA,mBAAA;EACA,UAAA;ACJJ;;ADOA;EACI,sCAAA;ACJJ;;ADOA;EACI,iBAAA;ACJJ;;ADOA;EACI,aAAA;ACJJ;;ADOA;EACI,SAAA;EACA,UAAA;EACA,qBAAA;EACA,gBAAA;ACJJ;;ADOA;EACI,eAAA;EACA,qBAAA;EACA,aAAA;EACA,iBAAA;EACA,eAAA;ACJJ;;ADOA;EACI,aAAA;EACA,kBAAA;EACA,YAAA;EACA,oCAAA;ACJJ;;ADOA;EACI,YAAA;EACA,kBAAA;EACA,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,WAAA;EACA,yBAAA;EACA,YAAA;EACA,YAAA;EACA,eAAA;ACJJ;;ADOA;EACI,aAAA;EACA,kBAAA;EACA,YAAA;EACA,sBAAA;EACA,YAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,wCAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;ACJJ","file":"style.css"}

View File

@ -1 +1 @@
body{margin:0}.container{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-evenly;align-items:stretch;align-content:flex-start;max-width:1020px;margin:0 auto}.top-tab{height:50px;width:100%}.hamburger{display:flex;justify-content:space-between;align-items:center;margin:15px 0 15px 15px;border:#000 solid 1px;cursor:pointer;border-radius:5px;width:20px;height:20px;padding:5px;box-shadow:0 2px 5px rgba(0,0,0,.3)}.fa-check{color:green}.fa-bars:before,.fa-navicon:before{padding:3px}ul.menu-open{display:block !important;background-color:#f9c74d;padding:10px;z-index:100;list-style:none;list-style-type:none;position:fixed}.ref-tab{width:60px}.tab button{display:flex;justify-content:center;align-items:center;height:100px;width:100%;text-align:center;background-color:#4caf50;color:#fff;border:none;border-radius:3px;box-shadow:0 4px 5px rgba(0,0,0,.8);font-size:14px}.tab button:hover{background-color:#3e8e41}.ref-tab ul{margin:0;padding:0}.ref-tab ul li{list-style:none;list-style-type:none}.ref{width:35%}.ref>div#ref{overflow-y:scroll;width:100%;height:100%;border:#000 solid 1px;border-radius:3px;box-shadow:0 2px 5px rgba(0,0,0,.3)}#passage{width:100px}#newSpeaker{display:none;width:110px}#newSeries{display:none;width:110px}#noteSearch{display:none}#fields-container{display:none}#show-hide-btn{position:absolute}.button{top:10px;right:20px;font-size:16px;cursor:pointer;background-color:#4caf50;color:#fff;border:none;border-radius:5px;box-shadow:0 2px 5px rgba(0,0,0,.6);padding:5px 20px;text-align:center;text-decoration:none;display:inline-block;font-size:16px;margin:4px 2px;transition:all .3s ease-out}.button:hover{background-color:#3e8e41}.button::before{font-size:16px;cursor:pointer}.button::before{font-size:16px;cursor:pointer;transition:transform .5s ease-in-out}.button:hover::before{transform:translateY(-10px)}#fields-container.show{display:block}.notes{width:55%}textarea#notes{width:100%;height:100%;font-size:14pt}#notePreview{display:none;overflow-x:scroll}#note-header-left,#note-header-right{display:inline-flex;flex-direction:row;width:49%}#note-header-right{flex-direction:row-reverse !important}#note-header-left h2.dirty{color:#ff8c00}#note-list{display:none}#note-list ul{margin:0;padding:0;list-style-type:none;list-style:none}.noteListLinks{cursor:pointer;text-decoration:none;color:purple;font-weight:bold;font-size:16px}div#refQuery{display:none;position:absolute;z-index:100;background-color:rgba(0,0,0,.5)}div#refQuery #search{border:none;border-radius:5px;padding:10px 20px;font-size:16px;line-height:1.5;color:#333;background-color:#f4f4f4;width:150px;height:25px;cursor:pointer}/*# sourceMappingURL=style.min.css.map */ body{margin:0}.container{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-evenly;align-items:stretch;align-content:flex-start;max-width:1020px;margin:0 auto}.top-tab{height:50px;width:100%}.hamburger{display:flex;justify-content:space-between;align-items:center;margin:15px 0 15px 15px;border:#000 solid 1px;cursor:pointer;border-radius:5px;width:20px;height:20px;padding:5px;box-shadow:0 2px 5px rgba(0,0,0,.3)}.fa-check{color:green}.fa-bars:before,.fa-navicon:before{padding:3px}ul.menu-open{display:block !important;background-color:#f9c74d;padding:10px;z-index:100;list-style:none;list-style-type:none;position:fixed}.ref-tab{width:60px}.tab button{display:flex;justify-content:center;align-items:center;height:100px;width:100%;text-align:center;background-color:#4caf50;color:#fff;border:none;border-radius:3px;box-shadow:0 4px 5px rgba(0,0,0,.8);font-size:14px}.tab button:hover{background-color:#3e8e41}.ref-tab ul{margin:0;padding:0}.ref-tab ul li{list-style:none;list-style-type:none}.ref{width:35%}.ref>div#ref{overflow-y:scroll;width:100%;height:100%;border:#000 solid 1px;border-radius:3px;box-shadow:0 2px 5px rgba(0,0,0,.3)}#passage{width:100px}#newSpeaker{display:none;width:110px}#newSeries{display:none;width:110px}#noteSearch{display:none}#fields-container{display:none}#show-hide-btn{position:absolute}.button{top:10px;right:20px;font-size:16px;cursor:pointer;background-color:#4caf50;color:#fff;border:none;border-radius:5px;box-shadow:0 2px 5px rgba(0,0,0,.6);padding:5px 20px;text-align:center;text-decoration:none;display:inline-block;font-size:16px;margin:4px 2px;transition:all .3s ease-out}.button:hover{background-color:#3e8e41}.button::before{font-size:16px;cursor:pointer}.button::before{font-size:16px;cursor:pointer;transition:transform .5s ease-in-out}.button:hover::before{transform:translateY(-10px)}#fields-container.show{display:block}.notes{width:55%}textarea#notes{width:100%;height:100%;font-size:14pt}#notePreview{display:none;overflow-x:scroll}#note-header-left,#note-header-right{display:inline-flex;flex-direction:row;width:49%}#note-header-right{flex-direction:row-reverse !important}#note-header-left h2.dirty{color:#ff8c00}#note-list{display:none}#note-list ul{margin:0;padding:0;list-style-type:none;list-style:none}.noteListLinks{cursor:pointer;text-decoration:none;color:purple;font-weight:bold;font-size:16px}div#refQuery{display:none;position:absolute;z-index:100;background-color:rgba(0,0,0,.5)}div#refQuery #search{border:none;border-radius:5px;padding:10px 20px;font-size:16px;line-height:1.5;color:#333;background-color:#f4f4f4;width:150px;height:25px;cursor:pointer}#passage-popup{display:none;position:absolute;z-index:100;background-color:#fff;color:#000;padding:10px;border:1px solid #ccc;border-radius:5px;box-shadow:0 2px 5px rgba(0,0,0,.3);width:300px;height:300px;overflow-x:scroll}/*# sourceMappingURL=style.min.css.map */

View File

@ -1 +1 @@
{"version":3,"sources":["style.scss"],"names":[],"mappings":"AACA,KACI,QAAA,CAGJ,WACI,YAAA,CACA,kBAAA,CACA,cAAA,CACA,4BAAA,CACA,mBAAA,CACA,wBAAA,CACA,gBAAA,CAEA,aAAA,CAGJ,SACI,WAAA,CACA,UAAA,CAKJ,WACI,YAAA,CACA,6BAAA,CACA,kBAAA,CACA,uBAAA,CACA,qBAAA,CACA,cAAA,CACA,iBAAA,CACA,UAAA,CACA,WAAA,CACA,WAAA,CACA,mCAAA,CAGJ,UACI,WAAA,CAGJ,mCAEI,WAAA,CAIJ,aACI,wBAAA,CACA,wBAAA,CACA,YAAA,CACA,WAAA,CACA,eAAA,CACA,oBAAA,CACA,cAAA,CAGJ,SACI,UAAA,CAIJ,YACI,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,YAAA,CACA,UAAA,CACA,iBAAA,CACA,wBAAA,CACA,UAAA,CACA,WAAA,CACA,iBAAA,CACA,mCAAA,CACA,cAAA,CAEA,kBACI,wBAAA,CAIR,YACI,QAAA,CACA,SAAA,CAGJ,eACI,eAAA,CACA,oBAAA,CAGJ,KACI,SAAA,CAGJ,aACI,iBAAA,CACA,UAAA,CACA,WAAA,CACA,qBAAA,CACA,iBAAA,CACA,mCAAA,CAGJ,SACI,WAAA,CAGJ,YACI,YAAA,CACA,WAAA,CAGJ,WACI,YAAA,CACA,WAAA,CAGJ,YACI,YAAA,CAGJ,kBACI,YAAA,CAGJ,eACI,iBAAA,CAGJ,QACI,QAAA,CACA,UAAA,CACA,cAAA,CACA,cAAA,CACA,wBAAA,CAEA,UAAA,CAEA,WAAA,CACA,iBAAA,CACA,mCAAA,CACA,gBAAA,CACA,iBAAA,CACA,oBAAA,CACA,oBAAA,CACA,cAAA,CACA,cAAA,CAGA,2BAAA,CAEA,cACI,wBAAA,CAIJ,gBACI,cAAA,CACA,cAAA,CAIR,gBACI,cAAA,CACA,cAAA,CACA,oCAAA,CAGJ,sBACI,2BAAA,CAGJ,uBACI,aAAA,CAGJ,OACI,SAAA,CAGJ,eACI,UAAA,CACA,WAAA,CACA,cAAA,CAGJ,aACI,YAAA,CACA,iBAAA,CAGJ,qCAEI,mBAAA,CACA,kBAAA,CACA,SAAA,CAGJ,mBACI,qCAAA,CAGJ,2BACI,aAAA,CAGJ,WACI,YAAA,CAGJ,cACI,QAAA,CACA,SAAA,CACA,oBAAA,CACA,eAAA,CAGJ,eACI,cAAA,CACA,oBAAA,CACA,YAAA,CACA,gBAAA,CACA,cAAA,CAGJ,aACI,YAAA,CACA,iBAAA,CACA,WAAA,CACA,+BAAA,CAGJ,qBACI,WAAA,CACA,iBAAA,CACA,iBAAA,CACA,cAAA,CACA,eAAA,CACA,UAAA,CACA,wBAAA,CACA,WAAA,CACA,WAAA,CACA,cAAA","file":"style.min.css"} {"version":3,"sources":["style.scss"],"names":[],"mappings":"AACA,KACI,QAAA,CAGJ,WACI,YAAA,CACA,kBAAA,CACA,cAAA,CACA,4BAAA,CACA,mBAAA,CACA,wBAAA,CACA,gBAAA,CAEA,aAAA,CAGJ,SACI,WAAA,CACA,UAAA,CAKJ,WACI,YAAA,CACA,6BAAA,CACA,kBAAA,CACA,uBAAA,CACA,qBAAA,CACA,cAAA,CACA,iBAAA,CACA,UAAA,CACA,WAAA,CACA,WAAA,CACA,mCAAA,CAGJ,UACI,WAAA,CAGJ,mCA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CACA,+BAAA,CAGJ,qBACI,WAAA,CACA,iBAAA,CACA,iBAAA,CACA,cAAA,CACA,eAAA,CACA,UAAA,CACA,wBAAA,CACA,WAAA,CACA,WAAA,CACA,cAAA,CAGJ,eACI,YAAA,CACA,iBAAA,CACA,WAAA,CACA,qBAAA,CACA,UAAA,CACA,YAAA,CACA,qBAAA,CACA,iBAAA,CACA,mCAAA,CACA,WAAA,CACA,YAAA,CACA,iBAAA","file":"style.min.css"}

View File

@ -244,3 +244,18 @@ div#refQuery #search {
height: 25px; height: 25px;
cursor: pointer; cursor: pointer;
} }
#passage-popup {
display: none;
position: absolute;
z-index: 100;
background-color: #fff;
color: black;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
width: 300px;
height: 300px;
overflow-x: scroll;
}

View File

@ -57,6 +57,8 @@ function setHeight() {
dt = new Date(); dt = new Date();
date.value = dt.getFullYear() + '-' + ((dt.getMonth() < 9) ? '0' + (dt.getMonth() + 1) : (dt.getMonth() + 1)) + '-' + dt.getDate(); date.value = dt.getFullYear() + '-' + ((dt.getMonth() < 9) ? '0' + (dt.getMonth() + 1) : (dt.getMonth() + 1)) + '-' + dt.getDate();
var user = getCookie('user');
document.querySelector('#user').value = user;
setTimeout(saveNote, saveTimeout); setTimeout(saveNote, saveTimeout);
} }
@ -107,6 +109,7 @@ function saveNote(event) {
series: document.querySelector('#series').value, series: document.querySelector('#series').value,
passage: document.querySelector('#passage').value, passage: document.querySelector('#passage').value,
note: document.querySelector('#notes').value, note: document.querySelector('#notes').value,
user: document.querySelector('#user').value,
refs: references refs: references
}; };
fetch('/index.php/save-note', { fetch('/index.php/save-note', {
@ -137,6 +140,7 @@ function validateNote() {
const title = document.querySelector('#noteTitle'); const title = document.querySelector('#noteTitle');
const id = document.querySelector('#noteId'); const id = document.querySelector('#noteId');
const psg = document.querySelector('#passage'); const psg = document.querySelector('#passage');
const user = document.querySelector('#user');
if (!isUuidV4Valid(id.value)) { return false; } if (!isUuidV4Valid(id.value)) { return false; }
if (!title.value.length) { return false; } if (!title.value.length) { return false; }
@ -145,6 +149,7 @@ function validateNote() {
if (!parseInt(series.value)) { return false; } if (!parseInt(series.value)) { return false; }
if (!psg.value) { return false; } if (!psg.value) { return false; }
if (!note.value.length) { return false; } if (!note.value.length) { return false; }
if (!user.value) { return false; }
return true; return true;
} }
@ -547,7 +552,49 @@ function previewNote() {
function findLinks() { function findLinks() {
var links = document.querySelector('#notePreview').querySelectorAll('a'); var links = document.querySelector('#notePreview').querySelectorAll('a');
//alert(links.length);
for (var i = 0; i < links.length; i++) {
links[i].addEventListener('mouseover', function (e) {
e.preventDefault();
var passage = this.href.split('/');
passage = passage[passage.length - 1];
fetch(this.href, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
'passage': passage
})
})
.then(response => response.text())
.then(result => {
showPassage(e, result + "<button onclick='closePopup()'>Close</button>");
});
});
}
}
function showPassage(event, text) {
// Create a new div element for the popup
const popup = document.querySelector('#passage-popup');
popup.innerHTML = md.render(text);
// Position the popup relative to the cursor
let x = event.clientX + window.pageXOffset;
let y = event.clientY + window.pageYOffset;
// Set the position of the popup element
popup.style.top = `${y}px`;
popup.style.left = `${x}px`;
popup.style.display = 'block';
}
function closePopup() {
const popup = document.querySelector('#passage-popup');
popup.innerHTML = '';
popup.style.display = 'none';
} }
function openNote() { function openNote() {
@ -584,8 +631,6 @@ function retrieveNote(id) {
document.querySelector('#noteDate').value = result.date; document.querySelector('#noteDate').value = result.date;
document.querySelector('#noteId').value = result.id; document.querySelector('#noteId').value = result.id;
document.querySelector('#noteSearch').style.display = 'none';
if (result.references) { if (result.references) {
references = result.references; references = result.references;
} }
@ -604,45 +649,29 @@ function retrieveNote(id) {
}); });
} }
function searchNote() { function changeUser(name, value, days) {
const search = document.querySelector('#noteSearchQuery'); var expires = "";
if (days) {
fetch('/index.php/search-note', { var date = new Date();
method: 'POST', date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
header: { expires = "; expires=" + date.toUTCString();
'Content-Type': 'application/json' }
}, document.cookie = name + "=" + value + expires + "; path=/";
body: JSON.stringify({
"search": search.value
})
})
.then(response => response.json())
.then(result => {
document.querySelector('#notes').value = result.text;
document.querySelector('#passage').value = result.passage;
document.querySelector('#series').value = result.series.id;
document.querySelector('#speaker').value = result.speaker.id;
document.querySelector('#noteTitle').value = result.title;
document.querySelector('#noteDate').value = result.date;
document.querySelector('#noteId').value = result.id;
document.querySelector('#noteSearch').style.display = 'none';
link.click();
if (result.references) {
references = result.references;
} }
const list = document.querySelector('#ref-list'); function getCookie(name) {
var newList = null; var nameEQ = name + "=";
for (var x in references) { var ca = document.cookie.split(';');
var newList = document.createElement('li'); for (var i = 0; i < ca.length; i++) {
newList.className = 'tab'; var c = ca[i];
var button = makeButton(x); while (c.charAt(0) === ' ') {
newList.appendChild(button); c = c.substring(1, c.length);
list.appendChild(newList);
} }
}); if (c.indexOf(nameEQ) === 0) {
return c.substring(nameEQ.length, c.length);
}
}
return null;
} }
/** /**

View File

@ -10,6 +10,7 @@ use App\Entity\Speaker;
use App\Entity\Template; use App\Entity\Template;
use App\Entity\Notes; use App\Entity\Notes;
use App\Entity\Reference; use App\Entity\Reference;
use App\Entity\User;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@ -259,8 +260,10 @@ class AjaxController extends AbstractController
$series = $emi->getRepository(Series::class)->find($data->series); $series = $emi->getRepository(Series::class)->find($data->series);
$speaker = $emi->getRepository(Speaker::class)->find($data->speaker); $speaker = $emi->getRepository(Speaker::class)->find($data->speaker);
$user = $emi->getRepository(User::class)->find($data->user);
$note->setTitle($data->title) $note->setUser($user)
->setTitle($data->title)
->setDate(new DateTime($data->date)) ->setDate(new DateTime($data->date))
->setSeries($series) ->setSeries($series)
->setSpeaker($speaker) ->setSpeaker($speaker)

View File

@ -6,6 +6,7 @@ use App\Entity\Speaker;
use App\Entity\Template; use App\Entity\Template;
use App\Entity\Series; use App\Entity\Series;
use App\Entity\Notes; use App\Entity\Notes;
use App\Entity\User;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@ -18,10 +19,18 @@ class DefaultController extends AbstractController
#[Route('/', name: 'app_default')] #[Route('/', name: 'app_default')]
public function index(EntityManagerInterface $emi): Response public function index(EntityManagerInterface $emi): Response
{ {
$user = null;
if (isset($_COOKIE['user'])) {
$user = $emi->getRepository(User::class)->findBy(['email' => $_COOKIE['user']]);
if (is_array($user) && count($user) == 1) {
$user = $user[0];
}
}
$speakers = $emi->getRepository(Speaker::class)->findAll(); $speakers = $emi->getRepository(Speaker::class)->findAll();
$series = $emi->getRepository(Series::class)->findAll(); $series = $emi->getRepository(Series::class)->findAll();
$templates = $emi->getRepository(Template::class)->findAll(); $templates = $emi->getRepository(Template::class)->findAll();
$notes = $emi->getRepository(Notes::class)->findAll(); $notes = $emi->getRepository(Notes::class)->findUserNotes($user);
$uuid = Uuid::v4(); $uuid = Uuid::v4();
return $this->render('default/index.html.twig', [ return $this->render('default/index.html.twig', [

View File

@ -36,6 +36,9 @@ class Notes implements JsonSerializable
#[ORM\Column(type: Types::JSON, nullable: true)] #[ORM\Column(type: Types::JSON, nullable: true)]
private ?array $refs = null; private ?array $refs = null;
#[ORM\ManyToOne(inversedBy: 'notes')]
private ?User $user = null;
/** /**
* Retrieves the ID of the object. * Retrieves the ID of the object.
* *
@ -154,6 +157,18 @@ class Notes implements JsonSerializable
return $this; return $this;
} }
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
public function toLink(): string public function toLink(): string
{ {
return "<a href='#' onclick=\"retrieveNote('{$this->id}')\">". return "<a href='#' onclick=\"retrieveNote('{$this->id}')\">".

View File

@ -3,6 +3,7 @@
namespace App\Repository; namespace App\Repository;
use App\Entity\Notes; use App\Entity\Notes;
use App\Entity\User;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry; use Doctrine\Persistence\ManagerRegistry;
@ -73,13 +74,16 @@ class NotesRepository extends ServiceEntityRepository
// ; // ;
// } // }
// public function findOneBySomeField($value): ?Notes public function findUserNotes(?User $value): ?array
// { {
// return $this->createQueryBuilder('n') if (!$value) {
// ->andWhere('n.exampleField = :val') return null;
// ->setParameter('val', $value) }
// ->getQuery()
// ->getOneOrNullResult() return $this->createQueryBuilder('n')
// ; ->andWhere('n.user = :val')
// } ->setParameter('val', $value->getId())
->getQuery()
->getResult();
}
} }

View File

@ -29,7 +29,11 @@
<li><a href='/index.php/template-editor'>Template Editor</a></li> <li><a href='/index.php/template-editor'>Template Editor</a></li>
</ul>&nbsp;&nbsp; </ul>&nbsp;&nbsp;
<i id='save-check' class='fa fa-check' style='opacity:0;'></i> <i id='save-check' class='fa fa-check' style='opacity:0;'></i>
<div id='res'></div> <select id='user' onchange="changeUser('user', this.value)">
<option value=''>-- User --</option>
<option value='godsgood33@gmail.com'>Ryan</option>
<option value='kimprather01@gmail.com'>Kim</option>
</select>
</section> </section>
<section class="ref-tab"> <section class="ref-tab">
<ul id='ref-list'> <ul id='ref-list'>
@ -116,4 +120,7 @@
<input type="text" id="search" placeholder="Search"><br /> <input type="text" id="search" placeholder="Search"><br />
<button id="searchBtn" onclick="queryRef()">Search</button> <button id="searchBtn" onclick="queryRef()">Search</button>
</div> </div>
<div id='passage-popup'>
</div>
{% endblock %} {% endblock %}