Permalink
Browse files

Working on blocks

  • Loading branch information...
JustCarmen committed Jan 6, 2019
1 parent e93dead commit c6f4fc4d613b7b0213063fb53cd9a900d8dfc0eb
@@ -193,9 +193,9 @@ module.exports = function (grunt) {
'colorbox.php',
'views/*page*',
'views/lists/*',
'views/modules/gedcom_block/*',
'views/modules/gedcom_stats/*',
'views/modules/user_welcome/*',
'views/modules/gedcom*/*',
'views/modules/user*/*',
'views/modules/random_media/*',
'views/selects/*'
],
dest: 'resources',
@@ -20059,6 +20059,10 @@ tr.even {
padding: 0.25rem 0.5rem;
}

.dt-bootstrap4 .dataTables_length select {
width: 100% !important;
}

.dt-bootstrap4 .dataTables_filter input {
width: auto !important;
}
@@ -0,0 +1,72 @@
<?php
/**
* Change: Styling
* Correction: removed personbox class from outer div, preventing double borders. It is also part of the individualBoxLarge markup.
* Themes: all themes
*
*/
?>

<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\Individual; ?>
<?php use Fisharebest\Webtrees\Theme; ?>

<?php foreach ($favorites as $favorite) : ?>
<div class="action_header<?= $favorite->record instanceof Individual ? $favorite->record->getSex() : '' ?> my-2">
<?php if ($favorite->favorite_type === 'URL') : ?>
<a href="<?= e($favorite->url) ?>"><b><?= e($favorite->title) ?></b></a>
<?php elseif ($favorite->record instanceof Individual) : ?>
<?= Theme::theme()->individualBoxLarge($favorite->record) ?>
<?php elseif ($favorite->record !== null) : ?>
<?= $favorite->record->formatList() ?>
<?php endif ?>

<div class="wt-favorites-block-note">
<?= e((string)$favorite->note) ?>
</div>
</div>

<?php if ($is_manager) : ?>
<form action="<?= e(route('module', ['module' => 'gedcom_favorites', 'action' => 'DeleteFavorite', 'ged' => $tree->name(), 'favorite_id' => $favorite->favorite_id])) ?>" method="post">
<?= csrf_field() ?>
<button type="submit" class="btn btn-sm btn-secondary" data-confirm="<?= I18N::translate('Are you sure you want to remove this item from your list of favorites?') ?>" onclick="return confirm(this.dataset.confirm);">
<?= I18N::translate('Remove') ?>
</button>
</form>
<hr>
<?php endif ?>
<?php endforeach ?>

<?php if ($is_manager) : ?>
<div class="add_fav_head">
<a href="#" onclick="return expand_layer('add_fav<?= e($block_id) ?>');">
<?= I18N::translate('Add a favorite') ?>
<i id="add_fav<?= e($block_id) ?>_img" class="icon-plus"></i>
</a>
</div>
<div id="add_fav<?= e($block_id) ?>" style="display: none;">
<form action="<?= e(route('module', ['module' => 'gedcom_favorites', 'action' => 'AddFavorite', 'ged' => $tree->name()])) ?>" method="post">
<?= csrf_field() ?>
<div class="add_fav_ref">
<input class="m-0" type="radio" name="fav_category" value="record" checked onclick="$('#xref<?= e($block_id) ?>').removeAttr('disabled'); $('#url, #title').attr('disabled','disabled').val('');">
<label for="xref<?= e($block_id) ?>">
<?= I18N::translate('Record') ?>
</label>
<input class="pedigree_form" data-autocomplete-type="IFSRO" type="text" name="xref" id="xref<?= e($block_id) ?>" size="5">
</div>
<div class="add_fav_url">
<input type="radio" name="fav_category" value="url" onclick="$('#url, #title').removeAttr('disabled'); $('#xref<?= e($block_id) ?>').attr('disabled','disabled').val('');">
<input type="text" name="url" id="url" size="20" value="" placeholder="<?= I18N::translate('URL') ?>" disabled>
<input type="text" name="title" id="title" size="20" value="" placeholder="<?= I18N::translate('Title') ?>" disabled>
<p class="mt-3">
<?= I18N::translate('Enter an optional note about this favorite') ?>
</p>
<textarea name="note" rows="6" cols="50"></textarea>
</div>
<button type="submit" class="btn btn-sm btn-primary">
<?= /* I18N: A button label. */ I18N::translate('add') ?>
</button>
</form>
</div>
<?php endif ?>
@@ -0,0 +1,98 @@
<?php
/**
* Change: Styling
* Other: Text replaced with icons
* Themes: all themes
*
*/
?>

<?php use Fisharebest\Webtrees\FontAwesome; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsPrint; ?>
<?php use Fisharebest\Webtrees\I18N; ?>

<div class="text-center slide-show-container">
<?php if ($show_controls) : ?>
<div class="slide-show-controls">
<?= FontAwesome::linkIcon('media-play', I18N::translate('Play'), ['href' => '#', 'hidden' => $start_automatically]) ?>
<?= FontAwesome::linkIcon('media-stop', I18N::translate('Stop'), ['href' => '#', 'hidden' => !$start_automatically]) ?>
<?= FontAwesome::linkIcon('media-next', I18N::translate('Next image'), ['href' => '#']) ?>
</div>
<?php endif ?>

<figure class="text-center slide-show-figure">
<?= $media_file->displayImage(200, 200, '', ['class' => 'slide-show-image']) ?>
<figcaption class="slide-show-figcaption">
<a href="<?= e($media->url()) ?>">
<b><?= $media->getFullName() ?></b>
</a>
</figcaption>
</figure>

