From 0ad3313371d97fec5609e41e8377354eade3ef32 Mon Sep 17 00:00:00 2001 From: R Axalan Date: Wed, 2 Feb 2022 08:17:35 -0500 Subject: [PATCH 1/2] Adds student dashboard --- .../HackathonMigrations.cs | 25 ++++++++++++++ .../Views/Widget-StudentDashboard.liquid | 34 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 src/Modules/StatCan.OrchardCore.Hackathon/Views/Widget-StudentDashboard.liquid 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..a31a07ebb --- /dev/null +++ b/src/Modules/StatCan.OrchardCore.Hackathon/Views/Widget-StudentDashboard.liquid @@ -0,0 +1,34 @@ +{% assign hackers = Queries.GetHackersForTeam | query %} + + +

Student Dashboard

+ + + {% for hacker in hackers %} + {% assign user = hacker.UserId | users_by_id %} + {% assign phoneNumber = user.Properties.SkillsInterest.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 %} + + {% if fieldOfStudy and programLevel != null %} + + + {{studentName}} + {{hacker.Email}} + {{phoneNumber}} + +
Field of Study: + {{fieldOfStudy}} +
+
Program Level: + {{programLevel}} +
+ +
+ + {% endif %} + {% endfor %} +
+
+
\ No newline at end of file From a81046a84736b9f1226715309e155422149e734c Mon Sep 17 00:00:00 2001 From: R Axalan Date: Wed, 9 Feb 2022 14:17:02 -0500 Subject: [PATCH 2/2] WIP Adds Hire button indicator --- .../Views/Widget-StudentDashboard.liquid | 49 ++++++++++++------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/src/Modules/StatCan.OrchardCore.Hackathon/Views/Widget-StudentDashboard.liquid b/src/Modules/StatCan.OrchardCore.Hackathon/Views/Widget-StudentDashboard.liquid index a31a07ebb..4281c5c34 100644 --- a/src/Modules/StatCan.OrchardCore.Hackathon/Views/Widget-StudentDashboard.liquid +++ b/src/Modules/StatCan.OrchardCore.Hackathon/Views/Widget-StudentDashboard.liquid @@ -1,33 +1,44 @@ {% 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 = user.Properties.SkillsInterest.SkillsInterest.PhoneNumber.Text %} + {% 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 %} - - {% if fieldOfStudy and programLevel != null %} - - - {{studentName}} - {{hacker.Email}} - {{phoneNumber}} - -
Field of Study: - {{fieldOfStudy}} -
-
Program Level: - {{programLevel}} -
- -
- - {% endif %} + {% 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 %}