Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/Modules/StatCan.OrchardCore.Hackathon/HackathonMigrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public async Task<int> CreateAsync()
CreateUserProfiles();
CreateWidgets();
CreateChallenge();
CreateStudentDashboard();

await _recipeMigrator.ExecuteAsync("queries.recipe.json", this);
await _recipeMigrator.ExecuteAsync("roles.recipe.json", this);
Expand Down Expand Up @@ -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" },
})
)
);
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{% assign hackers = Queries.GetHackersForTeam | query %}
{% assign skillsInterest = Queries.GetItemsForHackathon | query: type: "SkillsInterest" %}

<v-container justify="center" >
<h1>Student Dashboard</h1>
<v-row justify="center">
<v-col cols="12" class="d-flex my-5 xs-12 flex-wrap" >

{% 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 %}
<v-card class="pa-2 ma-3" width="30%">
<span class="d-flex justify-space-between align-center">
<v-card-title class="pb-0">{{studentName}}</v-card-title>
{% if isHired == "true" %}
<v-btn color="success" class="ma-3">
Hired
<v-icon right>mdi-checkbox-marked-circle</v-icon>
</v-btn>
{% endif %}
</span>
<v-card-subtitle class="py-0">{{hacker.Email}}</v-card-subtitle>
<v-card-subtitle class="pt-0" >{{ i.ContentItem.Content.SkillsInterest.PhoneNumber.Text}}</v-card-subtitle>
<v-card-text>
<div class="text-body-2">Field of Study:
<span class="font-weight-bold"> {{fieldOfStudy}} </span>
</div>
<div class="text-body-2">Program Level:
<span class="font-weight-bold"> {{programLevel}} </span>
</div>
<v-card-text>
</v-card>
{% endif %}

{% endfor %}
</v-col>
</v-row>
</v-container>