diff --git a/Wollmilchsau/Components/Pages/Admin/AdminHome.razor b/Wollmilchsau/Components/Pages/Admin/AdminHome.razor
index 5f95d6c..e1e3a63 100644
--- a/Wollmilchsau/Components/Pages/Admin/AdminHome.razor
+++ b/Wollmilchsau/Components/Pages/Admin/AdminHome.razor
@@ -8,13 +8,15 @@
User Comparison
-
+Export CSV
-
User Comparison
+User Comparison
@if (!AdminState.Value.LdapUsersLoaded || !AdminState.Value.MoodleUsersLoaded)
{
- Loading users...
+
+ Loading @string.Join(" and ", PendingUserImports, " users")...
+
}
else
{
@@ -27,19 +29,21 @@ else
@if (!CombinedUsers.Any())
{
- No users found.
+
+ No users found.
+
}
else
{
- Username
- Classroom
- Surname
- Given name
- Role
- Exists in LDAP
- Exists in Moodle
+ Username
+ Classroom
+ Surname
+ Given name
+ Role
+ Exists in LDAP
+ Exists in Moodle
@context.Username
@@ -58,8 +62,32 @@ else
}
@code {
+ private static readonly Func SortByUsername = user => user.Username;
+ private static readonly Func SortByClassroom = user => user.Classroom ?? string.Empty;
+ private static readonly Func SortBySurname = user => user.Surname ?? string.Empty;
+ private static readonly Func SortByGivenName = user => user.GivenName ?? string.Empty;
+ private static readonly Func SortByRole = user => user.Role?.ToString() ?? string.Empty;
+ private static readonly Func SortByLdapExistence = user => user.ExistsInLdap;
+ private static readonly Func SortByMoodleExistence = user => user.ExistsInMoodle;
+
private IEnumerable LdapUsers => AdminState.Value.LdapUsers.Values;
+ private IEnumerable PendingUserImports
+ {
+ get
+ {
+ if (!AdminState.Value.LdapUsersLoaded)
+ {
+ yield return "LDAP";
+ }
+
+ if (!AdminState.Value.MoodleUsersLoaded)
+ {
+ yield return "Moodle";
+ }
+ }
+ }
+
private IEnumerable CombinedUsers
{
get