<p class="slide-show-notes text-left">
<?= FunctionsPrint::printFactNotes($tree, $media->gedcom(), 1) ?>
</p>

<ul class="slide-show-links text-left">
<?php foreach ($media->linkedIndividuals('OBJE') as $individual) : ?>
<?= view('icons/individual') ?>
<a href="<?= e($individual->url()) ?>" class="slide-show-link">
<?= $individual->getFullName() ?>
</a>
<br>
<?php endforeach ?>

<?php foreach ($media->linkedFamilies('OBJE') as $family) : ?>
<?= view('icons/family') ?>
<a href="<?= e($family->url()) ?>" class="slide-show-link">
<?= $family->getFullName() ?>
</a>
<br>
<?php endforeach ?>

<?php foreach ($media->linkedSources('OBJE') as $source) : ?>
<?= I18N::translate('View this source') ?>
<a href="<?= e($source->url()) ?>" class="slide-show-link">
<?= $source->getFullName() ?>
</a>
<br>
<?php endforeach ?>
</ul>
</div>

<script>
// Reload automatically?
var play = <?= json_encode($start_automatically); ?>;
function slideShowReload() {
if (play) {
var block = $("#block-<?= $block_id ?>").parent();
clearTimeout(timeout);
block.load(block.data('ajaxUrl') + '&start=' + (play ? '1' : '0'));
}
return false;
}
$(".wt-icon-media-play").on('click', function () {
$(".wt-icon-media-play").parent().attr('hidden', true);
$(".wt-icon-media-stop").parent().attr('hidden', false);
play = true;
return slideShowReload();
});
$(".wt-icon-media-stop").on('click', function () {
$(".wt-icon-media-stop").parent().attr('hidden', true);
$(".wt-icon-media-play").parent().attr('hidden', false);
play = false;
return false;
});
$(".wt-icon-media-next").on('click', function () {
play = true;
return slideShowReload();
});
var timeout = setTimeout(slideShowReload, 6000);
</script>
@@ -0,0 +1,68 @@
<?php
/**
* Change: Styling
* Correction: removed personbox class from outer div, preventing double borders. It is also part of the individualBoxLarge markup.
* Themes: all themes
*
*/
?>

<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\Individual; ?>
<?php use Fisharebest\Webtrees\Theme; ?>

<?php foreach ($favorites as $favorite) : ?>
<div class="action_header<?= $favorite->record instanceof Individual ? $favorite->record->getSex() : '' ?> my-2">
<?php if ($favorite->favorite_type === 'URL') : ?>
<a href="<?= e($favorite->url) ?>"><b><?= e($favorite->title) ?></b></a>
<?php elseif ($favorite->record instanceof Individual) : ?>
<?= Theme::theme()->individualBoxLarge($favorite->record) ?>
<?php elseif ($favorite->record !== null) : ?>
<?= $favorite->record->formatList() ?>
<?php endif ?>

<div class="wt-favorites-block-note">
<?= e((string)$favorite->note) ?>
</div>
</div>

<form action="<?= e(route('module', ['module' => 'user_favorites', 'action' => 'DeleteFavorite', 'ged' => $tree->name(), 'favorite_id' => $favorite->favorite_id])) ?>" method="post">
<?= csrf_field() ?>
<button type="submit" class="btn btn-sm btn-secondary" data-confirm="<?= I18N::translate('Are you sure you want to remove this item from your list of favorites?') ?>" onclick="return confirm(this.dataset.confirm);">
<?= I18N::translate('Remove') ?>
</button>
</form>
<hr>
<?php endforeach ?>

<div class="add_fav_head">
<a href="#" onclick="return expand_layer('add_fav<?= e($block_id) ?>');">
<?= I18N::translate('Add a favorite') ?>
<i id="add_fav<?= e($block_id) ?>_img" class="icon-plus"></i>
</a>
</div>
<div id="add_fav<?= e($block_id) ?>" style="display: none;">
<form action="<?= e(route('module', ['module' => 'user_favorites', 'action' => 'AddFavorite', 'ged' => $tree->name()])) ?>" method="post">
<?= csrf_field() ?>
<div class="add_fav_ref">
<input class="m-0" type="radio" name="fav_category" value="record" checked onclick="$('#xref<?= e($block_id) ?>').removeAttr('disabled'); $('#url, #title').attr('disabled','disabled').val('');">
<label for="xref<?= e($block_id) ?>">
<?= I18N::translate('Record') ?>
</label>
<input class="pedigree_form" data-autocomplete-type="IFSRO" type="text" name="xref" id="xref<?= e($block_id) ?>" size="5">
</div>
<div class="add_fav_url">
<input type="radio" name="fav_category" value="url" onclick="$('#url, #title').removeAttr('disabled'); $('#xref<?= e($block_id) ?>').attr('disabled','disabled').val('');">
<input type="text" name="url" id="url" size="20" value="" placeholder="<?= I18N::translate('URL') ?>" disabled>
<input type="text" name="title" id="title" size="20" value="" placeholder="<?= I18N::translate('Title') ?>" disabled>
<p class="mt-3">
<?= I18N::translate('Enter an optional note about this favorite') ?>
</p>
<textarea name="note" rows="6" cols="50"></textarea>
</div>
<button type="submit" class="btn btn-sm btn-primary">
<?= /* I18N: A button label. */ I18N::translate('add') ?>
</button>
</form>
</div>

0 comments on commit c6f4fc4

Please sign in to comment.