Add fallback graphic for user.phtml

+ Fallback SVG
+ onError code to change src if image doesn't exist
This commit is contained in:
Bradley Schofield
2020-09-16 15:27:32 +01:00
parent 6b5ba93e07
commit 3317e7aa68
2 changed files with 26 additions and 1 deletions
+1 -1
View File
@@ -179,7 +179,7 @@
<button class="danger">Logout</button>
</form>
<img data-ls-attrs="src={{env.API}}/avatars/browsers/{{session.client.short_name|lowercase}}?width=120&height=120&project={{env.PROJECT}},title={{session.client.name}},alt={{session.client.name}}" class="avatar trans pull-start margin-end" />
<img onerror="this.onerror=null;this.src='/images/unknown.svg'" data-ls-attrs="src={{env.API}}/avatars/browsers/{{session.client.short_name|lowercase}}?width=120&height=120&project={{env.PROJECT}},title={{session.client.name}},alt={{session.client.name}}" class="avatar trans pull-start margin-end" />
<span data-ls-bind="{{session.client.name}}"></span> <span data-ls-bind="{{session.client.version}}"></span> on <span data-ls-bind="{{session.model}}"></span> <span data-ls-bind="{{session.OS.name}}"></span> <span data-ls-bind="{{session.OS.version}}"></span>
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="1024.000000pt" height="1024.000000pt" viewBox="0 0 1024.000000 1024.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,1024.000000) scale(0.100000,-0.100000)"
fill="#26262F" stroke="none">
<path d="M5000 10143 c-904 -20 -1805 -293 -2565 -776 -1163 -740 -1970 -1911
-2240 -3252 -68 -337 -96 -634 -96 -1000 0 -483 55 -896 180 -1350 268 -971
836 -1854 1609 -2501 868 -726 1911 -1129 3032 -1173 700 -27 1388 85 2020
331 1324 514 2364 1554 2878 2878 197 508 309 1052 331 1610 42 1074 -243
2099 -830 2983 -742 1118 -1887 1889 -3194 2152 -354 71 -756 106 -1125 98z
m375 -673 c778 -48 1359 -279 1826 -728 377 -361 594 -768 676 -1267 25 -156
25 -525 -1 -680 -36 -221 -88 -386 -182 -583 -175 -368 -480 -723 -1099 -1281
-310 -279 -556 -524 -649 -647 -84 -111 -194 -331 -235 -474 -51 -175 -81
-419 -97 -803 l-7 -157 -506 2 -506 3 1 300 c1 508 55 822 199 1160 175 408
417 696 1105 1316 645 582 814 806 890 1181 39 188 26 461 -31 653 -122 415
-477 811 -894 997 -252 113 -552 162 -849 138 -373 -29 -659 -142 -929 -368
-301 -253 -521 -690 -621 -1237 -19 -103 -25 -120 -42 -122 -10 -2 -253 26
-539 60 l-520 62 3 60 c3 73 43 289 83 447 98 390 273 757 497 1043 84 107
305 322 417 405 120 90 277 185 402 245 446 213 1020 311 1608 275z m355
-8130 l0 -600 -600 0 -600 0 0 600 0 600 600 0 600 0 0 -600z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB