Compare commits
3 Commits
885298437b
...
82700e2dc5
Author | SHA1 | Date | |
---|---|---|---|
82700e2dc5 | |||
8aa1652283 | |||
16d5df4095 |
106
src/Entity/NoteShares.php
Normal file
106
src/Entity/NoteShares.php
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\NoteSharesRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: NoteSharesRepository::class)]
|
||||||
|
class NoteShares
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(inversedBy: 'noteShares')]
|
||||||
|
#[ORM\JoinColumn(nullable: false)]
|
||||||
|
private ?User $owner = null;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne]
|
||||||
|
#[ORM\JoinColumn(nullable: false)]
|
||||||
|
private ?User $share = null;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne]
|
||||||
|
#[ORM\JoinColumn(nullable: false)]
|
||||||
|
private ?Note $note = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the ID of the NoteShares entity.
|
||||||
|
*
|
||||||
|
* @return int|null The ID of the NoteShares entity, or null if not set.
|
||||||
|
*/
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the owner of the object.
|
||||||
|
*
|
||||||
|
* @return User|null The owner of the object, or null if not set.
|
||||||
|
*/
|
||||||
|
public function getOwner(): ?User
|
||||||
|
{
|
||||||
|
return $this->owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A description of the entire PHP function.
|
||||||
|
*
|
||||||
|
* @param User|null $owner description
|
||||||
|
* @return static
|
||||||
|
*/
|
||||||
|
public function setOwner(?User $owner): static
|
||||||
|
{
|
||||||
|
$this->owner = $owner;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the share for the current instance.
|
||||||
|
*
|
||||||
|
* @return User|null The user who shares this instance.
|
||||||
|
*/
|
||||||
|
public function getShare(): ?User
|
||||||
|
{
|
||||||
|
return $this->share;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the share for the current instance.
|
||||||
|
*
|
||||||
|
* @param User|null $share The user to set as the share.
|
||||||
|
* @return static The current instance.
|
||||||
|
*/
|
||||||
|
public function setShare(?User $share): static
|
||||||
|
{
|
||||||
|
$this->share = $share;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the associated Note object.
|
||||||
|
*
|
||||||
|
* @return Note|null The associated Note object, or null if not found.
|
||||||
|
*/
|
||||||
|
public function getNote(): ?Note
|
||||||
|
{
|
||||||
|
return $this->note;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the note for this NoteShares entity.
|
||||||
|
*
|
||||||
|
* @param Note|null $note The note to set
|
||||||
|
* @return static
|
||||||
|
*/
|
||||||
|
public function setNote(?Note $note): static
|
||||||
|
{
|
||||||
|
$this->note = $note;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
43
src/Repository/NoteSharesRepository.php
Normal file
43
src/Repository/NoteSharesRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\NoteShares;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<NoteShares>
|
||||||
|
*/
|
||||||
|
class NoteSharesRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, NoteShares::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return NoteShares[] Returns an array of NoteShares objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('n')
|
||||||
|
// ->andWhere('n.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('n.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?NoteShares
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('n')
|
||||||
|
// ->andWhere('n.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
@ -11,7 +11,7 @@
|
|||||||
<style>
|
<style>
|
||||||
.flex-container {
|
.flex-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: row;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
justify-content: normal;
|
justify-content: normal;
|
||||||
align-items: normal;
|
align-items: normal;
|
||||||
@ -26,15 +26,18 @@
|
|||||||
align-self: auto;
|
align-self: auto;
|
||||||
order: 0;
|
order: 0;
|
||||||
border: solid 1px black;
|
border: solid 1px black;
|
||||||
|
margin: 0 10px 0 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-flex {
|
.settings-flex {
|
||||||
display: block;
|
display: block;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
flex-shrink: 0;
|
flex-shrink: 1;
|
||||||
flex-basis: auto;
|
flex-basis: auto;
|
||||||
align-self: auto;
|
align-self: auto;
|
||||||
order: 0;
|
order: 0;
|
||||||
|
border: solid 1px black;
|
||||||
|
margin: 0 20px 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notes-flex {
|
.notes-flex {
|
||||||
@ -124,6 +127,8 @@ function saveSettings() {
|
|||||||
|
|
||||||
<label for='conf-password'>Confirm Password: </label>
|
<label for='conf-password'>Confirm Password: </label>
|
||||||
<input type='password' id='conf-password' name='conf-password' /><br />
|
<input type='password' id='conf-password' name='conf-password' /><br />
|
||||||
|
|
||||||
|
<button id='save-profile' onclick='saveProfile()'>Save Profile</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="settings-flex">
|
<div class="settings-flex">
|
||||||
<label for='save-interval'>Save Interval (seconds)?</label>
|
<label for='save-interval'>Save Interval (seconds)?</label>
|
||||||
@ -147,9 +152,33 @@ function saveSettings() {
|
|||||||
<button id='save-settings' onclick='saveSettings()'>Save Settings</button>
|
<button id='save-settings' onclick='saveSettings()'>Save Settings</button>
|
||||||
<button id='back' onclick='history.go(-1)'>Back</button>
|
<button id='back' onclick='history.go(-1)'>Back</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="notes-fles">
|
</div>
|
||||||
<table id='notes'>
|
|
||||||
|
<div class='flex-container'>
|
||||||
|
<div class='user-flex'>
|
||||||
|
<h2>My Shared Notes</h2>
|
||||||
|
<table id='shared-notes'>
|
||||||
<thead>
|
<thead>
|
||||||
|
<th>Recipient</th>
|
||||||
|
<th>Title</th>
|
||||||
|
<th>Passage</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='settings-flex'>'
|
||||||
|
<h2>Notes Shared w/Me</h2>
|
||||||
|
|
||||||
|
<table id='shared-with-me'>
|
||||||
|
<thead>
|
||||||
|
<th>Owner</th>
|
||||||
|
<th>Title</th>
|
||||||
|
<th>Passage</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
9
templates/emails/registration.html.twig
Normal file
9
templates/emails/registration.html.twig
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head></head>
|
||||||
|
<body>
|
||||||
|
<h1>New User Registered</h1>
|
||||||
|
Name: {{ user.name }}<br />
|
||||||
|
Email: {{ user.email }}
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
x
Reference in New Issue
Block a user