Skip to content

Commit

Permalink
redirect to content after storing
Browse files Browse the repository at this point in the history
  • Loading branch information
emmachughes committed Sep 8, 2023
1 parent 8dada02 commit 0d0b06f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
6 changes: 4 additions & 2 deletions sourcecode/hub/app/Http/Controllers/ContentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function store(
$tool = LtiTool::where('consumer_key', $request->session()->get('lti.oauth_consumer_key'))
->firstOrFail();

/*$content = */DB::transaction(function () use ($item, $tool) {
$content = DB::transaction(function () use ($item, $tool) {
$title = $item->getTitle() ?? throw new Exception('Missing title');
$url = $item->getUrl() ?? throw new Exception('Missing URL');

Expand All @@ -175,7 +175,9 @@ public function store(
return $content;
});

return view('lti.close-edlib');
return view('lti.close-editor', [
'redirectUrl' => route('content.preview', $content),
]);
}

public function sitemap(): Response
Expand Down
8 changes: 8 additions & 0 deletions sourcecode/hub/resources/views/lti/close-editor.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<x-layout :nav="false">
<x-slot:title>Closing Edlib</x-slot:title>

{{-- FIXME: if $redirectUrl should include form params, then they must be included as hidden inputs --}}
<form action="{{ $redirectUrl }}" method="GET" class="auto-submit" target="_parent">
<button class="btn btn-primary">Return to Edlib</button>
</form>
</x-layout>
15 changes: 0 additions & 15 deletions sourcecode/hub/resources/views/lti/close-edlib.blade.php

This file was deleted.

0 comments on commit 0d0b06f

Please sign in to comment.