Skip to content

Commit

Permalink
Make the help address optional, and configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
robol committed Sep 25, 2024
1 parent 6d8ea52 commit efc44a5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion backend/src/Model/Table/SettingsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class SettingsTable extends Table
[ 'field' => 'disclaimer', 'value' => '', 'fieldtype' => 'text' ],
[ 'field' => 'notified-emails', 'value' => '', 'fieldtype' => 'text' ],
[ 'field' => 'approval-signature-text', 'value' => '', 'fieldtype' => 'text' ],
[ 'field' => 'pdf-name', 'value' => 'CAPS_%d_%n_%s_%c']
[ 'field' => 'pdf-name', 'value' => 'CAPS_%d_%n_%s_%c'],
[ 'field' => 'support-email', 'value' => ''],
];

private $settingsInstance = null;
Expand Down
7 changes: 7 additions & 0 deletions backend/templates/Settings/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
</textarea>
</div>

<div class="form-group">
<label for="caps-setting-support-email" class="caps-setting-header">Email di supporto</label>
<div class="caps-setting-description">Questo indirizzo viene mostrato all'utente nella barra laterale per
contattare il supporto. Se non impostato, il bottone non è mostrato.</div>
<input id="caps-setting-support-email" name="support-email" class="form-control" value="<?= h($settings['support-email']); ?>"></input>
</div>

<?= $this->element('card-end') ?>

<?= $this->element('card-start', [ 'header' => 'Piani di studio' ]) ?>
Expand Down
4 changes: 3 additions & 1 deletion backend/templates/element/sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,15 @@
<?php endif; ?>

<!-- Divider -->
<?php if($settings['support-email']): ?>
<hr class="sidebar-divider">
<li class="nav-item">
<a class="nav-link" href="mailto:[email protected]">
<a class="nav-link" href="mailto:<?= $settings['support-email'] ?>">
<i class="fas f-fw fa-at"></i>
<span>Supporto</span>
</a>
</li>
<?php endif; ?>

</ul>
<!-- End of Sidebar -->

0 comments on commit efc44a5

Please sign in to comment.