Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from AlexeyShobanov/completed-exercises-list
add view completed exercises list
- Loading branch information
Showing
17 changed files
with
254 additions
and
54 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
class Solution extends Model | ||
{ | ||
protected $fillable = [ | ||
'exercise_id', | ||
'content' | ||
]; | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
return [ | ||
'сhapters' => 'Chapters', | ||
'my_solutions' => 'My Solutions', | ||
'exercise' => 'Exercise', | ||
'see_details' => 'See details', | ||
'solutions' => 'Solutions', | ||
'exercises' => 'Exercises' | ||
]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
return [ | ||
'сhapters' => 'Главы', | ||
'my_solutions' => 'Мои Решения', | ||
'exercise' => 'Упражнение', | ||
'see_details' => 'Подробнее', | ||
'solutions' => 'Решения', | ||
'exercises' => 'Упражнения' | ||
]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,24 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
<div class="row"> | ||
<div class="col"> | ||
<h3>{{ __('layout.nav.my_progress') }}</h3> | ||
</div> | ||
<div class="col text-right"> | ||
<h5><a href="{{ route('users.show', $user) }}">{{ $user->name }}</a></h5> | ||
<div class="d-flex flex-wrap justify-content-between"> | ||
<div class="h3">{{ __('layout.nav.my_progress') }}</h3></div> | ||
<div class="h5 align-self-center"> | ||
<a href="{{ route('users.show', $user) }}">{{ $user->name }}</a> | ||
</div> | ||
</div> | ||
<div class="row mt-2"> | ||
<div class="col-12 col-md-4 mb-2"> | ||
<div class="nav nav-pills flex-column sticky-top x-z-index-0" role="tablist"> | ||
@foreach($mainChapters as $mainChapter) | ||
<a class="nav-item nav-link {{ $mainChapter->path === '1' ? 'active' : '' }}" | ||
id="subChapters{{ $mainChapter->id }}-tab" | ||
href="#subChapters{{ $mainChapter->id }}" | ||
data-toggle="tab" | ||
role="tab" | ||
aria-controls="subChapters{{ $mainChapter->id }}" | ||
aria-selected="{{ $mainChapter->path === '1' ? 'true' : 'false' }}"> | ||
{{ $mainChapter->path }} {{ getChapterName($mainChapter->path) }} | ||
</a> | ||
@endforeach | ||
</div> | ||
<nav> | ||
<div class="nav nav-tabs" id="nav-tab" role="tablist"> | ||
<a class="nav-item nav-link active" id="nav-chapters-tab" data-toggle="tab" href="#nav-chapters" role="tab" aria-controls="nav-home" aria-selected="true">{{ __('progresses.сhapters') }}</a> | ||
<a class="nav-item nav-link" id="nav-solutions-tab" data-toggle="tab" href="#nav-solutions" role="tab" aria-controls="nav-profile" aria-selected="false">{{ __('progresses.my_solutions') }}</a> | ||
</div> | ||
</nav> | ||
<div class="tab-content bg-white" id="nav-tabContent"> | ||
<div class="tab-pane fade show active" id="nav-chapters" role="tabpanel" aria-labelledby="nav-chapters-tab"> | ||
@include('my.progresses._my_chapters') | ||
</div> | ||
<div class="col-12 col-md-8"> | ||
<div class="card pl-2 pr-3"> | ||
{!! Form::open()->route('users.chapters.store', [$user]) !!} | ||
<div class="tab-content"> | ||
@foreach($mainChapters as $mainChapter) | ||
<div | ||
class="tab-pane card-body {{ $mainChapter->path === '1' ? 'active' : '' }}" | ||
id="subChapters{{ $mainChapter->id }}" | ||
role="tabpanel" | ||
aria-labelledby="subChapters{{ $mainChapter->id }}-tab"> | ||
@include('partials.chapter_form_element', ['chapter' => $mainChapter]) | ||
</div> | ||
@endforeach | ||
<div class="form-group text-right"> | ||
{!! Form::submit(__('layout.common.save')) !!} | ||
</div> | ||
</div> | ||
{!! Form::close() !!} | ||
</div> | ||
<div class="tab-pane fade show" id="nav-solutions" role="tabpanel" aria-labelledby="nav-solutions-tab"> | ||
@include('my.progresses._my_solutions') | ||
</div> | ||
</div> | ||
@endsection |
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,35 @@ | ||
<div class="row no-gutters border border-top-0"> | ||
<div class="col-12 col-md-4 border-right x-z-index-0"> | ||
<div class="nav nav-pills flex-column sticky-top m-2 pt-2" role="tablist"> | ||
@foreach($mainChapters as $mainChapter) | ||
<a class="nav-item nav-link {{ $mainChapter->path === '1' ? 'active' : '' }}" | ||
id="subChapters{{ $mainChapter->id }}-tab" | ||
href="#subChapters{{ $mainChapter->id }}" | ||
data-toggle="tab" | ||
role="tab" | ||
aria-controls="subChapters{{ $mainChapter->id }}" | ||
aria-selected="{{ $mainChapter->path === '1' ? 'true' : 'false' }}"> | ||
{{ $mainChapter->path }} {{ getChapterName($mainChapter->path) }} | ||
</a> | ||
@endforeach | ||
</div> | ||
</div> | ||
<div class="col-12 col-md-8"> | ||
{!! Form::open()->route('users.chapters.store', [$user]) !!} | ||
<div class="tab-content m-2 m-lg-4"> | ||
@foreach($mainChapters as $mainChapter) | ||
<div | ||
class="tab-pane {{ $mainChapter->path === '1' ? 'active' : '' }}" | ||
id="subChapters{{ $mainChapter->id }}" | ||
role="tabpanel" | ||
aria-labelledby="subChapters{{ $mainChapter->id }}-tab"> | ||
@include('partials.chapter_form_element', ['chapter' => $mainChapter]) | ||
</div> | ||
@endforeach | ||
<div class="text-right mt-2 mt-lg-4"> | ||
{!! Form::submit(__('layout.common.save')) !!} | ||
</div> | ||
</div> | ||
{!! Form::close() !!} | ||
</div> | ||
</div> |
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,23 @@ | ||
|
||
<div class="table-responsive border border-top-0 p-2 p-lg-4"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th class="border-top h5">{{ __('progresses.exercises') }}</th> | ||
<th class="border-top h5">{{ __('progresses.solutions') }}</th> | ||
</tr> | ||
@foreach ($savedSolutionsExercises as $solution) | ||
<tr> | ||
<td> | ||
{{ __('progresses.exercise') }} {{ $solution->exercise->path }} {{ getExerciseTitle($solution->exercise) }} (Chapter {{ $solution->exercise->chapter->path }}) | ||
</td> | ||
<td> | ||
<a href="{{ route('users.solutions.show', [$user, $solution]) }}"> | ||
{{ __('progresses.see_details') }} | ||
</td> | ||
</tr> | ||
@endforeach | ||
</thead> | ||
</table> | ||
</div> | ||
{{ $savedSolutionsExercises->fragment('nav-solutions')->links() }} |
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,80 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
|
||
<div class="d-flex flex-wrap justify-content-between mb-2 mb-lg-4"> | ||
<div class="h5"> | ||
<a href="{{ route('exercises.show', $currentExercise) }}"> | ||
{{ __('solution.exercise') }} {{ $currentExercise->path }}: {{ getExerciseTitle($currentExercise) }} | ||
</div> | ||
<div class="h5"> | ||
<a href="{{ route('users.show', $user) }}">{{ $user->name }}</a> | ||
</div> | ||
</div> | ||
|
||
<h2 class="text-center">{{ __('solution.code_review') }}</h2> | ||
<div class="text-center h5">{{ __('solution.sub_title') }}</div> | ||
<hr> | ||
<div class="row no-gutters"> | ||
<div class="col-12 col-md p-2 p-lg-4"> | ||
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist"> | ||
@foreach ($solutionsListForCurrentExercise as $currentSolution) | ||
@if ($loop->first) | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link active" id="pills-{{ $currentSolution->id }}-tab" data-toggle="pill" href="#pills-{{ $currentSolution->id }}" role="tab" aria-controls="pills-{{ $currentSolution->id }}" aria-selected="true">v.{{ $loop->iteration }}</a> | ||
</li> | ||
@else | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link" id="pills-{{ $currentSolution->id }}-tab" data-toggle="pill" href="#pills-{{ $currentSolution->id }}" role="tab" aria-controls="pills-{{ $currentSolution->id }}" aria-selected="true">v.{{ $loop->iteration }}</a> | ||
</li> | ||
@endif | ||
@endforeach | ||
</ul> | ||
<div class="tab-content" id="pills-tabContent"> | ||
@foreach ($solutionsListForCurrentExercise as $currentSolution) | ||
@if ($loop->first) | ||
<div class="tab-pane fade show active" id="pills-{{ $currentSolution->id }}" role="tabpanel" aria-labelledby="pills-{{ $currentSolution->id }}-tab"> | ||
<pre><code>{{ $currentSolution->content }}</code></pre> | ||
</div> | ||
@else | ||
<div class="tab-pane fade show" id="pills-{{ $currentSolution->id }}" role="tabpanel" aria-labelledby="pills-{{ $currentSolution->id }}-tab"> | ||
<pre><code>{{ $currentSolution->content }}</code></pre> | ||
</div> | ||
@endif | ||
@endforeach | ||
</div> | ||
</div> | ||
|
||
@if (count($solutionsListForCurrentExercise) > 1) | ||
<div class="d-none d-md-block border-left"></div> | ||
<div class="col p-2 p-lg-4"> | ||
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist"> | ||
@foreach ($solutionsListForCurrentExercise as $currentSolution) | ||
@if ($loop->first) | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link active" id="pills-{{ $currentSolution->id }}double-tab" data-toggle="pill" href="#pills-{{ $currentSolution->id }}double" role="tab" aria-controls="pills-{{ $currentSolution->id }}double" aria-selected="true">v.{{ $loop->iteration }}</a> | ||
</li> | ||
@else | ||
<li class="nav-item" role="presentation"> | ||
<a class="nav-link" id="pills-{{ $currentSolution->id }}double-tab" data-toggle="pill" href="#pills-{{ $currentSolution->id }}double" role="tab" aria-controls="pills-{{ $currentSolution->id }}double" aria-selected="true">v.{{ $loop->iteration }}</a> | ||
</li> | ||
@endif | ||
@endforeach | ||
</ul> | ||
<div class="tab-content" id="pills-tabContent"> | ||
@foreach ($solutionsListForCurrentExercise as $currentSolution) | ||
@if ($loop->first) | ||
<div class="tab-pane fade show active" id="pills-{{ $currentSolution->id }}double" role="tabpanel" aria-labelledby="pills-{{ $currentSolution->id }}double-tab"> | ||
<pre><code>{{ $currentSolution->content }}</code></pre> | ||
</div> | ||
@else | ||
<div class="tab-pane fade show" id="pills-{{ $currentSolution->id }}double" role="tabpanel" aria-labelledby="pills-{{ $currentSolution->id }}double-tab"> | ||
<pre><code>{{ $currentSolution->content }}</code></pre> | ||
</div> | ||
@endif | ||
@endforeach | ||
</div> | ||
</div> | ||
@endif | ||
</div> | ||
@endsection |
Oops, something went wrong.