1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Merge pull request #3656 from BookStackApp/x_linking

Link reference tracking & updating
This commit is contained in:
Dan Brown
2022-08-29 17:45:05 +01:00
committed by GitHub
48 changed files with 1421 additions and 140 deletions

View File

@ -1,4 +1,3 @@
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.8 4.8z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>

Before

Width:  |  Height:  |  Size: 431 B

After

Width:  |  Height:  |  Size: 389 B

View File

@ -0,0 +1,3 @@
<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="m24 44.15c-0.4 0-0.79167-0.06667-1.175-0.2-0.38333-0.13333-0.70833-0.33333-0.975-0.6l-17.2-17.2c-0.26667-0.26667-0.46667-0.59167-0.6-0.975s-0.2-0.775-0.2-1.175 0.066667-0.79167 0.2-1.175c0.13333-0.38333 0.33333-0.70833 0.6-0.975l17.2-17.2c0.26667-0.26667 0.59167-0.46667 0.975-0.6s0.775-0.2 1.175-0.2 0.79167 0.066667 1.175 0.2c0.38333 0.13333 0.70833 0.33333 0.975 0.6l17.2 17.2c0.26667 0.26667 0.46667 0.59167 0.6 0.975s0.2 0.775 0.2 1.175-0.06667 0.79167-0.2 1.175c-0.13333 0.38333-0.33333 0.70833-0.6 0.975l-17.2 17.2c-0.26667 0.26667-0.59167 0.46667-0.975 0.6s-0.775 0.2-1.175 0.2zm4.05-18.65-5.15 5.15c-0.3 0.3-0.44167 0.65-0.425 1.05 0.01667 0.4 0.175 0.75 0.475 1.05s0.65833 0.45 1.075 0.45 0.775-0.15 1.075-0.45l7.7-7.7c0.3-0.3 0.45-0.65 0.45-1.05s-0.15-0.75-0.45-1.05l-7.75-7.75c-0.3-0.3-0.65-0.45-1.05-0.45s-0.75 0.15-1.05 0.45-0.45 0.65833-0.45 1.075 0.15 0.775 0.45 1.075l5.1 5.15h-12.4c-0.43333 0-0.79167 0.14167-1.075 0.425s-0.425 0.64167-0.425 1.075 0.14167 0.79167 0.425 1.075 0.64167 0.425 1.075 0.425z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -23,6 +23,7 @@ return [
'meta_updated' => 'Updated :timeLength',
'meta_updated_name' => 'Updated :timeLength by :user',
'meta_owned_name' => 'Owned by :user',
'meta_reference_page_count' => 'Referenced on 1 page|Referenced on :count pages',
'entity_select' => 'Entity Select',
'entity_select_lack_permission' => 'You don\'t have the required permissions to select this item',
'images' => 'Images',
@ -248,6 +249,7 @@ return [
'pages_edit_content_link' => 'Edit Content',
'pages_permissions_active' => 'Page Permissions Active',
'pages_initial_revision' => 'Initial publish',
'pages_references_update_revision' => 'System auto-update of internal links',
'pages_initial_name' => 'New Page',
'pages_editing_draft_notification' => 'You are currently editing a draft that was last saved :timeDiff.',
'pages_draft_edited_notification' => 'This page has been updated by since that time. It is recommended that you discard this draft.',
@ -369,4 +371,9 @@ return [
'convert_to_book_desc' => 'You can convert this chapter to a new book with the same contents. Any permissions set on this chapter will be copied to the new book but any inherited permissions, from the parent book, will not be copied which could lead to a change of access control.',
'convert_chapter' => 'Convert Chapter',
'convert_chapter_confirm' => 'Are you sure you want to convert this chapter?',
// References
'references' => 'References',
'references_none' => 'There are no tracked references to this item.',
'references_to_desc' => 'Shown below are all the known pages in the system that link to this item.',
];

View File

@ -89,6 +89,10 @@ return [
'maint_send_test_email_mail_text' => 'Congratulations! As you received this email notification, your email settings seem to be configured properly.',
'maint_recycle_bin_desc' => 'Deleted shelves, books, chapters & pages are sent to the recycle bin so they can be restored or permanently deleted. Older items in the recycle bin may be automatically removed after a while depending on system configuration.',
'maint_recycle_bin_open' => 'Open Recycle Bin',
'maint_regen_references' => 'Regenerate References',
'maint_regen_references_desc' => 'This action will rebuild the cross-item reference index within the database. This is usually handled automatically but this action can be useful to index old content or content added via unofficial methods.',
'maint_regen_references_success' => 'Reference index has been regenerated!',
'maint_timeout_command_note' => 'Note: This action can take time to run, which can lead to timeout issues in some web environments. As an alternative, this action be performed using a terminal command.',
// Recycle Bin
'recycle_bin' => 'Recycle Bin',

View File

@ -0,0 +1,20 @@
@extends('layouts.simple')
@section('body')
<div class="container small">
<div class="my-s">
@include('entities.breadcrumbs', ['crumbs' => [
$book,
$book->getUrl('/references') => [
'text' => trans('entities.references'),
'icon' => 'reference',
]
]])
</div>
@include('entities.references', ['references' => $references])
</div>
@stop

View File

@ -0,0 +1,21 @@
@extends('layouts.simple')
@section('body')
<div class="container small">
<div class="my-s">
@include('entities.breadcrumbs', ['crumbs' => [
$chapter->book,
$chapter,
$chapter->getUrl('/references') => [
'text' => trans('entities.references'),
'icon' => 'reference',
]
]])
</div>
@include('entities.references', ['references' => $references])
</div>
@stop

View File

@ -59,4 +59,13 @@
<span title="{{ $entity->updated_at->toDayDateTimeString() }}">{{ trans('entities.meta_updated', ['timeLength' => $entity->updated_at->diffForHumans()]) }}</span>
</div>
@endif
@if($referenceCount ?? 0)
<a href="{{ $entity->getUrl('/references') }}" class="entity-meta-item">
@icon('reference')
<div>
{!! trans_choice('entities.meta_reference_page_count', $referenceCount, ['count' => $referenceCount]) !!}
</div>
</a>
@endif
</div>

View File

@ -0,0 +1,13 @@
<main class="card content-wrap">
<h1 class="list-heading">{{ trans('entities.references') }}</h1>
<p>{{ trans('entities.references_to_desc') }}</p>
@if(count($references) > 0)
<div class="book-contents">
@include('entities.list', ['entities' => $references->pluck('from'), 'showPath' => true])
</div>
@else
<p class="text-muted italic">{{ trans('entities.references_none') }}</p>
@endif
</main>

View File

@ -0,0 +1,22 @@
@extends('layouts.simple')
@section('body')
<div class="container small">
<div class="my-s">
@include('entities.breadcrumbs', ['crumbs' => [
$page->book,
$page->chapter,
$page,
$page->getUrl('/references') => [
'text' => trans('entities.references'),
'icon' => 'reference',
]
]])
</div>
@include('entities.references', ['references' => $references])
</div>
@stop

View File

@ -25,9 +25,10 @@
<div id="image-cleanup" class="card content-wrap auto-height">
<h2 class="list-heading">{{ trans('settings.maint_image_cleanup') }}</h2>
<div class="grid half gap-xl">
<div class="grid left-focus gap-xl">
<div>
<p class="small text-muted">{{ trans('settings.maint_image_cleanup_desc') }}</p>
<p class="small text-muted italic">{{ trans('settings.maint_timeout_command_note') }}</p>
</div>
<div>
<form method="POST" action="{{ url('/settings/maintenance/cleanup-images') }}">
@ -55,7 +56,7 @@
<div id="send-test-email" class="card content-wrap auto-height">
<h2 class="list-heading">{{ trans('settings.maint_send_test_email') }}</h2>
<div class="grid half gap-xl">
<div class="grid left-focus gap-xl">
<div>
<p class="small text-muted">{{ trans('settings.maint_send_test_email_desc') }}</p>
</div>
@ -68,5 +69,21 @@
</div>
</div>
<div id="regenerate-references" class="card content-wrap auto-height">
<h2 class="list-heading">{{ trans('settings.maint_regen_references') }}</h2>
<div class="grid left-focus gap-xl">
<div>
<p class="small text-muted">{{ trans('settings.maint_regen_references_desc') }}</p>
<p class="small text-muted italic">{{ trans('settings.maint_timeout_command_note') }}</p>
</div>
<div>
<form method="POST" action="{{ url('/settings/maintenance/regenerate-references') }}">
{!! csrf_field() !!}
<button class="button outline">{{ trans('settings.maint_regen_references') }}</button>
</form>
</div>
</div>
</div>
</div>
@stop

View File

@ -0,0 +1,20 @@
@extends('layouts.simple')
@section('body')
<div class="container small">
<div class="my-s">
@include('entities.breadcrumbs', ['crumbs' => [
$shelf,
$shelf->getUrl('/references') => [
'text' => trans('entities.references'),
'icon' => 'reference',
]
]])
</div>
@include('entities.references', ['references' => $references])
</div>
@stop