move uploaders modules to chiya_web

This commit is contained in:
Inhji 2023-03-23 08:17:47 +01:00
parent 3b6cf4f3b7
commit d088ad71f8
8 changed files with 10 additions and 10 deletions

View file

@ -9,7 +9,7 @@ defmodule Chiya.Accounts.User do
field :hashed_password, :string, redact: true field :hashed_password, :string, redact: true
field :confirmed_at, :naive_datetime field :confirmed_at, :naive_datetime
field :user_image, Chiya.Uploaders.UserImage.Type field :user_image, ChiyaWeb.Uploaders.UserImage.Type
timestamps() timestamps()
end end

View file

@ -157,7 +157,7 @@ defmodule Chiya.Notes do
def delete_note_image(%NoteImage{} = note_image) do def delete_note_image(%NoteImage{} = note_image) do
{:ok, _} = Repo.delete(note_image) {:ok, _} = Repo.delete(note_image)
:ok = Chiya.Uploaders.NoteImage.delete({note_image.path, note_image}) :ok = ChiyaWeb.Uploaders.NoteImage.delete({note_image.path, note_image})
:ok :ok
end end

View file

@ -5,7 +5,7 @@ defmodule Chiya.Notes.NoteImage do
schema "note_images" do schema "note_images" do
field :content, :string, default: "" field :content, :string, default: ""
field :path, Chiya.Uploaders.NoteImage.Type field :path, ChiyaWeb.Uploaders.NoteImage.Type
field :note_id, :id field :note_id, :id
timestamps() timestamps()

View file

@ -19,11 +19,11 @@
<a href={"#image-#{image.id}"}> <a href={"#image-#{image.id}"}>
<img <img
class="rounded-lg w-28 border" class="rounded-lg w-28 border"
src={Chiya.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)} src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)}
/> />
</a> </a>
<a href="#images" class="lightbox" id={"image-#{image.id}"}> <a href="#images" class="lightbox" id={"image-#{image.id}"}>
<span style={"background-image: url('#{Chiya.Uploaders.NoteImage.url({image.path, image}, :full_dithered)}')"}> <span style={"background-image: url('#{ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :full_dithered)}')"}>
</span> </span>
</a> </a>
</article> </article>

View file

@ -41,7 +41,7 @@ defmodule ChiyaWeb.NoteShowLive do
<a href={"#image-#{image.id}"}> <a href={"#image-#{image.id}"}>
<img <img
class="rounded-lg w-28 " class="rounded-lg w-28 "
src={Chiya.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)} src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)}
/> />
</a> </a>
<p class="text-center text-xs text-gray-700 dark:text-gray-300"> <p class="text-center text-xs text-gray-700 dark:text-gray-300">
@ -56,7 +56,7 @@ defmodule ChiyaWeb.NoteShowLive do
</p> </p>
<a href="#images" class="lightbox" id={"image-#{image.id}"}> <a href="#images" class="lightbox" id={"image-#{image.id}"}>
<span style={"background-image: url('#{Chiya.Uploaders.NoteImage.url({image.path, image}, :full_dithered)}')"}> <span style={"background-image: url('#{ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :full_dithered)}')"}>
</span> </span>
</a> </a>
</article> </article>

View file

@ -10,7 +10,7 @@ defmodule ChiyaWeb.UserSettingsLive do
<img <img
class="rounded-lg w-28 mt-8" class="rounded-lg w-28 mt-8"
src={Chiya.Uploaders.UserImage.url({@current_user.user_image, @current_user}, :thumb)} src={ChiyaWeb.Uploaders.UserImage.url({@current_user.user_image, @current_user}, :thumb)}
/> />
<.simple_form <.simple_form

View file

@ -1,4 +1,4 @@
defmodule Chiya.Uploaders.NoteImage do defmodule ChiyaWeb.Uploaders.NoteImage do
use Waffle.Definition use Waffle.Definition
use Waffle.Ecto.Definition use Waffle.Ecto.Definition

View file

@ -1,4 +1,4 @@
defmodule Chiya.Uploaders.UserImage do defmodule ChiyaWeb.Uploaders.UserImage do
use Waffle.Definition use Waffle.Definition
use Waffle.Ecto.Definition use Waffle.Ecto.Definition