Merge branch 'feature/user_avatars' into live
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-05-12 15:11:39 +04:00
15 changed files with 137 additions and 62 deletions

View File

@@ -95,8 +95,8 @@
<tr>
<th>Avatar</th>
<td>
<% if @avatar.present? %>
<img src="data:image/jpeg;base64,<%= @avatar %>" class="h-48 w-48" />
<% if @ldap_avatar.present? %>
JPEG size: <%= @ldap_avatar.size %>
<% else %>
&mdash;
<% end %>

View File

@@ -20,7 +20,7 @@
</button>
</p>
<p class="text-sm text-gray-500">
Your user address for Chat and Lightning Network.
Your account's address on the Internet
</p>
</div>
<%= form_for(@user, url: setting_path(:profile), html: { :method => :put }) do |f| %>
@@ -33,21 +33,19 @@
<% if Flipper.enabled?(:avatar_upload, current_user) %>
<label class="block">
<p class="font-bold mb-1">
Avatar
</p>
<p class="text-gray-500">
Default profile picture
</p>
<p class="font-bold mb-1">Avatar</p>
<p class="text-gray-500">Default profile picture</p>
<div class="flex items-center gap-6">
<% if current_user.avatar.present? %>
<p class="flex-none">
<%= image_tag "data:image/jpeg;base64,#{current_user.avatar}", class: "h-24 w-24 rounded-lg" %>
</p>
<% if @user.avatar.attached? %>
<p class="flex-none">
<%= image_tag @user.avatar_variant(size: :medium),
class: "h-24 w-24 rounded-lg" %>
</p>
<% end %>
<div class="grow">
<p class="mb-2">
<%= f.file_field :avatar, class: "" %>
<%= f.file_field :avatar_new, accept: "image/jpeg,image/png" %>
</p>
<p class="text-sm text-gray-500">
JPEG or PNG image, not larger than 1 megabyte
</p>