Changed reference editor to not pass through data

This commit is contained in:
Ryan Prather 2024-05-29 00:34:50 -04:00
parent a1e921063a
commit 53e5c48aa9
2 changed files with 17 additions and 60 deletions

View File

@ -40,25 +40,7 @@ class DefaultController extends AbstractController
{ {
$this->denyAccessUnlessGranted('ROLE_ADMIN'); $this->denyAccessUnlessGranted('ROLE_ADMIN');
$creeds = $emi->getRepository(Reference::class)->findByType('creed'); return $this->render('editors/reference-editor.html.twig');
$belgic = $emi->getRepository(Reference::class)->findByType('belgic');
$heidelberg = $emi->getRepository(Reference::class)->findByType('hc');
$dort = $emi->getRepository(Reference::class)->findByType('cd');
$wcf = $emi->getRepository(Reference::class)->findByType('wcf');
$wsc = $emi->getRepository(Reference::class)->findByType('wsc');
$wlc = $emi->getRepository(Reference::class)->findByType('wlc');
$lbc = $emi->getRepository(Reference::class)->findByType('lbc');
return $this->render('editors/reference-editor.html.twig', [
'creeds' => ($creeds),
'belgic' => ($belgic),
'heidelberg' => ($heidelberg),
'dort' => ($dort),
'wcf' => ($wcf),
'wsc' => ($wsc),
'wlc' => ($wlc),
'lbc' => ($lbc),
]);
} }
#[Route('/template-editor', name: 'app_template_editor')] #[Route('/template-editor', name: 'app_template_editor')]

View File

@ -5,49 +5,24 @@
</head> </head>
<body> <body>
<select id='references' onchange='retrieveReference(this)'> <select id='referenceTypes' onchange='retrieveReferenceType(this)'>
<option value=''>-- Select Reference --</option> <option value=''>-- Select Reference --</option>
<option value='new'>-- Insert New --</option> <option value='new'>-- Insert New --</option>
<optgroup id='creeds' label='Creeds'> <option value='creed'>Creed</option>
{% for c in creeds %} <option value='belgic'>Belgic Confession</option>
<option type='creed' value='{{ c.id }}'>{{ c.name }}</option> <option value='hc'>Heidelberg Catechism</option>
{% endfor %} <option value='cd'>Canons of Dort</option>
</optgroup> <option value='wcf'>Westminster Confession of Faith</option>
<optgroup id='belgic' label='Belgic Confession'> <option value='wsc'>Westminster Shorter Catechism</option>
{% for c in belgic %} <option value='wlc'>Westminster Larger Catechism</option>
<option type='bc' value='{{ c.id }}'>{{ c.label }}</option> <option value='agc'>Augsberg Confession</option>
{% endfor %} <option value='1hc'>First Helvetic Confession</option>
</optgroup> <option value='2hc'>Second Helvetic Confession</option>
<optgroup id='heidelberg' label='Heidelberg Catechism'> <option value='sd'>Savoy Declaration</option>
{% for c in heidelberg %} <option value='39a'>Thirty-Nine Articles</option>
<option type='hc' value='{{ c.id }}'>{{ c.label }}</option> <option value='lbc'>London Baptist Confession</option>
{% endfor %} </select>&nbsp;&nbsp;
</optgroup> <select id='referenceSeries' onchange='retrieveReference(this)'>
<optgroup id='dort' label='Canons of Dort'>
{% for c in dort %}
<option type='cd' value='{{ c.id }}'>{{ c.label }}</option>
{% endfor %}
</optgroup>
<optgroup id='wcf' label='Westminster Confession of Faith'>
{% for c in wcf %}
<option type='wcf' value='{{ c.id }}'>{{ c.label }}</option>
{% endfor %}
</optgroup>
<optgroup id='wsc' label='Westminster Short Catechism'>
{% for c in wsc %}
<option type='wsc' value='{{ c.id }}'>{{ c.label }}</option>
{% endfor %}
</optgroup>
<optgroup id='wlc' label='Westminster Larger Catechism'>
{% for c in wlc %}
<option type='wlc' value='{{ c.id }}'>{{ c.label }}</option>
{% endfor %}
</optgroup>
<optgroup id='lbc' label='London Baptist Confession'>
{% for c in lbc %}
<option type='lbc' value='{{ c.id }}'>{{ c.label }}</option>
{% endfor %}
</optgroup>
</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>