Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions resources/js/vendor.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ import {
faStar, faStepForward, faStickyNote, faStop, faSyncAlt, faTags, faThList, faThumbtack, faTimes, faTransgender,
faTrashAlt, faTree, faUndo, faUniversity, faUnlink, faUpload, faUser, faUsers, faVenus, faWrench,
// For the BeautifyMarker library
faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater
faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater,
// Fact icons
faAt, faBaby, faBullhorn, faBuildingUser, faClipboardList, faCross, faDove, faFileContract, faGlobe,
faHammer, faHashtag, faHouseChimneyUser, faIdCard, faInfo, faMonument, faNoteSticky, faPenFancy,
faPeopleArrows, faPersonMilitaryRifle, faPhone, faRing, faUserGraduate
} from '@fortawesome/free-solid-svg-icons';
import 'corejs-typeahead';

Expand Down Expand Up @@ -89,7 +93,11 @@ library.add(
faStar, faStepForward, faStickyNote, faStop, faSyncAlt, faTags, faThList, faThumbtack, faTimes, faTransgender,
faTrashAlt, faTree, faUndo, faUniversity, faUnlink, faUpload, faUser, faUsers, faVenus, faWrench,
// For the BeautifyMarker library
faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater
faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater,
// Fact icons
faAt, faBaby, faBullhorn, faBuildingUser, faClipboardList, faCross, faDove, faFileContract, faGlobe,
faHammer, faHashtag, faHouseChimneyUser, faIdCard, faInfo, faMonument, faNoteSticky, faPenFancy,
faPeopleArrows, faPersonMilitaryRifle, faPhone, faRing, faUserGraduate
);
dom.watch();

Expand Down
47 changes: 43 additions & 4 deletions resources/views/fact.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,54 @@ if ($fact->target() instanceof Note) {
?>
<tr class="<?= implode(' ', $styles) ?>">
<th scope="row">
<div class="wt-fact-label ut"><?= $label?></div>
<?php if ($tree->getPreference('SHOW_FACT_ICONS') === '1') : ?>
<span class="wt-fact-icon wt-fact-icon-<?= e($tag) ?>" title="<?= strip_tags($label) ?>">
<?php
$iconMap = [
'AFN' => 'fa-hashtag',
'BAPL' => 'fa-dove',
'BAPM' => 'fa-dove',
'BIRT' => 'fa-baby',
'BURI' => 'fa-monument',
'CHR' => 'fa-dove',
'DEAT' => 'fa-cross',
'DIV' => 'fa-people-arrows',
'EMAIL' => 'fa-at',
'ENGA' => 'fa-ring',
'EVEN' => 'fa-calendar',
'FACT' => 'fa-info',
'GRAD' => 'fa-user-graduate',
'MARB' => 'fa-bullhorn',
'MARC' => 'fa-pen-fancy',
'MARR' => 'fa-ring',
'NOTE' => 'fa-note-sticky',
'OCCU' => 'fa-hammer',
'PHON' => 'fa-phone',
'PROB' => 'fa-file-contract',
'PROP' => 'fa-building-user',
'REFN' => 'fa-hashtag',
'RESI' => 'fa-house-chimney-user',
'RFN' => 'fa-hashtag',
'RIN' => 'fa-hashtag',
'WWW' => 'fa-globe',
'_FSFTID' => 'fa-id-card',
'_MILI' => 'fa-person-military-rifle',
'_TODO' => 'fa-clipboard-list',
'_UID' => 'fa-hashtag'
];
?>
<?php if (isset($iconMap[$tag])) : ?>
<i class="fa-solid <?= e($iconMap[$tag]) ?>"></i>
<?php endif ?>
</span>
<?php endif ?>
<span class="wt-fact-label ut"><?= $label?></span>

<?php if ($id !== 'histo' && $id !== 'asso' && $fact->canEdit() && !in_array($tag, ['HUSB', 'WIFE', 'CHIL', 'FAMC', 'FAMS'], true)) : ?>
<?= view('fact-edit-links', ['fact' => $fact, 'url' => $record->url()]) ?>
<?php endif ?>

<?php if ($tree->getPreference('SHOW_FACT_ICONS') === '1') : ?>
<span class="wt-fact-icon wt-fact-icon-<?= e($tag) ?>" title="<?= strip_tags($label) ?>"></span>
<?php endif ?>

</th>

<td>
Expand Down
Loading