Other various changes

This commit is contained in:
Ryan Prather 2025-04-04 15:27:16 -04:00
parent 6af5f2a3f8
commit f114843e4c
20 changed files with 231 additions and 190 deletions

View File

@ -2,6 +2,11 @@
use App\Kernel; use App\Kernel;
if (preg_match("/js\/data\.json$/", $_SERVER['REQUEST_URI'])) {
print file_get_contents('js/data.json');
exit;
}
require_once dirname(__DIR__).'/vendor/autoload_runtime.php'; require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) { return function (array $context) {

View File

@ -12,9 +12,11 @@ use App\Entity\Bible;
use App\Entity\Speaker; use App\Entity\Speaker;
use App\Entity\Series; use App\Entity\Series;
use App\Entity\Note; use App\Entity\Note;
use App\Entity\NoteShares; use App\Entity\SharedNote;
use App\Utils\Utils; use App\Utils\Utils;
use Doctrine\DBAL\Exception\ReadOnlyException;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Exception;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@ -54,7 +56,7 @@ class AjaxController extends AbstractController
$user = $this->getUser(); $user = $this->getUser();
if($template_id) { if ($template_id) {
$template = $emi->getRepository(Template::class)->find($template_id); $template = $emi->getRepository(Template::class)->find($template_id);
$template->setName($template_name); $template->setName($template_name);
$template->setContent($template_value); $template->setContent($template_value);
@ -166,8 +168,12 @@ class AjaxController extends AbstractController
$ref = new Reference(); $ref = new Reference();
$ref->setType($data->type); $ref->setType($data->type);
if(is_numeric($data->book)) { if (is_numeric($data->book)) {
$ref->setNdx($data->book); $ref->setNdx($data->book);
} elseif ($data->type == 'ld' || $data->type == 'hc') {
$type = substr($data->book, 0, 2);
$ref->setType($type);
$ref->setLabel($data->book);
} }
ReferenceController::$emi = $emi; ReferenceController::$emi = $emi;
@ -191,13 +197,27 @@ class AjaxController extends AbstractController
'note' => ReferenceController::retrieveNote($user) 'note' => ReferenceController::retrieveNote($user)
}; };
if (!is_a($ret, Reference::class)) { $ref = new Reference();
$ret = new Reference();
if (is_a($ret, Reference::class)) {
$ref = $ret;
}
if ($data->type == 'hc' && is_array($ret)) {
$ref->setLabel(
substr($ret[0]->getLabel(), 0, strpos($ret[0]->getLabel(), '-'))
);
$content = null;
foreach ($ret as $row) {
$content .= $row->getContent().PHP_EOL.PHP_EOL;
}
$ref->setContent($content);
} }
$res->setContent(json_encode([ $res->setContent(json_encode([
'text' => $ret->getContent(), 'text' => $ref->getContent(),
'title' => "{$ret->getLabel()}", 'title' => $ref->getLabel(),
])); ]));
return $res; return $res;
@ -223,28 +243,12 @@ class AjaxController extends AbstractController
{ {
$res = new Response(); $res = new Response();
$data = json_decode($req->getContent()); $data = json_decode($req->getContent());
$path = match($data->type) { $ref = $emi->getRepository(Reference::class)->find($data->refId);
'creed' => 'Creeds',
'bc' => 'Belgic',
'hc' => 'Heidelberg',
'cd' => 'Dort',
'wcf' => 'Westminster/Confessions',
'wsc' => 'Westminster/Shorter Catechism',
'wlc' => 'Westminster/Larger Catechism',
'lbc' => 'London',
'39a' => '39 Articles',
'1hc' => '1 Helvetic Catechism',
'2hc' => '2 Helvetic Catechism',
'sd' => 'Savor Declaration',
'agc' => 'Augsburg Confession'
};
$ret = file_put_contents(dirname(dirname(__DIR__))."/references/{$path}/{$data->file}", $data->text); if ($ref) {
$ref->setContent($data->text);
if($ret !== false) { $emi->persist($ref);
$res->setContent(json_encode(['msg' => 'File Saved'])); $res = $this->json(['msg' => 'Reference updated.']);
} else {
$res->setContent(json_encode(['msg' => 'Failed to save file']));
} }
return $res; return $res;
@ -371,10 +375,10 @@ class AjaxController extends AbstractController
} }
if (is_array($shared) && count($shared) > 0) { if (is_array($shared) && count($shared) > 0) {
$ns = new NoteShares(); $ns = new SharedNote();
$ns->setNote($note) $ns->setNote($note)
->setOwner($user) ->setOwnerId($user->getId())
->setShare($shared[0]); ->setSharedUserId($shared[0]->getId());
$emi->persist($ns); $emi->persist($ns);
$emi->flush(); $emi->flush();
@ -434,7 +438,7 @@ class AjaxController extends AbstractController
if (is_array($ret)) { if (is_array($ret)) {
$text = null; $text = null;
foreach($ret as $b) { foreach ($ret as $b) {
$text .= "{$b->getVerse()}. {$b->getContent()}".PHP_EOL; $text .= "{$b->getVerse()}. {$b->getContent()}".PHP_EOL;
} }
$bible->setContent($text); $bible->setContent($text);
@ -477,16 +481,20 @@ class AjaxController extends AbstractController
$data->trackSaveSize = false; $data->trackSaveSize = false;
} }
$meta = $user->getMetaData(); try {
$meta['saveInterval'] = $data->saveInterval; $meta = $user->getMetaData();
$meta['saveReferences'] = $data->saveReferences; $meta['saveInterval'] = $data->saveInterval;
$meta['noteTextSize'] = $data->noteTextSize; $meta['saveReferences'] = $data->saveReferences;
$meta['trackSaveSize'] = $data->trackSaveSize; $meta['noteTextSize'] = $data->noteTextSize;
$meta['saveTimeout'] = $data->saveTimeout; $meta['trackSaveSize'] = $data->trackSaveSize;
$meta['save-failure-count'] = $data->saveFailureCount; $meta['saveTimeout'] = $data->saveTimeout;
$user->setMetaData($meta); $meta['save-failure-count'] = $data->saveFailureCount;
$emi->persist($user); $user->setMetaData($meta);
$emi->flush(); $emi->persist($user);
$emi->flush();
} catch (ReadOnlyException $e) {
return new Response('Read Only '.$_ENV['DATABASE_URL'], 403);
}
$res = new Response(); $res = new Response();
$res->setContent(json_encode([ $res->setContent(json_encode([

View File

@ -4,6 +4,7 @@ namespace App\Controller;
use App\Entity\Note; use App\Entity\Note;
use App\Entity\User; use App\Entity\User;
use App\Entity\SharedNote;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@ -17,9 +18,9 @@ class DefaultController extends AbstractController
public function index(): Response public function index(): Response
{ {
if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {
return $this->redirect('/index.php/home'); return $this->redirect('/home');
} }
return $this->render('default/index.html.twig'); return $this->render('default/index.html.twig', ['onLoad' => null]);
} }
#[Route('/home', name: 'app_home')] #[Route('/home', name: 'app_home')]
@ -31,6 +32,7 @@ class DefaultController extends AbstractController
$meta = $user->getMetaData(); $meta = $user->getMetaData();
return $this->render('default/home.html.twig', [ return $this->render('default/home.html.twig', [
'onLoad' => 'setHeight()',
'last4Notes' => $last4Notes, 'last4Notes' => $last4Notes,
'reverseNoteSort' => $openNotes, 'reverseNoteSort' => $openNotes,
'isAdmin' => $this->isGranted('ROLE_ADMIN'), 'isAdmin' => $this->isGranted('ROLE_ADMIN'),
@ -45,7 +47,7 @@ class DefaultController extends AbstractController
} }
#[Route('/profile', name: 'app_profile')] #[Route('/profile', name: 'app_profile')]
public function profile(): Response public function profile(EntityManagerInterface $emi): Response
{ {
/** @var User $user */ /** @var User $user */
$user = $this->getUser(); $user = $this->getUser();
@ -55,6 +57,7 @@ class DefaultController extends AbstractController
$meta = $user->getMetaData(); $meta = $user->getMetaData();
if (!$meta) { if (!$meta) {
$meta = [ $meta = [
'onLoad' => null,
'saveInterval' => 15, 'saveInterval' => 15,
'saveReferences' => 'checked', 'saveReferences' => 'checked',
'noteTextSize' => 12, 'noteTextSize' => 12,
@ -67,8 +70,16 @@ class DefaultController extends AbstractController
$meta['trackSaveSize'] = $meta['trackSaveSize'] ? 'checked' : null; $meta['trackSaveSize'] = $meta['trackSaveSize'] ? 'checked' : null;
} }
$sharedWithMe = $emi->getRepository(SharedNote::class)->getNotesSharedWithMe($user);
$shared = $emi->getRepository(SharedNote::class)->getNotesSharedByMe($user);
dump($shared);
return $this->render('default/profile.html.twig', [ return $this->render('default/profile.html.twig', [
'onLoad' => 'rollUp("user");rollUp("settings")',
'meta' => $meta, 'meta' => $meta,
'sharedWithMe' => $sharedWithMe,
'shared' => $shared,
'user' => $this->getUser(),
]); ]);
} }

View File

@ -41,7 +41,7 @@ class ReferenceController extends AbstractController
$bible = self::$emi->getRepository(Bible::class)->findRange($bible, [$passage_start, $passage_end]); $bible = self::$emi->getRepository(Bible::class)->findRange($bible, [$passage_start, $passage_end]);
$passage = "{$passage_start}-{$passage_end}"; $passage = "{$passage_start}-{$passage_end}";
$label = "{$bible[0]->getLabel()}\n{$bible[0]->getChapter()}:{$passage}"; $label = "{$bible[0]->getLabel()}\n{$bible[0]->getChapter()}\n{$passage}";
} elseif (is_int($passage)) { } elseif (is_int($passage)) {
$bible = self::$emi->getRepository(Bible::class)->findBy(['book' => $book, 'chapter' => $chapter, 'verse' => $passage]); $bible = self::$emi->getRepository(Bible::class)->findBy(['book' => $book, 'chapter' => $chapter, 'verse' => $passage]);
$label = "{$bible[0]->getLabel()}\n{$bible[0]->getChapter()}:{$passage}"; $label = "{$bible[0]->getLabel()}\n{$bible[0]->getChapter()}:{$passage}";
@ -52,9 +52,9 @@ class ReferenceController extends AbstractController
$passage = null; $passage = null;
} }
if(is_array($bible)) { if (is_array($bible)) {
$text = []; $text = [];
foreach($bible as $b) { foreach ($bible as $b) {
$text[] = "{$b->getVerse()}. {$b->getContent()}"; $text[] = "{$b->getVerse()}. {$b->getContent()}";
} }
} else { } else {
@ -93,15 +93,16 @@ class ReferenceController extends AbstractController
* *
* @param Reference $ref * @param Reference $ref
* *
* @return Reference * @return Reference|array
*/ */
public static function retrieveHC($ref): Reference public static function retrieveHC(Reference $ref): Reference|array
{ {
$r = self::$emi->getRepository(Reference::class)->findBy(['type' => 'hc', 'ndx' => $ref->getNdx()]); $r = self::$emi->getRepository(Reference::class)->findHeidelberg($ref->getLabel());
if (!$r) { if (!$r) {
return new Reference(); return new Reference();
} }
return $r[0]; return $r;
} }
/** /**
@ -114,7 +115,7 @@ class ReferenceController extends AbstractController
public static function retrieveBC($ref): Reference public static function retrieveBC($ref): Reference
{ {
$r = self::$emi->getRepository(Reference::class)->findBy(['type' => 'belgic', 'ndx' => $ref->getNdx()]); $r = self::$emi->getRepository(Reference::class)->findBy(['type' => 'belgic', 'ndx' => $ref->getNdx()]);
if(!$r) { if (!$r) {
return new Reference(); return new Reference();
} }
return $r[0]; return $r[0];

View File

@ -19,6 +19,7 @@ class SecurityController extends AbstractController
$lastUsername = $authenticationUtils->getLastUsername(); $lastUsername = $authenticationUtils->getLastUsername();
return $this->render('security/login.html.twig', [ return $this->render('security/login.html.twig', [
'onLoad' => null,
'last_username' => $lastUsername, 'last_username' => $lastUsername,
'error' => $error, 'error' => $error,
]); ]);

View File

@ -68,12 +68,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, JsonSer
#[ORM\OneToMany(targetEntity: Note::class, mappedBy: 'user')] #[ORM\OneToMany(targetEntity: Note::class, mappedBy: 'user')]
private Collection $notes; private Collection $notes;
/**
* @var Collection<int, NoteShares>
*/
#[ORM\OneToMany(targetEntity: NoteShares::class, mappedBy: 'ownerId', orphanRemoval: true)]
private Collection $noteShares;
#[ORM\Column(nullable: true)] #[ORM\Column(nullable: true)]
private ?array $metaData = null; private ?array $metaData = null;
@ -83,7 +77,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, JsonSer
$this->speakers = new ArrayCollection(); $this->speakers = new ArrayCollection();
$this->templates = new ArrayCollection(); $this->templates = new ArrayCollection();
$this->notes = new ArrayCollection(); $this->notes = new ArrayCollection();
$this->noteShares = new ArrayCollection();
} }
public function getId(): ?Uuid public function getId(): ?Uuid
@ -319,36 +312,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, JsonSer
]; ];
} }
/**
* @return Collection<int, NoteShares>
*/
public function getNoteShares(): Collection
{
return $this->noteShares;
}
public function addNoteShare(NoteShares $noteShare): static
{
if (!$this->noteShares->contains($noteShare)) {
$this->noteShares->add($noteShare);
$noteShare->setOwner($this);
}
return $this;
}
public function removeNoteShare(NoteShares $noteShare): static
{
if ($this->noteShares->removeElement($noteShare)) {
// set the owning side to null (unless already changed)
if ($noteShare->getOwner() === $this) {
$noteShare->setOwner(null);
}
}
return $this;
}
public function getMetaData(): ?array public function getMetaData(): ?array
{ {
return $this->metaData; return $this->metaData;

View File

@ -25,6 +25,35 @@ class ReferenceRepository extends ServiceEntityRepository
->getResult(); ->getResult();
} }
public function findHeidelberg($ref): array|Reference
{
if (substr($ref, 0, 2) == 'ld') {
$num = substr($ref, 2);
$qb = $this->createQueryBuilder('r');
$r = $qb->where($qb->expr()->like('r.label', ':ld'))
->setParameter('ld', "ld{$num}-%")
->getQuery()
->getResult()
;
} elseif (substr($ref, 0, 2) == 'hc') {
$num = substr($ref, 2);
$qb = $this->createQueryBuilder('r');
$r = $qb->where($qb->expr()->like('r.label', ':hc'))
->setParameter('hc', "%-hc{$num}")
->getQuery()
->getResult()
;
if(count($r) > 0) {
$r = $r[0];
$r->setLabel(implode("\n", explode("-", $r->getLabel())));
}
}
return $r;
}
// /** // /**
// * @return Reference[] Returns an array of Reference objects // * @return Reference[] Returns an array of Reference objects
// */ // */

View File

@ -12,7 +12,7 @@
<title>{% block title %}Welcome!{% endblock %}</title> <title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}{% endblock %} {% block stylesheets %}{% endblock %}
</head> </head>
<body class='is-preload' onresize='setHeight()'> <body class='is-preload' onload='{% if onLoad is defined %}{{ onLoad }}{% endif %}'>
{% block body %}{% endblock %} {% block body %}{% endblock %}
{% block javascripts %}{% endblock %} {% block javascripts %}{% endblock %}
</body> </body>

View File

@ -3,20 +3,20 @@
{% block title %}Markdown Cheat Sheet{% endblock %} {% block title %}Markdown Cheat Sheet{% endblock %}
{% block stylesheets %} {% block stylesheets %}
<link href="/theme/assets/css/main.css" rel="stylesheet" /> <link href="{{ asset('css/main.css') }}" rel="stylesheet" />
<link href='/theme/assets/css/jquery-ui.theme.css' rel='stylesheet' /> <link href='{{ asset('css/jquery-ui.theme.css') }}' rel='stylesheet' />
<link href='/theme/assets/css/jquery-ui.structure.css' rel='stylesheet' /> <link href='{{ asset('css/jquery-ui.structure.css') }}' rel='stylesheet' />
<link href='/css/style.css' rel='stylesheet' /> <link href='{{ asset('css/style.css') }}' rel='stylesheet' />
<link href='//cdn.datatables.net/2.0.8/css/dataTables.dataTables.min.css' rel='stylesheet' /> <link href='//cdn.datatables.net/2.0.8/css/dataTables.dataTables.min.css' rel='stylesheet' />
{% endblock %} {% endblock %}
{% block javascripts %} {% block javascripts %}
<script src="/theme/assets/js/jquery.min.js"></script> <script src="{{ asset('js/jquery.min.js') }}"></script>
<script src='/theme/assets/js/jquery-ui.js'></script> <script src='{{ asset('js/jquery-ui.js') }}'></script>
<script src="/theme/assets/js/browser.min.js"></script> <script src="{{ asset('js/browser.min.js') }}"></script>
<script src="/theme/assets/js/breakpoints.min.js"></script> <script src="{{ asset('js/breakpoints.min.js') }}"></script>
<script src="/theme/assets/js/util.js"></script> <script src="{{ asset('js/util.js') }}"></script>
<script src="/theme/assets/js/main.js"></script> <script src="{{ asset('js/main.js') }}"></script>
<script src='//momentjs.com/downloads/moment-with-locales.js'></script> <script src='//momentjs.com/downloads/moment-with-locales.js'></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/markdown-it/13.0.2/markdown-it.min.js" integrity="sha512-ohlWmsCxOu0bph1om5eDL0jm/83eH09fvqLDhiEdiqfDeJbEvz4FSbeY0gLJSVJwQAp0laRhTXbUQG+ZUuifUQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/markdown-it/13.0.2/markdown-it.min.js" integrity="sha512-ohlWmsCxOu0bph1om5eDL0jm/83eH09fvqLDhiEdiqfDeJbEvz4FSbeY0gLJSVJwQAp0laRhTXbUQG+ZUuifUQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src='//cdn.datatables.net/2.0.8/js/dataTables.min.js'></script> <script src='//cdn.datatables.net/2.0.8/js/dataTables.min.js'></script>

View File

@ -3,10 +3,10 @@
{% block title %}Sermon Notes{% endblock %} {% block title %}Sermon Notes{% endblock %}
{% block stylesheets %} {% block stylesheets %}
<link href="/theme/assets/css/main.css" rel="stylesheet" /> <link href="{{ asset('css/main.css') }}" rel="stylesheet" />
<link href='/theme/assets/css/jquery-ui.theme.css' rel='stylesheet' /> <link href='{{ asset('css/jquery-ui.theme.css') }}' rel='stylesheet' />
<link href='/theme/assets/css/jquery-ui.structure.css' rel='stylesheet' /> <link href='{{ asset('css/jquery-ui.structure.css') }}' rel='stylesheet' />
<link href='/css/style.css' rel='stylesheet' /> <link href='{{ asset('styles/style.css') }}' rel='stylesheet' />
<link href='//cdn.datatables.net/2.0.8/css/dataTables.dataTables.min.css' rel='stylesheet' /> <link href='//cdn.datatables.net/2.0.8/css/dataTables.dataTables.min.css' rel='stylesheet' />
<style> <style>
#notes, #notes,
@ -20,12 +20,12 @@ button.button i {
{% endblock %} {% endblock %}
{% block javascripts %} {% block javascripts %}
<script src="/theme/assets/js/jquery.min.js"></script> <script src="{{ asset('js/jquery.min.js') }}"></script>
<script src='/theme/assets/js/jquery-ui.js'></script> <script src='{{ asset('js/jquery-ui.js') }}'></script>
<script src="/theme/assets/js/browser.min.js"></script> <script src="{{ asset('js/browser.min.js') }}"></script>
<script src="/theme/assets/js/breakpoints.min.js"></script> <script src="{{ asset('js/breakpoints.min.js') }}"></script>
<script src="/theme/assets/js/util.js"></script> <script src="{{ asset('js/util.js') }}"></script>
<script src="/theme/assets/js/main.js"></script> <script src="{{ asset('js/main.js') }}"></script>
<script src='//momentjs.com/downloads/moment-with-locales.js'></script> <script src='//momentjs.com/downloads/moment-with-locales.js'></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/markdown-it/13.0.2/markdown-it.min.js" integrity="sha512-ohlWmsCxOu0bph1om5eDL0jm/83eH09fvqLDhiEdiqfDeJbEvz4FSbeY0gLJSVJwQAp0laRhTXbUQG+ZUuifUQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/markdown-it/13.0.2/markdown-it.min.js" integrity="sha512-ohlWmsCxOu0bph1om5eDL0jm/83eH09fvqLDhiEdiqfDeJbEvz4FSbeY0gLJSVJwQAp0laRhTXbUQG+ZUuifUQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src='//cdn.datatables.net/2.0.8/js/dataTables.min.js'></script> <script src='//cdn.datatables.net/2.0.8/js/dataTables.min.js'></script>
@ -35,7 +35,7 @@ let saveTimeout = ({{ meta.saveTimeout }} * 1000);
const SAVE_FAILURE_LIMIT = {{ meta.saveFailureCount }}; const SAVE_FAILURE_LIMIT = {{ meta.saveFailureCount }};
let saveFailureCount = {{ meta.saveFailureCount }}; let saveFailureCount = {{ meta.saveFailureCount }};
</script> </script>
<script src='/js/script.js'></script> <script src='{{ asset('js/script.js') }}'></script>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
@ -54,7 +54,7 @@ let saveFailureCount = {{ meta.saveFailureCount }};
<button onclick='decreaseFont()'><i class='fa fa-minus'></i></button>&nbsp; <button onclick='decreaseFont()'><i class='fa fa-minus'></i></button>&nbsp;
<button id='openRefBtn' class='button' onclick='openRef(false)'><i class='fa fa-book'></i></button> <button id='openRefBtn' class='button' onclick='openRef(false)'><i class='fa fa-book'></i></button>
</div> </div>
<div id="ref" style='font-size:12pt;'></div> <div id="ref" style='font-size:{{ meta.noteTextSize }}pt;'></div>
<div id='note-list'> <div id='note-list'>
<table id='note-table' data-order='[[ 3, "desc" ]]'> <table id='note-table' data-order='[[ 3, "desc" ]]'>
<thead> <thead>
@ -117,7 +117,7 @@ let saveFailureCount = {{ meta.saveFailureCount }};
</select> </select>
</div> </div>
<textarea id="notes" wrap="hard"></textarea> <textarea id="notes" wrap="hard" style='font-size:{{ meta.noteTextSize }}pt'></textarea>
<div id='notePreview'></div> <div id='notePreview'></div>
</section> </section>
</div> </div>

View File

@ -3,16 +3,18 @@
{% block title %}Sermon Notes{% endblock %} {% block title %}Sermon Notes{% endblock %}
{% block stylesheets %} {% block stylesheets %}
<link href="/theme/assets/css/main.css" rel="stylesheet" /> <link href="{{ asset('css/main.css') }}" rel="stylesheet" />
<link href='/css/style.css' rel='stylesheet' /> <link href='{{ asset('styles/style.css') }}' rel='stylesheet' />
<link href='{{ asset('css/jquery-ui.theme.css') }}' rel='stylesheet' />
<link href='{{ asset('css/jquery-ui.structure.css') }}' rel='stylesheet' />
{% endblock %} {% endblock %}
{% block javascripts %} {% block javascripts %}
<script src="/theme/assets/js/jquery.min.js"></script> <script src="{{ asset('js/jquery.min.js') }}"></script>
<script src="/theme/assets/js/browser.min.js"></script> <script src="{{ asset('js/browser.min.js') }}"></script>
<script src="/theme/assets/js/breakpoints.min.js"></script> <script src="{{ asset('js/breakpoints.min.js') }}"></script>
<script src="/theme/assets/js/util.js"></script> <script src="{{ asset('js/util.js') }}"></script>
<script src="/theme/assets/js/main.js"></script> <script src="{{ asset('js/main.js') }}"></script>
<!-- <script src="https://kit.fontawesome.com/f15a79324f.js" crossorigin="anonymous"></script> --> <!-- <script src="https://kit.fontawesome.com/f15a79324f.js" crossorigin="anonymous"></script> -->
{% endblock %} {% endblock %}
@ -23,12 +25,12 @@
<div class='inner'> <div class='inner'>
<header id="header"> <header id="header">
{% if app.user %} {% if app.user %}
<a href='/index.php/home' class='logo'> <a href='/home' class='logo'>
<img src='/theme/images/vecteezy_notes-icon-in-trendy-flat-style-isolated-on-white_29722382.jpg' style='width:60px;'/> <img src='{{ asset('images/vecteezy_notes-icon-in-trendy-flat-style-isolated-on-white_29722382.jpg') }}' style='width:60px;'/>
</a> </a>
{% else %} {% else %}
<a href="/index.php/" class="logo"> <a href="/" class="logo">
<img src='/theme/images/vecteezy_notes-icon-in-trendy-flat-style-isolated-on-white_29722382.jpg' style='width:60px;'/> <img src=' {{ asset('images/vecteezy_notes-icon-in-trendy-flat-style-isolated-on-white_29722382.jpg') }}' style='width:60px;'/>
</a> </a>
{% endif %} {% endif %}
</header> </header>
@ -42,7 +44,7 @@
</header> </header>
</div> </div>
<span class="image object"> <span class="image object">
<img src="/theme/images/lined-paper-template-01.png" alt="" /> <img src="{{ asset('images/lined-paper-template-01.png') }}" alt="" />
</span> </span>
</section> </section>
</div> </div>

View File

@ -53,7 +53,7 @@ label,
input[type="number"], input[type="number"],
input[type="email"], input[type="email"],
input[type="text"] { input[type="text"] {
display: inline !important; /*display: inline !important;*/
} }
input[type="checkbox"] { input[type="checkbox"] {
@ -67,12 +67,12 @@ input[type="checkbox"] {
{% endblock %} {% endblock %}
{% block javascripts %} {% block javascripts %}
<script src="/theme/assets/js/jquery.min.js"></script> <script src="{{ asset('js/jquery.min.js') }}"></script>
<script src='/theme/assets/js/jquery-ui.js'></script> <script src='{{ asset('js/jquery-ui.js') }}'></script>
<script src="/theme/assets/js/browser.min.js"></script> <script src="{{ asset('js/browser.min.js') }}"></script>
<script src="/theme/assets/js/breakpoints.min.js"></script> <script src="{{ asset('js/breakpoints.min.js') }}"></script>
<script src="/theme/assets/js/util.js"></script> <script src="{{ asset('js/util.js') }}"></script>
<script src="/theme/assets/js/main.js"></script> <script src="{{ asset('js/main.js') }}"></script>
<script src='//momentjs.com/downloads/moment-with-locales.js'></script> <script src='//momentjs.com/downloads/moment-with-locales.js'></script>
<script src='//cdn.datatables.net/2.0.8/js/dataTables.min.js'></script> <script src='//cdn.datatables.net/2.0.8/js/dataTables.min.js'></script>
<script type='text/javascript'> <script type='text/javascript'>
@ -88,7 +88,7 @@ function saveSettings() {
var saveTimeout = $('#save-timeout'); var saveTimeout = $('#save-timeout');
var saveFailureCount = $('#save-failure-count'); var saveFailureCount = $('#save-failure-count');
fetch('/index.php/save-settings', { fetch('/save-settings', {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@ -107,50 +107,62 @@ function saveSettings() {
alert(results.msg); alert(results.msg);
}); });
} }
function rollUp(cont) {
$('#'+cont+'-container').toggle(600);
//$('#'+cont+'-div').height(100);
}
</script> </script>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<button id='back' onclick='history.go(-1)'>Back</button><br/>
<div class="flex-container"> <div class="flex-container">
<div class="user-flex"> <div class="user-flex" id='user-div'>
<label for='name'>Name: </label> <h2 onclick='rollUp("user")'>User Profile</h2>
<input type='text' id='name' name='name' value='{{ app.user.name }}' /><br /> <div id='user-container'>
<label for='name'>Name: </label>
<input type='text' id='name' name='name' value='{{ app.user.name }}' /><br />
<label for='email'>Email: </label> <label for='email'>Email: </label>
<input type='email' id='email' name='email' value='{{ app.user.email }}' /><br /> <input type='email' id='email' name='email' value='{{ app.user.email }}' /><br />
<label for='password'>Password: </label> <label for='password'>Password: </label>
<input type='password' id='password' name='password' /><br/> <input type='password' id='password' name='password' /><br/>
<label for='new-password'>New Password: </label> <label for='new-password'>New Password: </label>
<input type='password' id='new-password' name='new-password' /><br /> <input type='password' id='new-password' name='new-password' /><br />
<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> <button id='save-profile' onclick='saveProfile()'>Save Profile</button>
</div>
</div> </div>
<div class="settings-flex"> <div class="settings-flex">
<label for='save-interval'>Save Interval (seconds)?</label> <h2 onclick='rollUp("settings")'>Site Settings</h2>
<input type='number' id='save-interval' value='{{ meta.saveInterval }}' title='What is the interval to trigger an autosave, in seconds?' /><br/> <div id='settings-container'>
<label for='save-interval'>Save Interval (seconds)?</label>
<input type='number' id='save-interval' value='{{ meta.saveInterval }}' title='What is the interval to trigger an autosave, in seconds?' /><br/>
<label for='save-references'>Save References?</label> <label for='save-references'>Save References?</label>
<input type='checkbox' id='save-references' {{ meta.saveReferences }} title='Do you want to also save reference content' /><br /> <input type='checkbox' id='save-references' {{ meta.saveReferences }} title='Do you want to also save reference content' /><br />
<label for='note-text-size'>Note Text Size? (points)</label> <label for='note-text-size'>Text Size? (points)</label>
<input type='number' id='note-text-size' value='{{ meta.noteTextSize }}' title='Font size of the note preview, in points' /><br /> <input type='number' id='note-text-size' value='{{ meta.noteTextSize }}' title='Font size of the note preview, in points' /><br />
<label for='track-save-size'>Track Save Size?</label> <label for='track-save-size'>Track Save Size?</label>
<input type='checkbox' id='track-save-size' {{ meta.noteTextSize }} title='Do you want to track the size of saves, useful if teathering to mobile device?' /><br /> <input type='checkbox' id='track-save-size' {{ meta.noteTextSize }} title='Do you want to track the size of saves, useful if teathering to mobile device?' /><br />
<label for='save-timeout'>Save Timeout? (seconds)</label> <label for='save-timeout'>Save Timeout? (seconds)</label>
<input type='number' id='save-timeout' value='{{ meta.saveTimeout }}' title='How long does it wait to before cancelling the save and trying again later?' /><br /> <input type='number' id='save-timeout' value='{{ meta.saveTimeout }}' title='How long does it wait to before cancelling the save and trying again later?' /><br />
<label for='save-failure-count'>Save Failure Count? </label> <label for='save-failure-count'>Save Failure Count? </label>
<input type='number' id='save-failure-count' value='{{ meta.saveFailureCount }}' title='How many times do you want to attempt to auto save before it stops and waits for a manual attempt' /><br /> <input type='number' id='save-failure-count' value='{{ meta.saveFailureCount }}' title='How many times do you want to attempt to auto save before it stops and waits for a manual attempt' /><br />
<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> </div>
</div> </div>
</div> </div>
@ -164,11 +176,13 @@ function saveSettings() {
<th>Passage</th> <th>Passage</th>
</thead> </thead>
<tbody> <tbody>
{% for s in shared %}
{% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
<div class='settings-flex'>' <div class='settings-flex'>
<h2>Notes Shared w/Me</h2> <h2>Notes Shared w/Me</h2>
<table id='shared-with-me'> <table id='shared-with-me'>

View File

@ -13,27 +13,27 @@
<nav id="menu"> <nav id="menu">
<header class="major"> <header class="major">
{% if app.user %} {% if app.user %}
<h3>Welcome <a href='/index.php/profile' style='text-decoration:underline;'>{{ app.user.name }}</a></h3> <h3>Welcome <a href='/profile' style='text-decoration:underline;'>{{ app.user.name }}</a></h3>
<a href='/index.php/logout'>Logout</a> <a href='/logout'>Logout</a>
{% endif %} {% endif %}
</header> </header>
<ul> <ul>
{% if app.user %} {% if app.user %}
<li><a href='/index.php/home'>Home</a></li> <li><a href='/home'>Home</a></li>
<li><a href="#" onclick='newNote()'>New Note</a></li> <li><a href="#" onclick='newNote()'>New Note</a></li>
<li><a href='#' onclick='openNote()'>Open Note</a></li> <li><a href='#' onclick='openNote()'>Open Note</a></li>
<li><a href="#" onclick="saveNote()">Save Note</a></li> <li><a href="#" onclick="saveNote()">Save Note</a></li>
<li><a href='#' onclick='discardNote()'>Delete Note</a></li> <li><a href='#' onclick='discardNote()'>Delete Note</a></li>
{% if isAdmin is defined and isAdmin %} {% if isAdmin is defined and isAdmin %}
<li><a href='/index.php/reference-editor'>Reference Editor</a></li> <li><a href='/reference-editor'>Reference Editor</a></li>
{% endif %} {% endif %}
<li><a href='#' onclick="openRef()">Open Reference</a></li> <li><a href='#' onclick="openRef()">Open Reference</a></li>
<li><a href='/index.php/template-editor'>Template Editor</a></li> <li><a href='/template-editor'>Template Editor</a></li>
<li><a href='/index.php/cheat-sheet' target='_blank'>Markdown Cheat Sheet</a></li> <li><a href='/cheat-sheet' target='_blank'>Markdown Cheat Sheet</a></li>
{% else %} {% else %}
<li><a href="/index.php/">Home</a></li> <li><a href="/">Home</a></li>
<li><a href='/index.php/register'>Register</a></li> <li><a href='/register'>Register</a></li>
<li><a href='/index.php/login'>Login</a></li> <li><a href='/login'>Login</a></li>
{% endif %} {% endif %}
</ul> </ul>
</nav> </nav>

View File

@ -26,9 +26,9 @@
</select>&nbsp;&nbsp; </select>&nbsp;&nbsp;
<input type='text' name='name' id='refName' style='display:none;' />&nbsp;&nbsp; <input type='text' name='name' id='refName' style='display:none;' />&nbsp;&nbsp;
<button id='save' name='save' onclick='saveReference()'>Save</button> <button id='save' name='save' onclick='saveReference()'>Save</button>
<a href='/index.php/home'>Back</a><br /> <a href='/home'>Back</a><br />
<textarea id='reference' name='reference' rows=45 cols=100></textarea> <textarea id='reference' name='reference' rows=45 cols=100></textarea>
<script src='/js/script.js'></script> <script src='{{ asset('js/script.js') }}'></script>
</body> </body>
</html> </html>

View File

@ -13,7 +13,7 @@
</select>&nbsp;&nbsp; </select>&nbsp;&nbsp;
<input type='text' name='series_name' id='series_name' />&nbsp;&nbsp; <input type='text' name='series_name' id='series_name' />&nbsp;&nbsp;
<input type='button' name='save' value='Save' onclick='saveSeries()' />&nbsp;&nbsp; <input type='button' name='save' value='Save' onclick='saveSeries()' />&nbsp;&nbsp;
<a href='/index.php/'>Back</a> <a href='/'>Back</a>
<script src='/js/script.js'></script> <script src='/js/script.js'></script>
</body> </body>

View File

@ -13,7 +13,7 @@
</select>&nbsp;&nbsp; </select>&nbsp;&nbsp;
<input type='text' name='speaker_name' id='speaker_name' />&nbsp;&nbsp; <input type='text' name='speaker_name' id='speaker_name' />&nbsp;&nbsp;
<input type='button' name='save' value='Save' onclick='saveSpeaker()' />&nbsp;&nbsp; <input type='button' name='save' value='Save' onclick='saveSpeaker()' />&nbsp;&nbsp;
<a href='/index.php/'>Back</a> <a href='/'>Back</a>
<script src='/js/script.js'></script> <script src='/js/script.js'></script>
</body> </body>

View File

@ -14,7 +14,7 @@
</select>&nbsp;&nbsp; </select>&nbsp;&nbsp;
<input type='text' name='name' id='template_name' />&nbsp;&nbsp; <input type='text' name='name' id='template_name' />&nbsp;&nbsp;
<input type='button' name='submit' value='Save' onclick='saveTemplate()' />&nbsp;&nbsp; <input type='button' name='submit' value='Save' onclick='saveTemplate()' />&nbsp;&nbsp;
<a href='/index.php/home'>Back</a> <a href='/home'>Back</a>
<br /> <br />
<textarea id='template_value' name='template' wrap='hard' cols=100 rows=45></textarea> <textarea id='template_value' name='template' wrap='hard' cols=100 rows=45></textarea>

View File

@ -1,22 +1,29 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<style>
blockquote {
background-color: #808080;
margin: 5 5 20 5;
padding: 10px;
}
</style>
</head> </head>
<body> <body>
<p> <p>
{{ owner.name }} has shared a note with you, what follows are their formatted notes. {{ owner.name }} has shared a note with you, what follows are their formatted notes.
{% if isRegistered %} {% if isRegistered %}
You can see shared notes <a href='{{ domain }}/index.php/shared-notes'>here</a>. You can see shared notes <a href='{{ domain }}/shared-notes'>here</a>.
{% else %} {% else %}
You can register for an account <a href='{{ domain }}/index.php/register'>here</a>, or just review the notes below You can register for an account <a href='{{ domain }}/register'>here</a>, or just review the notes below
{% endif %} {% endif %}
</p> </p>
<h1>{{ note.title }}</h1> <h1>{{ note.title }}</h1>
<blockquote> <blockquote>
Passage: {{ note.passage }}<br/> <strong>Passage:</strong> {{ note.passage }}<br/>
Date: {{ note.date | date("F j Y") }}<br/> <strong>Date:</strong> {{ note.date | date("F j Y") }}<br/>
Speaker: {{ note.speaker.name }}<br/> <strong>Speaker:</strong> {{ note.speaker.name }}<br/>
Series: {{ note.series.name }}<br/> <strong>Series:</strong> {{ note.series.name }}<br/>
</blockquote> </blockquote>
{{ formattedText | raw }} {{ formattedText | raw }}

View File

@ -36,7 +36,7 @@
<button type='submit' class='btn'>Register</button> <button type='submit' class='btn'>Register</button>
{{ form_end(registrationForm) }} {{ form_end(registrationForm) }}
<!-- <!--
<form action="/index.php/register" method="post" id='registration-form'> <form action="/register" method="post" id='registration-form'>
<input type="hidden" name="_csrf_token" id="csrfToken" <input type="hidden" name="_csrf_token" id="csrfToken"
value="{{ csrf_token('authenticate') }}" value="{{ csrf_token('authenticate') }}"
> >

View File

@ -3,17 +3,17 @@
{% block title %}Login{% endblock %} {% block title %}Login{% endblock %}
{% block stylesheets %} {% block stylesheets %}
<link href='/theme/assets/css/login.css' rel='stylesheet'/> <link href='{{ asset('css/login.css') }}' rel='stylesheet'/>
<link href="/theme/assets/css/main.css" rel="stylesheet" /> <link href="{{ asset('css/main.css') }}" rel="stylesheet" />
{% endblock %} {% endblock %}
{% block javascripts %} {% block javascripts %}
<script src="/theme/assets/js/login.js"></script> <script src="{{ asset('js/login.js') }}"></script>
<script src="/theme/assets/js/jquery.min.js"></script> <script src="{{ asset('js/jquery.min.js') }}"></script>
<script src="/theme/assets/js/browser.min.js"></script> <script src="{{ asset('js/browser.min.js') }}"></script>
<script src="/theme/assets/js/breakpoints.min.js"></script> <script src="{{ asset('js/breakpoints.min.js') }}"></script>
<script src="/theme/assets/js/util.js"></script> <script src="{{ asset('js/util.js') }}"></script>
<script src="/theme/assets/js/main.js"></script> <script src="{{ asset('js/main.js') }}"></script>
{% endblock %} {% endblock %}
{% block body %} {% block body %}