mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
i liked syncing more before i cared about order
This commit is contained in:
@@ -95,6 +95,13 @@
|
||||
>
|
||||
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>
|
||||
|
||||
@if(planner.LoadingCanvasData)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ global using CanvasModel.EnrollmentTerms;
|
||||
global using CanvasModel.Courses;
|
||||
global using CanvasModel;
|
||||
global using LocalModels;
|
||||
global using Management.Planner;
|
||||
global using Management.Web.Shared.Components;
|
||||
global using Management.Web.Shared.Course;
|
||||
|
||||
@@ -17,6 +18,16 @@ DotEnv.Load();
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
var canvas_token = Environment.GetEnvironmentVariable("CANVAS_TOKEN");
|
||||
if (canvas_token == null)
|
||||
throw new Exception("CANVAS_TOKEN is null");
|
||||
var canvas_url = Environment.GetEnvironmentVariable("CANVAS_URL");
|
||||
if (canvas_url == null)
|
||||
{
|
||||
Console.WriteLine("CANVAS_URL is null, defaulting to https://snow.instructure.com");
|
||||
Environment.SetEnvironmentVariable("CANVAS_URL", "https://snow.instructure.com");
|
||||
}
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorPages();
|
||||
builder.Services.AddServerSideBlazor();
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
|
||||
@if (localCourses != null)
|
||||
{
|
||||
<h3 >Stored Courses</h3>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
private string name { get; set; } = String.Empty;
|
||||
private bool lockAtDueDate { get; set; }
|
||||
private IEnumerable<RubricItem> rubric { get; set; } = Enumerable.Empty<RubricItem>();
|
||||
private IEnumerable<SubmissionType> submissionTypes { get; set; } = Enumerable.Empty<SubmissionType>();
|
||||
private IEnumerable<string> submissionTypes { get; set; } = Enumerable.Empty<string>();
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
@using System.Reflection
|
||||
|
||||
@code
|
||||
{
|
||||
[Parameter, EditorRequired]
|
||||
public IEnumerable<SubmissionType> Types { get; set; } = Enumerable.Empty<SubmissionType>();
|
||||
public IEnumerable<string> Types { get; set; } = Enumerable.Empty<string>();
|
||||
|
||||
[Parameter, EditorRequired]
|
||||
public Action<IEnumerable<SubmissionType>> SetTypes { get; set; } = (_) => {};
|
||||
private string getLabel(SubmissionType type)
|
||||
public Action<IEnumerable<string>> SetTypes { get; set; } = (_) => {};
|
||||
private string getLabel(string type)
|
||||
{
|
||||
return type.ToString().Replace("_", "") + "switch";
|
||||
}
|
||||
@@ -14,7 +16,7 @@
|
||||
<h5>Submission Types</h5>
|
||||
<div class="row">
|
||||
|
||||
@foreach (var submissionType in (SubmissionType[])Enum.GetValues(typeof(SubmissionType)))
|
||||
@foreach (var submissionType in SubmissionType.AllTypes)
|
||||
{
|
||||
<div class="col-4">
|
||||
<div class="form-check form-switch">
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
lock_at = null,
|
||||
due_at = DateTime.Now,
|
||||
points_possible = 10,
|
||||
submission_types = new SubmissionType[] { SubmissionType.online_text_entry }
|
||||
submission_types = new string[] { SubmissionType.online_text_entry }
|
||||
};
|
||||
|
||||
if(planner.LocalCourse != null)
|
||||
|
||||
@@ -6,6 +6,18 @@
|
||||
[Parameter]
|
||||
[EditorRequired]
|
||||
public LocalAssignment Assignment { get; set; } = new();
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
planner.StateHasChanged += reload;
|
||||
}
|
||||
private void reload()
|
||||
{
|
||||
this.InvokeAsync(this.StateHasChanged);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
planner.StateHasChanged -= reload;
|
||||
}
|
||||
|
||||
private void dropOnDate(DateTime dropDate)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user