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');
$creeds = $emi->getRepository(Reference::class)->findByType('creed');
$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),
]);
return $this->render('editors/reference-editor.html.twig');
}
#[Route('/template-editor', name: 'app_template_editor')]

View File

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