Add avatar to admin user page

This commit is contained in:
Râu Cao 2025-05-17 17:46:05 +04:00
parent 37c59b7b0c
commit 92e6b1395a
Signed by: raucao
GPG Key ID: 37036C356E56CC51

View File

@ -89,14 +89,42 @@
</section> </section>
<section class="sm:flex-1 sm:pt-0"> <section class="sm:flex-1 sm:pt-0">
<h3>LDAP</h3> <h3>Avatar</h3>
<% if @user.avatar.attached? %>
<table class="divided">
<tbody>
<tr>
<th class="align-top">Image</th>
<td class="align-top">
<%= image_tag image_url_for(@user.avatar), class: "h-20 w-20 rounded-lg" %>
</td>
</tr>
<tr>
<th>Content type</th>
<td>
<%= @user.avatar.content_type %>
</td>
</tr>
<tr>
<th>Size</th>
<td>
<%= number_to_human_size(@user.avatar.blob.byte_size) %>
</td>
</tr>
</tbody>
</table>
<% else %>
<p class="text-gray-500">No avatar uploaded</p>
<% end %>
<h3 class="mt-12">LDAP</h3>
<table class="divided"> <table class="divided">
<tbody> <tbody>
<tr> <tr>
<th>Avatar</th> <th>Avatar</th>
<td> <td>
<% if @ldap_avatar.present? %> <% if @ldap_avatar.present? %>
JPEG size: <%= @ldap_avatar.size %> JPEG size: <%= number_to_human_size(@ldap_avatar.size) %>
<% else %> <% else %>
&mdash; &mdash;
<% end %> <% end %>