diff --git a/src/Modules/StatCan.OrchardCore.Hackathon/HackathonMigrations.cs b/src/Modules/StatCan.OrchardCore.Hackathon/HackathonMigrations.cs index b8876487e..24cc8c7e6 100644 --- a/src/Modules/StatCan.OrchardCore.Hackathon/HackathonMigrations.cs +++ b/src/Modules/StatCan.OrchardCore.Hackathon/HackathonMigrations.cs @@ -27,6 +27,7 @@ public async Task CreateAsync() CreateUserProfiles(); CreateWidgets(); CreateChallenge(); + CreateStudentDashboard(); await _recipeMigrator.ExecuteAsync("queries.recipe.json", this); await _recipeMigrator.ExecuteAsync("roles.recipe.json", this); @@ -104,5 +105,29 @@ private void CreateChallenge() .WithMarkdownBody("2") ); } + + private void CreateStudentDashboard() + { + _contentDefinitionManager.AlterTypeDefinition("StudentDashboard", type => type + .DisplayedAs("StudentDashboard") + .Stereotype("Widget") + .WithPart("StudentDashboard", part => part + .WithPosition("0") + ) + ); + + _contentDefinitionManager.AlterPartDefinition("StudentDashboard", part => part + .WithField("Hacker", field => field + .OfType("UserPickerField") + .WithDisplayName("Hacker") + .WithPosition("0") + .WithSettings(new UserPickerFieldSettings + { + DisplayedRoles = new[] { "Hacker" }, + }) + ) + ); + } + } } diff --git a/src/Modules/StatCan.OrchardCore.Hackathon/Views/Widget-StudentDashboard.liquid b/src/Modules/StatCan.OrchardCore.Hackathon/Views/Widget-StudentDashboard.liquid new file mode 100644 index 000000000..4281c5c34 --- /dev/null +++ b/src/Modules/StatCan.OrchardCore.Hackathon/Views/Widget-StudentDashboard.liquid @@ -0,0 +1,45 @@ +{% assign hackers = Queries.GetHackersForTeam | query %} +{% assign skillsInterest = Queries.GetItemsForHackathon | query: type: "SkillsInterest" %} + + +

Student Dashboard

+ + + + {% for hacker in hackers %} + + {% assign user = hacker.UserId | users_by_id %} + {% assign phoneNumber = i.ContentItem.Content.SkillsInterest.PhoneNumber.Text %} + {% capture studentName %} {{hacker.FirstName}} {{hacker.LastName}} {% endcapture %} + {% assign fieldOfStudy = user.Properties.Hacker.Hacker.FieldOfStudy.Text %} + {% assign programLevel = user.Properties.Hacker.Hacker.ProgramLevel.Text %} + {% assign isHired = i.ContentItem.Content.SkillsInterest.Hired.Value %} + + {% if fieldOfStudy and programLevel != null %} + + + {{studentName}} + {% if isHired == "true" %} + + Hired + mdi-checkbox-marked-circle + + {% endif %} + + {{hacker.Email}} + {{ i.ContentItem.Content.SkillsInterest.PhoneNumber.Text}} + +
Field of Study: + {{fieldOfStudy}} +
+
Program Level: + {{programLevel}} +
+ +
+ {% endif %} + + {% endfor %} +
+
+
\ No newline at end of file