| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <?php
- $tester_invoice_fields = $template->getTesterInvoiceFields();
- $customer_invoice_fields = $template->getCustomerInvoiceFields();
- $template_keys = $template->getTemplateKeys();
- ?>
- <div class="container pt-3 my-4">
- <div class="row">
- <div class="col align-self-center">
- <h2><?=htmlspecialchars($template->name)?> Template</h2>
- </div>
- <div class="col-auto align-self-center">
- <a class="btn btn-outline-primary" href="/account/templates/<?=$template->id?>/edit">Edit</a>
- </div>
- </div>
- <div class="row">
- <div class="col-lg-6">
- <div class="card mb-3">
- <div class="card-header">
- Tester Invoice Fields
- </div>
- <div class="card-body">
- <?php
- if(empty($tester_invoice_fields)) {
- ?>
- None configured.
- <?php
- }
- else {
- ?>
- The following costs will be included in testers' invoices:
- <?php
- }
- ?>
- </div>
- <div class="list-group list-group-flush">
- <?php
- foreach($tester_invoice_fields as $field) {
- ?>
- <div class="list-group-item">
- <code><?=htmlspecialchars($field->name)?></code> as
- "<?=htmlspecialchars($field->label)?>"
- </div>
- <?php
- }
- ?>
- </div>
- </div>
- </div>
- <div class="col-lg-6">
- <div class="card mb-3">
- <div class="card-header">
- Customer Invoice Fields
- </div>
- <div class="card-body">
- <?php
- if(empty($tester_invoice_fields)) {
- ?>
- None configured.
- <?php
- }
- else {
- ?>
- The following costs will be included in customer invoices:
- <?php
- }
- ?>
- </div>
- <div class="list-group list-group-flush">
- <?php
- foreach($customer_invoice_fields as $field) {
- ?>
- <div class="list-group-item">
- <code><?=htmlspecialchars($field->name)?></code> as
- "<?=htmlspecialchars($field->label)?>"
- </div>
- <?php
- }
- ?>
- </div>
- </div>
- </div>
- </div>
- <?php
- if($template_keys) {
- ?>
- <div class="card mb-3">
- <div class="card-header">
- Template Tags
- </div>
- <div class="card-body">
- <form method="get">
- This template has the following toggleable tags:
- <div class="form-group">
- <?php
- foreach($template_keys as $key) {
- $checked = in_array($key, $keys) ? "checked" : "";
- $id = sprintf("key-%s", $key);
- ?>
- <div class="custom-control custom-switch">
- <input type="checkbox" class="custom-control-input" name="keys[]" id="<?=$key?>" value="<?=$key?>" <?=$checked?> />
- <label class="custom-control-label" for="<?=$key?>"><?=$key?></label>
- </div>
- <?php
- }
- ?>
- </div>
- <button type="submit" class="btn btn-primary">Reload Page</button>
- </form>
- </div>
- </div>
- <?php
- }
- ?>
- <div class="card mb-3">
- <div class="card-header">
- Before Test Form Preview
- </div>
- <div class="card-body">
- <div class="row">
- <div class="col-md-6 offset-md-3">
- <?php
- $template->renderBeforeTestForm();
- ?>
- </div>
- </div>
- </div>
- </div>
- <div class="card mb-3">
- <div class="card-header">
- During Test Form Preview
- </div>
- <div class="card-body">
- <div class="row">
- <div class="col-md-6 offset-md-3">
- <?php
- $template->renderDuringTestForm();
- ?>
- </div>
- </div>
- </div>
- </div>
- </div>
|