WIP Store avatars as ActiveStorage attachments
Also push to LDAP as jpegPhoto
This commit is contained in:
@@ -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 %>
|
||||
—
|
||||
<% end %>
|
||||
|
||||
@@ -33,22 +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">
|
||||
<% unless current_user.avatar.nil? %>
|
||||
<p class="flex-none">
|
||||
<%= image_tag "data:image/jpeg;base64,#{current_user.avatar_base64}",
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user