mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27: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();
|
initializeFilters();
|
||||||
|
|
||||||
// CSRF
|
// CSRF
|
||||||
window.booru.csrfToken = $('meta[name="csrf-token"]').content;
|
// TODO
|
||||||
window.booru.csrfParam = $('meta[name="csrf-param"]').content;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function BooruOnRails() {
|
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
|
= cond do
|
||||||
- @image.duplicate_id ->
|
- @image.duplicate_id ->
|
||||||
.media-box__overlay
|
.media-box__overlay
|
||||||
|
|
|
@ -25,4 +25,6 @@ html lang="en"
|
||||||
= render PhilomenaWeb.LayoutView, "_flash_warnings.html", assigns
|
= render PhilomenaWeb.LayoutView, "_flash_warnings.html", assigns
|
||||||
main#content class="layout--wide"
|
main#content class="layout--wide"
|
||||||
= render @view_module, @view_template, assigns
|
= 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
|
defmodule PhilomenaWeb.ImageView do
|
||||||
use PhilomenaWeb, :view
|
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
|
def thumb_url(image, show_hidden, name) do
|
||||||
%{year: year, month: month, day: day} = image.created_at
|
%{year: year, month: month, day: day} = image.created_at
|
||||||
deleted = image.hidden_from_users
|
deleted = image.hidden_from_users
|
||||||
|
|
Loading…
Reference in a new issue