|
|
@@ -184,58 +184,63 @@ $time_of_day_options = [
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <hr />
|
|
|
+ <?php
|
|
|
+ if($project->id) {
|
|
|
+ ?>
|
|
|
+ <hr />
|
|
|
|
|
|
- <div class="row">
|
|
|
- <div class="col">
|
|
|
- <h3>Template Overrides</h3>
|
|
|
- </div>
|
|
|
- <div class="col-auto">
|
|
|
- <a class="btn btn-outline-primary" href="/account/projects/<?=$project->id?>/edit/template-overrides">Edit</a>
|
|
|
+ <div class="row">
|
|
|
+ <div class="col">
|
|
|
+ <h3>Template Overrides</h3>
|
|
|
+ </div>
|
|
|
+ <div class="col-auto">
|
|
|
+ <a class="btn btn-outline-primary" href="/account/projects/<?=$project->id?>/edit/template-overrides">Edit</a>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
- <?php
|
|
|
- $overrides = $project->getTemplateOverrides();
|
|
|
- if(empty($overrides)) {
|
|
|
- ?>
|
|
|
- <div class="alert alert-info">There are no template overrides configured for this project.</div>
|
|
|
<?php
|
|
|
- }
|
|
|
- else {
|
|
|
- $fields = $template->getFields();
|
|
|
- ?>
|
|
|
- <table class="table table-bordered table-hover">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>Field</th>
|
|
|
- <th>Element</th>
|
|
|
- <th>Value</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
+ $overrides = $project->getTemplateOverrides();
|
|
|
+ if(empty($overrides)) {
|
|
|
+ ?>
|
|
|
+ <div class="alert alert-info">There are no template overrides configured for this project.</div>
|
|
|
<?php
|
|
|
- foreach($overrides as $override) {
|
|
|
- ?>
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- <?=htmlspecialchars($fields[$override->field]->label)?>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <?=ucfirst($override->element)?>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <?=htmlspecialchars($override->value)?>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <?php
|
|
|
- }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $fields = $template->getFields();
|
|
|
?>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- <?php
|
|
|
+ <table class="table table-bordered table-hover">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Field</th>
|
|
|
+ <th>Element</th>
|
|
|
+ <th>Value</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <?php
|
|
|
+ foreach($overrides as $override) {
|
|
|
+ ?>
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <?=htmlspecialchars($fields[$override->field]->label)?>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <?=ucfirst($override->element)?>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <?=htmlspecialchars($override->value)?>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
}
|
|
|
?>
|
|
|
+
|
|
|
<hr />
|
|
|
|
|
|
<input type="hidden" name="location_ids" id="location-ids" value="<?=implode(", ", $location_ids)?>" />
|