diff options
| -rw-r--r-- | app/FontAwesome.php | 19 | ||||
| -rw-r--r-- | resources/views/admin/locations.phtml | 5 | ||||
| -rw-r--r-- | resources/views/edit/reorder-children.phtml | 3 | ||||
| -rw-r--r-- | resources/views/edit/reorder-media.phtml | 3 | ||||
| -rw-r--r-- | resources/views/edit/reorder-names.phtml | 3 | ||||
| -rw-r--r-- | resources/views/edit/reorder-spouses.phtml | 3 | ||||
| -rw-r--r-- | resources/views/icons/individual.phtml | 2 | ||||
| -rw-r--r-- | resources/views/media-list-page.phtml | 27 | ||||
| -rw-r--r-- | resources/views/modals/media-file-fields.phtml | 4 | ||||
| -rw-r--r-- | resources/views/modals/on-screen-keyboard.phtml | 4 | ||||
| -rw-r--r-- | resources/views/modules/census-assistant.phtml | 10 | ||||
| -rw-r--r-- | resources/views/modules/recent_changes/changes-table.phtml | 25 |
12 files changed, 50 insertions, 58 deletions
diff --git a/app/FontAwesome.php b/app/FontAwesome.php index 3d685452cd..0872e592ad 100644 --- a/app/FontAwesome.php +++ b/app/FontAwesome.php @@ -104,25 +104,6 @@ class FontAwesome extends Html } /** - * Generate a semantic icon. - * - * These icons convey meaning, such as status/type/mode, and need - * to allow assistive technology to display this meaning. - * - * @param string $icon The icon to show - * @param string $title The meaning of the icon - * @param string[] $attributes Additional HTML attributes - * - * @return string - */ - public static function semanticIcon($icon, $title, $attributes = []): string - { - $attributes['title'] = $title; - - return self::decorativeIcon($icon, $attributes) . '<span class="sr-only">' . $title . '</span>'; - } - - /** * Generate a link icon. * * @param string $icon The icon to show diff --git a/resources/views/admin/locations.phtml b/resources/views/admin/locations.phtml index a7244e7e38..b815fe39f8 100644 --- a/resources/views/admin/locations.phtml +++ b/resources/views/admin/locations.phtml @@ -1,5 +1,4 @@ <?php use Fisharebest\Webtrees\Bootstrap4; ?> -<?php use Fisharebest\Webtrees\FontAwesome; ?> <?php use Fisharebest\Webtrees\I18N; ?> <?php use Fisharebest\Webtrees\Tree; ?> <?php use Fisharebest\Webtrees\Webtrees; ?> @@ -73,8 +72,8 @@ data-confirm="<?= I18N::translate('Remove this location?') ?>" onsubmit="return confirm(this.dataset.confirm)"> <?= csrf_field() ?> - <button type="submit" class="btn btn-danger"> - <?= FontAwesome::semanticIcon('delete', I18N::translate('delete')) ?> + <button type="submit" class="btn btn-danger" aria-label="<?= I18N::translate('delete') ?>"> + <?= view('icons/delete') ?> </button> </form> <?php else : ?> diff --git a/resources/views/edit/reorder-children.phtml b/resources/views/edit/reorder-children.phtml index 8a3ab61f8d..c23426b68e 100644 --- a/resources/views/edit/reorder-children.phtml +++ b/resources/views/edit/reorder-children.phtml @@ -1,4 +1,3 @@ -<?php use Fisharebest\Webtrees\FontAwesome; ?> <?php use Fisharebest\Webtrees\Gedcom; ?> <?php use Fisharebest\Webtrees\I18N; ?> <?php use Fisharebest\Webtrees\View; ?> @@ -12,7 +11,7 @@ <div class="card mb-2 wt-sortable-item" data-sortbydate="<?= $fact->target()->getBirthDate()->julianDay() ?>"> <input type="hidden" name="order[]" value="<?= $fact->id() ?>"> <h3 class="card-header"> - <?= FontAwesome::semanticIcon('drag-handle', '') ?> + <?= view('icons/drag-handle') ?> <?= $fact->target()->getFullName() ?> </h3> <div class="card-body"> diff --git a/resources/views/edit/reorder-media.phtml b/resources/views/edit/reorder-media.phtml index 8c6af7ce5e..2df128d36f 100644 --- a/resources/views/edit/reorder-media.phtml +++ b/resources/views/edit/reorder-media.phtml @@ -1,4 +1,3 @@ -<?php use Fisharebest\Webtrees\FontAwesome; ?> <?php use Fisharebest\Webtrees\I18N; ?> <?php use Fisharebest\Webtrees\View; ?> @@ -11,7 +10,7 @@ <div class="card mb-2 wt-sortable-item"> <input type="hidden" name="order[]" value="<?= $fact->id() ?>"> <h3 class="card-header"> - <?= FontAwesome::semanticIcon('drag-handle', '') ?> + <?= view('icons/drag-handle') ?> <?= $fact->target()->getFullName() ?> </h3> <div class="card-body"> diff --git a/resources/views/edit/reorder-names.phtml b/resources/views/edit/reorder-names.phtml index 6fab4d0109..7260f5b684 100644 --- a/resources/views/edit/reorder-names.phtml +++ b/resources/views/edit/reorder-names.phtml @@ -1,4 +1,3 @@ -<?php use Fisharebest\Webtrees\FontAwesome; ?> <?php use Fisharebest\Webtrees\GedcomCode\GedcomCodeName; ?> <?php use Fisharebest\Webtrees\GedcomTag; ?> <?php use Fisharebest\Webtrees\I18N; ?> @@ -13,7 +12,7 @@ <div class="card mb-2 wt-sortable-item"> <input type="hidden" name="order[]" value="<?= $fact->id() ?>"> <h3 class="card-header"> - <?= FontAwesome::semanticIcon('drag-handle', '') ?> + <?= view('icons/drag-handle') ?> <?= $fact->value() ?> </h3> <div class="card-body"> diff --git a/resources/views/edit/reorder-spouses.phtml b/resources/views/edit/reorder-spouses.phtml index 7121b65a55..2da64355d9 100644 --- a/resources/views/edit/reorder-spouses.phtml +++ b/resources/views/edit/reorder-spouses.phtml @@ -1,4 +1,3 @@ -<?php use Fisharebest\Webtrees\FontAwesome; ?> <?php use Fisharebest\Webtrees\Gedcom; ?> <?php use Fisharebest\Webtrees\I18N; ?> <?php use Fisharebest\Webtrees\View; ?> @@ -12,7 +11,7 @@ <div class="card mb-2 wt-sortable-item" data-sortbydate="<?= $fact->target()->getMarriageDate()->julianDay() ?>"> <input type="hidden" name="order[]" value="<?= $fact->id() ?>"> <h3 class="card-header"> - <?= FontAwesome::semanticIcon('drag-handle', '') ?> + <?= view('icons/drag-handle') ?> <?= $fact->target()->getFullName() ?> </h3> <div class="card-body"> diff --git a/resources/views/icons/individual.phtml b/resources/views/icons/individual.phtml index 87e015cf35..ade451cb74 100644 --- a/resources/views/icons/individual.phtml +++ b/resources/views/icons/individual.phtml @@ -1 +1 @@ -<i class="far fa-user fa-fw wt-icon-family" aria-hidden="true"></i> +<i class="far fa-user fa-fw wt-icon-individual" aria-hidden="true"></i> diff --git a/resources/views/media-list-page.phtml b/resources/views/media-list-page.phtml index d10b4f59cd..ea9b10977f 100644 --- a/resources/views/media-list-page.phtml +++ b/resources/views/media-list-page.phtml @@ -156,16 +156,23 @@ </p> </div> <div class="card-footer"> - <?php - foreach ($media_object->linkedIndividuals('OBJE') as $individual) { - echo '<a href="' . e($individual->url()) . '">' . FontAwesome::semanticIcon('individual', I18N::translate('Individual')) . ' ' . $individual->getFullName() . '</a><br>'; - } - foreach ($media_object->linkedFamilies('OBJE') as $family) { - echo '<a href="' . e($family->url()) . '">' . FontAwesome::semanticIcon('family', I18N::translate('Family')) . ' ' . $family->getFullName() . '</a><br>'; - } - foreach ($media_object->linkedSources('OBJE') as $source) { - echo '<a href="' . e($source->url()) . '">' . FontAwesome::semanticIcon('source', I18N::translate('Source')) . ' ' . $source->getFullName() . '</a><br>'; - } ?> + <?php foreach ($media_object->linkedIndividuals('OBJE') as $record) : ?> + <?= view('icons/individual') ?> + <a href="<?= e($record->url()) ?>"><?= $record->getFullName() ?></a> + <br> + <?php endforeach ?> + + <?php foreach ($media_object->linkedFamilies('OBJE') as $record) : ?> + <?= view('icons/family') ?> + <a href="<?= e($record->url()) ?>"><?= $record->getFullName() ?></a> + <br> + <?php endforeach ?> + + <?php foreach ($media_object->linkedSources('OBJE') as $record) : ?> + <?= view('icons/source') ?> + <a href="<?= e($record->url()) ?>"><?= $record->getFullName() ?></a> + <br> + <?php endforeach ?> </div> </div> </div> diff --git a/resources/views/modals/media-file-fields.phtml b/resources/views/modals/media-file-fields.phtml index 82ba0c4f52..e8974083c2 100644 --- a/resources/views/modals/media-file-fields.phtml +++ b/resources/views/modals/media-file-fields.phtml @@ -90,7 +90,9 @@ <div class="col-sm-10"> <input class="form-control" type="url" id="remote" name="remote" placeholder="https://www.example.com/photo.jpeg" value="<?= e($media_file && $media_file->isExternal() ? $media_file->filename() : '') ?>"> <small class="text-muted"> - <?= \Fisharebest\Webtrees\FontAwesome::semanticIcon('warning', I18N::translate('Caution!')) ?> + <?= view('icons/warning') ?> + <span class="sr-only"><?= I18N::translate('Caution!') ?></span> + <?= I18N::translate('The GEDCOM standard does not allow URLs in media objects.') ?> <?= I18N::translate('Other genealogy applications might not recognize this data.') ?> </small> diff --git a/resources/views/modals/on-screen-keyboard.phtml b/resources/views/modals/on-screen-keyboard.phtml index 4e858cafa7..4677dbf211 100644 --- a/resources/views/modals/on-screen-keyboard.phtml +++ b/resources/views/modals/on-screen-keyboard.phtml @@ -1,11 +1,11 @@ -<?php use Fisharebest\Webtrees\FontAwesome; ?> <?php use Fisharebest\Webtrees\I18N; ?> + <div class="card wt-osk"> <div class="card-header"> <div class="card-title"> <button type="button" class="btn btn-primary wt-osk-close">×</button> - <button type="button" class="btn btn-secondary wt-osk-pin-button" data-toggle="button" aria-pressed="false"><?= FontAwesome::semanticIcon('pin', I18N::translate('Keep open')) ?></button> + <button type="button" class="btn btn-secondary wt-osk-pin-button" data-toggle="button" aria-pressed="false" aria-label="<?= I18N::translate('Keep open') ?>"><?= view('icons/pin') ?></button> <button type="button" class="btn btn-secondary wt-osk-shift-button" data-toggle="button" aria-pressed="false">a ↔ A</button> diff --git a/resources/views/modules/census-assistant.phtml b/resources/views/modules/census-assistant.phtml index 997d56b35c..42311084d0 100644 --- a/resources/views/modules/census-assistant.phtml +++ b/resources/views/modules/census-assistant.phtml @@ -1,5 +1,4 @@ <?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?> -<?php use Fisharebest\Webtrees\FontAwesome; ?> <?php use Fisharebest\Webtrees\I18N; ?> <?php use Fisharebest\Webtrees\View; ?> @@ -55,14 +54,13 @@ </div> <?= FunctionsEdit::formControlIndividual($individual->tree(), $individual, ['id' => 'census-assistant-individual', 'style' => 'width:100%']) ?> <span class="input-group-btn"> - <button type="button" class="btn btn-primary" id="census-assistant-add"> - <?= FontAwesome::semanticIcon('add', I18N::translate('Add')) ?> + <button type="button" class="btn btn-primary" id="census-assistant-add" aria-label="<?= I18N::translate('add') ?>"> + <?= view('icons/add') ?> </button> </span> <span class="input-group-btn"> - <button type="button" class="btn btn-primary" id="census-assistant-head" - title="<?= I18N::translate('Head of household') ?>"> - <?= FontAwesome::semanticIcon('individual', I18N::translate('Head of household')) ?> + <button type="button" class="btn btn-primary" id="census-assistant-head" aria-label="<?= I18N::translate('Head of household') ?>"> + <?= view('icons/individual') ?> </button> </span> </div> diff --git a/resources/views/modules/recent_changes/changes-table.phtml b/resources/views/modules/recent_changes/changes-table.phtml index e09677e89b..cb3b65dd4c 100644 --- a/resources/views/modules/recent_changes/changes-table.phtml +++ b/resources/views/modules/recent_changes/changes-table.phtml @@ -1,4 +1,3 @@ -<?php use Fisharebest\Webtrees\FontAwesome; ?> <?php use Fisharebest\Webtrees\I18N; ?> <?php use Fisharebest\Webtrees\View; ?> @@ -28,27 +27,37 @@ <tr> <td data-sort="<?= $record::RECORD_TYPE ?>" class="text-centre"> <?php if ($record::RECORD_TYPE === 'INDI') : ?> - <?= FontAwesome::semanticIcon('individual', I18N::translate('Individual')) ?> + <?= view('icons/individual') ?> + <span class="sr-only"><?= I18N::translate('Individual') ?></span> <?php elseif ($record::RECORD_TYPE === 'FAM') : ?> - <?= FontAwesome::semanticIcon('family', I18N::translate('Family')) ?> + <?= view('icons/family') ?> + <span class="sr-only"><?= I18N::translate('Family') ?></span> <?php elseif ($record::RECORD_TYPE === 'OBJE') : ?> - <?= FontAwesome::semanticIcon('media', I18N::translate('Media')) ?> + <?= view('icons/media') ?> + <span class="sr-only"><?= I18N::translate('Media') ?></span> <?php elseif ($record::RECORD_TYPE === 'NOTE') : ?> - <?= FontAwesome::semanticIcon('note', I18N::translate('Note')) ?> + <?= view('icons/note') ?> + <span class="sr-only"><?= I18N::translate('Note') ?></span> <?php elseif ($record::RECORD_TYPE === 'SOUR') : ?> - <?= FontAwesome::semanticIcon('source', I18N::translate('Source')) ?> + <?= view('icons/source') ?> + <span class="sr-only"><?= I18N::translate('Source') ?></span> <?php elseif ($record::RECORD_TYPE === 'SUBM') : ?> - <?= FontAwesome::semanticIcon('submitter', I18N::translate('Submitter')) ?> + <?= view('icons/submitter') ?> + <span class="sr-only"><?= I18N::translate('Submitter') ?></span> <?php elseif ($record::RECORD_TYPE === 'REPO') : ?> - <?= FontAwesome::semanticIcon('repository', I18N::translate('Repository')) ?> + <?= view('icons/repository') ?> + <span class="sr-only"><?= I18N::translate('Repository') ?></span> <?php endif ?> </td> + <td data-sort="<?= e($record->getSortName()) ?>"> <a href="<?= e($record->url()) ?>"><?= $record->getFullName() ?></a> </td> + <td data-sort="<?= $record->lastChangeTimestamp(true) ?>"> <?= $record->lastChangeTimestamp() ?> </td> + <?php if ($show_user) : ?> <td> <?= e($record->lastChangeUser()) ?> |
