Skip to content

Commit

Permalink
show debug info on content creator
Browse files Browse the repository at this point in the history
  • Loading branch information
emmachughes committed Sep 7, 2023
1 parent 641b321 commit 301ee0a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 15 deletions.
24 changes: 24 additions & 0 deletions sourcecode/hub/resources/views/components/lti-debug.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@php use Carbon\CarbonImmutable; @endphp
<dl>
<dt>LTI launch URL</dt>
<dd><kbd>{{ $request->getUrl() }}</kbd></dd>

<dt>LTI parameters</dt>
<dd>
<dl>
@foreach ($request->toArray() as $key => $value)
<dt>{{ $key }}</dt>
<dd>
<kbd>{{ $value }}</kbd>

@if ($key === 'oauth_timestamp')
@php($timestamp = CarbonImmutable::createFromTimestamp((int) $value))
<time datetime="{{ $timestamp->format('c') }}">
({{ $timestamp }})
</time>
@endif
</dd>
@endforeach
</dl>
</dd>
</dl>
13 changes: 11 additions & 2 deletions sourcecode/hub/resources/views/content/launch-creator.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<x-layout>
<x-sidebar-layout>
<x-slot:title>{{ sprintf('Create a thing with %s', $tool->name) }}</x-slot:title>

<x-lti-launch :launch="$launch" />
</x-layout>

<x-slot:sidebar>
@if (auth()->user()?->debug_mode ?? false)
<details>
<summary>Debug</summary>
<x-lti-debug :request="$launch->getRequest()" />
</details>
@endif
</x-slot:sidebar>
</x-sidebar-layout>
15 changes: 2 additions & 13 deletions sourcecode/hub/resources/views/content/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,9 @@

<dt>Presentation launch URL</dt>
<dd><kbd>{{ $version->resource->view_launch_url }}</kbd></dd>

<dt>LTI launch URL</dt>
<dd><kbd>{{ $launch->getRequest()->getUrl() }}</kbd></dd>

<dt>LTI parameters</dt>
<dd>
<dl>
@foreach ($launch->getRequest()->toArray() as $key => $parameter)
<dt>{{ $key }}</dt>
<dd><kbd>{{ $parameter }}</kbd></dd>
@endforeach
</dl>
</dd>
</dl>

<x-lti-debug :request="$launch->getRequest()" />
</details>
@endif
</x-slot:sidebar>
Expand Down

0 comments on commit 301ee0a

Please sign in to comment.