-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add adding contexts to lti platforms
- Loading branch information
1 parent
cfb9ca4
commit 06f09a1
Showing
14 changed files
with
138 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
sourcecode/hub/app/Http/Requests/AddContextToLtiPlatformRequest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Http\Requests; | ||
|
||
use App\Models\Context; | ||
use Illuminate\Foundation\Http\FormRequest; | ||
use Illuminate\Validation\Rule; | ||
|
||
class AddContextToLtiPlatformRequest extends FormRequest | ||
{ | ||
/** | ||
* @return array<mixed> | ||
*/ | ||
public function rules(): array | ||
{ | ||
return [ | ||
'context' => ['required', 'string', Rule::exists(Context::class, 'id')], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
sourcecode/hub/resources/views/admin/lti-platforms/contexts.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<x-layout> | ||
<x-slot:title>{{ trans('messages.contexts-for-lti-platform', ['platform' => $platform->name]) }}</x-slot:title> | ||
|
||
<p><a href="{{ route('admin.lti-platforms.index') }}">Back to LTI platforms</a></p> | ||
|
||
@if (count($platform->contexts) > 0) | ||
<ul> | ||
@foreach ($platform->contexts as $context) | ||
<li>{{ $context->name }}</li> | ||
@endforeach | ||
</ul> | ||
@endif | ||
|
||
@if (count($available_contexts) > 0) | ||
<x-form action="{{ route('admin.lti-platforms.add-context', [$platform]) }}" method="PUT"> | ||
<x-form.field | ||
name="context" | ||
type="select" | ||
emptyOption | ||
required | ||
:label="trans('messages.context')" | ||
:options="$available_contexts" | ||
/> | ||
|
||
<x-form.button class="btn-primary">{{ trans('messages.add') }}</x-form.button> | ||
</x-form> | ||
@else | ||
<p>{{ trans('messages.no-available-contexts-to-add') }}</p> | ||
@endif | ||
</x-layout> |
2 changes: 1 addition & 1 deletion
2
sourcecode/hub/resources/views/admin/lti-platforms/edit.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters