diff --git a/ModernTheme.php b/ModernTheme.php index b34774b..69ff4d4 100644 --- a/ModernTheme.php +++ b/ModernTheme.php @@ -38,7 +38,7 @@ class ModernTheme extends MinimalTheme implements ModuleThemeInterface, ModuleCu // Module constants public const CUSTOM_AUTHOR = 'JessewebDotCom'; - public const CUSTOM_VERSION = '0.0.1'; + public const CUSTOM_VERSION = '0.0.7'; public const GITHUB_REPO = 'webtrees-theme-modern'; public const AUTHOR_WEBSITE = 'jesseweb.com'; public const CUSTOM_SUPPORT_URL = 'https://github.com/JesseWebDotCom/webtrees-theme-modern'; diff --git a/resources/css/palettes/modern/ancestry/bootstrap.css b/resources/css/palettes/modern/ancestry/bootstrap.css index cdbce1d..4a09166 100644 --- a/resources/css/palettes/modern/ancestry/bootstrap.css +++ b/resources/css/palettes/modern/ancestry/bootstrap.css @@ -86,4 +86,24 @@ a { [dir] .wt-block { border: none !important; - } \ No newline at end of file + } + +/* login page */ +.wt-route-LoginPage .wt-main-container { + padding-bottom: 1rem; + padding-top: 1rem; + width: 500px; + + background-color: white; + margin-top: 20px; + border-radius: 9px; + } + + .wt-route-LoginPage .row { + padding-bottom: 10px; + } + + .wt-route-LoginPage .col-sm-9 { + flex: 0 0 auto; + width: unset; + } \ No newline at end of file diff --git a/resources/css/palettes/modern/ancestry/bootstrap.min.css b/resources/css/palettes/modern/ancestry/bootstrap.min.css index 5f4d7a2..eb01c81 100644 --- a/resources/css/palettes/modern/ancestry/bootstrap.min.css +++ b/resources/css/palettes/modern/ancestry/bootstrap.min.css @@ -1 +1 @@ -.navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E")!important}#navbarMobile{color:white}[dir] .wt-global{background-color:rgb(246,243,240)!important;}.wt-header-wrapper,#navbarMobile{background-color:black!important;}.wt-site-title,.wt-page-title span.NAME{font-family:'Times New Roman',serif;}[dir] .navbar-toggler{color:white!important;border-color:white!important;}.nav-link{color:black!important;}.wt-header-wrapper .nav-link{color:white!important;}.wt-site-title,#navbarMobileTitle{color:white!important;}.btn-link:hover,.nav-link:hover,a:hover{text-decoration:underline;text-decoration-color:#94bf13!important;text-decoration-thickness:2px;}[dir] .card-header{border-bottom:var(--bs-card-border-width) solid rgba(0,0,0,.1);}a{color:#94bf13;}[dir] .btn,.btn:hover{background-color:#94bf13!important;border-color:#94bf13!important;text-decoration:none!important;color:white!important;}.btn-link,.btn-link:hover{color:white;text-decoration:none}[dir] .nav-pills .nav-link.active{background-color:#94bf13;color:white!important;}#navbarMobile .nav-link{color:white!important;}[dir] .form-check-input:checked{background-color:#94bf13;border-color:#94bf13}[dir] .wt-block-header{font-weight:600}.card>.card-header::before{color:black!important}[dir] .wt-block{border:none!important} \ No newline at end of file +.navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E")!important}#navbarMobile{color:white}[dir] .wt-global{background-color:rgb(246,243,240)!important;}.wt-header-wrapper,#navbarMobile{background-color:black!important;}.wt-site-title,.wt-page-title span.NAME{font-family:'Times New Roman',serif;}[dir] .navbar-toggler{color:white!important;border-color:white!important;}.nav-link{color:black!important;}.wt-header-wrapper .nav-link{color:white!important;}.wt-site-title,#navbarMobileTitle{color:white!important;}.btn-link:hover,.nav-link:hover,a:hover{text-decoration:underline;text-decoration-color:#94bf13!important;text-decoration-thickness:2px;}[dir] .card-header{border-bottom:var(--bs-card-border-width) solid rgba(0,0,0,.1);}a{color:#94bf13;}[dir] .btn,.btn:hover{background-color:#94bf13!important;border-color:#94bf13!important;text-decoration:none!important;color:white!important;}.btn-link,.btn-link:hover{color:white;text-decoration:none}[dir] .nav-pills .nav-link.active{background-color:#94bf13;color:white!important;}#navbarMobile .nav-link{color:white!important;}[dir] .form-check-input:checked{background-color:#94bf13;border-color:#94bf13}[dir] .wt-block-header{font-weight:600}.card>.card-header::before{color:black!important}[dir] .wt-block{border:none!important}.wt-route-LoginPage .wt-main-container{padding-bottom:1rem;padding-top:1rem;width:500px;background-color:white;margin-top:20px;border-radius:9px}.wt-route-LoginPage .row{padding-bottom:10px}.wt-route-LoginPage .col-sm-9{flex:0 0 auto;width:unset} \ No newline at end of file diff --git a/resources/views/chart-box.phtml b/resources/views/chart-box.phtml new file mode 100644 index 0000000..88e68a0 --- /dev/null +++ b/resources/views/chart-box.phtml @@ -0,0 +1,5 @@ + +
+ + $individual]) ?> +
diff --git a/resources/views/fact.phtml b/resources/views/fact.phtml new file mode 100644 index 0000000..eb7af0d --- /dev/null +++ b/resources/views/fact.phtml @@ -0,0 +1,174 @@ +record(); +$tree = $parent->tree(); +[, $tag] = explode(':', $fact->tag()); +$label = $fact->label(); +$value = $fact->value(); +$type = $fact->attribute('TYPE'); +$id = $fact->id(); + +$element = Registry::elementFactory()->make($fact->tag()); + +// New or deleted facts need different styling +$styles = []; +if ($fact->isPendingAddition()) { + $styles[] = 'wt-new'; +} +if ($fact->isPendingDeletion()) { + $styles[] = 'wt-old'; +} + +// Event of close relative +if ($tag === 'EVEN' && $value === 'CLOSE_RELATIVE') { + $value = ''; + $styles[] = 'wt-relation-fact collapse'; +} + +// Event of close associates +if ($id === 'asso') { + $styles[] = 'wt-associate-fact collapse'; +} + +if ($element instanceof UnknownElement && $tree->getPreference('HIDE_GEDCOM_ERRORS') === '0') { + $styles[] = 'd-none'; +} + + +// historical facts +if ($id === 'histo') { + $styles[] = 'wt-historic-fact collapse'; +} + +// Use marriage type as the label. e.g. "Civil partnership" +if ($tag === 'MARR') { + $label = $fact->label(); + $type = ''; +} + +?> + + +
+ + canEdit() && !in_array($tag, ['HUSB', 'WIFE', 'CHIL', 'FAMC', 'FAMS'], true)) : ?> + $fact, 'url' => $record->url()]) ?> + + + getPreference('SHOW_FACT_ICONS') === '1') : ?> + + + + + + target() instanceof Media) : ?> +
+ target()->mediaFiles() as $media_file) : ?> +
+ displayImage(100, 100, 'contain', []) ?> +
+ +
+ + target()->fullName() ?> + + target()->facts(['NOTE']) as $note) : ?> + $note->gedcom(), 'parent' => $fact->target()->tag(), 'tree' => $fact->record()->tree()]) ?> + + +
+ +
+ + spouses()->filter(static fn ($individual): bool => $individual !== $record) as $spouse) : ?> + tree()->getPreference('SHOW_HIGHLIGHT_IMAGES')) : ?> +
+ displayImage(40, 50, 'crop', ['class' => 'wt-chart-box-thumbnail']) ?> +
+ + fullName() ?> — + + + + tree()->getPreference('SHOW_HIGHLIGHT_IMAGES')) : ?> +
+ displayImage(40, 50, 'crop', ['class' => 'wt-chart-box-thumbnail']) ?> +
+ + fullName() ?> + +
+ + +
+ value($value, $tree) ?> + target() instanceof Individual) : ?> + get(ModuleService::class)->findByComponent(ModuleChartInterface::class, $tree, Auth::user()) + ->first(static fn (ModuleInterface $module): bool => $module instanceof RelationshipsChartModule) + ?> + + + — + get(RelationshipService::class)->getCloseRelationshipName($record, $fact->target()) ?> + + + +
+ + + +
+ make($fact->tag() . ':TYPE')->labelValue(I18N::translate($type), $tree) ?> +
+ + + 'true', 'fact' => $fact, 'record' => $record, 'time' => true]) ?> + $fact, 'record' => $record]) ?> +
+ +
+ gedcom(), $matches, PREG_SET_ORDER) ?> + + + $match[0], 'parent' => $fact->tag() . ':' . $match[1], 'tree' => $tree]) ?> + + +
+ + + $fact]) ?> + + + $fact]) ?> + $fact]) ?> + $fact]) ?> + + + \ No newline at end of file diff --git a/resources/views/individual-page copy 2.phtml b/resources/views/individual-page copy 2.phtml new file mode 100644 index 0000000..ca54e63 --- /dev/null +++ b/resources/views/individual-page copy 2.phtml @@ -0,0 +1,148 @@ +]*>\s*/s'; +preg_match($pattern, $view, $matches); +$galleryDiv = $matches[0] ?? ''; + +// Extract the image link +$imageLinkPattern = '/src="([^"]+)"/'; +preg_match($imageLinkPattern, $galleryDiv, $imageLinkMatches); +$imageLink = $imageLinkMatches[1] ?? ''; + +// Extract the link URL and text +$linkPattern = '/
\s*\s*(.*?)\s*<\/a>/s'; +preg_match($linkPattern, $galleryDiv, $linkMatches); +$linkURL = $linkMatches[1] ?? ''; +$linkText = $linkMatches[2] ?? ''; + +// Extract the title +$pattern = '/

