Skip to content

Commit 2f1f460

Browse files
authored
Merge pull request #200 from ltb-project/171-tooltips-for-attributes
Tooltips for attributes
2 parents ecbae0c + ea591f2 commit 2f1f460

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ LDAP Tool Box White Pages documentation
2525
csvexport.rst
2626
vcardexport.rst
2727
updateinfos.rst
28+
tooltips.rst

docs/tooltips.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Tooltips
2+
========
3+
4+
Some tooltips can be added on update info page for each item.
5+
6+
By default no tooltips are defined. You can create one in the custom lang file in configuration directory by setting the ``tooltip_item`` message.
7+
8+
For example to add a tooltip on mail item, edit or create ``/etc/white-pages/en.inc.php``:
9+
10+
.. code-block:: php
11+
12+
$messages['tooltip_mail'] = "Please do not use a personal email";
13+

templates/footer.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
<script src="vendor/datatables/buttons.print.min.js"></script>
1616
<script src="vendor/datatables/buttons.bootstrap5.min.js"></script>
1717
{/if}
18+
<script>
19+
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
20+
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
21+
</script>
1822
{if $use_updateinfos}
1923
<script src="js/update.js"></script>
2024
{/if}

templates/updateinfos.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
</th>
5656
<th class="d-none d-sm-table-cell">
5757
{$msg_label_{$item}}
58+
{if $msg_tooltip_{$item}}<span data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="{$msg_tooltip_{$item}}"><i class="fa fa-fw fa-regular fa-circle-question"></i></span>{/if}
5859
</th>
5960
<td>
6061
{if $item|in_array:$update_items}

0 commit comments

Comments
 (0)