cartodb-4.42/lib/assets/javascripts/dashboard/components/avatar-selector/avatar-selector.tpl
2024-04-09 12:00:11 +08:00

47 lines
7.0 KiB
Smarty

<div class="CDB-Text js-avatarSelector">
<div class="FormAccount-rowLabel">
<label class="CDB-Text CDB-Size-medium is-semibold u-mainTextColor">
<% if (inputName == "user[avatar_url]") { %>
*
<% } else if (inputName == "organization[avatar_url]") { %>
<% } %>
</label>
</div>
<div class="FormAccount-rowData FormAccount-avatar">
<div class="FormAccount-avatarPreview">
<% if (avatarURL) { %>
<img src="<%- avatarURL %>" title="<%- username %>" alt="<%- username %>" class="FormAccount-avatarPreviewImage" />
<% } else { %>
<svg width="100px" height="100px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="FormAccount-avatarPreviewImage">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Group-2">
<rect id="Rectangle" fill="#F9F9F9" x="0" y="0" width="100" height="100"></rect>
<g id="seats-icon" transform="translate(21.093750, 25.000000)" fill="#B1B8C1">
<g id="Group">
<path d="M13.0696615,16.6666666 L1.18815104,16.6666666 C0.532291666,16.6666666 0,17.2 0,17.8571429 L0,25 C0,27.5785714 0.7984375,29.1190477 2.37630209,29.6 L2.37630209,39.2857143 C2.37630209,39.9428571 2.90859375,40.4761905 3.56445312,40.4761905 L10.6933594,40.4761905 C11.3492187,40.4761905 11.8815104,39.9428571 11.8815104,39.2857143 L11.8815104,29.6 C13.4569987,29.1190477 14.2554362,27.5785714 14.2578125,25 L14.2578125,17.8571429 C14.2578125,17.2 13.7255209,16.6666666 13.0696615,16.6666666 L13.0696615,16.6666666 L13.0696615,16.6666666 Z M11.8815104,25 C11.8791341,27.3809523 11.2208984,27.3809523 10.6933594,27.3809523 C10.0375,27.3809523 9.50520836,27.9142857 9.50520836,28.5714286 L9.50520836,38.0952381 L4.75260416,38.0952381 L4.75260416,28.5714286 C4.75260416,27.9142857 4.2203125,27.3809523 3.56445312,27.3809523 C3.03453776,27.3809523 2.37630209,27.3809523 2.37630209,25 L2.37630209,19.0476191 L11.8815104,19.0476191 L11.8815104,25 L11.8815104,25 L11.8815104,25 Z M55.843099,16.6666666 L43.9615885,16.6666666 C43.3057291,16.6666666 42.7734375,17.2 42.7734375,17.8571429 L42.7734375,25 C42.7734375,27.5785714 43.571875,29.1190477 45.1497396,29.6 L45.1497396,39.2857143 C45.1497396,39.9428571 45.6820313,40.4761905 46.3378906,40.4761905 L53.4667969,40.4761905 C54.1226562,40.4761905 54.6549479,39.9428571 54.6549479,39.2857143 L54.6549479,29.6 C56.2304362,29.1190477 57.0288737,27.5785714 57.03125,25 L57.03125,17.8571429 C57.03125,17.2 56.4989584,16.6666666 55.843099,16.6666666 L55.843099,16.6666666 L55.843099,16.6666666 Z M54.6549479,25 C54.6525716,27.3809523 53.9943359,27.3809523 53.4667969,27.3809523 C52.8109375,27.3809523 52.2786459,27.9142857 52.2786459,28.5714286 L52.2786459,38.0952381 L47.5260416,38.0952381 L47.5260416,28.5714286 C47.5260416,27.9142857 46.99375,27.3809523 46.3378906,27.3809523 C45.8079752,27.3809523 45.1497396,27.3809523 45.1497396,25 L45.1497396,19.0476191 L54.6549479,19.0476191 L54.6549479,25 L54.6549479,25 L54.6549479,25 Z M36.8326823,16.6666666 L20.1985677,16.6666666 C19.5427084,16.6666666 19.0104166,17.2 19.0104166,17.8571429 L19.0104166,29.7619048 C19.0104166,32.6380952 21.0540365,35.0404762 23.7630209,35.5952381 L23.7630209,48.8095238 C23.7630209,49.4666666 24.2953125,50 24.9511719,50 L32.0800781,50 C32.7359375,50 33.2682291,49.4666666 33.2682291,48.8095238 L33.2682291,35.5952381 C35.9772135,35.0428571 38.0208334,32.6380952 38.0208334,29.7619048 L38.0208334,17.8571429 C38.0208334,17.2 37.4885416,16.6666666 36.8326823,16.6666666 L36.8326823,16.6666666 L36.8326823,16.6666666 Z M35.6445312,29.7619048 C35.6445312,31.7309523 34.0452799,33.3333334 32.0800781,33.3333334 C31.4242188,33.3333334 30.8919271,33.8666666 30.8919271,34.5238095 L30.8919271,47.6190477 L26.1393229,47.6190477 L26.1393229,34.5238095 C26.1393229,33.8666666 25.6070312,33.3333334 24.9511719,33.3333334 C22.9859701,33.3333334 21.3867188,31.7309523 21.3867188,29.7619048 L21.3867188,19.0476191 L35.6445312,19.0476191 L35.6445312,29.7619048 L35.6445312,29.7619048 L35.6445312,29.7619048 Z M7.12890625,14.2857143 C9.74996742,14.2857143 11.8815104,12.15 11.8815104,9.52380953 C11.8815104,6.89523809 9.74996742,4.76190477 7.12890625,4.76190477 C4.50784505,4.76190477 2.37630209,6.89523809 2.37630209,9.52380953 C2.37630209,12.15 4.50784505,14.2857143 7.12890625,14.2857143 L7.12890625,14.2857143 L7.12890625,14.2857143 Z M7.12890625,7.14285714 C8.43824867,7.14285714 9.50520836,8.21190477 9.50520836,9.52380953 C9.50520836,10.8357143 8.43824867,11.9047619 7.12890625,11.9047619 C5.8195638,11.9047619 4.75260416,10.8357143 4.75260416,9.52380953 C4.75260416,8.21190477 5.8195638,7.14285714 7.12890625,7.14285714 L7.12890625,7.14285714 L7.12890625,7.14285714 Z M49.9023438,14.2857143 C52.5234049,14.2857143 54.6549479,12.15 54.6549479,9.52380953 C54.6549479,6.89523809 52.5234049,4.76190477 49.9023438,4.76190477 C47.2812826,4.76190477 45.1497396,6.89523809 45.1497396,9.52380953 C45.1497396,12.15 47.2812826,14.2857143 49.9023438,14.2857143 L49.9023438,14.2857143 L49.9023438,14.2857143 Z M49.9023438,7.14285714 C51.2116862,7.14285714 52.2786459,8.21190477 52.2786459,9.52380953 C52.2786459,10.8357143 51.2116862,11.9047619 49.9023438,11.9047619 C48.5930013,11.9047619 47.5260416,10.8357143 47.5260416,9.52380953 C47.5260416,8.21190477 48.5930013,7.14285714 49.9023438,7.14285714 L49.9023438,7.14285714 L49.9023438,7.14285714 Z M28.515625,14.2857143 C32.4460287,14.2857143 35.6445312,11.0809523 35.6445312,7.14285714 C35.6445312,3.20476191 32.4460287,0 28.515625,0 C24.5852213,0 21.3867188,3.20476191 21.3867188,7.14285714 C21.3867188,11.0809523 24.5852213,14.2857143 28.515625,14.2857143 L28.515625,14.2857143 L28.515625,14.2857143 Z M28.515625,2.38095238 C31.1366862,2.38095238 33.2682291,4.51428571 33.2682291,7.14285714 C33.2682291,9.76904766 31.1366862,11.9047619 28.515625,11.9047619 C25.8945638,11.9047619 23.7630209,9.76904766 23.7630209,7.14285714 C23.7630209,4.51428571 25.8945638,2.38095238 28.515625,2.38095238 L28.515625,2.38095238 L28.515625,2.38095238 Z" id="Shape"></path>
</g>
</g>
</g>
</g>
</svg>
<% } %>
<% if (state === "loading") { %>
<div class="FormAccount-avatarPreviewLoader">
<div class="Spinner FormAccount-avatarPreviewSpinner"></div>
</div>
<% } %>
</div>
<input class="js-fileAvatar" type="file" value="Choose image" accept="<%- avatarAcceptedExtensions %>" />
<input class="js-inputAvatar" id="user_avatar_url" name="<%- inputName %>" type="hidden" value="<%- avatarURL %>" />
<div class="FormAccount-rowInfo FormAccount-rowInfo--marginLeft">
<% if (state === "error") { %>
<p class="FormAccount-rowInfoText FormAccount-rowInfoText--error FormAccount-rowInfoText--maxWidth">. </p>
<% } else { %>
<p class="FormAccount-rowInfoText FormAccount-rowInfoText--smaller"> 128x128 </p>
<% } %>
</div>
</div>
</div>