Skip to content

Issue 60 change #61

Merged
merged 5 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 37 additions & 0 deletions app/Modules/Courses/Resources/assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -694,3 +694,40 @@ document.addEventListener('DOMContentLoaded', function () {
});
}
});

document.addEventListener('DOMContentLoaded', function() {
function updateStepMenu() {
const steps = {
level: document.querySelector('#field-level_id').value,
description: document.querySelector('#field-description').value,
materials: document.querySelector('#field-materials').value,
prerequisites: document.querySelector('#prerequisites').children.length > 0
};

Object.keys(steps).forEach(step => {
const stepMenuItem = document.querySelector(`.step-menu-item[data-step="${step}"]`);
if (steps[step]) {
stepMenuItem.classList.add('bold');
stepMenuItem.classList.remove('disabled');
} else {
stepMenuItem.classList.remove('bold');
stepMenuItem.classList.add('disabled');
}
});
}

document.querySelectorAll('.step-menu-item').forEach(item => {
item.addEventListener('click', function() {
const step = this.getAttribute('data-step');
document.querySelectorAll('.step-menu-item').forEach(i => i.classList.add('disabled'));
this.classList.add('bold');
this.classList.remove('disabled');
});
});

document.querySelectorAll('input, select, textarea').forEach(input => {
input.addEventListener('change', updateStepMenu);
});

updateStepMenu();
});
1 change: 1 addition & 0 deletions app/Modules/Courses/Resources/lang/en/courses.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
'no description available' => '(no description available)',
'add to lesson plan' => 'Add to lesson plan',
'my modules' => 'My Modules',
'dashboard' => 'Dashboard',
'badges' => 'Badges',
'badge' => 'Badge',
'certificates' => 'Certificates',
Expand Down
222 changes: 83 additions & 139 deletions app/Modules/Courses/Resources/views/admin/units/edit.blade.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/Modules/Courses/Resources/views/site/browse.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@section('title'){{ trans('courses::courses.units') . ($title ? ': ' . $title : '') }}@stop

@section('content')
<a href="{{ route('site.courses.dashboard') }}" class="btn btn-primary float-right">{{ trans('courses::courses.my modules') }}</a>
<a href="{{ route('site.courses.dashboard') }}" class="btn btn-primary float-right">{{ trans('courses::courses.dashboard') }}</a>

<h2>{{ trans('courses::courses.browse') }}</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
route('site.courses.index')
)
->append(
trans('courses::courses.my modules'),
trans('courses::courses.dashboard'),
route('site.courses.dashboard')
)
->append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
route('site.courses.index')
)
->append(
trans('courses::courses.my modules'),
trans('courses::courses.dashboard'),
route('site.courses.dashboard')
)
->append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
route('site.courses.index')
)
->append(
trans('courses::courses.my modules'),
trans('courses::courses.dashboard'),
route('site.courses.dashboard')
)
->append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
route('site.courses.index')
)
->append(
trans('courses::courses.my modules'),
trans('courses::courses.dashboard'),
route('site.courses.dashboard')
)
->append(
Expand All @@ -24,10 +24,10 @@
);
@endphp

@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.my modules') . ': ' . trans('courses::courses.achievements') }}@stop
@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.dashboard') . ': ' . trans('courses::courses.achievements') }}@stop

@section('content')
<h2 class="sr-only">{{ trans('courses::courses.my modules') }}</h2>
<h2 class="sr-only">{{ trans('courses::courses.dashboard') }}</h2>

<div class="row">
<div class="col-md-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
route('site.courses.index')
)
->append(
trans('courses::courses.my modules'),
trans('courses::courses.dashboard'),
route('site.courses.dashboard')
)
->append(
Expand All @@ -24,10 +24,10 @@
);
@endphp

@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.my modules') . ': ' . trans('courses::courses.achievements') }}@stop
@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.dashboard') . ': ' . trans('courses::courses.achievements') }}@stop

