mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 14:17:59 +01:00
make scripts behave
This commit is contained in:
parent
a40d31e9cd
commit
64ff8cfa28
4 changed files with 17 additions and 4 deletions
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue