Support medium-sized profile pictures
This commit is contained in:
parent
5f298b3828
commit
a615f12238
view/src/main
@ -9,7 +9,7 @@ import se.su.dsv.scipro.system.User;
|
||||
|
||||
public class UserProfileImage extends WebComponent {
|
||||
public enum Size {
|
||||
TINY(16), LARGE(128);
|
||||
TINY(16), MEDIUM(64), LARGE(128);
|
||||
|
||||
private final int pixels;
|
||||
|
||||
@ -36,14 +36,12 @@ public class UserProfileImage extends WebComponent {
|
||||
checkComponentTag(tag, "img");
|
||||
super.onComponentTag(tag);
|
||||
tag.put("src", getImageSrc());
|
||||
switch (size) {
|
||||
case TINY:
|
||||
tag.append("class", "profile-picture-sm", " ");
|
||||
break;
|
||||
case LARGE:
|
||||
tag.append("class", "profile-picture-lg", " ");
|
||||
break;
|
||||
}
|
||||
String cssClass = switch (size) {
|
||||
case TINY -> "profile-picture-sm";
|
||||
case MEDIUM -> "profile-picture-md";
|
||||
case LARGE -> "profile-picture-lg";
|
||||
};
|
||||
tag.append("class", cssClass, " ");
|
||||
tag.put("alt", "photo");
|
||||
tag.put("loading", "lazy");
|
||||
}
|
||||
|
@ -527,6 +527,10 @@ th.wicket_orderUp, th.sorting_asc {
|
||||
max-width: 16px;
|
||||
max-height: 16px;
|
||||
}
|
||||
.profile-picture-md {
|
||||
max-width: 64px;
|
||||
max-height: 64px;
|
||||
}
|
||||
.profile-picture-lg {
|
||||
max-width: 128px;
|
||||
max-height: 128px;
|
||||
|
Loading…
x
Reference in New Issue
Block a user