@section('content')
<h2 class="sr-only">{{ trans('courses::courses.my modules') }}</h2>
<h2 class="sr-only">{{ trans('courses::courses.dashboard') }}</h2>

<div class="row">
<div class="col-md-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
route('site.courses.index')
)
->append(
trans('courses::courses.my modules'),
trans('courses::courses.dashboard'),
route('site.courses.dashboard')
)
->append(
Expand All @@ -64,10 +64,10 @@
);
@endphp

@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.my modules') . ': ' . trans('courses::courses.analytics') }}@stop
@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.dashboard') . ': ' . trans('courses::courses.analytics') }}@stop

@section('content')
<h2 class="sr-only">{{ trans('courses::courses.my modules') }}</h2>
<h2 class="sr-only">{{ trans('courses::courses.dashboard') }}</h2>

<div class="row">
<div class="col-md-3">
Expand Down
78 changes: 44 additions & 34 deletions app/Modules/Courses/Resources/views/site/dashboard/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
route('site.courses.index')
)
->append(
trans('courses::courses.my modules'),
trans('courses::courses.dashboard'),
route('site.courses.dashboard')
);
@endphp

@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.my modules') }}@stop
@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.dashboard') }}@stop

@section('content')
<h2 class="sr-only">{{ trans('courses::courses.my modules') }}</h2>
<h2 class="sr-only">{{ trans('courses::courses.dashboard') }}</h2>

<div class="row">
<div class="col-md-3">
Expand All @@ -37,39 +37,49 @@
<div class="row">
<div class="col-md-12">
<div class="overview mb-4">
<div class="row">
<div class="col-md-4 pb-4 pr-4 border-bottom border-right">
<span class="fa fa-fw fa-hourglass-1" aria-hidden="true"></span>
<span class="val">{{ $notstarted }}</span>
<span class="key">{{ trans('courses::courses.pending') }}</span>
</div>
<div class="col-md-4 pb-4 pr-4 border-bottom border-right">
<span class="fa fa-fw fa-hourglass-half" aria-hidden="true"></span>
<span class="val">{{ $inprogress }}</span>
<span class="key">{{ trans('courses::courses.inprogress') }}</span>
</div>
<div class="col-md-4 pb-4 pl-4 border-bottom">
<span class="fa fa-fw fa-check" aria-hidden="true"></span>
<span class="val">{{ count($complete) }}</span>
<span class="key">{{ trans('courses::courses.completed') }}</span>
</div>
<div class="col-md-4 pt-4 pr-4 border-right">
<span class="fa fa-fw fa-clock-o" aria-hidden="true"></span>
<span class="val">{{ $timespent }}</span>
<span class="key">{{ trans('courses::courses.time spent') }}</span>
</div>
<div class="col-md-4 pt-4 pr-4 border-right">
<span class="fa fa-fw fa-drivers-license-o" aria-hidden="true"></span>
<span class="val">{{ count($certificates) }}</span>
<span class="key">{{ trans('courses::courses.certificates') }}</span>
</div>
<div class="col-md-4 pt-4 pl-4">
<span class="fa fa-fw fa-certificate" aria-hidden="true"></span>
<span class="val">{{ count($badges) }}</span>
<span class="key">{{ trans('courses::courses.badges') }}</span>
<div class="row">
<div class="col-md-4 pb-4 pr-4 border-bottom border-right">
<a href="{{ route('site.courses.dashboard.pending') }}" class="text-decoration-none">
<span class="fa fa-fw fa-hourglass-1" aria-hidden="true"></span>
<span class="val">{{ $notstarted }}</span>
<span class="key">{{ trans('courses::courses.pending') }}</span>
</a>
</div>
<div class="col-md-4 pb-4 pr-4 border-bottom border-right">
<a href="{{ route('site.courses.dashboard.inprogress') }}" class="text-decoration-none">
<span class="fa fa-fw fa-hourglass-half" aria-hidden="true"></span>
<span class="val">{{ $inprogress }}</span>
<span class="key">{{ trans('courses::courses.inprogress') }}</span>
</a>
</div>
<div class="col-md-4 pb-4 pl-4 border-bottom">
<a href="{{ route('site.courses.dashboard.completed') }}" class="text-decoration-none">
<span class="fa fa-fw fa-check" aria-hidden="true"></span>
<span class="val">{{ count($complete) }}</span>
<span class="key">{{ trans('courses::courses.completed') }}</span>
</a>
</div>
<div class="col-md-4 pt-4 pr-4 border-right">
<span class="fa fa-fw fa-clock-o" aria-hidden="true"></span>
<span class="val">{{ $timespent }}</span>
<span class="key">{{ trans('courses::courses.time spent') }}</span>
</div>
<div class="col-md-4 pt-4 pr-4 border-right">
<a href="{{ route('site.courses.dashboard.achievements') }}" class="text-decoration-none">
<span class="fa fa-fw fa-drivers-license-o" aria-hidden="true"></span>
<span class="val">{{ count($certificates) }}</span>
<span class="key">{{ trans('courses::courses.certificates') }}</span>
</a>
</div>
<div class="col-md-4 pt-4 pl-4">
<a href="{{ route('site.courses.dashboard.achievements') }}" class="text-decoration-none">
<span class="fa fa-fw fa-certificate" aria-hidden="true"></span>
<span class="val">{{ count($badges) }}</span>
<span class="key">{{ trans('courses::courses.badges') }}</span>
</a>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
@if (!count($badges))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
route('site.courses.index')
)
->append(
trans('courses::courses.my modules'),
trans('courses::courses.dashboard'),
route('site.courses.dashboard')
)
->append(
Expand All @@ -25,10 +25,10 @@
);
@endphp