' . + '
' . $pageTitleDiv . '
' . + '

', $view); + +// Pass the $imageLink variable to the modified view +$view = str_replace('$imageLink', $imageLink, $view); + +// Extract the original navbar background color and box shadow +$originalNavbar = '
+ + + + + + +
+ +
diff --git a/resources/views/individual-page copy.phtml b/resources/views/individual-page copy.phtml new file mode 100644 index 0000000..eb79243 --- /dev/null +++ b/resources/views/individual-page copy.phtml @@ -0,0 +1,149 @@ +]*>\s*
/s'; +preg_match($pattern, $view, $matches); +$galleryDiv = $matches[0] ?? ''; + +// Extract the image link +$imageLinkPattern = '/src="([^"]+)"/'; +preg_match($imageLinkPattern, $galleryDiv, $imageLinkMatches); +$imageLink = $imageLinkMatches[1] ?? ''; + +// Extract the link URL and text +$linkPattern = '/
\s*\s*(.*?)\s*<\/a>/s'; +preg_match($linkPattern, $galleryDiv, $linkMatches); +$linkURL = $linkMatches[1] ?? ''; +$linkText = $linkMatches[2] ?? ''; + +// Extract the title +$pattern = '/

' . + '' . + '
' . $pageTitleDiv . '
' . + '

