got assignment template variables and replacement working

This commit is contained in:
2023-07-27 19:51:36 -06:00
parent b03c699381
commit 7c857a3887
10 changed files with 63 additions and 81 deletions

View File

@@ -134,7 +134,23 @@
<div class="card-text">
<div class="row">
<div class="col">
@Assignment.description
@if(Assignment.use_template)
{
var template = planner.LocalCourse?.AssignmentTemplates.First((t) => t.Id == Assignment.template_id);
if(template == null)
{
System.Console.WriteLine($"Could not find template fof assignment, {Assignment.template_id}");
}
else
{
var html = AssignmentTemplate.GetHtml(template, Assignment);
@((MarkupString) html)
}
}
else
{
@Assignment.description
}
</div>
<div class="col-auto">