<div class="alert alert-info ce-page-header">
  <div class="alert-header"><?php echo $this->user->lang("Public Style"); ?></div>
  <p class="alert-content"><?php echo $this->user->lang('Customize the public portal style.  Each template might have their own custom settings.'); ?></p>
</div>

<script data-cfasync="false" type="text/javascript">
    templateOptions = {};
    templateOptions.defaultTemplate = "<?php echo $this->default;?>";
</script>

<form id="sitesettings" name="settings" method="post" action="index.php?fuse=admin&amp;action=savetemplateoptions">

<dl class="form noborder automation-options">
    <dt><label><?php echo $this->user->lang("Template");?></label></dt>
    <dd>
        <select id="templateselector" name="templateselector">
            <?php
            foreach ($this->templates as $template) {
                if ($this->default === $template['name']) {
                    $checked = "selected='selected'";
                } else {
                    $checked = "";
                }
                echo "<option value='".$template["name"]."' ".$checked.">".$template['name']."</option>";
            }
            ?>
        </select>
    </dd>

    <dd class="full desc">
        <span>
            <?php echo $this->user->lang("Select the template you wish to set options for.   These options are template specific, so make sure you set the options for all the templates you are making available to your clients.");?>
        </span>
    </dd>
    <dt><label><?php echo $this->user->lang("Primary");?></label></dt>
    <dd>
        <select id="setDefault" name="setDefault">
            <option value="yes"><?php echo $this->user->lang("Yes");?></option>
            <option value="no"><?php echo $this->user->lang("No");?></option>
        </select>
    </dd>
    <dd class="full desc">
        <span>
            <?php echo $this->user->lang("Set the selected template as the primary client portal template.  If no template is selected as the primary template then the <b>default</b> template will be used.");?>
        </span>
    </dd>
</dl>
<button id="updatesettingbtn" class="btn" data-loading-text="<?php echo $this->user->lang("Saving");?>..."><?php echo $this->user->lang("Update Settings");?></button>
</form>