diff --git a/assets/js/booru.js b/assets/js/booru.js index 70db2221..69359900 100644 --- a/assets/js/booru.js +++ b/assets/js/booru.js @@ -99,8 +99,7 @@ function loadBooruData() { initializeFilters(); // CSRF - window.booru.csrfToken = $('meta[name="csrf-token"]').content; - window.booru.csrfParam = $('meta[name="csrf-param"]').content; + // TODO } function BooruOnRails() { diff --git a/lib/philomena_web/templates/image/_image_container.html.slime b/lib/philomena_web/templates/image/_image_container.html.slime index 8506cda3..fe23afcf 100644 --- a/lib/philomena_web/templates/image/_image_container.html.slime +++ b/lib/philomena_web/templates/image/_image_container.html.slime @@ -1,4 +1,4 @@ -.image-container class=@size +.image-container class=@size data-image-tags="[]" data-size=@size data-uris=Jason.encode!(thumb_urls(@image, false)) = cond do - @image.duplicate_id -> .media-box__overlay diff --git a/lib/philomena_web/templates/layout/app.html.slime b/lib/philomena_web/templates/layout/app.html.slime index 440a8998..3f0dca2c 100644 --- a/lib/philomena_web/templates/layout/app.html.slime +++ b/lib/philomena_web/templates/layout/app.html.slime @@ -25,4 +25,6 @@ html lang="en" = render PhilomenaWeb.LayoutView, "_flash_warnings.html", assigns main#content class="layout--wide" = render @view_module, @view_template, assigns - = render PhilomenaWeb.LayoutView, "_footer.html", assigns \ No newline at end of file + = render PhilomenaWeb.LayoutView, "_footer.html", assigns + eex: +
\ No newline at end of file diff --git a/lib/philomena_web/views/image_view.ex b/lib/philomena_web/views/image_view.ex index 2087e78e..0461420e 100644 --- a/lib/philomena_web/views/image_view.ex +++ b/lib/philomena_web/views/image_view.ex @@ -1,6 +1,18 @@ defmodule PhilomenaWeb.ImageView do use PhilomenaWeb, :view + def thumb_urls(image, show_hidden) do + %{ + thumb_tiny: thumb_url(image, show_hidden, :thumb_tiny), + thumb_small: thumb_url(image, show_hidden, :thumb_small), + thumb: thumb_url(image, show_hidden, :thumb), + small: thumb_url(image, show_hidden, :small), + medium: thumb_url(image, show_hidden, :medium), + large: thumb_url(image, show_hidden, :large), + full: thumb_url(image, show_hidden, :full) + } + end + def thumb_url(image, show_hidden, name) do %{year: year, month: month, day: day} = image.created_at deleted = image.hidden_from_users