mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
courses go in their own page
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
@using Management.Web.Shared.Module.Assignment
|
||||
@using Management.Web.Shared.Components
|
||||
|
||||
@inject YamlManager yamlManager
|
||||
@inject CanvasService canvas
|
||||
@inject CoursePlanner planner
|
||||
|
||||
@@ -16,6 +17,62 @@
|
||||
[Parameter]
|
||||
public string CourseName { get; set; }
|
||||
|
||||
private bool loading = true;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if(planner.LocalCourse == null)
|
||||
{
|
||||
var courses = await yamlManager.LoadSavedCourses();
|
||||
planner.LocalCourse = courses.First(c => c.Name == CourseName);
|
||||
}
|
||||
base.OnInitialized();
|
||||
loading = false;
|
||||
}
|
||||
|
||||
@planner.LocalCourse?.Name
|
||||
}
|
||||
|
||||
@if(loading)
|
||||
{
|
||||
<Spinner />
|
||||
}
|
||||
|
||||
@if(planner.LocalCourse != null)
|
||||
{
|
||||
<div class="mb-3 d-flex justify-content-between" style="height: 4em;">
|
||||
<div class="my-auto">
|
||||
<button
|
||||
@onclick="planner.Clear"
|
||||
class="btn btn-primary"
|
||||
>
|
||||
Select New Course
|
||||
</button>
|
||||
<CourseSettings />
|
||||
<AssignmentTemplateManagement />
|
||||
|
||||
<button
|
||||
class="btn btn-outline-primary"
|
||||
@onclick="planner.SyncWithCanvas"
|
||||
>
|
||||
Sync With Canvas
|
||||
</button>
|
||||
<a
|
||||
class="btn btn-outline-secondary"
|
||||
target="_blank"
|
||||
href="@($"{Environment.GetEnvironmentVariable("CANVAS_URL")}/courses/{planner.LocalCourse.CanvasId}")"
|
||||
>
|
||||
View In Canvas
|
||||
</a>
|
||||
<div class="my-auto ms-2 d-inline">
|
||||
@planner.LocalCourse.Name
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(planner.LoadingCanvasData)
|
||||
{
|
||||
<Spinner />
|
||||
}
|
||||
</div>
|
||||
<CourseDetails />
|
||||
}
|
||||
<br>
|
||||
@@ -18,6 +18,7 @@
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
planner.StateHasChanged += reload;
|
||||
planner.LocalCourse = null;
|
||||
}
|
||||
|
||||
private void reload()
|
||||
@@ -76,7 +77,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@if(planner.LocalCourse != null)
|
||||
@* @if(planner.LocalCourse != null)
|
||||
{
|
||||
<div class="mb-3 d-flex justify-content-between" style="height: 4em;">
|
||||
<div class="my-auto">
|
||||
@@ -113,7 +114,7 @@
|
||||
}
|
||||
</div>
|
||||
<CourseDetails />
|
||||
}
|
||||
} *@
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
{
|
||||
var newQuestion = new LocalQuizQuestion
|
||||
{
|
||||
Id = Guid.NewGuid().ToString()
|
||||
Id = Guid.NewGuid().ToString(),
|
||||
Points = 1,
|
||||
};
|
||||
var newQuiz = quizContext.Quiz with
|
||||
{
|
||||
|
||||
@@ -32,19 +32,9 @@
|
||||
{
|
||||
var location = "/course/" + course.Name;
|
||||
<div>
|
||||
<h4
|
||||
class="m-3 hover-underline-animation"
|
||||
@onclick="(e) => handleClick(e, course)"
|
||||
role='button'
|
||||
>
|
||||
<h4 class="m-3 hover-underline-animation" @onclick="(e) => handleClick(e, course)" role='button'>
|
||||
@course.Name
|
||||
</h4>
|
||||
@* <h4
|
||||
@onclick="(e) => handleClick(e, course)"
|
||||
role='button'
|
||||
>
|
||||
@course.Name
|
||||
</h4> *@
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user