| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <div class="container mt-3 py-4">
- <form method="post">
- <h3>Active Template Overrides</h3>
- <?php
- if(empty($template_overrides)) {
- ?>
- <div class="alert alert-info">There are no active template overrides 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>
- <th>Action</th>
- </tr>
- </thead>
- <tbody>
- <?php
- foreach($template_overrides as $override) {
- ?>
- <tr>
- <td class="align-middle">
- <?=htmlspecialchars($fields[$override->field]->label)?>
- </td>
- <td class="align-middle">
- <?=ucfirst($override->element)?>
- </td>
- <td class="align-middle">
- <?=htmlspecialchars($override->value)?>
- </td>
- <td class="text-right">
- <button type="submit" name="delete" value="<?=htmlspecialchars($override->field)?>-<?=htmlspecialchars($override->element)?>" class="btn btn-sm btn-danger">Delete</button>
- </td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
- <input type="hidden" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>" />
- <?php
- }
- ?>
- </form>
- <form method="post">
- <h3>Add Template Override</h3>
- <input type="hidden" name="add" value="1" />
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label">
- Field
- </label>
- <div class="col-sm">
- <select class="form-control" name="field" required>
- <option value="">Select Field</option>
- <?php
- foreach($fields as $value => $field) {
- ?>
- <option value="<?=htmlspecialchars($field->name)?>"><?=htmlspecialchars($field->label)?></option>
- <?php
- }
- ?>
- </select>
- </div>
- </div>
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label">
- Element
- </label>
- <div class="col-sm">
- <select class="form-control" name="element" required>
- <option value="label">Label</option>
- </select>
- </div>
- </div>
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label">
- Value
- </label>
- <div class="col-sm">
- <input class="form-control" type="text" name="value" placeholder="Type override value" required />
- </div>
- </div>
- <div class="row">
- <div class="col-sm offset-sm-4">
- <button class="btn btn-primary" type="submit" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>">Add Override</button>
- </div>
- </div>
- </form>
- </div>
|