', $view); + +// Pass the $imageLink variable to the modified view +$modifiedView = str_replace('$imageLink', $imageLink, $modifiedView); + +// Extract the original navbar background color and box shadow +$originalNavbar = '
+ + + + + + +
+ +
diff --git a/resources/views/individual-page-title.phtml b/resources/views/individual-page-title.phtml new file mode 100644 index 0000000..95add0d --- /dev/null +++ b/resources/views/individual-page-title.phtml @@ -0,0 +1,10 @@ +', $view); + +echo $view; + +?> diff --git a/resources/views/modules/random_media/slide-show.phtml b/resources/views/modules/random_media/slide-show.phtml new file mode 100644 index 0000000..a77288b --- /dev/null +++ b/resources/views/modules/random_media/slide-show.phtml @@ -0,0 +1,129 @@ + $linked_families + * @var Collection $linked_individuals + * @var Collection $linked_sources + * @var Media $media + * @var MediaFile $media_file + * @var bool $show_controls + * @var bool $start_automatically + * @var Tree $tree + */ + +?> + +
+ + + + +
+ displayImage(200, 200, 'contain', ['class' => 'slide-show-image img-fluid']) ?> +
+ + fullName() ?> + +
+
+ +

+ facts(['NOTE']) as $fact) : ?> + $fact->gedcom(), 'parent' => $media->tag(), 'tree' => $tree]) ?> + +

+ + +
+ +