make scripts behave

This commit is contained in:
byte[] 2019-10-04 20:27:26 -04:00
parent a40d31e9cd
commit 64ff8cfa28
4 changed files with 17 additions and 4 deletions

View file

@ -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() {

View file

@ -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

View file

@ -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
= render PhilomenaWeb.LayoutView, "_footer.html", assigns
eex:
<div class="js-datastore" data-hidden-filter="" data-spoilered-filter="" data-hidden-tag-list="[]" data-spoilered-tag-list="[]"></div>

View file

@ -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