@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.my modules') . ': ' . trans('courses::courses.' . $active) }}@stop
@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.dashboard') . ': ' . trans('courses::courses.' . $active) }}@stop

@section('content')
<h2 class="sr-only">{{ trans('courses::courses.my modules') }}</h2>
<h2 class="sr-only">{{ trans('courses::courses.dashboard') }}</h2>

<div class="row">
<div class="col-md-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
route('site.courses.index')
)
->append(
trans('courses::courses.my modules'),
trans('courses::courses.dashboard'),
route('site.courses.dashboard')
)
->append(
Expand All @@ -25,10 +25,10 @@
);
@endphp

@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.my modules') . ': ' . trans('courses::courses.reviews') }}@stop
@section('title'){{ trans('courses::courses.learn') . ': ' . trans('courses::courses.dashboard') . ': ' . trans('courses::courses.reviews') }}@stop

@section('content')
<h2 class="sr-only">{{ trans('courses::courses.my modules') }}</h2>
<h2 class="sr-only">{{ trans('courses::courses.dashboard') }}</h2>

<div class="row">
<div class="col-md-3">
Expand Down
2 changes: 1 addition & 1 deletion app/Modules/Courses/Resources/views/site/menu.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h2 class="course-title mt-0">{{ trans('courses::courses.my modules') }}</h2>
<h2 class="course-title mt-0">{{ trans('courses::courses.dashboard') }}</h2>

<nav aria-label="Course Menu">
<ul class="nav flex-column">
Expand Down
1 change: 1 addition & 0 deletions app/Themes/Cybernetic/lang/en/cybernetic.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
'skip to content' => 'Skip to main content',
'copyright' => 'Copyright &copy; :year :name. All rights reserved.',
'my modules' => 'My Modules',
'dashboard' => 'Dashboard'
];
2 changes: 1 addition & 1 deletion app/Themes/Cybernetic/views/layouts/master.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
</div>
<ul class="user-body ist-group my-0">
<li class="ist-group-item">
<a href="{{ route('site.courses.dashboard') }}">{{ trans('theme::cybernetic.my modules') }}</a>
<a href="{{ route('site.courses.dashboard') }}">{{ trans('theme::cybernetic.dashboard') }}</a>
</li>
<li class="ist-group-item">
<a href="{{ route('site.users.account') }}">{{ trans('theme::cybernetic.account') }}</a>
Expand Down