summaryrefslogtreecommitdiff
path: root/resources/views/modules
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-12-02 20:35:43 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-12-02 20:35:43 +0000
commitff995987d4f49998b73210a12a1cd47e39ef63a0 (patch)
treefa7cde64ebbd935654d1e6235f60c3b20349bb39 /resources/views/modules
parentb6cbda56211056b0a196beca59a08357e110cc70 (diff)
downloadwebtrees-ff995987d4f49998b73210a12a1cd47e39ef63a0.tar.gz
webtrees-ff995987d4f49998b73210a12a1cd47e39ef63a0.tar.bz2
webtrees-ff995987d4f49998b73210a12a1cd47e39ef63a0.zip
Move module views to the views/modules folder
Diffstat (limited to 'resources/views/modules')
-rw-r--r--resources/views/modules/branches/list.phtml3
-rw-r--r--resources/views/modules/individual-list/page.phtml7
-rw-r--r--resources/views/modules/media-list/page.phtml208
-rw-r--r--resources/views/modules/note-list/page.phtml7
-rw-r--r--resources/views/modules/repository-list/page.phtml7
-rw-r--r--resources/views/modules/source-list/page.phtml7
6 files changed, 239 insertions, 0 deletions
diff --git a/resources/views/modules/branches/list.phtml b/resources/views/modules/branches/list.phtml
new file mode 100644
index 0000000000..5c0c15df45
--- /dev/null
+++ b/resources/views/modules/branches/list.phtml
@@ -0,0 +1,3 @@
+<ol>
+ <?= $branches ?>
+</ol>
diff --git a/resources/views/modules/individual-list/page.phtml b/resources/views/modules/individual-list/page.phtml
new file mode 100644
index 0000000000..fc9de325be
--- /dev/null
+++ b/resources/views/modules/individual-list/page.phtml
@@ -0,0 +1,7 @@
+<h2 class="wt-page-title">
+ <?= $title ?>
+</h2>
+
+<div class="wt-page-content">
+ <?= $content ?>
+</div>
diff --git a/resources/views/modules/media-list/page.phtml b/resources/views/modules/media-list/page.phtml
new file mode 100644
index 0000000000..041925d652
--- /dev/null
+++ b/resources/views/modules/media-list/page.phtml
@@ -0,0 +1,208 @@
+<?php
+
+use Fisharebest\Webtrees\Auth;
+use Fisharebest\Webtrees\Functions\FunctionsEdit;
+use Fisharebest\Webtrees\Functions\FunctionsPrint;
+use Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
+use Fisharebest\Webtrees\GedcomTag;
+use Fisharebest\Webtrees\I18N;
+
+?>
+
+<h2 class="wt-page-title">
+ <?= $title ?>
+</h2>
+
+<form method="post" class="wt-page-options wt-page-options-media-list d-print-none">
+ <?= csrf_field() ?>
+
+ <div class="row form-group">
+ <label class="col-sm-3 col-form-label wt-page-options-label" for="folder">
+ <?= I18N::translate('Folder') ?>
+ </label>
+ <div class="col-sm-3 wt-page-options-value">
+ <?= view('components/select', ['name' => 'folder', 'selected' => $folder, 'options' => $folders]) ?>
+ <?= view('components/checkbox-inline', ['label' => /* I18N: Label for check-box */ I18N::translate('Include subfolders'), 'name' => 'subdirs', 'checked' => $subdirs === '1']) ?>
+ </div>
+
+ <label class="col-sm-3 col-form-label wt-page-options-label" for="max">
+ <?= I18N::translate('Media objects per page') ?>
+ </label>
+ <div class="col-sm-3 wt-page-options-value">
+ <?= view('components/select', ['name' => 'max', 'selected' => $max, 'options' => FunctionsEdit::numericOptions([10, 20, 30, 40, 50, 75, 100, 150, 200])]) ?>
+ </div>
+ </div>
+
+ <div class="row form-group">
+ <label class="col-sm-3 col-form-label wt-page-options-label" for="form-type">
+ <?= I18N::translate('Type') ?>
+ </label>
+ <div class="col-sm-3 wt-page-options-value">
+ <?= view('components/select', ['name' => 'form_type', 'id' => 'form-type', 'selected' => $form_type, 'options' => ['' => ''] + $formats]) ?>
+ </div>
+
+ <div class="col-sm-3 col-form-label wt-page-options-label">
+ </div>
+ <div class="col-sm-3 wt-page-options-value">
+ </div>
+ </div>
+
+ <div class="row form-group">
+ <label class="col-sm-3 col-form-label wt-page-options-label" for="filter">
+ <?= I18N::translate('Search filters') ?>
+ </label>
+ <div class="col-sm-3 wt-page-options-value">
+ <input type="text" class="form-control" name="filter" id="filter" value="<?= e($filter) ?>">
+ </div>
+
+ <div class="col-sm-3 col-form-label wt-page-options-label">
+ </div>
+ <div class="col-sm-3 wt-page-options-value">
+ <button type="submit" name="action2" value="1" class="btn btn-primary">
+ <?= /* I18N: A button label. */ I18N::translate('search') ?>
+ </button>
+ <a class="btn btn-secondary" href="<?= e(route('module', ['module' => $module, 'action' => $action, 'tree' => $tree->name()])) ?>">
+ <?= /* I18N: A button label. */ I18N::translate('reset') ?>
+ </a>
+ </div>
+ </div>
+</form>
+
+<div class="wt-page-content">
+ <?php if ($media_objects->isNotEmpty()) : ?>
+ <p class="text-center mt-4"><?= I18N::translate('Media objects found') ?> <?= I18N::number($count) ?></p>
+
+ <div class="row text-center">
+ <div class="col">
+ <?php if ($page > 1) : ?>
+ <a href="<?= e(route('module', ['module' => $module, 'action' => $action, 'tree' => $tree->name(), 'action2' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'form_type' => $form_type, 'max' => $max, 'page' => 1])) ?>">
+ <?= I18N::translate('first') ?>
+ </a>
+ <?php endif ?>
+ </div>
+ <div class="col">
+ <?php if ($page > 1) : ?>
+ <a href="<?= e(route('module', ['module' => $module, 'action' => $action, 'tree' => $tree->name(), 'action2' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'form_type' => $form_type, 'max' => $max, 'page' => $page - 1])) ?>">
+ <?= I18N::translate('previous') ?>
+ </a>
+ <?php endif ?>
+ </div>
+ <div class="col">
+ <?= I18N::translate('Page %s of %s', $page, $pages) ?>
+ </div>
+ <div class="col">
+ <?php if ($page < $pages) : ?>
+ <a href="<?= e(route('module', ['module' => $module, 'action' => $action, 'tree' => $tree->name(), 'action2' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'form_type' => $form_type, 'max' => $max, 'page' => $page + 1])) ?>">
+ <?= I18N::translate('next') ?>
+ </a>
+ <?php endif ?>
+ </div>
+ <div class="col">
+ <?php if ($page < $pages) : ?>
+ <a href="<?= e(route('module', ['module' => $module, 'action' => $action, 'tree' => $tree->name(), 'action2' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'form_type' => $form_type, 'max' => $max, 'page' => $pages])) ?>">
+ <?= I18N::translate('last') ?>
+ </a>
+ <?php endif ?>
+ </div>
+ </div>
+
+ <div class="card-deck row mb-4 mt-4">
+ <?php foreach ($media_objects as $n => $media_object) : ?>
+ <div class="col-xs-12 col-sm-6 col-lg-4 d-flex">
+ <div class="card mb-4">
+ <div class="card-header">
+ <h4 class="card-title">
+ <a href="<?= e($media_object->url()) ?>"><?= $media_object->fullName() ?></a>
+ </h4>
+ </div>
+ <div class="card-body">
+ <?php foreach ($media_object->mediaFiles() as $media_file) : ?>
+ <?= $media_file->displayImage(300, 200, 'contain', ['class' => 'img-fluid']) ?>
+ <?php endforeach ?>
+
+ <p class="card-text">
+ <?php
+ // Show file details
+ $mediatype = $media_file->type();
+ if ($mediatype) {
+ echo GedcomTag::getLabelValue('TYPE', GedcomTag::getFileFormTypeValue($mediatype));
+ }
+ echo FunctionsPrintFacts::printFactSources($tree, $media_object->gedcom(), 1);
+ echo FunctionsPrint::printFactNotes($tree, $media_object->gedcom(), 1);
+ if ($media_file->isExternal()) {
+ echo GedcomTag::getLabelValue('URL', $media_file->filename());
+ } elseif ($media_file->fileExists($data_filesystem)) {
+ echo GedcomTag::getLabelValue('FORM', $media_file->mimeType());
+ if (Auth::isEditor($tree)) {
+ echo GedcomTag::getLabelValue('FILE', $media_file->filename());
+ }
+ if (Auth::isEditor($tree)) {
+ foreach ($media_file->attributes($data_filesystem) as $tag => $value) {
+ echo GedcomTag::getLabelValue($tag, $value);
+ }
+ }
+ } else {
+ echo '<p class="alert alert-danger">', /* I18N: %s is a filename */ I18N::translate('The file ā€œ%sā€ does not exist.', $media_file->filename()), '</p>';
+ }
+ ?>
+ </p>
+ </div>
+ <div class="card-footer">
+ <?php foreach ($media_object->linkedIndividuals('OBJE') as $record) : ?>
+ <?= view('icons/individual') ?>
+ <a href="<?= e($record->url()) ?>"><?= $record->fullName() ?></a>
+ <br>
+ <?php endforeach ?>
+
+ <?php foreach ($media_object->linkedFamilies('OBJE') as $record) : ?>
+ <?= view('icons/family') ?>
+ <a href="<?= e($record->url()) ?>"><?= $record->fullName() ?></a>
+ <br>
+ <?php endforeach ?>
+
+ <?php foreach ($media_object->linkedSources('OBJE') as $record) : ?>
+ <?= view('icons/source') ?>
+ <a href="<?= e($record->url()) ?>"><?= $record->fullName() ?></a>
+ <br>
+ <?php endforeach ?>
+ </div>
+ </div>
+ </div>
+ <?php endforeach ?>
+ </div>
+
+ <div class="row text-center">
+ <div class="col">
+ <?php if ($page > 1) : ?>
+ <a href="<?= e(route('module', ['module' => $module, 'action' => $action, 'tree' => $tree->name(), 'action2' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'form_type' => $form_type, 'max' => $max, 'page' => 1])) ?>">
+ <?= I18N::translate('first') ?>
+ </a>
+ <?php endif ?>
+ </div>
+ <div class="col">
+ <?php if ($page > 1) : ?>
+ <a href="<?= e(route('module', ['module' => $module, 'action' => $action, 'tree' => $tree->name(), 'action2' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'form_type' => $form_type, 'max' => $max, 'page' => $page - 1])) ?>">
+ <?= I18N::translate('previous') ?>
+ </a>
+ <?php endif ?>
+ </div>
+ <div class="col">
+ <?= I18N::translate('Page %s of %s', $page, $pages) ?>
+ </div>
+ <div class="col">
+ <?php if ($page < $pages) : ?>
+ <a href="<?= e(route('module', ['module' => $module, 'action' => $action, 'tree' => $tree->name(), 'action2' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'form_type' => $form_type, 'max' => $max, 'page' => $page + 1])) ?>">
+ <?= I18N::translate('next') ?>
+ </a>
+ <?php endif ?>
+ </div>
+ <div class="col">
+ <?php if ($page < $pages) : ?>
+ <a href="<?= e(route('module', ['module' => $module, 'action' => $action, 'tree' => $tree->name(), 'action2' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'form_type' => $form_type, 'max' => $max, 'page' => $pages])) ?>">
+ <?= I18N::translate('last') ?>
+ </a>
+ <?php endif ?>
+ </div>
+ </div>
+ <?php endif ?>
+</div>
diff --git a/resources/views/modules/note-list/page.phtml b/resources/views/modules/note-list/page.phtml
new file mode 100644
index 0000000000..3be5fcd5dd
--- /dev/null
+++ b/resources/views/modules/note-list/page.phtml
@@ -0,0 +1,7 @@
+<h2 class="wt-page-title">
+ <?= $title ?>
+</h2>
+
+<div class="wt-page-content">
+ <?= view('lists/notes-table', ['notes' => $notes, 'tree' => $tree]) ?>
+</div>
diff --git a/resources/views/modules/repository-list/page.phtml b/resources/views/modules/repository-list/page.phtml
new file mode 100644
index 0000000000..19ffc64459
--- /dev/null
+++ b/resources/views/modules/repository-list/page.phtml
@@ -0,0 +1,7 @@
+<h2 class="wt-page-title">
+ <?= $title ?>
+</h2>
+
+<div class="wt-page-content">
+ <?= view('lists/repositories-table', ['repositories' => $repositories, 'tree' => $tree]) ?>
+</div>
diff --git a/resources/views/modules/source-list/page.phtml b/resources/views/modules/source-list/page.phtml
new file mode 100644
index 0000000000..146fb1ef6e
--- /dev/null
+++ b/resources/views/modules/source-list/page.phtml
@@ -0,0 +1,7 @@
+<h2 class="wt-page-title">
+ <?= $title ?>
+</h2>
+
+<div class="wt-page-content">
+ <?= view('lists/sources-table', ['sources' => $sources, 'tree' => $tree]) ?>
+</div>