diff --git a/public/css/style.css b/public/css/style.css index fc6b435..a7aa7f0 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -236,4 +236,19 @@ div#refQuery #search { width: 150px; height: 25px; 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 */ \ No newline at end of file diff --git a/public/css/style.css.map b/public/css/style.css.map index 8fa3c3c..2e6a0de 100644 --- a/public/css/style.css.map +++ b/public/css/style.css.map @@ -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,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eAAA;ACJJ","file":"style.css"} \ No newline at end of file +{"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;ACFJ;;ADKA;EACI,kBAAA;EACA,WAAA;EACA,YAAA;EACA,uBAAA;EACA,kBAAA;EACA,wCAAA;ACFJ;;ADKA;EACI,YAAA;ACFJ;;ADKA;EACI,aAAA;EACA,YAAA;ACFJ;;ADKA;EACI,aAAA;EACA,YAAA;ACFJ;;ADKA;EACI,aAAA;ACFJ;;ADKA;EACI,aAAA;ACFJ;;ADKA;EACI,kBAAA;ACFJ;;ADKA;EACI,SAAA;EACA,WAAA;EACA,eAAA;EACA,eAAA;EACA,yBAAA;EACA,UAAA;EACA,WAAA;EACA,UAAA;EACA,YAAA;EACA,kBAAA;EACA,wCAAA;EACA,iBAAA;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"} \ No newline at end of file diff --git a/public/css/style.min.css b/public/css/style.min.css index 3b0f896..6c0da9c 100644 --- a/public/css/style.min.css +++ b/public/css/style.min.css @@ -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 */ \ No newline at end of file +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 */ \ No newline at end of file diff --git a/public/css/style.min.css.map b/public/css/style.min.css.map index bb73e91..c48d052 100644 --- a/public/css/style.min.css.map +++ b/public/css/style.min.css.map @@ -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"} \ No newline at end of file +{"version":3,"sources":["style.scss"],"names":[],"mappings":"AACA,KACI,QAAA,CAGJ,WACI,YAAA,CACA,kBAAA,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AA,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,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"} \ No newline at end of file diff --git a/public/css/style.scss b/public/css/style.scss index c33200c..b7f3e8c 100644 --- a/public/css/style.scss +++ b/public/css/style.scss @@ -243,4 +243,19 @@ div#refQuery #search { width: 150px; height: 25px; 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; } \ No newline at end of file diff --git a/public/js/script.js b/public/js/script.js index f01ba80..fb64e40 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -57,6 +57,8 @@ function setHeight() { dt = new Date(); 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); } @@ -107,6 +109,7 @@ function saveNote(event) { series: document.querySelector('#series').value, passage: document.querySelector('#passage').value, note: document.querySelector('#notes').value, + user: document.querySelector('#user').value, refs: references }; fetch('/index.php/save-note', { @@ -137,6 +140,7 @@ function validateNote() { const title = document.querySelector('#noteTitle'); const id = document.querySelector('#noteId'); const psg = document.querySelector('#passage'); + const user = document.querySelector('#user'); if (!isUuidV4Valid(id.value)) { return false; } if (!title.value.length) { return false; } @@ -145,6 +149,7 @@ function validateNote() { if (!parseInt(series.value)) { return false; } if (!psg.value) { return false; } if (!note.value.length) { return false; } + if (!user.value) { return false; } return true; } @@ -547,7 +552,49 @@ function previewNote() { function findLinks() { 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 + ""); + }); + }); + } +} + +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() { @@ -584,8 +631,6 @@ function retrieveNote(id) { document.querySelector('#noteDate').value = result.date; document.querySelector('#noteId').value = result.id; - document.querySelector('#noteSearch').style.display = 'none'; - if (result.references) { references = result.references; } @@ -604,45 +649,29 @@ function retrieveNote(id) { }); } -function searchNote() { - const search = document.querySelector('#noteSearchQuery'); +function changeUser(name, value, days) { + var expires = ""; + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + expires = "; expires=" + date.toUTCString(); + } + document.cookie = name + "=" + value + expires + "; path=/"; +} - fetch('/index.php/search-note', { - method: 'POST', - header: { - 'Content-Type': 'application/json' - }, - 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'); - var newList = null; - for (var x in references) { - var newList = document.createElement('li'); - newList.className = 'tab'; - var button = makeButton(x); - newList.appendChild(button); - list.appendChild(newList); - } - }); +function getCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for (var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) === ' ') { + c = c.substring(1, c.length); + } + if (c.indexOf(nameEQ) === 0) { + return c.substring(nameEQ.length, c.length); + } + } + return null; } /** diff --git a/src/Controller/AjaxController.php b/src/Controller/AjaxController.php index c9837c7..bd06dcf 100644 --- a/src/Controller/AjaxController.php +++ b/src/Controller/AjaxController.php @@ -10,6 +10,7 @@ use App\Entity\Speaker; use App\Entity\Template; use App\Entity\Notes; use App\Entity\Reference; +use App\Entity\User; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -259,8 +260,10 @@ class AjaxController extends AbstractController $series = $emi->getRepository(Series::class)->find($data->series); $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)) ->setSeries($series) ->setSpeaker($speaker) diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index 2f2ec0b..a771285 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -6,6 +6,7 @@ use App\Entity\Speaker; use App\Entity\Template; use App\Entity\Series; use App\Entity\Notes; +use App\Entity\User; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -18,10 +19,18 @@ class DefaultController extends AbstractController #[Route('/', name: 'app_default')] 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(); $series = $emi->getRepository(Series::class)->findAll(); $templates = $emi->getRepository(Template::class)->findAll(); - $notes = $emi->getRepository(Notes::class)->findAll(); + $notes = $emi->getRepository(Notes::class)->findUserNotes($user); $uuid = Uuid::v4(); return $this->render('default/index.html.twig', [ diff --git a/src/Entity/Notes.php b/src/Entity/Notes.php index 7aa8638..18fd6cf 100644 --- a/src/Entity/Notes.php +++ b/src/Entity/Notes.php @@ -36,6 +36,9 @@ class Notes implements JsonSerializable #[ORM\Column(type: Types::JSON, nullable: true)] private ?array $refs = null; + #[ORM\ManyToOne(inversedBy: 'notes')] + private ?User $user = null; + /** * Retrieves the ID of the object. * @@ -154,6 +157,18 @@ class Notes implements JsonSerializable return $this; } + public function getUser(): ?User + { + return $this->user; + } + + public function setUser(?User $user): static + { + $this->user = $user; + + return $this; + } + public function toLink(): string { return "id}')\">". diff --git a/src/Repository/NotesRepository.php b/src/Repository/NotesRepository.php index 4ceed1e..a3db684 100644 --- a/src/Repository/NotesRepository.php +++ b/src/Repository/NotesRepository.php @@ -3,6 +3,7 @@ namespace App\Repository; use App\Entity\Notes; +use App\Entity\User; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; @@ -73,13 +74,16 @@ class NotesRepository extends ServiceEntityRepository // ; // } - // public function findOneBySomeField($value): ?Notes - // { - // return $this->createQueryBuilder('n') - // ->andWhere('n.exampleField = :val') - // ->setParameter('val', $value) - // ->getQuery() - // ->getOneOrNullResult() - // ; - // } + public function findUserNotes(?User $value): ?array + { + if (!$value) { + return null; + } + + return $this->createQueryBuilder('n') + ->andWhere('n.user = :val') + ->setParameter('val', $value->getId()) + ->getQuery() + ->getResult(); + } } diff --git a/templates/default/index.html.twig b/templates/default/index.html.twig index dde1a0c..4f2bb6a 100644 --- a/templates/default/index.html.twig +++ b/templates/default/index.html.twig @@ -29,7 +29,11 @@
  • Template Editor
  •    -
    +