diff --git a/resources/build/admin.min.js b/resources/build/admin.min.js index 7b160f0..1cc4197 100644 --- a/resources/build/admin.min.js +++ b/resources/build/admin.min.js @@ -1 +1 @@ -$(document).ready(function(){var a=$("#faces-admin-config"),t=a.find("#faces-admin-config-table");function e(t){a.find(".alert").remove(),a.prepend(tmpl($("#faces-alert-template").html(),{message:t.message,readmore:t.link}))}t.dataTable({processing:!0,serverSide:!0,ajax:t.data("url"),autoWidth:!1,filter:!1,pageLength:10,pagingType:"full_numbers",stateSave:!0,cookieDuration:300,sort:!1,columns:[{className:"faces-td-photo text-break"},{className:"faces-td-notes"},{className:"faces-td-status"},{className:"faces-td-actions"}],fnDrawCallback:function(){t.find('[data-action="destroy"]').on("click",function(){confirm(window.WT_FACES_WARNING)&&$.ajax({url:$(this).data("url")}).done(function(a){e(a),t.DataTable().ajax.reload()})})}}),a.find('[data-action="setting-exif"], [data-action="setting-linking"], [data-action="setting-meta"]').on("change",function(a){$.ajax({url:$(this).data("url")}).done(function(a){e(a)})}),a.find('[aria-labelledby="faces-settings-menu"]').on("click",function(a){a.stopPropagation()}),a.find('[data-action="missed-repair"], [data-action="missed-delete"]').on("click",function(){confirm(window.WT_FACES_WARNING)&&$.ajax({url:$(this).data("url")}).done(function(a){e(a),t.DataTable().ajax.reload()})})}); +$(document).ready(function(){var a=$("#faces-admin-config"),t=a.find("#faces-admin-config-table");function n(t){a.find(".alert").remove(),a.prepend(tmpl($("#faces-alert-template").html(),{message:t.message,readmore:t.link}))}t.dataTable({processing:!0,serverSide:!0,ajax:t.data("url"),autoWidth:!1,filter:!1,pageLength:10,pagingType:"full_numbers",stateSave:!0,cookieDuration:300,sort:!1,columns:[{className:"faces-td-photo text-break"},{className:"faces-td-notes"},{className:"faces-td-status"},{className:"faces-td-actions"}],fnDrawCallback:function(){t.find('[data-action="destroy"]').on("click",function(){confirm(window.WT_FACES_WARNING)&&$.ajax({url:$(this).data("url")}).done(function(a){n(a),t.DataTable().ajax.reload()})})}}),a.find(['[data-action="setting-exif"]','[data-action="setting-linking"]','[data-action="setting-meta"]','[data-action="setting-tab"]'].join(", ")).on("change",function(){$.ajax({url:$(this).data("url")}).done(function(a){n(a)})}),a.find('[aria-labelledby="faces-settings-menu"]').on("click",function(a){a.stopPropagation()}),a.find(['[data-action="missed-repair"]','[data-action="missed-delete"]'].join(", ")).on("click",function(){confirm(window.WT_FACES_WARNING)&&$.ajax({url:$(this).data("url")}).done(function(a){n(a),t.DataTable().ajax.reload()})})}); diff --git a/resources/langs/en.php b/resources/langs/en.php index 455379a..0f3dd66 100644 --- a/resources/langs/en.php +++ b/resources/langs/en.php @@ -30,6 +30,8 @@ 'Link individual with media when mark them on photo' => 'Link individual with media when mark them on photo', 'Show meta' => 'Show meta', 'Load and show information from linked fact' => 'Load and show information from linked fact', + 'Show tab' => 'Show tab', + 'Show tab on individuals page' => 'Show tab on individuals page', //Config: Table //'Media' => 'Media', //'Notes' => 'Notes', diff --git a/resources/langs/ru.php b/resources/langs/ru.php index 0b8ec4d..c02903e 100644 --- a/resources/langs/ru.php +++ b/resources/langs/ru.php @@ -30,6 +30,8 @@ 'Link individual with media when mark them on photo' => 'Связывать персону с медиа при добавлении ее на фото', 'Show meta' => 'Показывать мету', 'Load and show information from linked fact' => 'Загружать и показывать информацию из связанного факта', + 'Show tab' => 'Показывать вкладку', + 'Show tab on individuals page' => 'Показывать вкладку на странице персоны', //Config: Table //'Media' => 'Медиа', //'Notes' => 'Примечания', diff --git a/resources/scripts/admin/config.js b/resources/scripts/admin/config.js index a4ec3ef..3401732 100644 --- a/resources/scripts/admin/config.js +++ b/resources/scripts/admin/config.js @@ -49,26 +49,40 @@ $(document).ready(function() { } }); - $page.find('[data-action="setting-exif"], [data-action="setting-linking"], [data-action="setting-meta"]').on('change', function(e) { - $.ajax({ - url: $(this).data('url') - }).done(function(response) { - facesShowMessage(response); - }); - }); - - $page.find('[aria-labelledby="faces-settings-menu"]').on('click', function(e) { - e.stopPropagation(); - }); - - $page.find('[data-action="missed-repair"], [data-action="missed-delete"]').on('click', function() { - if (confirm(window.WT_FACES_WARNING)) { + $page + .find([ + '[data-action="setting-exif"]', + '[data-action="setting-linking"]', + '[data-action="setting-meta"]', + '[data-action="setting-tab"]', + ].join(', ')) + .on('change', function() { $.ajax({ url: $(this).data('url') }).done(function(response) { facesShowMessage(response); - $table.DataTable().ajax.reload(); }); - } - }); + }); + + $page + .find('[aria-labelledby="faces-settings-menu"]') + .on('click', function(e) { + e.stopPropagation(); + }); + + $page + .find([ + '[data-action="missed-repair"]', + '[data-action="missed-delete"]', + ].join(', ')) + .on('click', function() { + if (confirm(window.WT_FACES_WARNING)) { + $.ajax({ + url: $(this).data('url') + }).done(function(response) { + facesShowMessage(response); + $table.DataTable().ajax.reload(); + }); + } + }); }); \ No newline at end of file diff --git a/resources/views/admin/config.phtml b/resources/views/admin/config.phtml index dfb3367..a9b03c1 100644 --- a/resources/views/admin/config.phtml +++ b/resources/views/admin/config.phtml @@ -83,6 +83,20 @@ use Fisharebest\Webtrees\View; + + + > + + + diff --git a/resources/views/tab.phtml b/resources/views/tab.phtml new file mode 100644 index 0000000..579a053 --- /dev/null +++ b/resources/views/tab.phtml @@ -0,0 +1,13 @@ +