From 6a4b020dd88452099d9e1d77997fe46d64eb22e2 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Fri, 12 Feb 2021 20:58:01 +0000 Subject: [PATCH] Removed user and revision links in export meta Closes #2526 --- resources/sass/export-styles.scss | 1 + .../partials/entity-export-meta.blade.php | 33 +++++-------------- tests/Entity/ExportTest.php | 11 ++++++- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/resources/sass/export-styles.scss b/resources/sass/export-styles.scss index 6d9a1a718..278e5b6c5 100644 --- a/resources/sass/export-styles.scss +++ b/resources/sass/export-styles.scss @@ -19,6 +19,7 @@ body { font-family: 'DejaVu Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen", "Ubuntu", "Roboto", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; margin: 0; padding: 0; + display: block; } table { diff --git a/resources/views/partials/entity-export-meta.blade.php b/resources/views/partials/entity-export-meta.blade.php index fa1394ed4..a84d0ae85 100644 --- a/resources/views/partials/entity-export-meta.blade.php +++ b/resources/views/partials/entity-export-meta.blade.php @@ -1,33 +1,16 @@
- @if($entity->isA('revision')) - @icon('history'){{ trans('entities.pages_revision') }} - {{ trans('entities.pages_revisions_number') }}{{ $entity->revision_number == 0 ? '' : $entity->revision_number }} -
- @endif - @if ($entity->isA('page')) - @if (userCan('page-update', $entity)) @endif @icon('history'){{ trans('entities.meta_revision', ['revisionCount' => $entity->revision_count]) }}
- @if (userCan('page-update', $entity))
@endif - @endif - - @if ($entity->createdBy) - @icon('star'){!! trans('entities.meta_created_name', [ - 'timeLength' => ''.$entity->created_at->toDayDateTimeString() . '', - 'user' => "".htmlentities($entity->createdBy->name). "" - ]) !!} - @else - @icon('star'){{ trans('entities.meta_created', ['timeLength' => $entity->created_at->toDayDateTimeString()]) }} @endif + @icon('star'){!! trans('entities.meta_created' . ($entity->createdBy ? '_name' : ''), [ + 'timeLength' => $entity->created_at->toDayDateTimeString(), + 'user' => htmlentities($entity->createdBy->name), + ]) !!}
- @if ($entity->updatedBy) - @icon('edit'){!! trans('entities.meta_updated_name', [ - 'timeLength' => '' . $entity->updated_at->toDayDateTimeString() .'', - 'user' => "".htmlentities($entity->updatedBy->name). "" - ]) !!} - @elseif (!$entity->isA('revision')) - @icon('edit'){{ trans('entities.meta_updated', ['timeLength' => $entity->updated_at->toDayDateTimeString()]) }} - @endif + @icon('edit'){!! trans('entities.meta_updated' . ($entity->updatedBy ? '_name' : ''), [ + 'timeLength' => $entity->updated_at->toDayDateTimeString(), + 'user' => htmlentities($entity->updatedBy->name) + ]) !!}
\ No newline at end of file diff --git a/tests/Entity/ExportTest.php b/tests/Entity/ExportTest.php index 1e44f015a..05672c6ca 100644 --- a/tests/Entity/ExportTest.php +++ b/tests/Entity/ExportTest.php @@ -1,6 +1,5 @@ assertDontSee($page->updated_at->diffForHumans()); } + public function test_page_export_does_not_include_user_or_revision_links() + { + $page = Page::first(); + + $resp = $this->asEditor()->get($page->getUrl('/export/html')); + $resp->assertDontSee($page->getUrl('/revisions')); + $resp->assertDontSee($page->createdBy->getProfileUrl()); + $resp->assertSee($page->createdBy->name); + } + public function test_page_export_sets_right_data_type_for_svg_embeds() { $page = Page::first();