From: Radek Czajka Date: Fri, 25 Aug 2023 10:25:52 +0000 (+0200) Subject: Cleanup X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/9bc86f5a6542c5893ac94284da33162a7c7be2d6 Cleanup --- diff --git a/src/ajaxable/templates/ajaxable/form_on_page.html b/src/ajaxable/templates/ajaxable/form_on_page.html index d88cadb85..ec5d414ea 100644 --- a/src/ajaxable/templates/ajaxable/form_on_page.html +++ b/src/ajaxable/templates/ajaxable/form_on_page.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% block titleextra %}{{ title }}{% endblock %} diff --git a/src/api/templates/api/main.html b/src/api/templates/api/main.html index 06688d0dc..72c455a5d 100644 --- a/src/api/templates/api/main.html +++ b/src/api/templates/api/main.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% load build_absolute_uri from fnp_common %} diff --git a/src/api/templates/oauth/authorize_token.html b/src/api/templates/oauth/authorize_token.html index 70c5e497d..60e5abd03 100644 --- a/src/api/templates/oauth/authorize_token.html +++ b/src/api/templates/oauth/authorize_token.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% block settings %} diff --git a/src/catalogue/static/2022/book/filter.js b/src/catalogue/static/2022/book/filter.js deleted file mode 100644 index 2ff426234..000000000 --- a/src/catalogue/static/2022/book/filter.js +++ /dev/null @@ -1,134 +0,0 @@ -(function($) { - - let unpagedSearch = null; - if (!$(".quick-filter").val() && !$('.l-pagination li').length) { - unpagedSearch = ''; - } - - function get_page(page, search, ordering, callback) { - get_page_by_url('.?page=' + page + '&order=' + ordering + '&search=' + search, callback); - } - - let lastFulfilledPage = 0; - - function get_page_by_url(url, callback) { - let requestTime = + new Date(); - $.get( - url, - function(data) { - if (lastFulfilledPage > requestTime) return; - lastFulfilledPage = requestTime; - - html = $(data); - objectList = $('#object-list', html); - paginate = $('#paginate', html); - - ids = new Set(); - $(".icon-like", objectList).each( - (i, e)=>{ - ids.add($(e).attr('data-book')); - } - ); - ids = [...ids].join(','); - $.refreshLikes(ids); - - $('#book-list').html(objectList.children()); - $('#paginator').html(paginate.children()); - history.replaceState({}, '', url); - callback && callback(); - } - ) - } - - $("#paginator").on('click', 'a', function() { - get_page_by_url(url=$(this).attr('href')); - return false; - }); - - $(".quick-filter").each(function() { - let bookList = $('#' + $(this).data('for')); - let filterList = $('.' + $(this).data('filters')); - - $(this).on('focus', function() { - filterList.addClass('filters-enabled'); - }); - $(this).on('blur', function() { - filterList.removeClass('filters-enabled'); - }); - - $(this).on('input propertychange', function() { - let search = $(this).val().toLowerCase(); - - if (!search.startsWith(unpagedSearch)) { - get_page(1, search, 'title', function() { - if ($('.l-pagination li').length) { - unpagedSearch = null; - } - }) - } else { - bookList.children().each(function() { - found = !search || - $(".s", this).text().toLowerCase().search(search) != -1 - ; - if (found) - $(this).fadeIn(); - else - $(this).fadeOut(); - }); - } - - $('.filter-container', filterList).children().each(function() { - found = !search || - $(this).text().toLowerCase().search(search) != -1 - ; - if (found) - $(this).fadeIn(); - else - $(this).fadeOut(); - }); - }); - - }); - - $(".l-books__sorting button").on('click', function() { - if ($(this).hasClass('is-active')) return; - $(".is-active", $(this).parent()).removeClass("is-active"); - $(this).addClass("is-active"); - let prop = $(this).attr('data-order'); - $(".l-books__sorting select").val(prop); - if (prop == '-') prop = ''; - resort(prop); - }); - $(".l-books__sorting select").on('change', function() { - let prop = $(this).val(); - $(".is-active", $(this).parent()).removeClass("is-active"); - $("[data-order='" + prop +"']", $(this).parent()).addClass("is-active"); - if (prop == '-') prop = ''; - resort(prop); - }); - - function resort(prop) { - // do we NOW have pages (possibly after filtering)? - // if we don't have pages, we can just sort here. - let havePages = $('.l-pagination li').length > 0; - - $(".l-books__item").css('opacity', '0'); - setTimeout(function() { - if (havePages) { - get_page(1, '', prop); - } else { - if (prop) { - $(".l-books__item").each(function() { - $(this).css('order', $(this).attr('data-' + prop)); - }); - } else { - $(".l-books__item").css('order', ''); - } - setTimeout(function() { - $(".l-books__item").css('opacity', '100%'); - }, 200); - } - }, 200); - } - -})(jQuery); diff --git a/src/catalogue/static/book/filter.js b/src/catalogue/static/book/filter.js new file mode 100644 index 000000000..2ff426234 --- /dev/null +++ b/src/catalogue/static/book/filter.js @@ -0,0 +1,134 @@ +(function($) { + + let unpagedSearch = null; + if (!$(".quick-filter").val() && !$('.l-pagination li').length) { + unpagedSearch = ''; + } + + function get_page(page, search, ordering, callback) { + get_page_by_url('.?page=' + page + '&order=' + ordering + '&search=' + search, callback); + } + + let lastFulfilledPage = 0; + + function get_page_by_url(url, callback) { + let requestTime = + new Date(); + $.get( + url, + function(data) { + if (lastFulfilledPage > requestTime) return; + lastFulfilledPage = requestTime; + + html = $(data); + objectList = $('#object-list', html); + paginate = $('#paginate', html); + + ids = new Set(); + $(".icon-like", objectList).each( + (i, e)=>{ + ids.add($(e).attr('data-book')); + } + ); + ids = [...ids].join(','); + $.refreshLikes(ids); + + $('#book-list').html(objectList.children()); + $('#paginator').html(paginate.children()); + history.replaceState({}, '', url); + callback && callback(); + } + ) + } + + $("#paginator").on('click', 'a', function() { + get_page_by_url(url=$(this).attr('href')); + return false; + }); + + $(".quick-filter").each(function() { + let bookList = $('#' + $(this).data('for')); + let filterList = $('.' + $(this).data('filters')); + + $(this).on('focus', function() { + filterList.addClass('filters-enabled'); + }); + $(this).on('blur', function() { + filterList.removeClass('filters-enabled'); + }); + + $(this).on('input propertychange', function() { + let search = $(this).val().toLowerCase(); + + if (!search.startsWith(unpagedSearch)) { + get_page(1, search, 'title', function() { + if ($('.l-pagination li').length) { + unpagedSearch = null; + } + }) + } else { + bookList.children().each(function() { + found = !search || + $(".s", this).text().toLowerCase().search(search) != -1 + ; + if (found) + $(this).fadeIn(); + else + $(this).fadeOut(); + }); + } + + $('.filter-container', filterList).children().each(function() { + found = !search || + $(this).text().toLowerCase().search(search) != -1 + ; + if (found) + $(this).fadeIn(); + else + $(this).fadeOut(); + }); + }); + + }); + + $(".l-books__sorting button").on('click', function() { + if ($(this).hasClass('is-active')) return; + $(".is-active", $(this).parent()).removeClass("is-active"); + $(this).addClass("is-active"); + let prop = $(this).attr('data-order'); + $(".l-books__sorting select").val(prop); + if (prop == '-') prop = ''; + resort(prop); + }); + $(".l-books__sorting select").on('change', function() { + let prop = $(this).val(); + $(".is-active", $(this).parent()).removeClass("is-active"); + $("[data-order='" + prop +"']", $(this).parent()).addClass("is-active"); + if (prop == '-') prop = ''; + resort(prop); + }); + + function resort(prop) { + // do we NOW have pages (possibly after filtering)? + // if we don't have pages, we can just sort here. + let havePages = $('.l-pagination li').length > 0; + + $(".l-books__item").css('opacity', '0'); + setTimeout(function() { + if (havePages) { + get_page(1, '', prop); + } else { + if (prop) { + $(".l-books__item").each(function() { + $(this).css('order', $(this).attr('data-' + prop)); + }); + } else { + $(".l-books__item").css('order', ''); + } + setTimeout(function() { + $(".l-books__item").css('opacity', '100%'); + }, 200); + } + }, 200); + } + +})(jQuery); diff --git a/src/catalogue/static/player/2022_player.js b/src/catalogue/static/player/2022_player.js deleted file mode 100644 index dfac09615..000000000 --- a/src/catalogue/static/player/2022_player.js +++ /dev/null @@ -1,325 +0,0 @@ -(function($) { - $(function() { - - $(".book-right-column").remove(); - - if ($("#player-bar").length) { - $("h1").first().after($("
Możesz jednocześnie czytać i słuchać tej lektury!
")); - } - - $(".enable-player-bar").click(function() { - $('body').addClass('with-player-bar'); - $('.jp-play').click(); - return false; - }) - - - var smil = $("#smil").text(); - if (smil) { - smil = $.parseJSON(smil); - - $.each(smil, function(i, e) { - $('#' + e).addClass('syncable'); - }) - } - - - scrolling = false; - /*$(window).on('scroll', function() { - if (!scrolling) { - $("#locator").removeClass('snap'); - } - });*/ - - lastscroll = null; - - scrollTo = function() { - if (!scrolling && $('.playing-highlight').length && $('.playing-highlight')[0] != lastscroll) { - lastscroll = $('.playing-highlight')[0]; - scrolling = true; - $("html").animate({ - scrollTop: $('.playing-highlight').offset().top, - }, { - duration: 2000, - done: function() { - scrolling = false; - - }, - }); - } - } - - - $.jPlayer.timeFormat.showHour = true; - - $(".jp-jplayer").each(function() { - var $self = $(this); - - var $root = $self.parent(); - var $currentMedia = null - var currentDuration = 0; - var speed = 1; - var totalDurationLeft = 0; - var totalDurationBefore = 0; - var lastUpdate = 0; - var player = null; - var doesUpdateSynchro = true; - - // TODO: will need class for attach - // may be added from sync data - $(".syncable").click(function() { - if (!$('body').hasClass('with-player-bar')) return; - let id = $(this).attr('id'); - if (!id) return; - for (let i=0; i { - d = parseFloat($(e).data('duration')); - if (time < d) { - setMedia($(e), time, cmd); - return false - } else { - time -= d; - } - }) - } - - var setMedia = function(elem, time=0, cmd='pause') { - var media = {} - - media['mp3'] = elem.attr('data-mp3'); - media['oga'] = elem.attr('data-ogg'); - media['id'] = elem.attr('data-media-id'); - - $(".c-player__head", $root).html( - $(".attribution", elem).html()) - ; - $(".c-player__info", $root).html( - $(".title", elem).html() - ); - $(".c-media__caption .content", $root).html($(".project-description", elem).html()); - $(".c-media__caption .license", $root).html($(".license", elem).html()); - $(".c-media__caption .project-logo", $root).html($(".project-icon", elem).html()); - - console.log('sm 1'); - doesUpdateSynchro = false; - if (!$currentMedia || $currentMedia[0] != elem[0]) { - console.log('set', player.jPlayer("setMedia", media)) - player.jPlayer("option", "playbackRate", speed); - } - doesUpdateSynchro = true; - player.jPlayer(cmd, time); - - $currentMedia = elem; - $(".play-next", $root).prop("disabled", !elem.next().length); - - let du = parseFloat(elem.data('duration')); - currentDuration = du; - elem.nextAll().each(function() { - du += parseFloat($(this).data('duration')); - }); - totalDurationLeft = du; - - let pdu = 0; - elem.prevAll().each(function() { - pdu += parseFloat($(this).data('duration')); - }); - totalDurationBefore = pdu; - console.log('sm 3', du, pdu); - - return player; - }; - - - var updateSynchrotext = function(position) { - if (!doesUpdateSynchro) return; - - let curElemId = null; - for (let i=0; i maxy) { - locator.addClass('down'); - } - } - } - } - - $self.jPlayer({ - swfPath: "/static/js/contrib/jplayer/", - solution: "html,flash", - supplied: 'oga,mp3', - cssSelectorAncestor: "#" + $self.attr("data-player"), - useStateClassSkin: true, - - ready: function() { - player = $(this); - - let selectItem = $('.c-select li'); - selectItem.on('click', function() { - let speedStr = $(this).data('speed'); - speed = parseFloat(speedStr); - player.jPlayer("option", "playbackRate", speed); - localStorage['audiobook-speed'] = speedStr; - _paq.push(['trackEvent', 'audiobook', 'speed', speedStr]); - }); - - $('.jp-play', $root).click(function() { - _paq.push(['trackEvent', 'audiobook', 'play']); - }); - $('.jp-seek-bar', $root).click(function() { - _paq.push(['trackEvent', 'audiobook', 'seek']); - }); - $('.jp-mute', $root).click(function() { - _paq.push(['trackEvent', 'audiobook', 'mute']); - }); - $('.jp-volume-bar', $root).click(function() { - _paq.push(['trackEvent', 'audiobook', 'volume']); - }); - - $('.play-next', $root).click(function() { - let p = $currentMedia.next(); - if (p.length) { - setMedia(p).jPlayer("play"); - _paq.push(['trackEvent', 'audiobook', 'next']); - } - }); - $('.play-prev', $root).click(function() { - let p = $currentMedia.prev(); - if (p.length) { - setMedia(p).jPlayer("play"); - _paq.push(['trackEvent', 'audiobook', 'prev']); - } else { - // If in first part, restart it. - setMedia($currentMedia).jPlayer("play"); - _paq.push(['trackEvent', 'audiobook', 'rewind']); - } - }); - - $('.jp-playlist li', $root).click(function() { - setMedia($(this)).jPlayer("play"); - $('.c-player__chapters').removeClass('is-active'); - _paq.push(['trackEvent', 'audiobook', 'chapter']); - }); - - console.log('READY 3!'); - var initialElem = $('.jp-playlist li', $root).first(); - var initialTime = 0; - console.log('READY 4!'); - if (true || Modernizr.localstorage) { - try { - let speedStr = localStorage['audiobook-speed']; - if (speedStr) { - speed = parseFloat(speedStr); - $(".speed .is-active").removeClass("is-active"); - $(".speed [data-speed='" + speedStr + "']").addClass("is-active"); - } - } catch {} - - try { - audiobooks = JSON.parse(localStorage["audiobook-history"]); - } catch { - audiobooks = {}; - } - last = audiobooks[$root.attr("data-book-slug")] - // Fallback for book id; - if (!last) { - last = audiobooks[$root.attr("data-book-id")] - } - - if (last) { - initialElem = $('[data-media-id="' + last[1] + '"]', $root).first(); - initialTime = last[2]; - } - } - console.log('READY 5!', initialElem, initialTime); - setMedia($(initialElem), initialTime); - console.log('READY 6!'); - }, - - timeupdate: function(event) { - t = event.jPlayer.status.currentTime; - - updateSynchrotext(totalDurationBefore + t); - - - ttl = (totalDurationLeft - t) / speed; - ttl = $.jPlayer.convertTime(ttl); - $(".total-time-left").text('Czas do końca: ' + ttl); - - $(".time-left").text('– ' + $.jPlayer.convertTime( - currentDuration - t, - )); - - - if (Math.abs(t - lastUpdate) > 3) { - try { - audiobooks = JSON.parse(localStorage["audiobook-history"]); - } catch { - audiobooks = {}; - } - if (t && event.jPlayer.status.duration - t > 10) { - audiobooks[$root.attr("data-book-slug")] = [ - Date.now(), - event.jPlayer.status.media.id, - event.jPlayer.status.currentTime - ]; - } else { - delete audiobooks[$root.attr("data-book-slug")]; - } - // Remove old book id, if present. - delete audiobooks[$root.attr("data-book-id")]; - localStorage["audiobook-history"] = JSON.stringify(audiobooks); - lastUpdate = t; - } - }, - - - ended: function(event) { - let p = $currentMedia.next(); - if (p.length) { - setMedia(p).jPlayer("play"); - } - } - }); - }); - - - $('#locator').on('click', function() { - $(this).toggleClass('snap'); - lastscroll = null; - }); - - - - }); -})(jQuery) diff --git a/src/catalogue/static/player/player.js b/src/catalogue/static/player/player.js new file mode 100644 index 000000000..dfac09615 --- /dev/null +++ b/src/catalogue/static/player/player.js @@ -0,0 +1,325 @@ +(function($) { + $(function() { + + $(".book-right-column").remove(); + + if ($("#player-bar").length) { + $("h1").first().after($("")); + } + + $(".enable-player-bar").click(function() { + $('body').addClass('with-player-bar'); + $('.jp-play').click(); + return false; + }) + + + var smil = $("#smil").text(); + if (smil) { + smil = $.parseJSON(smil); + + $.each(smil, function(i, e) { + $('#' + e).addClass('syncable'); + }) + } + + + scrolling = false; + /*$(window).on('scroll', function() { + if (!scrolling) { + $("#locator").removeClass('snap'); + } + });*/ + + lastscroll = null; + + scrollTo = function() { + if (!scrolling && $('.playing-highlight').length && $('.playing-highlight')[0] != lastscroll) { + lastscroll = $('.playing-highlight')[0]; + scrolling = true; + $("html").animate({ + scrollTop: $('.playing-highlight').offset().top, + }, { + duration: 2000, + done: function() { + scrolling = false; + + }, + }); + } + } + + + $.jPlayer.timeFormat.showHour = true; + + $(".jp-jplayer").each(function() { + var $self = $(this); + + var $root = $self.parent(); + var $currentMedia = null + var currentDuration = 0; + var speed = 1; + var totalDurationLeft = 0; + var totalDurationBefore = 0; + var lastUpdate = 0; + var player = null; + var doesUpdateSynchro = true; + + // TODO: will need class for attach + // may be added from sync data + $(".syncable").click(function() { + if (!$('body').hasClass('with-player-bar')) return; + let id = $(this).attr('id'); + if (!id) return; + for (let i=0; i { + d = parseFloat($(e).data('duration')); + if (time < d) { + setMedia($(e), time, cmd); + return false + } else { + time -= d; + } + }) + } + + var setMedia = function(elem, time=0, cmd='pause') { + var media = {} + + media['mp3'] = elem.attr('data-mp3'); + media['oga'] = elem.attr('data-ogg'); + media['id'] = elem.attr('data-media-id'); + + $(".c-player__head", $root).html( + $(".attribution", elem).html()) + ; + $(".c-player__info", $root).html( + $(".title", elem).html() + ); + $(".c-media__caption .content", $root).html($(".project-description", elem).html()); + $(".c-media__caption .license", $root).html($(".license", elem).html()); + $(".c-media__caption .project-logo", $root).html($(".project-icon", elem).html()); + + console.log('sm 1'); + doesUpdateSynchro = false; + if (!$currentMedia || $currentMedia[0] != elem[0]) { + console.log('set', player.jPlayer("setMedia", media)) + player.jPlayer("option", "playbackRate", speed); + } + doesUpdateSynchro = true; + player.jPlayer(cmd, time); + + $currentMedia = elem; + $(".play-next", $root).prop("disabled", !elem.next().length); + + let du = parseFloat(elem.data('duration')); + currentDuration = du; + elem.nextAll().each(function() { + du += parseFloat($(this).data('duration')); + }); + totalDurationLeft = du; + + let pdu = 0; + elem.prevAll().each(function() { + pdu += parseFloat($(this).data('duration')); + }); + totalDurationBefore = pdu; + console.log('sm 3', du, pdu); + + return player; + }; + + + var updateSynchrotext = function(position) { + if (!doesUpdateSynchro) return; + + let curElemId = null; + for (let i=0; i maxy) { + locator.addClass('down'); + } + } + } + } + + $self.jPlayer({ + swfPath: "/static/js/contrib/jplayer/", + solution: "html,flash", + supplied: 'oga,mp3', + cssSelectorAncestor: "#" + $self.attr("data-player"), + useStateClassSkin: true, + + ready: function() { + player = $(this); + + let selectItem = $('.c-select li'); + selectItem.on('click', function() { + let speedStr = $(this).data('speed'); + speed = parseFloat(speedStr); + player.jPlayer("option", "playbackRate", speed); + localStorage['audiobook-speed'] = speedStr; + _paq.push(['trackEvent', 'audiobook', 'speed', speedStr]); + }); + + $('.jp-play', $root).click(function() { + _paq.push(['trackEvent', 'audiobook', 'play']); + }); + $('.jp-seek-bar', $root).click(function() { + _paq.push(['trackEvent', 'audiobook', 'seek']); + }); + $('.jp-mute', $root).click(function() { + _paq.push(['trackEvent', 'audiobook', 'mute']); + }); + $('.jp-volume-bar', $root).click(function() { + _paq.push(['trackEvent', 'audiobook', 'volume']); + }); + + $('.play-next', $root).click(function() { + let p = $currentMedia.next(); + if (p.length) { + setMedia(p).jPlayer("play"); + _paq.push(['trackEvent', 'audiobook', 'next']); + } + }); + $('.play-prev', $root).click(function() { + let p = $currentMedia.prev(); + if (p.length) { + setMedia(p).jPlayer("play"); + _paq.push(['trackEvent', 'audiobook', 'prev']); + } else { + // If in first part, restart it. + setMedia($currentMedia).jPlayer("play"); + _paq.push(['trackEvent', 'audiobook', 'rewind']); + } + }); + + $('.jp-playlist li', $root).click(function() { + setMedia($(this)).jPlayer("play"); + $('.c-player__chapters').removeClass('is-active'); + _paq.push(['trackEvent', 'audiobook', 'chapter']); + }); + + console.log('READY 3!'); + var initialElem = $('.jp-playlist li', $root).first(); + var initialTime = 0; + console.log('READY 4!'); + if (true || Modernizr.localstorage) { + try { + let speedStr = localStorage['audiobook-speed']; + if (speedStr) { + speed = parseFloat(speedStr); + $(".speed .is-active").removeClass("is-active"); + $(".speed [data-speed='" + speedStr + "']").addClass("is-active"); + } + } catch {} + + try { + audiobooks = JSON.parse(localStorage["audiobook-history"]); + } catch { + audiobooks = {}; + } + last = audiobooks[$root.attr("data-book-slug")] + // Fallback for book id; + if (!last) { + last = audiobooks[$root.attr("data-book-id")] + } + + if (last) { + initialElem = $('[data-media-id="' + last[1] + '"]', $root).first(); + initialTime = last[2]; + } + } + console.log('READY 5!', initialElem, initialTime); + setMedia($(initialElem), initialTime); + console.log('READY 6!'); + }, + + timeupdate: function(event) { + t = event.jPlayer.status.currentTime; + + updateSynchrotext(totalDurationBefore + t); + + + ttl = (totalDurationLeft - t) / speed; + ttl = $.jPlayer.convertTime(ttl); + $(".total-time-left").text('Czas do końca: ' + ttl); + + $(".time-left").text('– ' + $.jPlayer.convertTime( + currentDuration - t, + )); + + + if (Math.abs(t - lastUpdate) > 3) { + try { + audiobooks = JSON.parse(localStorage["audiobook-history"]); + } catch { + audiobooks = {}; + } + if (t && event.jPlayer.status.duration - t > 10) { + audiobooks[$root.attr("data-book-slug")] = [ + Date.now(), + event.jPlayer.status.media.id, + event.jPlayer.status.currentTime + ]; + } else { + delete audiobooks[$root.attr("data-book-slug")]; + } + // Remove old book id, if present. + delete audiobooks[$root.attr("data-book-id")]; + localStorage["audiobook-history"] = JSON.stringify(audiobooks); + lastUpdate = t; + } + }, + + + ended: function(event) { + let p = $currentMedia.next(); + if (p.length) { + setMedia(p).jPlayer("play"); + } + } + }); + }); + + + $('#locator').on('click', function() { + $(this).toggleClass('snap'); + lastscroll = null; + }); + + + + }); +})(jQuery) diff --git a/src/catalogue/templates/catalogue/2022/author_box.html b/src/catalogue/templates/catalogue/2022/author_box.html deleted file mode 100644 index 3b474bf79..000000000 --- a/src/catalogue/templates/catalogue/2022/author_box.html +++ /dev/null @@ -1,32 +0,0 @@ -
-

- {% if tag.category == 'author' %}O autorze - {% elif tag.category == 'kind' %}O rodzaju - {% elif tag.category == 'genre' %}O gatunku - {% elif tag.category == 'epoch' %}O epoce - {% elif tag.category == 'set' %}Półka - {% endif %} -

-
- {% if tag.photo %} -
- {{ tag.name }} -
- {{ tag.photo_attribution|safe }} -
-
- {% endif %} -
- {% if tag.category == 'set' %} - {% load chunks %} - {% chunk 'polka-how-to' %} - {% else %} -

{{ tag.name }}

-
- {{ tag.description|safe }} -
- - {% endif %} -
-
-
diff --git a/src/catalogue/templates/catalogue/2022/author_detail.html b/src/catalogue/templates/catalogue/2022/author_detail.html deleted file mode 100644 index 9b00d8bbd..000000000 --- a/src/catalogue/templates/catalogue/2022/author_detail.html +++ /dev/null @@ -1,108 +0,0 @@ -{% extends '2022/base.html' %} -{% load catalogue_tags %} - -{% load choose_cites from social_tags %} - - -{% block breadcrumbs %} - Katalog - {% if tags %} - {{ main_tag.get_category_display|title }} - {% endif %} -{% endblock %} - -{% block main %} -
-
- {% if main_tag.photo %} -
- {{ main_tag.name }} -
- {% endif %} -

- {% if main_tag %} - {{ main_tag.name }} - {% else %} - {{ title }} - {% endif %} -

-
-
- -
-
-
- - -
- {% for tag in tags %} - {% if tag is not main_tag %} - - {{ tag }} - ✖ - - {% endif %} - {% endfor %} -
- -
-
- Sortuj: -
- - - -
-
-
-
-
- -
-

{% nice_title_from_tags tags categories %}

- {% if suggest %} -
- {% for tag in suggest %} - - {{ tag }} - - {% endfor %} -
- {% endif %} -
-
- -
-
- {% for book in object_list %} - {% include "catalogue/2022/book_box.html" %} - {% endfor %} -
-
- - {% if tags %} -
-
- {% with tag=main_tag %} - {% include 'catalogue/2022/author_box.html' %} - {% endwith %} - {% choose_cites 3 author=main_tag as cites %} - {% if cites %} -
-
-
- - {% for fragment in cites %} -
- {% include "catalogue/2022/fragment_slider_box.html" %} -
- {% endfor %} - -
-
-
- {% endif %} -
-
- {% endif %} -{% endblock %} diff --git a/src/catalogue/templates/catalogue/2022/book_box.html b/src/catalogue/templates/catalogue/2022/book_box.html deleted file mode 100644 index 97c61d936..000000000 --- a/src/catalogue/templates/catalogue/2022/book_box.html +++ /dev/null @@ -1,55 +0,0 @@ -{% load sorl_thumbnail %} - -
-
- - {% if book.is_picture %} - {% if book.image_file %} - {% thumbnail book.image_file "170x240" crop="center" as im %} - - {% endthumbnail %} - {% endif %} - {% else %} - {% if book.cover_clean %} - {{ book.title }} - {% endif %} - {% endif %} - - -
-
-
- {% csrf_token %} {# this needs to be copied in with JS #} - - - -
-
- -
-
- {% if book.is_book %} - - {% endif %} - {% if book.has_mp3_file %} - - {% endif %} - {% if book.is_picture %} - - {% endif %} - -
-

- {% for author in book.authors %} - {{ author }}{% if not forloop.last %}, {% endif %} - {% endfor %} -

-

{{ book.title }}

- - {% for kind in book.kinds %}{{ kind }} {% endfor %} - {% for genre in book.genres %}{{ genre }} {% endfor %} - {% for epoch in book.epochs %}{{ epoch }} {% endfor %} - -
diff --git a/src/catalogue/templates/catalogue/2022/book_detail.html b/src/catalogue/templates/catalogue/2022/book_detail.html deleted file mode 100644 index c2db0b1af..000000000 --- a/src/catalogue/templates/catalogue/2022/book_detail.html +++ /dev/null @@ -1,482 +0,0 @@ -{% extends '2022/base.html' %} - -{% load chunks %} -{% load static %} -{% load choose_cites from social_tags %} -{% load catalogue_tags %} -{% load likes_book from social_tags %} - - -{% block global-content %} -
- -
- - -
-
- {% with first_text=book.get_first_text %} - -
- -
- - - - - - {% if accessible %} -
-
-
- {% if accessible and first_text %} - - {% endif %} - {{ book.pretty_title }} - {% if accessible and first_text %} - - {% endif %} -
-
-
- {% if likes %} -
- {% csrf_token %} - -
- {% else %} -
- {% csrf_token %} - -
- {% endif %} -
-
-
- {% if book.has_mp3_file %} - - {% endif %} -
-
- -
-
- {% if first_text %} - czytaj online - {% endif %} -
-
-
-
- - - - {% if book.has_mp3_file %} - {% include 'catalogue/snippets/2022_jplayer.html' %} - {% else %} - {% with ch=book.get_child_audiobook %} - {% if ch %} - {% include 'catalogue/snippets/2022_jplayer_link.html' with book=ch %} - {% endif %} - {% endwith %} - - {% endif %} - - - - -
-
-
-

Pobieranie e-booka

-

Wybierz wersję dla siebie:

-
-
- {% if book.pdf_file %} -
-
-

.pdf

-

Jeśli planujesz wydruk albo lekturę na urządzeniu mobilnym bez dodatkowych aplikacji.

-
-
- .pdf -
-
- {% endif %} - {% if book.epub_file %} -
-
-

.epub

-

Uniwersalny format e-booków, obsługiwany przez większość czytników sprzętowych i aplikacji na urządzenia mobilne.

-
-
- .epub -
-
- {% endif %} - {% if book.mobi_file %} -
-
-

.mobi

-

Natywny format dla czytnika Amazon Kindle.

-
-
- .mobi -
-
- {% endif %} - {% if book.synchro_file %} -
-
-

synchrobook (epub3)

-

Książka elektroniczna i audiobook w jednym. Wymaga aplikacji obsługującej format (np. ..., ..., ...).

-
- -
- {% endif %} - {% if book.txt_file or book.fb2_file %} -
-
-

inne formaty

- -
-
- {% endif %} -
- -
-
- {% if book.has_mp3_file %} -
-
-
-

Pobieranie audiobooka

-

Wybierz wersję dla siebie:

-
-
-
-
-

.mp3

-

Uniwersalny format, obsługiwany przez wszystkie urządzenia.

-
-
- .mp3 -
-
- {% if book.has_ogg_file %} -
-
-

OggVorbis

-

Otwarty format plików audio, oferujący nagranie w najwyższej jakości dźwiękowej.

-
-
- .ogg -
-
- {% endif %} - {% if book.has_daisy_file %} -
-
-

DAISY

-

Format dla osób z dysfunkcjami czytania.

-
-
- {% for dsy in book.media_daisy %} - DAISY - {% endfor %} -
-
- {% endif %} - {% if book.has_audio_epub_file %} -
-
-

EPUB + audiobook

-

Książka elektroniczna i audiobook w jednym. Wymaga aplikacji obsługującej format.

-
-
- {% for epub in book.media_audio_epub %} - EPUB+audio - {% endfor %} -
-
- {% endif %} -
- -
-
- {% endif %} -
- {% else %} -
- {% chunk 'book-preview-warn' %} -
- -
- {% include 'club/2022/donation_step1_form.html' with form=donation_form %} -
- {% endif %} - -
- {% content_warning book %} - {{ book.abstract|safe }} - - {% if book.toc %} -
-

Spis treści:

- {{ book.toc|safe }} -
- {% endif %} -
- -
- {% if accessible %} -
-
-

Ta książka jest dostępna dla tysięcy dzieciaków dzięki darowiznom od osób takich jak Ty!

- Dorzuć się! -
-
- -
-
- {% endif %} -
- {% endwith %} -
- - {% for tag in book.authors %} -
-
- {% include 'catalogue/2022/author_box.html' %} - - {% if forloop.first %} - {% choose_cites 3 book=book as cites %} - {% if cites %} -
-
-
- {% for fragment in cites %} - {% include "catalogue/2022/fragment_slider_box.html" %} - {% endfor %} -
-
-
- {% endif %} - {% endif %} -
-
- {% endfor %} - -
-
- {% with book.related_themes as themes %} - {% if themes %} -

Motywy występujące w tym utworze Wszystkie motywy

-
- -
- - - {% endif %} - {% endwith %} - -
-
-
- - - - - -
-
-
-

Czytaj także

-
- {% if book.other_versions %} - {% for rel in book.other_versions %} - - {% endfor %} - {% endif %} - - - {% related_books_2022 book taken=book.other_versions|length as related_books %} - {% for rel in related_books %} - - {% endfor %} - - - -
-
-
-
- - -{% endblock %} diff --git a/src/catalogue/templates/catalogue/2022/book_fragments.html b/src/catalogue/templates/catalogue/2022/book_fragments.html deleted file mode 100644 index d1d4f2435..000000000 --- a/src/catalogue/templates/catalogue/2022/book_fragments.html +++ /dev/null @@ -1,78 +0,0 @@ -{% extends '2022/base.html' %} -{% load pagination_tags %} - -{% block global-content %} -
- -
- -
- -
-
-

- Motyw: {{ theme.name }} - w utworze - {{ book }} -

-
-
- - - - {% autopaginate fragments 10 %} - -
-
-
-
- - {% for fragment in fragments %} - {% include 'catalogue/2022/fragment_box.html' %} - {% endfor %} - {% paginate using '2022/paginate.html' %} -
-
-
-
-

Motyw: {{ theme.name }}

- {{ theme.description|safe }} - -
-
-
-
-
- -{% endblock %} diff --git a/src/catalogue/templates/catalogue/2022/book_list.html b/src/catalogue/templates/catalogue/2022/book_list.html deleted file mode 100644 index 1652e7a67..000000000 --- a/src/catalogue/templates/catalogue/2022/book_list.html +++ /dev/null @@ -1,144 +0,0 @@ -{% extends '2022/base.html' %} -{% load catalogue_tags %} -{% load thumbnail %} -{% load pagination_tags %} - -{% load choose_cites from social_tags %} - - -{% block breadcrumbs %} - Katalog - {% if main_tag %} - {{ main_tag.get_category_display|title }} - {% endif %} -{% endblock %} - -{% block main %} -
-
- {% if main_tag.photo %} - {% thumbnail main_tag.photo '40x40' crop='top' as th %} -
- {{ main_tag.name }} -
- {% endthumbnail %} - {% endif %} -

- {% if main_tag %} - {{ main_tag.name }} - {% else %} - {{ view.title }} - {% endif %} -

-
-
- -
-
-
- - -
- {% for tag in tags %} - {% if tag is not main_tag %} - - {{ tag }} - ✖ - - {% endif %} - {% endfor %} -
- -
- {% if view.get_orderings %} -
- Sortuj: -
- {% for ordering in view.get_orderings %} - - {% endfor %} - -
-
- {% endif %} -
-
-
-
-
-

{% nice_title_from_tags tags suggested_tags_by_category %}

- {% if suggested_tags %} -
- {% for tag in suggested_tags %} - - {{ tag }} - - {% endfor %} -
- {% endif %} -
-
-
- - {% autopaginate object_list view.page_size %} - -
-
- {% for book in object_list %} - {% include "catalogue/2022/book_box.html" %} - {% endfor %} -
-
- -
- {% paginate using '2022/paginate.html' %} -
- - {% if main_tag %} -
-
- {% with tag=main_tag %} - {% include 'catalogue/2022/author_box.html' %} - {% endwith %} - {% choose_cites 3 author=main_tag as cites %} - {% if cites %} -
-
-
- - {% for fragment in cites %} -
- {% include "catalogue/2022/fragment_slider_box.html" %} -
- {% endfor %} - -
-
-
- {% endif %} -
-
- {% endif %} -{% endblock %} diff --git a/src/catalogue/templates/catalogue/2022/collection.html b/src/catalogue/templates/catalogue/2022/collection.html deleted file mode 100644 index 38c52d847..000000000 --- a/src/catalogue/templates/catalogue/2022/collection.html +++ /dev/null @@ -1,50 +0,0 @@ -{% extends '2022/base.html' %} - - -{% block breadcrumbs %} - Katalog - Kolekcje -{% endblock %} - - -{% block main %} - -
-
-

{{ collection.title }}

-
-
- -
-

- {{ collection.description|safe }} -

-
- -
-
-
- - -
-
- Sortuj: -
- - - -
-
-
-
- -
-
- {% for book in collection.get_books %} - {% include "catalogue/2022/book_box.html" %} - {% endfor %} -
-
- - -{% endblock %} diff --git a/src/catalogue/templates/catalogue/2022/collection_box.html b/src/catalogue/templates/catalogue/2022/collection_box.html deleted file mode 100644 index 495fe231e..000000000 --- a/src/catalogue/templates/catalogue/2022/collection_box.html +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/src/catalogue/templates/catalogue/2022/collections.html b/src/catalogue/templates/catalogue/2022/collections.html deleted file mode 100644 index bdf36d506..000000000 --- a/src/catalogue/templates/catalogue/2022/collections.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends '2022/base.html' %} - - -{% block breadcrumbs %} - Katalog -{% endblock %} - - -{% block main %} - -
-
-

Kolekcje

-
-
- - - -
- {% for collection in objects %} -
-
- -
- {% for book in collection.get_5_books %} - {% include 'catalogue/2022/book_box.html' %} - {% endfor %} -
-
-
- {% endfor %} -
- - -{% endblock %} diff --git a/src/catalogue/templates/catalogue/2022/dynamic_book_list.html b/src/catalogue/templates/catalogue/2022/dynamic_book_list.html deleted file mode 100644 index 0511be5da..000000000 --- a/src/catalogue/templates/catalogue/2022/dynamic_book_list.html +++ /dev/null @@ -1,14 +0,0 @@ -{% load pagination_tags %} -{% autopaginate object_list view.page_size %} - -
-
- {% for book in object_list %} - {% include "catalogue/2022/book_box.html" %} - {% endfor %} -
- -
- {% paginate using '2022/paginate.html' %} -
-
diff --git a/src/catalogue/templates/catalogue/2022/dynamic_themed_book_list.html b/src/catalogue/templates/catalogue/2022/dynamic_themed_book_list.html deleted file mode 100644 index 3346d8885..000000000 --- a/src/catalogue/templates/catalogue/2022/dynamic_themed_book_list.html +++ /dev/null @@ -1,14 +0,0 @@ -{% load pagination_tags %} -{% autopaginate object_list view.themed_page_size %} - -
-
- {% for fragment in object_list %} - {% include "catalogue/2022/fragment_box.html" %} - {% endfor %} -
- -
- {% paginate using '2022/paginate.html' %} -
-
diff --git a/src/catalogue/templates/catalogue/2022/fragment_box.html b/src/catalogue/templates/catalogue/2022/fragment_box.html deleted file mode 100644 index b6be44f13..000000000 --- a/src/catalogue/templates/catalogue/2022/fragment_box.html +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/src/catalogue/templates/catalogue/2022/fragment_slider_box.html b/src/catalogue/templates/catalogue/2022/fragment_slider_box.html deleted file mode 100644 index 2522ce66e..000000000 --- a/src/catalogue/templates/catalogue/2022/fragment_slider_box.html +++ /dev/null @@ -1,10 +0,0 @@ - - - {% if fragment.short_text %} - {{ fragment.short_text|safe }} - {% else %} - {{ fragment.text|safe }} - {% endif %} - -

{{ fragment.book.pretty_title }}

-
diff --git a/src/catalogue/templates/catalogue/2022/set_detail.html b/src/catalogue/templates/catalogue/2022/set_detail.html deleted file mode 100644 index e835a86c5..000000000 --- a/src/catalogue/templates/catalogue/2022/set_detail.html +++ /dev/null @@ -1,41 +0,0 @@ -{% extends '2022/base.html' %} - -{% load choose_cites from social_tags %} - - -{% block breadcrumbs %} - Półka -{% endblock %} - -{% block main %} -
-
-

{{ tags.0.name }}

-
-
- -
-
-
- - -
-
- Sortuj: -
- - - -
-
-
-
- -
-
- {% for book in object_list %} - {% include "catalogue/2022/book_box.html" %} - {% endfor %} -
-
-{% endblock %} diff --git a/src/catalogue/templates/catalogue/2022/tag_catalogue.html b/src/catalogue/templates/catalogue/2022/tag_catalogue.html deleted file mode 100644 index a44e5b20a..000000000 --- a/src/catalogue/templates/catalogue/2022/tag_catalogue.html +++ /dev/null @@ -1,44 +0,0 @@ -{% extends '2022/base.html' %} -{% load thumbnail %} - - -{% block settings %} -{% endblock %} - -{% block breadcrumbs %} - {{ whole_category }} -{% endblock %} - - -{% block main %} -
-
-

{{ whole_category }}

-
-
- - - - -
-
    - {% for tag in tags %} -
  • - {% if tag.photo %} - {% thumbnail tag.photo '40x40' crop='top' as thumb %} - - {% endthumbnail %} - {% endif %} - {{ tag }} ({{ tag.count }}) -
  • - {% endfor %} -
-
- - -{% endblock %} diff --git a/src/catalogue/templates/catalogue/2022/theme_detail.html b/src/catalogue/templates/catalogue/2022/theme_detail.html deleted file mode 100644 index df34d17de..000000000 --- a/src/catalogue/templates/catalogue/2022/theme_detail.html +++ /dev/null @@ -1,89 +0,0 @@ -{% extends '2022/base.html' %} -{% load catalogue_tags %} -{% load pagination_tags %} - -{% block global-content %} -
- -
- -
- -
-
-

Motyw: {{ main_tag.name }}

-
-
- - -
-
-
- - -
- {% for tag in tags %} - {% if tag is not main_tag %} - - {{ tag }} - ✖ - - {% endif %} - {% endfor %} -
- -
-
-
-
-
-

{% nice_title_from_tags tags categories %}

- {% if suggest %} -
- {% for tag in suggest %} - - {{ tag }} - - {% endfor %} -
- {% endif %} -
-
- - {% autopaginate object_list 10 %} - -
-
-
-
- - {% for fragment in object_list %} - {% include 'catalogue/2022/fragment_box.html' %} - {% endfor %} - {% paginate using '2022/paginate.html' %} -
-
-
-
-

Motyw: {{ main_tag.name }}

- {{ main_tag.description|safe }} - -
-
-
-
-
- -{% endblock %} diff --git a/src/catalogue/templates/catalogue/2022/themed_book_list.html b/src/catalogue/templates/catalogue/2022/themed_book_list.html deleted file mode 100644 index 7957106d7..000000000 --- a/src/catalogue/templates/catalogue/2022/themed_book_list.html +++ /dev/null @@ -1,90 +0,0 @@ -{% extends '2022/base.html' %} -{% load catalogue_tags %} -{% load pagination_tags %} - -{% block global-content %} -
- -
- -
- -
-
-

Motyw: {{ main_tag.name }}

-
-
- - -
-
-
- - -
- {% for tag in tags %} - {% if tag is not main_tag %} - - {{ tag }} - ✖ - - {% endif %} - {% endfor %} -
- -
-
-
-
-
-

{% nice_title_from_tags tags categories %}

- {% if suggested_tags %} -
- {% for tag in suggested_tags %} - - {{ tag }} - - {% endfor %} -
- {% endif %} -
-
- - {% autopaginate object_list view.themed_page_size %} - -
-
-
-
- {% for fragment in object_list %} - {% include 'catalogue/2022/fragment_box.html' %} - {% endfor %} -
-
-
-
-

Motyw: {{ main_tag.name }}

- {{ main_tag.description|safe }} - -
-
-
-
- {% paginate using '2022/paginate.html' %} -
-
-
- -{% endblock %} diff --git a/src/catalogue/templates/catalogue/author_box.html b/src/catalogue/templates/catalogue/author_box.html new file mode 100644 index 000000000..3b474bf79 --- /dev/null +++ b/src/catalogue/templates/catalogue/author_box.html @@ -0,0 +1,32 @@ +
+

+ {% if tag.category == 'author' %}O autorze + {% elif tag.category == 'kind' %}O rodzaju + {% elif tag.category == 'genre' %}O gatunku + {% elif tag.category == 'epoch' %}O epoce + {% elif tag.category == 'set' %}Półka + {% endif %} +

+
+ {% if tag.photo %} +
+ {{ tag.name }} +
+ {{ tag.photo_attribution|safe }} +
+
+ {% endif %} +
+ {% if tag.category == 'set' %} + {% load chunks %} + {% chunk 'polka-how-to' %} + {% else %} +

{{ tag.name }}

+
+ {{ tag.description|safe }} +
+ + {% endif %} +
+
+
diff --git a/src/catalogue/templates/catalogue/author_detail.html b/src/catalogue/templates/catalogue/author_detail.html new file mode 100644 index 000000000..ae2c49578 --- /dev/null +++ b/src/catalogue/templates/catalogue/author_detail.html @@ -0,0 +1,108 @@ +{% extends 'base.html' %} +{% load catalogue_tags %} + +{% load choose_cites from social_tags %} + + +{% block breadcrumbs %} + Katalog + {% if tags %} + {{ main_tag.get_category_display|title }} + {% endif %} +{% endblock %} + +{% block main %} +
+
+ {% if main_tag.photo %} +
+ {{ main_tag.name }} +
+ {% endif %} +

+ {% if main_tag %} + {{ main_tag.name }} + {% else %} + {{ title }} + {% endif %} +

+
+
+ +
+
+
+ + +
+ {% for tag in tags %} + {% if tag is not main_tag %} + + {{ tag }} + ✖ + + {% endif %} + {% endfor %} +
+ +
+
+ Sortuj: +
+ + + +
+
+
+
+
+ +
+

{% nice_title_from_tags tags categories %}

+ {% if suggest %} +
+ {% for tag in suggest %} + + {{ tag }} + + {% endfor %} +
+ {% endif %} +
+
+ +
+
+ {% for book in object_list %} + {% include "catalogue/book_box.html" %} + {% endfor %} +
+
+ + {% if tags %} +
+
+ {% with tag=main_tag %} + {% include 'catalogue/author_box.html' %} + {% endwith %} + {% choose_cites 3 author=main_tag as cites %} + {% if cites %} +
+
+
+ + {% for fragment in cites %} +
+ {% include "catalogue/fragment_slider_box.html" %} +
+ {% endfor %} + +
+
+
+ {% endif %} +
+
+ {% endif %} +{% endblock %} diff --git a/src/catalogue/templates/catalogue/book_box.html b/src/catalogue/templates/catalogue/book_box.html new file mode 100644 index 000000000..97c61d936 --- /dev/null +++ b/src/catalogue/templates/catalogue/book_box.html @@ -0,0 +1,55 @@ +{% load sorl_thumbnail %} + +
+
+ + {% if book.is_picture %} + {% if book.image_file %} + {% thumbnail book.image_file "170x240" crop="center" as im %} + + {% endthumbnail %} + {% endif %} + {% else %} + {% if book.cover_clean %} + {{ book.title }} + {% endif %} + {% endif %} + + +
+
+
+ {% csrf_token %} {# this needs to be copied in with JS #} + + + +
+
+ +
+
+ {% if book.is_book %} + + {% endif %} + {% if book.has_mp3_file %} + + {% endif %} + {% if book.is_picture %} + + {% endif %} + +
+

+ {% for author in book.authors %} + {{ author }}{% if not forloop.last %}, {% endif %} + {% endfor %} +

+

{{ book.title }}

+ + {% for kind in book.kinds %}{{ kind }} {% endfor %} + {% for genre in book.genres %}{{ genre }} {% endfor %} + {% for epoch in book.epochs %}{{ epoch }} {% endfor %} + +
diff --git a/src/catalogue/templates/catalogue/book_detail.html b/src/catalogue/templates/catalogue/book_detail.html new file mode 100644 index 000000000..713d65ac9 --- /dev/null +++ b/src/catalogue/templates/catalogue/book_detail.html @@ -0,0 +1,482 @@ +{% extends 'base.html' %} + +{% load chunks %} +{% load static %} +{% load choose_cites from social_tags %} +{% load catalogue_tags %} +{% load likes_book from social_tags %} + + +{% block global-content %} +
+ +
+ + +
+
+ {% with first_text=book.get_first_text %} + +
+ +
+ + + + + + {% if accessible %} +
+
+
+ {% if accessible and first_text %} + + {% endif %} + {{ book.pretty_title }} + {% if accessible and first_text %} + + {% endif %} +
+
+
+ {% if likes %} +
+ {% csrf_token %} + +
+ {% else %} +
+ {% csrf_token %} + +
+ {% endif %} +
+
+
+ {% if book.has_mp3_file %} + + {% endif %} +
+
+ +
+
+ {% if first_text %} + czytaj online + {% endif %} +
+
+
+
+ + + + {% if book.has_mp3_file %} + {% include 'catalogue/snippets/jplayer.html' %} + {% else %} + {% with ch=book.get_child_audiobook %} + {% if ch %} + {% include 'catalogue/snippets/jplayer_link.html' with book=ch %} + {% endif %} + {% endwith %} + + {% endif %} + + + + +
+
+
+

Pobieranie e-booka

+

Wybierz wersję dla siebie:

+
+
+ {% if book.pdf_file %} +
+
+

.pdf

+

Jeśli planujesz wydruk albo lekturę na urządzeniu mobilnym bez dodatkowych aplikacji.

+
+
+ .pdf +
+
+ {% endif %} + {% if book.epub_file %} +
+
+

.epub

+

Uniwersalny format e-booków, obsługiwany przez większość czytników sprzętowych i aplikacji na urządzenia mobilne.

+
+
+ .epub +
+
+ {% endif %} + {% if book.mobi_file %} +
+
+

.mobi

+

Natywny format dla czytnika Amazon Kindle.

+
+
+ .mobi +
+
+ {% endif %} + {% if book.synchro_file %} +
+
+

synchrobook (epub3)

+

Książka elektroniczna i audiobook w jednym. Wymaga aplikacji obsługującej format (np. ..., ..., ...).

+
+ +
+ {% endif %} + {% if book.txt_file or book.fb2_file %} +
+
+

inne formaty

+ +
+
+ {% endif %} +
+ +
+
+ {% if book.has_mp3_file %} +
+
+
+

Pobieranie audiobooka

+

Wybierz wersję dla siebie:

+
+
+
+
+

.mp3

+

Uniwersalny format, obsługiwany przez wszystkie urządzenia.

+
+
+ .mp3 +
+
+ {% if book.has_ogg_file %} +
+
+

OggVorbis

+

Otwarty format plików audio, oferujący nagranie w najwyższej jakości dźwiękowej.

+
+
+ .ogg +
+
+ {% endif %} + {% if book.has_daisy_file %} +
+
+

DAISY

+

Format dla osób z dysfunkcjami czytania.

+
+
+ {% for dsy in book.media_daisy %} + DAISY + {% endfor %} +
+
+ {% endif %} + {% if book.has_audio_epub_file %} +
+
+

EPUB + audiobook

+

Książka elektroniczna i audiobook w jednym. Wymaga aplikacji obsługującej format.

+
+
+ {% for epub in book.media_audio_epub %} + EPUB+audio + {% endfor %} +
+
+ {% endif %} +
+ +
+
+ {% endif %} +
+ {% else %} +
+ {% chunk 'book-preview-warn' %} +
+ +
+ {% include 'club/donation_step1_form.html' with form=donation_form %} +
+ {% endif %} + +
+ {% content_warning book %} + {{ book.abstract|safe }} + + {% if book.toc %} +
+

Spis treści:

+ {{ book.toc|safe }} +
+ {% endif %} +
+ +
+ {% if accessible %} +
+
+

Ta książka jest dostępna dla tysięcy dzieciaków dzięki darowiznom od osób takich jak Ty!

+ Dorzuć się! +
+
+ +
+
+ {% endif %} +
+ {% endwith %} +
+ + {% for tag in book.authors %} +
+
+ {% include 'catalogue/author_box.html' %} + + {% if forloop.first %} + {% choose_cites 3 book=book as cites %} + {% if cites %} +
+
+
+ {% for fragment in cites %} + {% include "catalogue/fragment_slider_box.html" %} + {% endfor %} +
+
+
+ {% endif %} + {% endif %} +
+
+ {% endfor %} + +
+
+ {% with book.related_themes as themes %} + {% if themes %} +

Motywy występujące w tym utworze Wszystkie motywy

+
+ +
+ + + {% endif %} + {% endwith %} + +
+
+
+ + + + + +
+
+
+

Czytaj także

+
+ {% if book.other_versions %} + {% for rel in book.other_versions %} + + {% endfor %} + {% endif %} + + + {% related_books_2022 book taken=book.other_versions|length as related_books %} + {% for rel in related_books %} + + {% endfor %} + + + +
+
+
+
+ + +{% endblock %} diff --git a/src/catalogue/templates/catalogue/book_fragments.html b/src/catalogue/templates/catalogue/book_fragments.html new file mode 100644 index 000000000..82cc83b1b --- /dev/null +++ b/src/catalogue/templates/catalogue/book_fragments.html @@ -0,0 +1,78 @@ +{% extends 'base.html' %} +{% load pagination_tags %} + +{% block global-content %} +
+ +
+ +
+ +
+
+

+ Motyw: {{ theme.name }} + w utworze + {{ book }} +

+
+
+ + + + {% autopaginate fragments 10 %} + +
+
+
+
+ + {% for fragment in fragments %} + {% include 'catalogue/fragment_box.html' %} + {% endfor %} + {% paginate %} +
+
+
+
+

Motyw: {{ theme.name }}

+ {{ theme.description|safe }} + +
+
+
+
+
+ +{% endblock %} diff --git a/src/catalogue/templates/catalogue/book_list.html b/src/catalogue/templates/catalogue/book_list.html new file mode 100644 index 000000000..1f0d2c573 --- /dev/null +++ b/src/catalogue/templates/catalogue/book_list.html @@ -0,0 +1,144 @@ +{% extends 'base.html' %} +{% load catalogue_tags %} +{% load thumbnail %} +{% load pagination_tags %} + +{% load choose_cites from social_tags %} + + +{% block breadcrumbs %} + Katalog + {% if main_tag %} + {{ main_tag.get_category_display|title }} + {% endif %} +{% endblock %} + +{% block main %} +
+
+ {% if main_tag.photo %} + {% thumbnail main_tag.photo '40x40' crop='top' as th %} +
+ {{ main_tag.name }} +
+ {% endthumbnail %} + {% endif %} +

+ {% if main_tag %} + {{ main_tag.name }} + {% else %} + {{ view.title }} + {% endif %} +

+
+
+ +
+
+
+ + +
+ {% for tag in tags %} + {% if tag is not main_tag %} + + {{ tag }} + ✖ + + {% endif %} + {% endfor %} +
+ +
+ {% if view.get_orderings %} +
+ Sortuj: +
+ {% for ordering in view.get_orderings %} + + {% endfor %} + +
+
+ {% endif %} +
+
+
+
+
+

{% nice_title_from_tags tags suggested_tags_by_category %}

+ {% if suggested_tags %} +
+ {% for tag in suggested_tags %} + + {{ tag }} + + {% endfor %} +
+ {% endif %} +
+
+
+ + {% autopaginate object_list view.page_size %} + +
+
+ {% for book in object_list %} + {% include "catalogue/book_box.html" %} + {% endfor %} +
+
+ +
+ {% paginate %} +
+ + {% if main_tag %} +
+
+ {% with tag=main_tag %} + {% include 'catalogue/author_box.html' %} + {% endwith %} + {% choose_cites 3 author=main_tag as cites %} + {% if cites %} +
+
+
+ + {% for fragment in cites %} +
+ {% include "catalogue/fragment_slider_box.html" %} +
+ {% endfor %} + +
+
+
+ {% endif %} +
+
+ {% endif %} +{% endblock %} diff --git a/src/catalogue/templates/catalogue/book_text.html b/src/catalogue/templates/catalogue/book_text.html index 758c8cb81..16cc728b2 100644 --- a/src/catalogue/templates/catalogue/book_text.html +++ b/src/catalogue/templates/catalogue/book_text.html @@ -115,7 +115,7 @@ {% block footer %} {% if book.has_sync_file %}
- {% include 'catalogue/snippets/2022_jplayer_reader.html' %} + {% include 'catalogue/snippets/jplayer_reader.html' %}
{% javascript "book_text" %} - {% javascript "2022_player" %} + {% javascript "player" %} {% block extrabody %}{% endblock %} diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 817b3ada5..a9cc7e00d 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -51,7 +51,7 @@ def daisy_list(request): def collection(request, slug): coll = get_object_or_404(Collection, slug=slug) - template_name = 'catalogue/2022/collection.html' + template_name = 'catalogue/collection.html' return render(request, template_name, { 'collection': coll, 'active_menu_item': 'collections', @@ -161,10 +161,10 @@ class ObjectListView(TemplateView): class BookList(ObjectListView): title = gettext_lazy('Literature') list_type = 'books' - template_name = 'catalogue/2022/book_list.html' - dynamic_template_name = 'catalogue/2022/dynamic_book_list.html' - themed_template_name = 'catalogue/2022/themed_book_list.html' - dynamic_themed_template_name = 'catalogue/2022/dynamic_themed_book_list.html' + template_name = 'catalogue/book_list.html' + dynamic_template_name = 'catalogue/dynamic_book_list.html' + themed_template_name = 'catalogue/themed_book_list.html' + dynamic_themed_template_name = 'catalogue/dynamic_themed_book_list.html' orderings = { 'pop': ('-popularity__count', 'najpopularniejsze'), @@ -196,8 +196,8 @@ class BookList(ObjectListView): class ArtList(ObjectListView): - template_name = 'catalogue/2022/book_list.html' - dynamic_template_name = 'catalogue/2022/dynamic_book_list.html' + template_name = 'catalogue/book_list.html' + dynamic_template_name = 'catalogue/dynamic_book_list.html' title = gettext_lazy('Art') list_type = 'gallery' @@ -382,9 +382,9 @@ def object_list(request, objects, fragments=None, related_tags=None, tags=None, has_theme = any(((theme := x).category == 'theme' for x in tags)) if has_theme: result['main_tag'] = theme - template = 'catalogue/2022/theme_detail.html' + template = 'catalogue/theme_detail.html' else: - template = 'catalogue/2022/author_detail.html' + template = 'catalogue/author_detail.html' return render( request, template, result, @@ -501,7 +501,7 @@ def book_fragments(request, slug, theme_slug): fragments = Fragment.tagged.with_all([theme]).filter( Q(book=book) | Q(book__ancestor=book)) - template_name = 'catalogue/2022/book_fragments.html' + template_name = 'catalogue/book_fragments.html' return render( request, template_name, @@ -522,7 +522,7 @@ def book_detail(request, slug): return render( request, - 'catalogue/2022/book_detail.html', + 'catalogue/book_detail.html', { 'book': book, 'accessible': book.is_accessible_to(request.user), @@ -661,7 +661,7 @@ def tag_catalogue(request, category): else: best = described_tags - template_name = 'catalogue/2022/tag_catalogue.html' + template_name = 'catalogue/tag_catalogue.html' return render(request, template_name, { 'tags': tags, 'best': best, @@ -679,7 +679,7 @@ def collections(request): else: best = objects - template_name = 'catalogue/2022/collections.html' + template_name = 'catalogue/collections.html' return render(request, template_name, { 'objects': objects, 'best': best, diff --git a/src/club/templates/club/2022/donation_step1.html b/src/club/templates/club/2022/donation_step1.html deleted file mode 100644 index a59abd6a3..000000000 --- a/src/club/templates/club/2022/donation_step1.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends 'club/2022/donation_step_base.html' %} -{% load club %} -{% load static %} - - -{% block donation-step-content %} - {% include "club/2022/donation_step1_form.html" %} -{% endblock %} diff --git a/src/club/templates/club/2022/donation_step1_form.html b/src/club/templates/club/2022/donation_step1_form.html deleted file mode 100644 index 6a45f2c3d..000000000 --- a/src/club/templates/club/2022/donation_step1_form.html +++ /dev/null @@ -1,144 +0,0 @@ -{% load static %} - -
- {% csrf_token %} - {{ form.errors }} - - -
- {% if user.is_staff %} - - {% endif %} - -
- - - -
-
- - {% with amounts=club.get_amounts %} -
- {% for amount in amounts.single %} -
- -

{{ amount.amount }} zł

-
- {% if amount.description %} -

{{ amount.description|safe }}

- {% endif %} - -
-
- {% endfor %} - - -
- - -
- {% for amount in amounts.monthly %} -
-

{{ amount.amount }} zł /mies.

-
- {% if amount.description %} -

{{ amount.description|safe }}

- {% endif %} - -
-
- {% endfor %} - -
- -
-
- - - {{ form.custom_amount }} -
- -
- {% endwith %} -
- -
- - Bezpieczne płatności zapewniają: - PayU Visa MasterCard - {% if club.paypal_enabled %} - PayPal - {% endif %} -
- -
-
-
-
-

Dane do przelewu tradycyjnego:

-
-
-
nazwa odbiorcy
-

Fundacja Wolne Lektury

- - -
-
-
adres odbiorcy
-

ul. Marszałkowska 84/92 lok. 125, 00-514 Warszawa

- - -
-
-
numer konta
-

75 1090 2851 0000 0001 4324 3317

- - -
-
-
tytuł przelewu
-

Darowizna na Wolne Lektury + twoja nazwa użytkownika lub e-mail

- - -
-
-
wpłaty w EUR
-

PL88 1090 2851 0000 0001 4324 3374

- - -
-
-
Wpłaty w USD
-

PL82 1090 2851 0000 0001 4324 3385

- - -
-
-
SWIFT
-

WBKPPLPP

- - -
-
-
-
-
-
diff --git a/src/club/templates/club/2022/donation_step2.html b/src/club/templates/club/2022/donation_step2.html deleted file mode 100644 index 4f43b84fb..000000000 --- a/src/club/templates/club/2022/donation_step2.html +++ /dev/null @@ -1,117 +0,0 @@ -{% extends 'club/2022/donation_step_base.html' %} - -{% load static %} - - -{% block donation-jumbo-image %}{% static '2022/images/checkout-img-2.jpg' %}{% endblock %} - - -{% block donation-step-content %} - -
-
-
-

- {{ schedule.amount|floatformat }} zł - {% if schedule.monthly %} - /mies. - {% endif %} -

- -

{{ schedule.get_description }}

-
-
-
- -
- {% csrf_token %} - {{ form.errors }} - {{ form.amount }} - {{ form.monthly }} -
-
-
- - {{ form.first_name }} - {{ form.first_name.errors }} -
-
- - {{ form.last_name }} - {{ form.last_name.errors }} -
-
-
-
- - {{ form.email }} - {{ form.email.errors }} -
-
- - {{ form.phone }} - {{ form.phone.errors }} -
-
-
-
- - {{ form.postal }} - {{ form.postal.errors }} -
-
-
-
- - {{ form.postal_code }} - {{ form.postal_code.errors }} -
-
- - {{ form.postal_town }} - {{ form.postal_town.errors }} -
-
-
-
- - {{ form.postal_country }} - {{ form.postal_country.errors }} -
-
-
- {% for consent, key, field in form.consent %} - {{ field.errors }} -
- {{ field }} - -
- {% endfor %} -
- {{ form.agree_newsletter }} - -
-
-
- Powrót -
- -
-
-
-
-
-
-
- - Bezpieczne płatności zapewniają: - PayU Visa MasterCard - {% if club.paypal_enabled %} - PayPal - {% endif %} -
-{% endblock %} diff --git a/src/club/templates/club/2022/donation_step3.html b/src/club/templates/club/2022/donation_step3.html deleted file mode 100644 index 7acb6170b..000000000 --- a/src/club/templates/club/2022/donation_step3.html +++ /dev/null @@ -1,107 +0,0 @@ -{% extends 'club/2022/donation_step_base.html' %} - -{% load static %} -{% load club %} - - -{% block donation-jumbo-image %}{% static '2022/images/checkout-img-4.jpg' %}{% endblock %} - - -{% block donation-step-content %} -
-
-
-

- {{ schedule.amount|floatformat }} zł - {% if schedule.monthly %} - /mies. - {% endif %}

- -
-
-
-
-
- -
- {% for method in schedule.get_payment_methods %} - {% invite_payment method schedule %} - {% endfor %} -
-
-
-

Możesz też ustawić stały przelew na konto:

-
-
-
nazwa odbiorcy
-

Fundacja Wolne Lektury

- - -
-
-
adres odbiorcy
-

ul. Marszałkowska 84/92 lok. 125, 00-514 Warszawa

- - -
-
-
numer konta
-

75 1090 2851 0000 0001 4324 3317

- - -
-
-
tytuł przelewu
-

Darowizna na Wolne Lektury + twoja nazwa użytkownika lub e-mail

- - -
-
-
wpłaty w EUR
-

PL88 1090 2851 0000 0001 4324 3374

- - -
-
-
Wpłaty w USD
-

PL82 1090 2851 0000 0001 4324 3385

- - -
-
-
SWIFT
-

WBKPPLPP

- - -
-
-
-
- Powrót -
-
-
-
-
- - Bezpieczne płatności zapewniają: - PayU Visa MasterCard - {% if club.paypal_enabled %} - PayPal - {% endif %} -
-{% endblock %} diff --git a/src/club/templates/club/2022/donation_step4.html b/src/club/templates/club/2022/donation_step4.html deleted file mode 100644 index fd14ca7ee..000000000 --- a/src/club/templates/club/2022/donation_step4.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends 'club/2022/donation_step_base.html' %} - - -{% block donation-step-content %} -
-
-

Dziękujemy za wpłatę!

-

- Zajrzyj teraz do e-maila. Tam znajdziesz link, - który powiąże płatność z Twoim kontem użytkownika Wolnych Lektur. -

- Wracam do lektur -
-
-{% endblock %} diff --git a/src/club/templates/club/2022/donation_step_base.html b/src/club/templates/club/2022/donation_step_base.html deleted file mode 100644 index fa41f5f03..000000000 --- a/src/club/templates/club/2022/donation_step_base.html +++ /dev/null @@ -1,126 +0,0 @@ -{% extends '2022/base.html' %} -{% load chunks %} -{% load club %} -{% load static %} - - -{% block global-content %} -
- -
- - -
-
-
- -
- -
- -
-
- Wspieraj Wolne Lektury -
-

Wspieraj Wolne Lektury

-

Dziękujemy, że chcesz razem z nami uwalniać książki!

-

Wspieraj Wolne Lektury stałą wpłatą – nawet niewielka ma wielką moc! Możesz też wesprzeć Wolne Lektury jednorazowo.

-
-
-
- - {% if view.step > 1 and view.step != 4 %} - - {% endif %} -
- 1 -

Rodzaj wsparcia

-
- {% if view.step > 1 and view.step != 4 %} -
- {% endif %} - - {% if view.step != 2 and schedule and view.step != 4 %} - - {% endif %} -
- 2 -

Dane

-
- {% if view.step != 2 and schedule and view.step != 4 %} -
- {% endif %} - - {% if view.step != 3 and schedule.email and view.step != 4 %} - - {% endif %} -
- 3 -

Forma płatności

-
- {% if view.step != 3 and schedule.email and view.step != 4 %} -
- {% endif %} - -
- 4 -

Gotowe

-
-
- - - {% block donation-step-content %}{% endblock %} - -
- - -
- - - -{% endblock %} diff --git a/src/club/templates/club/donation_step1.html b/src/club/templates/club/donation_step1.html new file mode 100644 index 000000000..1a5b65d1e --- /dev/null +++ b/src/club/templates/club/donation_step1.html @@ -0,0 +1,8 @@ +{% extends 'club/donation_step_base.html' %} +{% load club %} +{% load static %} + + +{% block donation-step-content %} + {% include "club/donation_step1_form.html" %} +{% endblock %} diff --git a/src/club/templates/club/donation_step1_form.html b/src/club/templates/club/donation_step1_form.html new file mode 100644 index 000000000..6a45f2c3d --- /dev/null +++ b/src/club/templates/club/donation_step1_form.html @@ -0,0 +1,144 @@ +{% load static %} + +
+ {% csrf_token %} + {{ form.errors }} + + +
+ {% if user.is_staff %} + + {% endif %} + +
+ + + +
+
+ + {% with amounts=club.get_amounts %} +
+ {% for amount in amounts.single %} +
+ +

{{ amount.amount }} zł

+
+ {% if amount.description %} +

{{ amount.description|safe }}

+ {% endif %} + +
+
+ {% endfor %} + + +
+ + +
+ {% for amount in amounts.monthly %} +
+

{{ amount.amount }} zł /mies.

+
+ {% if amount.description %} +

{{ amount.description|safe }}

+ {% endif %} + +
+
+ {% endfor %} + +
+ +
+
+ + + {{ form.custom_amount }} +
+ +
+ {% endwith %} +
+ +
+ + Bezpieczne płatności zapewniają: + PayU Visa MasterCard + {% if club.paypal_enabled %} + PayPal + {% endif %} +
+ +
+
+
+
+

Dane do przelewu tradycyjnego:

+
+
+
nazwa odbiorcy
+

Fundacja Wolne Lektury

+ + +
+
+
adres odbiorcy
+

ul. Marszałkowska 84/92 lok. 125, 00-514 Warszawa

+ + +
+
+
numer konta
+

75 1090 2851 0000 0001 4324 3317

+ + +
+
+
tytuł przelewu
+

Darowizna na Wolne Lektury + twoja nazwa użytkownika lub e-mail

+ + +
+
+
wpłaty w EUR
+

PL88 1090 2851 0000 0001 4324 3374

+ + +
+
+
Wpłaty w USD
+

PL82 1090 2851 0000 0001 4324 3385

+ + +
+
+
SWIFT
+

WBKPPLPP

+ + +
+
+
+
+
+
diff --git a/src/club/templates/club/donation_step2.html b/src/club/templates/club/donation_step2.html new file mode 100644 index 000000000..8f3ce676a --- /dev/null +++ b/src/club/templates/club/donation_step2.html @@ -0,0 +1,117 @@ +{% extends 'club/donation_step_base.html' %} + +{% load static %} + + +{% block donation-jumbo-image %}{% static '2022/images/checkout-img-2.jpg' %}{% endblock %} + + +{% block donation-step-content %} + +
+
+
+

+ {{ schedule.amount|floatformat }} zł + {% if schedule.monthly %} + /mies. + {% endif %} +

+ +

{{ schedule.get_description }}

+
+
+
+ +
+ {% csrf_token %} + {{ form.errors }} + {{ form.amount }} + {{ form.monthly }} +
+
+
+ + {{ form.first_name }} + {{ form.first_name.errors }} +
+
+ + {{ form.last_name }} + {{ form.last_name.errors }} +
+
+
+
+ + {{ form.email }} + {{ form.email.errors }} +
+
+ + {{ form.phone }} + {{ form.phone.errors }} +
+
+
+
+ + {{ form.postal }} + {{ form.postal.errors }} +
+
+
+
+ + {{ form.postal_code }} + {{ form.postal_code.errors }} +
+
+ + {{ form.postal_town }} + {{ form.postal_town.errors }} +
+
+
+
+ + {{ form.postal_country }} + {{ form.postal_country.errors }} +
+
+
+ {% for consent, key, field in form.consent %} + {{ field.errors }} +
+ {{ field }} + +
+ {% endfor %} +
+ {{ form.agree_newsletter }} + +
+
+
+ Powrót +
+ +
+
+
+
+
+
+
+ + Bezpieczne płatności zapewniają: + PayU Visa MasterCard + {% if club.paypal_enabled %} + PayPal + {% endif %} +
+{% endblock %} diff --git a/src/club/templates/club/donation_step3.html b/src/club/templates/club/donation_step3.html new file mode 100644 index 000000000..dd64ce769 --- /dev/null +++ b/src/club/templates/club/donation_step3.html @@ -0,0 +1,107 @@ +{% extends 'club/donation_step_base.html' %} + +{% load static %} +{% load club %} + + +{% block donation-jumbo-image %}{% static '2022/images/checkout-img-4.jpg' %}{% endblock %} + + +{% block donation-step-content %} +
+
+
+

+ {{ schedule.amount|floatformat }} zł + {% if schedule.monthly %} + /mies. + {% endif %}

+ +
+
+
+
+
+ +
+ {% for method in schedule.get_payment_methods %} + {% invite_payment method schedule %} + {% endfor %} +
+
+
+

Możesz też ustawić stały przelew na konto:

+
+
+
nazwa odbiorcy
+

Fundacja Wolne Lektury

+ + +
+
+
adres odbiorcy
+

ul. Marszałkowska 84/92 lok. 125, 00-514 Warszawa

+ + +
+
+
numer konta
+

75 1090 2851 0000 0001 4324 3317

+ + +
+
+
tytuł przelewu
+

Darowizna na Wolne Lektury + twoja nazwa użytkownika lub e-mail

+ + +
+
+
wpłaty w EUR
+

PL88 1090 2851 0000 0001 4324 3374

+ + +
+
+
Wpłaty w USD
+

PL82 1090 2851 0000 0001 4324 3385

+ + +
+
+
SWIFT
+

WBKPPLPP

+ + +
+
+
+
+ Powrót +
+
+
+
+
+ + Bezpieczne płatności zapewniają: + PayU Visa MasterCard + {% if club.paypal_enabled %} + PayPal + {% endif %} +
+{% endblock %} diff --git a/src/club/templates/club/donation_step4.html b/src/club/templates/club/donation_step4.html new file mode 100644 index 000000000..28e11cb83 --- /dev/null +++ b/src/club/templates/club/donation_step4.html @@ -0,0 +1,15 @@ +{% extends 'club/donation_step_base.html' %} + + +{% block donation-step-content %} +
+
+

Dziękujemy za wpłatę!

+

+ Zajrzyj teraz do e-maila. Tam znajdziesz link, + który powiąże płatność z Twoim kontem użytkownika Wolnych Lektur. +

+ Wracam do lektur +
+
+{% endblock %} diff --git a/src/club/templates/club/donation_step_base.html b/src/club/templates/club/donation_step_base.html new file mode 100644 index 000000000..62666b1d2 --- /dev/null +++ b/src/club/templates/club/donation_step_base.html @@ -0,0 +1,126 @@ +{% extends 'base.html' %} +{% load chunks %} +{% load club %} +{% load static %} + + +{% block global-content %} +
+ +
+ + +
+
+
+ +
+ +
+ +
+
+ Wspieraj Wolne Lektury +
+

Wspieraj Wolne Lektury

+

Dziękujemy, że chcesz razem z nami uwalniać książki!

+

Wspieraj Wolne Lektury stałą wpłatą – nawet niewielka ma wielką moc! Możesz też wesprzeć Wolne Lektury jednorazowo.

+
+
+
+ + {% if view.step > 1 and view.step != 4 %} + + {% endif %} +
+ 1 +

Rodzaj wsparcia

+
+ {% if view.step > 1 and view.step != 4 %} +
+ {% endif %} + + {% if view.step != 2 and schedule and view.step != 4 %} + + {% endif %} +
+ 2 +

Dane

+
+ {% if view.step != 2 and schedule and view.step != 4 %} +
+ {% endif %} + + {% if view.step != 3 and schedule.email and view.step != 4 %} + + {% endif %} +
+ 3 +

Forma płatności

+
+ {% if view.step != 3 and schedule.email and view.step != 4 %} +
+ {% endif %} + +
+ 4 +

Gotowe

+
+
+ + + {% block donation-step-content %}{% endblock %} + +
+ + +
+ + + +{% endblock %} diff --git a/src/club/templates/club/index.html b/src/club/templates/club/index.html index 7c6a2075f..e07cdb47d 100644 --- a/src/club/templates/club/index.html +++ b/src/club/templates/club/index.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% load active_schedule from club %} {% load chunks %} diff --git a/src/club/templates/club/schedule.html b/src/club/templates/club/schedule.html index c86f11160..754759831 100644 --- a/src/club/templates/club/schedule.html +++ b/src/club/templates/club/schedule.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} diff --git a/src/club/templates/club/year_summary.html b/src/club/templates/club/year_summary.html index 434532179..3fbda0327 100644 --- a/src/club/templates/club/year_summary.html +++ b/src/club/templates/club/year_summary.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load chunks i18n %} diff --git a/src/club/templates/payu/rec_payment.html b/src/club/templates/payu/rec_payment.html index 3b7b18459..e5d391f37 100644 --- a/src/club/templates/payu/rec_payment.html +++ b/src/club/templates/payu/rec_payment.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} diff --git a/src/club/views.py b/src/club/views.py index 85faa85ad..068c5c659 100644 --- a/src/club/views.py +++ b/src/club/views.py @@ -34,7 +34,7 @@ class DonationStep1(UpdateView): queryset = models.Schedule.objects.filter(payed_at=None) form_class = forms.DonationStep1Form slug_field = slug_url_kwarg = 'key' - template_name = 'club/2022/donation_step1.html' + template_name = 'club/donation_step1.html' step = 1 def get_context_data(self, **kwargs): @@ -50,7 +50,7 @@ class DonationStep2(UpdateView): queryset = models.Schedule.objects.filter(payed_at=None) form_class = forms.DonationStep2Form slug_field = slug_url_kwarg = 'key' - template_name = 'club/2022/donation_step2.html' + template_name = 'club/donation_step2.html' step = 2 def get_context_data(self, **kwargs): @@ -61,7 +61,7 @@ class DonationStep2(UpdateView): class JoinView(CreateView): form_class = forms.DonationStep1Form - template_name = 'club/2022/donation_step1.html' + template_name = 'club/donation_step1.html' @property def club(self): @@ -122,7 +122,7 @@ class ScheduleView(DetailView): def get_template_names(self): if not self.object.payed_at: - return 'club/2022/donation_step3.html' + return 'club/donation_step3.html' return 'club/schedule.html' def get_context_data(self, *args, **kwargs): @@ -185,7 +185,7 @@ class PayUNotifyView(payu_views.NotifyView): class ScheduleThanksView(DetailView): model = models.Schedule - template_name = 'club/2022/donation_step4.html' + template_name = 'club/donation_step4.html' slug_field = slug_url_kwarg = 'key' step = 4 diff --git a/src/dictionary/templates/dictionary/note_list.html b/src/dictionary/templates/dictionary/note_list.html index 84c111e20..54758b04b 100644 --- a/src/dictionary/templates/dictionary/note_list.html +++ b/src/dictionary/templates/dictionary/note_list.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n pagination_tags %} {% load set_get from set_get %} diff --git a/src/education/templates/education/course_detail.html b/src/education/templates/education/course_detail.html index f5a9398dd..2723438e7 100644 --- a/src/education/templates/education/course_detail.html +++ b/src/education/templates/education/course_detail.html @@ -1,4 +1,4 @@ -{% extends '2022/base.html' %} +{% extends 'base.html' %} {% block main %} diff --git a/src/experiments/templates/experiments/main_switch.html b/src/experiments/templates/experiments/main_switch.html index 762d13b9b..cb4769005 100644 --- a/src/experiments/templates/experiments/main_switch.html +++ b/src/experiments/templates/experiments/main_switch.html @@ -1,4 +1,4 @@ -{% extends "2022/base.html" %} +{% extends "base.html" %} {% load static i18n %} {% block breadcrumbs %} diff --git a/src/funding/admin.py b/src/funding/admin.py index 6f29fbc83..f87a321b6 100644 --- a/src/funding/admin.py +++ b/src/funding/admin.py @@ -62,7 +62,6 @@ class FundingAdmin(admin.ModelAdmin): list_display = ['created_at', 'completed_at', 'offer', 'amount', 'name', 'email', 'perk_names'] search_fields = ['name', 'email', 'offer__title', 'offer__author'] list_filter = [PayedFilter, 'offer', PerksFilter] - search_fields = ['user'] actions = [export_as_csv_action( fields=[ 'id', 'offer', 'name', 'email', 'amount', 'completed_at', diff --git a/src/funding/models.py b/src/funding/models.py index 089b875b1..3280d6433 100644 --- a/src/funding/models.py +++ b/src/funding/models.py @@ -70,10 +70,7 @@ class Offer(models.Model): def clear_cache(self): clear_cached_renders(self.top_bar) - clear_cached_renders(self.top_bar_2022) - clear_cached_renders(self.list_bar) clear_cached_renders(self.detail_bar) - clear_cached_renders(self.detail_bar_2022) clear_cached_renders(self.status) clear_cached_renders(self.status_more) @@ -211,33 +208,6 @@ class Offer(models.Model): 'show_title_calling': True, } - @cached_render('funding/includes/funding.html') - def top_bar(self): - ctx = self.basic_info() - ctx.update({ - 'link': True, - 'closeable': True, - 'add_class': 'funding-top-header', - }) - return ctx - - @cached_render('funding/includes/funding.html') - def list_bar(self): - ctx = self.basic_info() - ctx.update({ - 'link': True, - 'show_title_calling': False, - }) - return ctx - - @cached_render('funding/includes/funding.html') - def detail_bar(self): - ctx = self.basic_info() - ctx.update({ - 'show_title': False, - }) - return ctx - @cached_render('funding/includes/offer_status.html') def status(self): return {'offer': self} @@ -246,8 +216,8 @@ class Offer(models.Model): def status_more(self): return {'offer': self} - @cached_render('funding/2022/includes/funding.html') - def top_bar_2022(self): + @cached_render('funding/includes/funding.html') + def top_bar(self): ctx = self.basic_info() ctx.update({ 'link': True, @@ -256,8 +226,8 @@ class Offer(models.Model): }) return ctx - @cached_render('funding/2022/includes/funding.html') - def detail_bar_2022(self): + @cached_render('funding/includes/funding.html') + def detail_bar(self): ctx = self.basic_info() ctx.update({ 'show_title': False, diff --git a/src/funding/templates/funding/2022/includes/funding.html b/src/funding/templates/funding/2022/includes/funding.html deleted file mode 100644 index b2dc55890..000000000 --- a/src/funding/templates/funding/2022/includes/funding.html +++ /dev/null @@ -1,42 +0,0 @@ -{% load i18n %} -{% load time_tags %} - -{% if offer %} - - - - -{% endif %} diff --git a/src/funding/templates/funding/2022/includes/funding_box.html b/src/funding/templates/funding/2022/includes/funding_box.html deleted file mode 100644 index c04234dfc..000000000 --- a/src/funding/templates/funding/2022/includes/funding_box.html +++ /dev/null @@ -1,23 +0,0 @@ -{% load i18n %} -{% load sorl_thumbnail %} - - diff --git a/src/funding/templates/funding/2022/offer_detail.html b/src/funding/templates/funding/2022/offer_detail.html deleted file mode 100644 index 920f84440..000000000 --- a/src/funding/templates/funding/2022/offer_detail.html +++ /dev/null @@ -1,108 +0,0 @@ -{% extends '2022/base.html' %} -{% load i18n %} -{% load chunks %} -{% load thumbnail %} -{% load fundings from funding_tags %} - - -{% block settings %} - {% load title %} - {% title object %} -{% endblock %} - - -{% block breadcrumbs %} - Zbiórki - {{ object }} -{% endblock %} - - -{% block main %} - {{ object.detail_bar_2022 }} - -
-

{{ object }}

- -
-
-
- {% if object.cover %} - {% thumbnail object.cover '320x1000' as th %} - - {% endthumbnail %} - {% endif %} -
-
-
-

{% trans "Help free the book!" %}

-
- {{ object.description|safe }} -
- {% if object.is_current %} -
- {{ form.as_p }} - - {{ form.data_processing }} - - -
- {% else %} - {{ object.status }} - {{ object.status_more }} - {% endif %} -
-
- -
- - - - -
-

{% trans "Supporters" %}

- {% fundings object %} -
- - {# 1% #} - {# share? #} - -{% endblock %} diff --git a/src/funding/templates/funding/2022/offer_list.html b/src/funding/templates/funding/2022/offer_list.html deleted file mode 100644 index 449cfea7b..000000000 --- a/src/funding/templates/funding/2022/offer_list.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends '2022/base.html' %} - - -{% block settings %} - {% load title %} - {% title 'Zbiórki' %} -{% endblock %} - - -{% block main %} -
-
-
- - -
-
-
- - -
-
- {% for funding in object_list %} - {% include "funding/2022/includes/funding_box.html" %} - {% endfor %} -
-
- -{% endblock %} diff --git a/src/funding/templates/funding/disable_notifications.html b/src/funding/templates/funding/disable_notifications.html index ce2b33097..1ed6a9b04 100644 --- a/src/funding/templates/funding/disable_notifications.html +++ b/src/funding/templates/funding/disable_notifications.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% load fnp_share %} diff --git a/src/funding/templates/funding/includes/funding.html b/src/funding/templates/funding/includes/funding.html index 3d24b7df2..b2dc55890 100644 --- a/src/funding/templates/funding/includes/funding.html +++ b/src/funding/templates/funding/includes/funding.html @@ -1,69 +1,42 @@ -{% spaceless %} - {% load i18n %} - {% load time_tags %} +{% load i18n %} +{% load time_tags %} - {% if offer %} -
- {% if closeable %}X{% endif %} - {% if link and is_current %} - +{% if offer %} + + +
+ {% if link %} + + Wesprzyj! +
+ {% endif %} +
+ +
+
- {% if closeable %} -
{% trans "Help free the book!" %}
- + {% if link %} +
+ {% endif %} - {% endif %} -{% endspaceless %} +
+ +{% endif %} diff --git a/src/funding/templates/funding/includes/funding_box.html b/src/funding/templates/funding/includes/funding_box.html new file mode 100644 index 000000000..c04234dfc --- /dev/null +++ b/src/funding/templates/funding/includes/funding_box.html @@ -0,0 +1,23 @@ +{% load i18n %} +{% load sorl_thumbnail %} + + diff --git a/src/funding/templates/funding/no_thanks.html b/src/funding/templates/funding/no_thanks.html index a8f2af179..c09be855b 100644 --- a/src/funding/templates/funding/no_thanks.html +++ b/src/funding/templates/funding/no_thanks.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% load fnp_share %} diff --git a/src/funding/templates/funding/offer_detail.html b/src/funding/templates/funding/offer_detail.html new file mode 100644 index 000000000..268817ff9 --- /dev/null +++ b/src/funding/templates/funding/offer_detail.html @@ -0,0 +1,108 @@ +{% extends 'base.html' %} +{% load i18n %} +{% load chunks %} +{% load thumbnail %} +{% load fundings from funding_tags %} + + +{% block settings %} + {% load title %} + {% title object %} +{% endblock %} + + +{% block breadcrumbs %} + Zbiórki + {{ object }} +{% endblock %} + + +{% block main %} + {{ object.detail_bar }} + +
+

{{ object }}

+ +
+
+
+ {% if object.cover %} + {% thumbnail object.cover '320x1000' as th %} + + {% endthumbnail %} + {% endif %} +
+
+
+

{% trans "Help free the book!" %}

+
+ {{ object.description|safe }} +
+ {% if object.is_current %} +
+ {{ form.as_p }} + + {{ form.data_processing }} + + +
+ {% else %} + {{ object.status }} + {{ object.status_more }} + {% endif %} +
+
+ +
+ + + + +
+

{% trans "Supporters" %}

+ {% fundings object %} +
+ + {# 1% #} + {# share? #} + +{% endblock %} diff --git a/src/funding/templates/funding/offer_list.html b/src/funding/templates/funding/offer_list.html new file mode 100644 index 000000000..3076b681f --- /dev/null +++ b/src/funding/templates/funding/offer_list.html @@ -0,0 +1,29 @@ +{% extends 'base.html' %} + + +{% block settings %} + {% load title %} + {% title 'Zbiórki' %} +{% endblock %} + + +{% block main %} +
+
+
+ + +
+
+
+ + +
+
+ {% for funding in object_list %} + {% include "funding/includes/funding_box.html" %} + {% endfor %} +
+
+ +{% endblock %} diff --git a/src/funding/templates/funding/thanks.html b/src/funding/templates/funding/thanks.html index 3d018b228..24333fb6f 100644 --- a/src/funding/templates/funding/thanks.html +++ b/src/funding/templates/funding/thanks.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% load fnp_share %} {% load polls_tags %} diff --git a/src/funding/templates/funding/wlfund.html b/src/funding/templates/funding/wlfund.html index 9b4e82e70..0054956db 100644 --- a/src/funding/templates/funding/wlfund.html +++ b/src/funding/templates/funding/wlfund.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% block titleextra %}{% trans "Remaining funds" %}{% endblock %} diff --git a/src/funding/templatetags/funding_tags.py b/src/funding/templatetags/funding_tags.py index 3e4889200..bfd0e5462 100644 --- a/src/funding/templatetags/funding_tags.py +++ b/src/funding/templatetags/funding_tags.py @@ -16,11 +16,6 @@ def funding_top_bar(): offer = Offer.current() return offer.top_bar() if offer is not None else '' -@register.simple_tag -def funding_top_bar_2022(): - offer = Offer.current() - return offer.top_bar_2022() if offer is not None else '' - @register.simple_tag(takes_context=True) def fundings(context, offer): diff --git a/src/funding/views.py b/src/funding/views.py index 35770aedc..315c3da49 100644 --- a/src/funding/views.py +++ b/src/funding/views.py @@ -71,7 +71,7 @@ class WLFundView(TemplateView): class OfferDetailView(FormView): form_class = FundingForm - template_name = 'funding/2022/offer_detail.html' + template_name = 'funding/offer_detail.html' @csrf_exempt def dispatch(self, request, slug=None): @@ -121,7 +121,7 @@ class CurrentView(OfferDetailView): class OfferListView(ListView): queryset = Offer.public() - template_name = 'funding/2022/offer_list.html' + template_name = 'funding/offer_list.html' def get_context_data(self, **kwargs): ctx = super(OfferListView, self).get_context_data(**kwargs) diff --git a/src/infopages/admin.py b/src/infopages/admin.py index d2f5fb071..d9f07487c 100644 --- a/src/infopages/admin.py +++ b/src/infopages/admin.py @@ -8,6 +8,6 @@ from infopages.models import InfoPage class InfoPageAdmin(TranslationAdmin): - list_display = ('title', 'slug', 'main_page') + list_display = ('title', 'slug') admin.site.register(InfoPage, InfoPageAdmin) diff --git a/src/infopages/migrations/0003_alter_infopage_options_remove_infopage_main_page.py b/src/infopages/migrations/0003_alter_infopage_options_remove_infopage_main_page.py new file mode 100644 index 000000000..3f0aac19c --- /dev/null +++ b/src/infopages/migrations/0003_alter_infopage_options_remove_infopage_main_page.py @@ -0,0 +1,21 @@ +# Generated by Django 4.0.8 on 2023-08-25 08:51 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('infopages', '0002_auto_20151221_1225'), + ] + + operations = [ + migrations.AlterModelOptions( + name='infopage', + options={'verbose_name': 'info page', 'verbose_name_plural': 'info pages'}, + ), + migrations.RemoveField( + model_name='infopage', + name='main_page', + ), + ] diff --git a/src/infopages/models.py b/src/infopages/models.py index e6e4eb7cd..c8720ae2d 100644 --- a/src/infopages/models.py +++ b/src/infopages/models.py @@ -9,14 +9,12 @@ from django.utils.translation import gettext_lazy as _ class InfoPage(models.Model): """An InfoPage is used to display a two-column flatpage.""" - main_page = models.IntegerField(_('main page priority'), null=True, blank=True) slug = models.SlugField(_('slug'), max_length=120, unique=True, db_index=True) title = models.CharField(_('title'), max_length=120, blank=True) left_column = models.TextField(_('left column'), blank=True) right_column = models.TextField(_('right column'), blank=True) class Meta: - ordering = ('main_page', 'slug',) verbose_name = _('info page') verbose_name_plural = _('info pages') diff --git a/src/infopages/templates/infopages/2022/infopage.html b/src/infopages/templates/infopages/2022/infopage.html deleted file mode 100644 index 465ad88cc..000000000 --- a/src/infopages/templates/infopages/2022/infopage.html +++ /dev/null @@ -1,23 +0,0 @@ -{% extends '2022/base.html' %} - -{% block settings %} - {% load title %} - {% title page.title %} -{% endblock %} - - -{% block main %} -
-

{{ page.title }}

-
-
-
-
- {{ left_column }} -
-
- {{ right_column }} -
-
-
-{% endblock %} diff --git a/src/infopages/templates/infopages/infopage.html b/src/infopages/templates/infopages/infopage.html new file mode 100644 index 000000000..5c6da3510 --- /dev/null +++ b/src/infopages/templates/infopages/infopage.html @@ -0,0 +1,23 @@ +{% extends 'base.html' %} + +{% block settings %} + {% load title %} + {% title page.title %} +{% endblock %} + + +{% block main %} +
+

{{ page.title }}

+
+
+
+
+ {{ left_column }} +
+
+ {{ right_column }} +
+
+
+{% endblock %} diff --git a/src/infopages/templates/infopages/on_main.html b/src/infopages/templates/infopages/on_main.html deleted file mode 100644 index 8ebbea05b..000000000 --- a/src/infopages/templates/infopages/on_main.html +++ /dev/null @@ -1,3 +0,0 @@ -{% for page in objects %} -
  • {{ page.title }}
  • -{% endfor %} diff --git a/src/infopages/templatetags/__init__.py b/src/infopages/templatetags/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/infopages/templatetags/infopages_tags.py b/src/infopages/templatetags/infopages_tags.py deleted file mode 100644 index 3c3cfdff6..000000000 --- a/src/infopages/templatetags/infopages_tags.py +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from django import template -from infopages.models import InfoPage - -register = template.Library() - - -@register.inclusion_tag('infopages/on_main.html') -def infopages_on_main(): - objects = InfoPage.objects.exclude(main_page=None) - return {"objects": objects} diff --git a/src/infopages/views.py b/src/infopages/views.py index 986d6a56e..5bc7b4b3e 100644 --- a/src/infopages/views.py +++ b/src/infopages/views.py @@ -23,7 +23,7 @@ def infopage(request, slug): return render( request, - 'infopages/2022/infopage.html', + 'infopages/infopage.html', { 'page': page, 'left_column': left_column, diff --git a/src/isbn/templates/isbn/add_isbn.html b/src/isbn/templates/isbn/add_isbn.html index 242badbd5..fc4f2a059 100644 --- a/src/isbn/templates/isbn/add_isbn.html +++ b/src/isbn/templates/isbn/add_isbn.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% block settings %} {% load title %} diff --git a/src/isbn/templates/isbn/assigned_isbn.html b/src/isbn/templates/isbn/assigned_isbn.html index 768b88cbf..dce566426 100644 --- a/src/isbn/templates/isbn/assigned_isbn.html +++ b/src/isbn/templates/isbn/assigned_isbn.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% block settings %} {% load title %} diff --git a/src/isbn/templates/isbn/confirm_isbn_wl.html b/src/isbn/templates/isbn/confirm_isbn_wl.html index cd27b54eb..5ce3a46fc 100644 --- a/src/isbn/templates/isbn/confirm_isbn_wl.html +++ b/src/isbn/templates/isbn/confirm_isbn_wl.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% block settings %} {% load title %} diff --git a/src/isbn/templates/isbn/wl_dc_tags.html b/src/isbn/templates/isbn/wl_dc_tags.html index b4c935df3..43afd4803 100644 --- a/src/isbn/templates/isbn/wl_dc_tags.html +++ b/src/isbn/templates/isbn/wl_dc_tags.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% block settings %} {% load title %} diff --git a/src/lesmianator/templates/lesmianator/2022/lesmianator.html b/src/lesmianator/templates/lesmianator/2022/lesmianator.html deleted file mode 100644 index c334792aa..000000000 --- a/src/lesmianator/templates/lesmianator/2022/lesmianator.html +++ /dev/null @@ -1,76 +0,0 @@ -{% extends "2022/base.html" %} -{% load i18n %} -{% load catalogue_tags %} - - -{% block settings %} - {% load title %} - {% title "Leśmianator" %} -{% endblock %} - - - -{% block main %} -
    -

    Leśmianator

    -
    - -
    -
    -
    - -

    - Leśmianator tworzy wierszmiksy – dzięki niemu - napiszesz wiersz jednym kliknięciem. - W nowej odsłonie nowe możliwości zabawy – teraz możesz zdecydować, co wrzucasz do miksera, - a swoimi dziełami podzielić się z przyjaciółmi! -

    -

    - Przygotowaliśmy kilka propozycji na start – możesz wybrać jedną z nich, - albo ułożyć sobie własną, niepowtarzalną mieszankę. -

    - - -
    -
    - - -

    Miksuj utwory

    -

    - Możesz zmiksować całą lirykę w naszej bibliotece - albo tylko jeden konkretny utwór. Jak? Wejdź na - stronę utworu, - kliknij w link „miksuj ten utwór” – i gotowe! -

    - -

    Miksuj półki

    -

    - Załóż konto, poukładaj swoje ulubione książki na półkach i miksuj - w dowolnych konfiguracjach. Nic prostszego, niż zmieszać - Leśmiana z - Tetmajerem, - a Żeromskiego z - Sienkiewiczem - – wystarczy wrzucić ich utwory na półkę i klikną w link „miksuj utwory z tej półki”. -

    - -

    Dziel się z innymi

    -

    - Wyszedł Ci wyjątkowo udany wierszmiks? Znajdziesz pod nim link, przy pomocy - którego możesz się nim podzielić z przyjaciółmi. -

    - -

    Miłej zabawy!

    - -
    -
    -
    -{% endblock %} diff --git a/src/lesmianator/templates/lesmianator/lesmianator.html b/src/lesmianator/templates/lesmianator/lesmianator.html new file mode 100644 index 000000000..437911b81 --- /dev/null +++ b/src/lesmianator/templates/lesmianator/lesmianator.html @@ -0,0 +1,76 @@ +{% extends "base.html" %} +{% load i18n %} +{% load catalogue_tags %} + + +{% block settings %} + {% load title %} + {% title "Leśmianator" %} +{% endblock %} + + + +{% block main %} +
    +

    Leśmianator

    +
    + +
    +
    +
    + +

    + Leśmianator tworzy wierszmiksy – dzięki niemu + napiszesz wiersz jednym kliknięciem. + W nowej odsłonie nowe możliwości zabawy – teraz możesz zdecydować, co wrzucasz do miksera, + a swoimi dziełami podzielić się z przyjaciółmi! +

    +

    + Przygotowaliśmy kilka propozycji na start – możesz wybrać jedną z nich, + albo ułożyć sobie własną, niepowtarzalną mieszankę. +

    + + +
    +
    + + +

    Miksuj utwory

    +

    + Możesz zmiksować całą lirykę w naszej bibliotece + albo tylko jeden konkretny utwór. Jak? Wejdź na + stronę utworu, + kliknij w link „miksuj ten utwór” – i gotowe! +

    + +

    Miksuj półki

    +

    + Załóż konto, poukładaj swoje ulubione książki na półkach i miksuj + w dowolnych konfiguracjach. Nic prostszego, niż zmieszać + Leśmiana z + Tetmajerem, + a Żeromskiego z + Sienkiewiczem + – wystarczy wrzucić ich utwory na półkę i klikną w link „miksuj utwory z tej półki”. +

    + +

    Dziel się z innymi

    +

    + Wyszedł Ci wyjątkowo udany wierszmiks? Znajdziesz pod nim link, przy pomocy + którego możesz się nim podzielić z przyjaciółmi. +

    + +

    Miłej zabawy!

    + +
    +
    +
    +{% endblock %} diff --git a/src/lesmianator/views.py b/src/lesmianator/views.py index b81f57f92..e179c1483 100644 --- a/src/lesmianator/views.py +++ b/src/lesmianator/views.py @@ -16,7 +16,7 @@ def main_page(request): return render( request, - 'lesmianator/2022/lesmianator.html', + 'lesmianator/lesmianator.html', {"last": last, "shelves": shelves}) @cache.never_cache diff --git a/src/libraries/templates/libraries/catalog_view.html b/src/libraries/templates/libraries/catalog_view.html index 2f2103110..92abeac09 100644 --- a/src/libraries/templates/libraries/catalog_view.html +++ b/src/libraries/templates/libraries/catalog_view.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% block settings %} diff --git a/src/libraries/templates/libraries/library_view.html b/src/libraries/templates/libraries/library_view.html index 7b340be51..2e1ca9ba8 100644 --- a/src/libraries/templates/libraries/library_view.html +++ b/src/libraries/templates/libraries/library_view.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% block settings %} diff --git a/src/libraries/templates/libraries/main_view.html b/src/libraries/templates/libraries/main_view.html index eb2f5d273..b887bdc43 100644 --- a/src/libraries/templates/libraries/main_view.html +++ b/src/libraries/templates/libraries/main_view.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% block settings %} diff --git a/src/messaging/templates/messaging/contact_detail.html b/src/messaging/templates/messaging/contact_detail.html index ada00b3e9..b30ff229c 100644 --- a/src/messaging/templates/messaging/contact_detail.html +++ b/src/messaging/templates/messaging/contact_detail.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% block body %} diff --git a/src/messaging/templates/messaging/contact_form.html b/src/messaging/templates/messaging/contact_form.html index a32d25a74..7ce1aadea 100644 --- a/src/messaging/templates/messaging/contact_form.html +++ b/src/messaging/templates/messaging/contact_form.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% block body %} diff --git a/src/newsletter/templates/newsletter/2022/subscribe_form.html b/src/newsletter/templates/newsletter/2022/subscribe_form.html deleted file mode 100644 index f667c08d6..000000000 --- a/src/newsletter/templates/newsletter/2022/subscribe_form.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "2022/base_simple.html" %} -{% load i18n %} -{% load honeypot %} - -{% block settings %} - {% load title %} - {% title form.newsletter.page_title %} -{% endblock %} - - -{% block content %} -

    {{ title }}

    - -
    - {% csrf_token %} - {% render_honeypot_field %} - {{ form }} - -
    - {{ form.data_processing }} -
    - - -
    -{% endblock %} diff --git a/src/newsletter/templates/newsletter/2022/subscribed.html b/src/newsletter/templates/newsletter/2022/subscribed.html deleted file mode 100644 index 5396885ea..000000000 --- a/src/newsletter/templates/newsletter/2022/subscribed.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "2022/base_simple.html" %} -{% load i18n %} - - -{% block settings %} - {% load title %} - {% trans "Subscribed" as title %} - {% title title %} -{% endblock %} - - -{% block content %} -

    {{ title }}

    - -

    - {% trans "You have subscribed to Wolne Lektury newsletter." %} -

    -{% endblock %} diff --git a/src/newsletter/templates/newsletter/subscribe_form.html b/src/newsletter/templates/newsletter/subscribe_form.html new file mode 100644 index 000000000..e20be8aba --- /dev/null +++ b/src/newsletter/templates/newsletter/subscribe_form.html @@ -0,0 +1,25 @@ +{% extends "base_simple.html" %} +{% load i18n %} +{% load honeypot %} + +{% block settings %} + {% load title %} + {% title form.newsletter.page_title %} +{% endblock %} + + +{% block content %} +

    {{ title }}

    + +
    + {% csrf_token %} + {% render_honeypot_field %} + {{ form }} + +
    + {{ form.data_processing }} +
    + + +
    +{% endblock %} diff --git a/src/newsletter/templates/newsletter/subscribed.html b/src/newsletter/templates/newsletter/subscribed.html new file mode 100644 index 000000000..56cf71a37 --- /dev/null +++ b/src/newsletter/templates/newsletter/subscribed.html @@ -0,0 +1,18 @@ +{% extends "base_simple.html" %} +{% load i18n %} + + +{% block settings %} + {% load title %} + {% trans "Subscribed" as title %} + {% title title %} +{% endblock %} + + +{% block content %} +

    {{ title }}

    + +

    + {% trans "You have subscribed to Wolne Lektury newsletter." %} +

    +{% endblock %} diff --git a/src/newsletter/views.py b/src/newsletter/views.py index cfa394be5..f226a6b12 100644 --- a/src/newsletter/views.py +++ b/src/newsletter/views.py @@ -19,7 +19,7 @@ def subscribe_form(request, slug=''): else: form = SubscribeForm(newsletter) - template_name = 'newsletter/2022/subscribe_form.html' + template_name = 'newsletter/subscribe_form.html' return render(request, template_name, { 'page_title': newsletter.page_title, 'form': form, @@ -27,7 +27,7 @@ def subscribe_form(request, slug=''): def subscribed(request): - template_name = 'newsletter/2022/subscribed.html' + template_name = 'newsletter/subscribed.html' return render(request, template_name, { 'page_title': _('Subscribed'), }) diff --git a/src/paypal/templates/paypal/cancel.html b/src/paypal/templates/paypal/cancel.html index eb73f3397..3314700ba 100644 --- a/src/paypal/templates/paypal/cancel.html +++ b/src/paypal/templates/paypal/cancel.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% block body %} diff --git a/src/pdcounter/templates/pdcounter/2022/author_detail.html b/src/pdcounter/templates/pdcounter/2022/author_detail.html deleted file mode 100644 index c1920d1fd..000000000 --- a/src/pdcounter/templates/pdcounter/2022/author_detail.html +++ /dev/null @@ -1,54 +0,0 @@ -{% extends "2022/base.html" %} -{% load i18n %} -{% load time_tags %} - -{% block settings %} - {% load title %} - {% title author.name %} -{% endblock %} - -{% block breadcrumbs %} - Katalog - Autor -{% endblock %} - -{% block main %} -
    -
    -

    {{ author.name }}

    -
    -
    - -
    - - - {% if author.alive %} -

    - {% trans "This author's works are copyrighted." %} - {% trans "Find out why Internet libraries can't publish this author's works." %} -

    - {% else %} - {% if author.in_pd %} -

    {% trans "This author's works are in public domain, but they were not yet published on Internet library of Wolne Lektury." %}

    - {% else %} -
    -

    - {% trans "This author's works will become part of public domain and will be allowed to be published without restrictions in" %} -

    -
    -

    - {% trans "Find out why Internet libraries can't publish this author's works." %} -

    -
    - {% endif %} - {% endif %} - - -
    - -
    -
    - {% include "catalogue/2022/author_box.html" %} -
    -
    -{% endblock %} diff --git a/src/pdcounter/templates/pdcounter/2022/book_detail.html b/src/pdcounter/templates/pdcounter/2022/book_detail.html deleted file mode 100644 index 9f07b479c..000000000 --- a/src/pdcounter/templates/pdcounter/2022/book_detail.html +++ /dev/null @@ -1,54 +0,0 @@ -{% extends '2022/base.html' %} -{% load i18n %} -{% load time_tags %} - -{% block global-content %} - - - -
    -
    -
    - -
    - {% if book.in_pd %} -

    {% trans "This work is in public domain and will be published on Internet library of Wolne Lektury soon." %}

    - {% else %} - {% if book.pd %} -

    - {% trans "This work will become part of public domain and will be allowed to be published without restrictions in" %} -

    -
    -

    - {% trans "Find out why Internet libraries can't publish this work." %} -

    - {% else %} -

    - {% trans "This work is copyrighted." %} - {% trans "Find out why Internet libraries can't publish this work." %} -

    - {% endif %} - {% endif %} -
    -
    -
    -
    - - -{% endblock %} diff --git a/src/pdcounter/templates/pdcounter/author_detail.html b/src/pdcounter/templates/pdcounter/author_detail.html new file mode 100644 index 000000000..85d29adc5 --- /dev/null +++ b/src/pdcounter/templates/pdcounter/author_detail.html @@ -0,0 +1,54 @@ +{% extends "base.html" %} +{% load i18n %} +{% load time_tags %} + +{% block settings %} + {% load title %} + {% title author.name %} +{% endblock %} + +{% block breadcrumbs %} + Katalog + Autor +{% endblock %} + +{% block main %} +
    +
    +

    {{ author.name }}

    +
    +
    + +
    + + + {% if author.alive %} +

    + {% trans "This author's works are copyrighted." %} + {% trans "Find out why Internet libraries can't publish this author's works." %} +

    + {% else %} + {% if author.in_pd %} +

    {% trans "This author's works are in public domain, but they were not yet published on Internet library of Wolne Lektury." %}

    + {% else %} +
    +

    + {% trans "This author's works will become part of public domain and will be allowed to be published without restrictions in" %} +

    +
    +

    + {% trans "Find out why Internet libraries can't publish this author's works." %} +

    +
    + {% endif %} + {% endif %} + + +
    + +
    +
    + {% include "catalogue/author_box.html" %} +
    +
    +{% endblock %} diff --git a/src/pdcounter/templates/pdcounter/book_detail.html b/src/pdcounter/templates/pdcounter/book_detail.html new file mode 100644 index 000000000..36ec0e012 --- /dev/null +++ b/src/pdcounter/templates/pdcounter/book_detail.html @@ -0,0 +1,54 @@ +{% extends 'base.html' %} +{% load i18n %} +{% load time_tags %} + +{% block global-content %} + + + +
    +
    +
    + +
    + {% if book.in_pd %} +

    {% trans "This work is in public domain and will be published on Internet library of Wolne Lektury soon." %}

    + {% else %} + {% if book.pd %} +

    + {% trans "This work will become part of public domain and will be allowed to be published without restrictions in" %} +

    +
    +

    + {% trans "Find out why Internet libraries can't publish this work." %} +

    + {% else %} +

    + {% trans "This work is copyrighted." %} + {% trans "Find out why Internet libraries can't publish this work." %} +

    + {% endif %} + {% endif %} +
    +
    +
    +
    + + +{% endblock %} diff --git a/src/pdcounter/views.py b/src/pdcounter/views.py index e66254b00..ca61f161f 100644 --- a/src/pdcounter/views.py +++ b/src/pdcounter/views.py @@ -18,7 +18,7 @@ def book_stub_detail(request, slug): form = PublishingSuggestForm(initial={"books": "%s — %s, \n" % (book.author, book.title)}) - template_name = 'pdcounter/2022/book_detail.html' + template_name = 'pdcounter/book_detail.html' return render(request, template_name, { 'book': book, @@ -37,7 +37,7 @@ def author_detail(request, slug): form = PublishingSuggestForm(initial={"books": author.name + ", \n"}) - template_name = 'pdcounter/2022/author_detail.html' + template_name = 'pdcounter/author_detail.html' return render(request, template_name, { 'author': author, diff --git a/src/picture/templates/picture/2022/picture_detail.html b/src/picture/templates/picture/2022/picture_detail.html deleted file mode 100644 index d9707c7af..000000000 --- a/src/picture/templates/picture/2022/picture_detail.html +++ /dev/null @@ -1,177 +0,0 @@ -{% extends '2022/base.html' %} -{% load i18n %} - -{% load chunks %} -{% load static %} -{% load thumbnail %} -{% load catalogue_tags %} - - -{% block global-content %} - - - -
    -
    - -
    - - -
    -
    - - {% for tag in picture.authors %} -
    -
    - {% include 'catalogue/2022/author_box.html' %} -
    -
    - {% endfor %} - -
    -
    - {% if themes %} -

    Motywy obecne na tym obrazie Wszystkie motywy

    -
    - -
    - - - {% endif %} - {% if things %} -

    Obiekty na tym obrazie Wszystkie obiekty

    -
    - -
    - - - {% endif %} - -
    -
    -
    - - - - - -
    -
    -
    -

    Czytaj także

    - - {% related_pictures_2022 picture=picture as related_books %} - {% for rel in related_books %} - - {% endfor %} - - - -
    -
    -
    - - - -{% endblock %} diff --git a/src/picture/templates/picture/picture_detail.html b/src/picture/templates/picture/picture_detail.html new file mode 100644 index 000000000..4b6177993 --- /dev/null +++ b/src/picture/templates/picture/picture_detail.html @@ -0,0 +1,177 @@ +{% extends 'base.html' %} +{% load i18n %} + +{% load chunks %} +{% load static %} +{% load thumbnail %} +{% load catalogue_tags %} + + +{% block global-content %} + + + +
    +
    + +
    + + +
    +
    + + {% for tag in picture.authors %} +
    +
    + {% include 'catalogue/author_box.html' %} +
    +
    + {% endfor %} + +
    +
    + {% if themes %} +

    Motywy obecne na tym obrazie Wszystkie motywy

    +
    + +
    + + + {% endif %} + {% if things %} +

    Obiekty na tym obrazie Wszystkie obiekty

    +
    + +
    + + + {% endif %} + +
    +
    +
    + + + + + +
    +
    +
    +

    Czytaj także

    + + {% related_pictures_2022 picture=picture as related_books %} + {% for rel in related_books %} + + {% endfor %} + + + +
    +
    + +
    + + +{% endblock %} diff --git a/src/picture/views.py b/src/picture/views.py index 35f0f3d44..44d516c7f 100644 --- a/src/picture/views.py +++ b/src/picture/views.py @@ -26,7 +26,7 @@ def picture_list_thumb(request): suggestions.append(t) if sum(suggestion_categories.values()) == 10: break - template_name = 'catalogue/2022/author_detail.html' + template_name = 'catalogue/author_detail.html' return render(request, template_name, { 'object_list': pictures, 'title': 'Galeria', @@ -41,7 +41,7 @@ def picture_detail(request, slug): theme_things = split_tags(picture.related_themes()) - template_name = 'picture/2022/picture_detail.html' + template_name = 'picture/picture_detail.html' return render(request, template_name, { 'picture': picture, diff --git a/src/polls/templates/polls/poll.html b/src/polls/templates/polls/poll.html index 61d651e6b..aabadec95 100644 --- a/src/polls/templates/polls/poll.html +++ b/src/polls/templates/polls/poll.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% load polls_tags %} diff --git a/src/push/templates/push/notification_form.html b/src/push/templates/push/notification_form.html index 680a77679..6767c154b 100644 --- a/src/push/templates/push/notification_form.html +++ b/src/push/templates/push/notification_form.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% block titleextra %}{% trans "Notifications" %}{% endblock %} diff --git a/src/push/templates/push/notification_sent.html b/src/push/templates/push/notification_sent.html index 53eb29bfc..8688c2d0f 100644 --- a/src/push/templates/push/notification_sent.html +++ b/src/push/templates/push/notification_sent.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% block titleextra %}{% trans "Notifications" %}{% endblock %} diff --git a/src/references/templates/references/map.html b/src/references/templates/references/map.html index f21b70b8b..3b266a1ed 100644 --- a/src/references/templates/references/map.html +++ b/src/references/templates/references/map.html @@ -1,4 +1,4 @@ -{% extends "2022/base.html" %} +{% extends "base.html" %} {% load cache %} {% load static %} {% load l10n %} diff --git a/src/reporting/templates/reporting/main.html b/src/reporting/templates/reporting/main.html index ece5d0268..5d121ce74 100644 --- a/src/reporting/templates/reporting/main.html +++ b/src/reporting/templates/reporting/main.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n l10n %} {% load reporting_stats catalogue_tags %} diff --git a/src/search/templates/search/results.html b/src/search/templates/search/results.html index 625bb6591..dbcf1c0a9 100644 --- a/src/search/templates/search/results.html +++ b/src/search/templates/search/results.html @@ -1,4 +1,4 @@ -{% extends "2022/base.html" %} +{% extends "base.html" %} {% block main %} @@ -108,7 +108,7 @@
    {% for book in results.book %} - {% include 'catalogue/2022/book_box.html' %} + {% include 'catalogue/book_box.html' %} {% endfor %}
    @@ -121,7 +121,7 @@
    {% for book in results.art %} - {% include 'catalogue/2022/book_box.html' %} + {% include 'catalogue/book_box.html' %} {% endfor %}
    @@ -153,7 +153,7 @@

    Kolekcje

    {% for collection in results.collection %} - {% include 'catalogue/2022/collection_box.html' %} + {% include 'catalogue/collection_box.html' %} {% endfor %}
    diff --git a/src/social/templates/social/2022/my_shelf.html b/src/social/templates/social/2022/my_shelf.html deleted file mode 100644 index a955b31b7..000000000 --- a/src/social/templates/social/2022/my_shelf.html +++ /dev/null @@ -1,62 +0,0 @@ -{% extends '2022/base.html' %} -{% load catalogue_tags %} - - -{% block settings %} - {% load title %} - {% title 'Półka' %} -{% endblock %} - -{% block main %} -
    -
    -

    Półka

    -
    -
    - -
    -
    -
    - - -
    -
    - Sortuj: -
    - - - -
    -
    -
    -
    - -
    - -
    -

     

    - {% if suggest %} -
    - {% with list_type='book' %} - {% for tag in suggest %} - - {{ tag }} - - {% endfor %} - {% endwith %} -
    - {% endif %} -
    -
    - - - -
    -
    - {% for book in books %} - {% include "catalogue/2022/book_box.html" %} - {% endfor %} -
    -
    - -{% endblock %} diff --git a/src/social/templates/social/carousel.html b/src/social/templates/social/carousel.html new file mode 100644 index 000000000..2d9172143 --- /dev/null +++ b/src/social/templates/social/carousel.html @@ -0,0 +1,7 @@ +{% for banner in banners %} + {% if banner.picture %} +
    + +
    + {% endif %} +{% endfor %} diff --git a/src/social/templates/social/carousel_2022.html b/src/social/templates/social/carousel_2022.html deleted file mode 100644 index 2d9172143..000000000 --- a/src/social/templates/social/carousel_2022.html +++ /dev/null @@ -1,7 +0,0 @@ -{% for banner in banners %} - {% if banner.picture %} -
    - -
    - {% endif %} -{% endfor %} diff --git a/src/social/templates/social/my_shelf.html b/src/social/templates/social/my_shelf.html new file mode 100644 index 000000000..f42a76b27 --- /dev/null +++ b/src/social/templates/social/my_shelf.html @@ -0,0 +1,62 @@ +{% extends 'base.html' %} +{% load catalogue_tags %} + + +{% block settings %} + {% load title %} + {% title 'Półka' %} +{% endblock %} + +{% block main %} +
    +
    +

    Półka

    +
    +
    + +
    +
    +
    + + +
    +
    + Sortuj: +
    + + + +
    +
    +
    +
    + +
    + +
    +

     

    + {% if suggest %} +
    + {% with list_type='book' %} + {% for tag in suggest %} + + {{ tag }} + + {% endfor %} + {% endwith %} +
    + {% endif %} +
    +
    + + + +
    +
    + {% for book in books %} + {% include "catalogue/book_box.html" %} + {% endfor %} +
    +
    + +{% endblock %} diff --git a/src/social/templatetags/social_tags.py b/src/social/templatetags/social_tags.py index 81a69e031..7e61b9041 100644 --- a/src/social/templatetags/social_tags.py +++ b/src/social/templatetags/social_tags.py @@ -51,8 +51,8 @@ def book_shelf_tags(context, book_id): return lazy(get_value, str)() -@register.inclusion_tag('social/carousel_2022.html', takes_context=True) -def carousel_2022(context, placement): +@register.inclusion_tag('social/carousel.html', takes_context=True) +def carousel(context, placement): banners = Carousel.get(placement).carouselitem_set.all()#first().get_banner() return { 'banners': [b.get_banner() for b in banners], diff --git a/src/social/views.py b/src/social/views.py index 9087d7bba..d3f938118 100644 --- a/src/social/views.py +++ b/src/social/views.py @@ -66,7 +66,7 @@ def unlike_book(request, slug): @login_required def my_shelf(request): - template_name = 'social/2022/my_shelf.html' + template_name = 'social/my_shelf.html' tags = list(request.user.tag_set.all()) suggest = [t for t in tags if t.name] print(suggest) diff --git a/src/stats/templates/stats/top.html b/src/stats/templates/stats/top.html index 1b365b162..422624cbe 100644 --- a/src/stats/templates/stats/top.html +++ b/src/stats/templates/stats/top.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% block settings %} {% load title %} diff --git a/src/waiter/templates/waiter/wait.html b/src/waiter/templates/waiter/wait.html index b67d957f6..0cee1df4c 100644 --- a/src/waiter/templates/waiter/wait.html +++ b/src/waiter/templates/waiter/wait.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% load static from static %} diff --git a/src/wolnelektury/settings/static.py b/src/wolnelektury/settings/static.py index e91c742d4..09e6111e3 100644 --- a/src/wolnelektury/settings/static.py +++ b/src/wolnelektury/settings/static.py @@ -21,7 +21,7 @@ IMAGE_DIR = 'book/pictures/' PIPELINE = { 'STYLESHEETS': { - '2022': { + 'main': { 'source_filenames': [ 'contrib/jquery-ui-1.13.1.custom/jquery-ui.css', 'css/jquery.countdown.css', @@ -30,7 +30,7 @@ PIPELINE = { '2022/more.scss', 'chunks/edit.scss', ], - 'output_filename': 'css/compressed/2022.css', + 'output_filename': 'css/compressed/main.css', }, 'book_text': { 'source_filenames': [ @@ -51,17 +51,17 @@ PIPELINE = { }, }, 'JAVASCRIPT': { - '2022': { + 'main': { 'source_filenames': [ '2022/scripts/vendor.js', 'contrib/jquery-ui-1.13.1.custom/jquery-ui.js', 'js/search.js', - 'js/2022.js', - '2022/book/filter.js', + 'js/header.js', + 'book/filter.js', 'chunks/edit.js', '2022/scripts/modernizr.js', - '2021/scripts/main.js', + 'js/main.js', 'js/contrib/jquery.cycle2.min.js', 'sponsors/js/sponsors.js', @@ -73,15 +73,15 @@ PIPELINE = { 'pdcounter/pdcounter.js', ], - 'output_filename': 'js/2022.min.js' + 'output_filename': 'js/compressed/main.min.js' }, - '2022_player': { + 'player': { 'source_filenames': [ 'js/contrib/jplayer/jquery.jplayer.min.js', 'js/contrib/jplayer/jplayer.playlist.min.js', - 'player/2022_player.js', + 'player/player.js', ], - 'output_filename': 'js/2022_player.min.js', + 'output_filename': 'js/compressed/player.min.js', }, 'book_text': { 'source_filenames': [ diff --git a/src/wolnelektury/static/2021/scripts/main.js b/src/wolnelektury/static/2021/scripts/main.js deleted file mode 100644 index d231b40a6..000000000 --- a/src/wolnelektury/static/2021/scripts/main.js +++ /dev/null @@ -1,546 +0,0 @@ -// JS Menu -(function () { - let button = $('.js-menu'); - let menu = $('.l-navigation'); - let menuLinks = menu.find('a'); - - button.on('click', function() { - if(!$(this).hasClass('is-active')) { - $(this).addClass('is-active'); - menu.addClass('is-open'); - $('body').addClass('is-open'); - button.find('.bar').addClass('animate'); - menuLinks.attr('tabindex', 0); - } else { - $(this).removeClass('is-active'); - menu.removeClass('is-open'); - $('body').removeClass('is-open'); - button.find('.bar').removeClass('animate'); - menuLinks.attr('tabindex', -1); - } - }); - - $(document).keyup(function(e) { - if (e.keyCode === 27) { - button.removeClass('is-active'); - menu.removeClass('is-open'); - $('body').removeClass('is-open'); - button.find('.bar').removeClass('animate'); - menuLinks.attr('tabindex', -1); - } - }); -})(); - -// User menu. -(function() { - let button = $('.l-navigation__actions .user'); - let menu = $('#user-menu'); - let menuLinks = menu.find('a'); - - button.on('click', function() { - if (!menu.hasClass('is-open')) { - menu.addClass('is-open'); - menuLinks.attr('tabindex', 0); - } else { - menu.removeClass('is-open'); - menuLinks.attr('tabindex', -1) - } - return false; - }); - - $(document).keyup(function(e) { - if (e.keyCode === 27) { - menu.removeClass('is-open'); - menuLinks.attr('tabindex', -1); - } - }); - - $(document).click(function() { - menu.removeClass('is-open'); - menuLinks.attr('tabindex', -1); - }); - -})(); - -// Ebook/Audiobook Btns -(function() { - let button = $('.c-media__btn button:not(.l-button--media--full)'); - let popupLayer = $('.c-media__popup'); - let closeButton = $('.c-media__popup__close'); - let playButton = $('.c-player__btn--md'); - let chaptersButton = $('.c-player__chapters span'); - let select = $('.c-select'); - let selectItem = $('.c-select li'); - let volumeButton = $('.icon-volume'); - - button.on('click', function () { - let target = $(this).attr('id'); - $('[data-popup=' + target).addClass('is-open'); - $('body').addClass('popup-open'); - }); - - closeButton.on('click', function() { - $(this).closest('.c-media__popup').removeClass('is-open'); - $('body').removeClass('popup-open'); - }); - - popupLayer.on('click', function(e) { - let _this = $(this); - if($(e.target).is(popupLayer)) { - _this.removeClass('is-open'); - $('body').removeClass('popup-open'); - } - }); - - chaptersButton.on('click', function() { - $(this).parent().toggleClass('is-active'); - }); - - select.on('click', function() { - $(this).toggleClass('is-active'); - }); - - selectItem.on('click', function() { - selectItem.removeClass('is-active'); - $(this).addClass('is-active'); - }); - - $(document).keyup(function(e) { - if (e.keyCode === 27) { - $('.c-media__popup').removeClass('is-open'); - } - }); -})(); - -// Homepage books sliders -(function () { - let shelfSlider = $('.l-your-books__shelf .l-books'); - let shelfNextSlide = $('.l-your-books__shelf .js-next-slide'); - let shelfPrevSlide = $('.l-your-books__shelf .js-prev-slide'); - let shelfCollapse = $('.l-your-books__shelf .js-collapse'); - - shelfSlider.slick({ - slidesToScroll: 1, - slidesToShow: 4, - infinite: false, - dots: false, - arrows: false, - autoplay: false, - responsive: [ - { - breakpoint: 768, - settings: { - centerMode: false, - slidesToShow: 1 - } - } - ] - }); - - shelfNextSlide.on('click', function (event) { - event.preventDefault(); - shelfSlider.slick('slickNext'); - }); - - shelfPrevSlide.on('click', function (event) { - event.preventDefault(); - shelfSlider.slick('slickPrev'); - }); - - shelfCollapse.on('click', function (event) { - event.preventDefault(); - shelfSlider.slick('slickPrev'); - }); - - - $('.js-collections').each(function() { - //return; - let collectionsSlider = $('.l-books', this); - if (collectionsSlider.children().length < 2) return; - - // remove flexbox - collectionsSlider.css('display', 'block'); - - let collectionsNextSlide = $('.js-next-slide', this); - let collectionsPrevSlide = $('.js-prev-slide', this); - - collectionsSlider.slick({ - //prevArrow, nextArrow, - - slidesToScroll: 1, - slidesToShow: 1, - infinite: false, - dots: false, - arrows: false, - autoplay: false, - - swipeToSlide: true, - centerMode: false, - mobileFirst: true, - responsive: [ - { - breakpoint: 360 - .01, - settings: { - slidesToShow: 2, - } - }, - { - breakpoint: 520 - .01, - settings: { - slidesToShow: 3 - } - }, - { - breakpoint: 680 - .01, - settings: { - slidesToShow: 4 - } - }, - { - breakpoint: 840 - .01, - settings: { - slidesToShow: 5 - } - }, - { - breakpoint: 1172 - .01, - settings: { - slidesToShow: 5, - variableWidth: true, - } - }, - ] - }); - - collectionsNextSlide.on('click', function (event) { - event.preventDefault(); - collectionsSlider.slick('slickNext'); - }); - - collectionsPrevSlide.on('click', function (event) { - event.preventDefault(); - collectionsSlider.slick('slickPrev'); - }); - }); - let newBooksSlider = $('.js-new-books-slider .l-books'); - let newBooksNextSlide = $('.js-new-books-slider .js-next-slide'); - let newBooksPrevSlide = $('.js-new-books-slider .js-prev-slide'); - - newBooksSlider.slick({ - slidesToScroll: 1, - slidesToShow: 5, - infinite: false, - dots: false, - arrows: false, - autoplay: false, - responsive: [ - { - breakpoint: 768, - settings: { - centerMode: false, - slidesToShow: 2 - } - } - ] - }); - - newBooksNextSlide.on('click', function (event) { - event.preventDefault(); - newBooksSlider.slick('slickNext'); - }); - - newBooksPrevSlide.on('click', function (event) { - event.preventDefault(); - newBooksSlider.slick('slickPrev'); - }); -})(); - -// Quotes slider -(function () { - let slider = $('.l-author__quotes__slider'); - - slider.slick({ - slidesToScroll: 1, - slidesToShow: 1, - infinite: true, - dots: true, - arrows: false, - autoplay: true, - autoplaySpeed: 3000 - }); - - - let sliderHomepage = $('.l-quotes'); - sliderHomepage.slick({ - slidesToShow: 1, - centerMode: false, - infinite: true, - dots: true, - arrows: false, - autoplay: true, - autoplaySpeed: 4000, - }); - -})(); - - - - -// Carousel -(function () { - let slider = $('.p-homepage__info__box--carousel'); - - slider.slick({ - slidesToScroll: 1, - slidesToShow: 1, - infinite: true, - dots: true, - arrows: false, - autoplay: true, - autoplaySpeed: 5000 - }); - - - -})(); - - - -// Text overlay toggler -(function () { - let overlays = $('.l-article__overlay'); - let button = $('.l-article__read-more'); - - overlays.each(function () { - let maxHeight = $(this).attr('data-max-height'); - if($(this).outerHeight() > maxHeight) { - $(this).css({'maxHeight': maxHeight+'px'}).addClass('is-active'); - } else { - $(this).next('.l-article__read-more').hide(); - } - }); - - button.on('click', function() { - let dataLabel = $(this).attr('data-label'); - let dataAction = $(this).attr('data-action'); - $(this).parent().find('.l-article__overlay').toggleClass('is-clicked'); - if($(this).text() === dataLabel) { - $(this).text(dataAction); - } else { - $(this).text(dataLabel); - } - }); -})(); - -(function() { - $('.l-checkout__payments__box button').on('click', function() { - let container = $(this).closest('.l-checkout__payments'); - $('input', container).val($(this).val()); - $('.is-active', container).removeClass('is-active'); - $(this).closest('.l-checkout__payments__box').addClass('is-active'); - $('#kwota').val(''); - return false; - }); - -})(); - - -//Copy function -(function() { - let $copy = $('.js-copy'); - - $copy.on('click', function() { - let $copyText = $(this).closest('.l-checkout__info__item').find('input'); - $copyText.select(); - document.execCommand('copy'); - }); -})(); - - - -// Likes -(function() { - - ids = new Set(); - $(".icon-like").each( - (i, e)=>{ - ids.add($(e).attr('data-book')); - } - ); - ids = [...ids].join(','); - - state = { - liked: [], - }; - - $(document).on('click', '.icon-like', function(e) { - e.preventDefault(); - let liked = $(this).hasClass('icon-liked'); - $btn = $(this); - if (liked) { - $.post({ - url: '/ludzie/lektura/' + $(this).attr('data-book-slug') + '/nie_lubie/', - data: {'csrfmiddlewaretoken': $('[name=csrfmiddlewaretoken]').val()}, - success: function() { - delete state.liked[$btn.attr('data-book')]; - updateLiked($btn); - } - }) - } else { - $.post({ - url: '/ludzie/lektura/' + $(this).attr('data-book-slug') + '/lubie/', - data: {'csrfmiddlewaretoken': $('[name=csrfmiddlewaretoken]').val()}, - success: function() { - state.liked[$btn.attr('data-book')] = []; - updateLiked($btn); - }, - error: function(e) { - if (e.status == 403) { - $('#login-link').click(); - } - }, - }); - } - }) - - // TODO: DYNAMICALLY ADD - $(".add-set-tag input[name=name]").autocomplete({ - source: '/ludzie/moje-tagi/', - }).on('autocompleteopen', function() { - $(this).closest('article').addClass('ac-hover'); - }).on('autocompleteclose', function() { - $(this).closest('article').removeClass('ac-hover'); - }); - $(".add-set-tag").on("submit", function(e) { - e.preventDefault(); - let $form = $(this); - $.post({ - url: $form.attr("action"), - data: $form.serialize(), - success: (data) => { - updateFromData(data); - updateLikedAll(); - $('input[name=name]', $form).val(''); - } - }); - }) - - $(document).on("click", ".sets .close", function() { - let bookId = $(this).closest("[data-book]").attr('data-book'); - $.post({ - url: '/ludzie/usun-tag/', - data: { - csrfmiddlewaretoken: $("[name=csrfmiddlewaretoken]").val(), - book: bookId, - slug: $(this).parent().attr('data-set'), - }, - success: (data) => { - updateFromData(data); - updateLikedAll(); - } - }); - }) - - - function refreshAll(ids) { - $.ajax('/ludzie/ulubione/?ids=' + ids, { - success: function(result) { - updateFromData(result); - updateLikedAll(); - }, - }); - } - refreshAll(ids); - $.refreshLikes = refreshAll; - - function updateFromData(data) { - for (pk in data) { - if (data[pk] === null) { - delete state.liked[pk]; - } else { - state.liked[pk] = data[pk]; - } - } - } - - function updateLikedAll() { - $(".icon-like").each( - (i, e) => { - updateLiked(e); - } - ) - } - - function updateLiked(e) { - let bookId = $(e).attr('data-book'); - let liked = bookId in state.liked; - $(e).toggleClass('icon-liked', liked); - let $bookContainer = $('.book-container-' + bookId); - $bookContainer.toggleClass('book-liked', liked); - let $sets = $(".sets", $bookContainer); - $sets.empty(); - $.each(state.liked[bookId], (i,e) => { - let $set = $(""); - $set.attr("data-set", e.slug); - let $setA = $("").appendTo($set); - $setA.attr("href", e.url); - $setA.text(e.name); - let $setX = $("").appendTo($set); - $sets.append($set); - }); - } - -})(); - - - -// Toggle a class on long press. -(function() { - const TIME = 250; - let timer; - - $("[data-longpress]").on("touchstart", (e) => { - $e = $(e.currentTarget); - timer = setTimeout(() => { - $e.toggleClass($e.attr('data-longpress')); - }, TIME); - }); - - $("[data-longpress]").on("touchend", () => { - clearTimeout(timer); - }); -})(); - - - -// Update search form filters. -(function() { - $('.j-form-auto').each(function() { - let $form = $(this); - $('input', $form).change(function() {$form.submit()}); - $('select', $form).change(function() {$form.submit()}); - $('textarea', $form).change(function() {$form.submit()}); - }); - - - // experiments - $(".experiment input").on('change', function() { - let name = $(this).attr('name'); - let val = $(this).val(); - document.cookie = 'EXPERIMENT_' + name + '=' + val + '; path=/; max-age=31536000'; - window.location.reload(true); - }); - - $('.c-lang').on('click', function() { - !$(this).toggleClass('is-open'); - }); - - - - - - $(".c-media__settings > i").on('click', function() { - $(".c-media__settings").toggleClass('active'); - }); - -})(); diff --git a/src/wolnelektury/static/js/2022.js b/src/wolnelektury/static/js/2022.js deleted file mode 100644 index cbf143057..000000000 --- a/src/wolnelektury/static/js/2022.js +++ /dev/null @@ -1,13 +0,0 @@ -(function($) { - $(function() { - - $("#search").search(); - $("#search").on('focus', function() { - $(".l-navigation__logo").addClass('search-active'); - }); - $("#search").on('blur', function() { - $(".l-navigation__logo").removeClass('search-active'); - }); - - }); -})(jQuery); diff --git a/src/wolnelektury/static/js/header.js b/src/wolnelektury/static/js/header.js new file mode 100644 index 000000000..cbf143057 --- /dev/null +++ b/src/wolnelektury/static/js/header.js @@ -0,0 +1,13 @@ +(function($) { + $(function() { + + $("#search").search(); + $("#search").on('focus', function() { + $(".l-navigation__logo").addClass('search-active'); + }); + $("#search").on('blur', function() { + $(".l-navigation__logo").removeClass('search-active'); + }); + + }); +})(jQuery); diff --git a/src/wolnelektury/static/js/main.js b/src/wolnelektury/static/js/main.js new file mode 100644 index 000000000..d231b40a6 --- /dev/null +++ b/src/wolnelektury/static/js/main.js @@ -0,0 +1,546 @@ +// JS Menu +(function () { + let button = $('.js-menu'); + let menu = $('.l-navigation'); + let menuLinks = menu.find('a'); + + button.on('click', function() { + if(!$(this).hasClass('is-active')) { + $(this).addClass('is-active'); + menu.addClass('is-open'); + $('body').addClass('is-open'); + button.find('.bar').addClass('animate'); + menuLinks.attr('tabindex', 0); + } else { + $(this).removeClass('is-active'); + menu.removeClass('is-open'); + $('body').removeClass('is-open'); + button.find('.bar').removeClass('animate'); + menuLinks.attr('tabindex', -1); + } + }); + + $(document).keyup(function(e) { + if (e.keyCode === 27) { + button.removeClass('is-active'); + menu.removeClass('is-open'); + $('body').removeClass('is-open'); + button.find('.bar').removeClass('animate'); + menuLinks.attr('tabindex', -1); + } + }); +})(); + +// User menu. +(function() { + let button = $('.l-navigation__actions .user'); + let menu = $('#user-menu'); + let menuLinks = menu.find('a'); + + button.on('click', function() { + if (!menu.hasClass('is-open')) { + menu.addClass('is-open'); + menuLinks.attr('tabindex', 0); + } else { + menu.removeClass('is-open'); + menuLinks.attr('tabindex', -1) + } + return false; + }); + + $(document).keyup(function(e) { + if (e.keyCode === 27) { + menu.removeClass('is-open'); + menuLinks.attr('tabindex', -1); + } + }); + + $(document).click(function() { + menu.removeClass('is-open'); + menuLinks.attr('tabindex', -1); + }); + +})(); + +// Ebook/Audiobook Btns +(function() { + let button = $('.c-media__btn button:not(.l-button--media--full)'); + let popupLayer = $('.c-media__popup'); + let closeButton = $('.c-media__popup__close'); + let playButton = $('.c-player__btn--md'); + let chaptersButton = $('.c-player__chapters span'); + let select = $('.c-select'); + let selectItem = $('.c-select li'); + let volumeButton = $('.icon-volume'); + + button.on('click', function () { + let target = $(this).attr('id'); + $('[data-popup=' + target).addClass('is-open'); + $('body').addClass('popup-open'); + }); + + closeButton.on('click', function() { + $(this).closest('.c-media__popup').removeClass('is-open'); + $('body').removeClass('popup-open'); + }); + + popupLayer.on('click', function(e) { + let _this = $(this); + if($(e.target).is(popupLayer)) { + _this.removeClass('is-open'); + $('body').removeClass('popup-open'); + } + }); + + chaptersButton.on('click', function() { + $(this).parent().toggleClass('is-active'); + }); + + select.on('click', function() { + $(this).toggleClass('is-active'); + }); + + selectItem.on('click', function() { + selectItem.removeClass('is-active'); + $(this).addClass('is-active'); + }); + + $(document).keyup(function(e) { + if (e.keyCode === 27) { + $('.c-media__popup').removeClass('is-open'); + } + }); +})(); + +// Homepage books sliders +(function () { + let shelfSlider = $('.l-your-books__shelf .l-books'); + let shelfNextSlide = $('.l-your-books__shelf .js-next-slide'); + let shelfPrevSlide = $('.l-your-books__shelf .js-prev-slide'); + let shelfCollapse = $('.l-your-books__shelf .js-collapse'); + + shelfSlider.slick({ + slidesToScroll: 1, + slidesToShow: 4, + infinite: false, + dots: false, + arrows: false, + autoplay: false, + responsive: [ + { + breakpoint: 768, + settings: { + centerMode: false, + slidesToShow: 1 + } + } + ] + }); + + shelfNextSlide.on('click', function (event) { + event.preventDefault(); + shelfSlider.slick('slickNext'); + }); + + shelfPrevSlide.on('click', function (event) { + event.preventDefault(); + shelfSlider.slick('slickPrev'); + }); + + shelfCollapse.on('click', function (event) { + event.preventDefault(); + shelfSlider.slick('slickPrev'); + }); + + + $('.js-collections').each(function() { + //return; + let collectionsSlider = $('.l-books', this); + if (collectionsSlider.children().length < 2) return; + + // remove flexbox + collectionsSlider.css('display', 'block'); + + let collectionsNextSlide = $('.js-next-slide', this); + let collectionsPrevSlide = $('.js-prev-slide', this); + + collectionsSlider.slick({ + //prevArrow, nextArrow, + + slidesToScroll: 1, + slidesToShow: 1, + infinite: false, + dots: false, + arrows: false, + autoplay: false, + + swipeToSlide: true, + centerMode: false, + mobileFirst: true, + responsive: [ + { + breakpoint: 360 - .01, + settings: { + slidesToShow: 2, + } + }, + { + breakpoint: 520 - .01, + settings: { + slidesToShow: 3 + } + }, + { + breakpoint: 680 - .01, + settings: { + slidesToShow: 4 + } + }, + { + breakpoint: 840 - .01, + settings: { + slidesToShow: 5 + } + }, + { + breakpoint: 1172 - .01, + settings: { + slidesToShow: 5, + variableWidth: true, + } + }, + ] + }); + + collectionsNextSlide.on('click', function (event) { + event.preventDefault(); + collectionsSlider.slick('slickNext'); + }); + + collectionsPrevSlide.on('click', function (event) { + event.preventDefault(); + collectionsSlider.slick('slickPrev'); + }); + }); + let newBooksSlider = $('.js-new-books-slider .l-books'); + let newBooksNextSlide = $('.js-new-books-slider .js-next-slide'); + let newBooksPrevSlide = $('.js-new-books-slider .js-prev-slide'); + + newBooksSlider.slick({ + slidesToScroll: 1, + slidesToShow: 5, + infinite: false, + dots: false, + arrows: false, + autoplay: false, + responsive: [ + { + breakpoint: 768, + settings: { + centerMode: false, + slidesToShow: 2 + } + } + ] + }); + + newBooksNextSlide.on('click', function (event) { + event.preventDefault(); + newBooksSlider.slick('slickNext'); + }); + + newBooksPrevSlide.on('click', function (event) { + event.preventDefault(); + newBooksSlider.slick('slickPrev'); + }); +})(); + +// Quotes slider +(function () { + let slider = $('.l-author__quotes__slider'); + + slider.slick({ + slidesToScroll: 1, + slidesToShow: 1, + infinite: true, + dots: true, + arrows: false, + autoplay: true, + autoplaySpeed: 3000 + }); + + + let sliderHomepage = $('.l-quotes'); + sliderHomepage.slick({ + slidesToShow: 1, + centerMode: false, + infinite: true, + dots: true, + arrows: false, + autoplay: true, + autoplaySpeed: 4000, + }); + +})(); + + + + +// Carousel +(function () { + let slider = $('.p-homepage__info__box--carousel'); + + slider.slick({ + slidesToScroll: 1, + slidesToShow: 1, + infinite: true, + dots: true, + arrows: false, + autoplay: true, + autoplaySpeed: 5000 + }); + + + +})(); + + + +// Text overlay toggler +(function () { + let overlays = $('.l-article__overlay'); + let button = $('.l-article__read-more'); + + overlays.each(function () { + let maxHeight = $(this).attr('data-max-height'); + if($(this).outerHeight() > maxHeight) { + $(this).css({'maxHeight': maxHeight+'px'}).addClass('is-active'); + } else { + $(this).next('.l-article__read-more').hide(); + } + }); + + button.on('click', function() { + let dataLabel = $(this).attr('data-label'); + let dataAction = $(this).attr('data-action'); + $(this).parent().find('.l-article__overlay').toggleClass('is-clicked'); + if($(this).text() === dataLabel) { + $(this).text(dataAction); + } else { + $(this).text(dataLabel); + } + }); +})(); + +(function() { + $('.l-checkout__payments__box button').on('click', function() { + let container = $(this).closest('.l-checkout__payments'); + $('input', container).val($(this).val()); + $('.is-active', container).removeClass('is-active'); + $(this).closest('.l-checkout__payments__box').addClass('is-active'); + $('#kwota').val(''); + return false; + }); + +})(); + + +//Copy function +(function() { + let $copy = $('.js-copy'); + + $copy.on('click', function() { + let $copyText = $(this).closest('.l-checkout__info__item').find('input'); + $copyText.select(); + document.execCommand('copy'); + }); +})(); + + + +// Likes +(function() { + + ids = new Set(); + $(".icon-like").each( + (i, e)=>{ + ids.add($(e).attr('data-book')); + } + ); + ids = [...ids].join(','); + + state = { + liked: [], + }; + + $(document).on('click', '.icon-like', function(e) { + e.preventDefault(); + let liked = $(this).hasClass('icon-liked'); + $btn = $(this); + if (liked) { + $.post({ + url: '/ludzie/lektura/' + $(this).attr('data-book-slug') + '/nie_lubie/', + data: {'csrfmiddlewaretoken': $('[name=csrfmiddlewaretoken]').val()}, + success: function() { + delete state.liked[$btn.attr('data-book')]; + updateLiked($btn); + } + }) + } else { + $.post({ + url: '/ludzie/lektura/' + $(this).attr('data-book-slug') + '/lubie/', + data: {'csrfmiddlewaretoken': $('[name=csrfmiddlewaretoken]').val()}, + success: function() { + state.liked[$btn.attr('data-book')] = []; + updateLiked($btn); + }, + error: function(e) { + if (e.status == 403) { + $('#login-link').click(); + } + }, + }); + } + }) + + // TODO: DYNAMICALLY ADD + $(".add-set-tag input[name=name]").autocomplete({ + source: '/ludzie/moje-tagi/', + }).on('autocompleteopen', function() { + $(this).closest('article').addClass('ac-hover'); + }).on('autocompleteclose', function() { + $(this).closest('article').removeClass('ac-hover'); + }); + $(".add-set-tag").on("submit", function(e) { + e.preventDefault(); + let $form = $(this); + $.post({ + url: $form.attr("action"), + data: $form.serialize(), + success: (data) => { + updateFromData(data); + updateLikedAll(); + $('input[name=name]', $form).val(''); + } + }); + }) + + $(document).on("click", ".sets .close", function() { + let bookId = $(this).closest("[data-book]").attr('data-book'); + $.post({ + url: '/ludzie/usun-tag/', + data: { + csrfmiddlewaretoken: $("[name=csrfmiddlewaretoken]").val(), + book: bookId, + slug: $(this).parent().attr('data-set'), + }, + success: (data) => { + updateFromData(data); + updateLikedAll(); + } + }); + }) + + + function refreshAll(ids) { + $.ajax('/ludzie/ulubione/?ids=' + ids, { + success: function(result) { + updateFromData(result); + updateLikedAll(); + }, + }); + } + refreshAll(ids); + $.refreshLikes = refreshAll; + + function updateFromData(data) { + for (pk in data) { + if (data[pk] === null) { + delete state.liked[pk]; + } else { + state.liked[pk] = data[pk]; + } + } + } + + function updateLikedAll() { + $(".icon-like").each( + (i, e) => { + updateLiked(e); + } + ) + } + + function updateLiked(e) { + let bookId = $(e).attr('data-book'); + let liked = bookId in state.liked; + $(e).toggleClass('icon-liked', liked); + let $bookContainer = $('.book-container-' + bookId); + $bookContainer.toggleClass('book-liked', liked); + let $sets = $(".sets", $bookContainer); + $sets.empty(); + $.each(state.liked[bookId], (i,e) => { + let $set = $(""); + $set.attr("data-set", e.slug); + let $setA = $("").appendTo($set); + $setA.attr("href", e.url); + $setA.text(e.name); + let $setX = $("").appendTo($set); + $sets.append($set); + }); + } + +})(); + + + +// Toggle a class on long press. +(function() { + const TIME = 250; + let timer; + + $("[data-longpress]").on("touchstart", (e) => { + $e = $(e.currentTarget); + timer = setTimeout(() => { + $e.toggleClass($e.attr('data-longpress')); + }, TIME); + }); + + $("[data-longpress]").on("touchend", () => { + clearTimeout(timer); + }); +})(); + + + +// Update search form filters. +(function() { + $('.j-form-auto').each(function() { + let $form = $(this); + $('input', $form).change(function() {$form.submit()}); + $('select', $form).change(function() {$form.submit()}); + $('textarea', $form).change(function() {$form.submit()}); + }); + + + // experiments + $(".experiment input").on('change', function() { + let name = $(this).attr('name'); + let val = $(this).val(); + document.cookie = 'EXPERIMENT_' + name + '=' + val + '; path=/; max-age=31536000'; + window.location.reload(true); + }); + + $('.c-lang').on('click', function() { + !$(this).toggleClass('is-open'); + }); + + + + + + $(".c-media__settings > i").on('click', function() { + $(".c-media__settings").toggleClass('active'); + }); + +})(); diff --git a/src/wolnelektury/templates/2022/base.html b/src/wolnelektury/templates/2022/base.html deleted file mode 100644 index c31eb7819..000000000 --- a/src/wolnelektury/templates/2022/base.html +++ /dev/null @@ -1,66 +0,0 @@ - -{% load cache %} -{% load pipeline %} -{% load static %} -{% load funding_tags %} -{% load piwik_tags %} -{% load title %} - -{% block settings %} -{% endblock %} - - - - - - - {% if title %}{{ title }} | {% endif %}WolneLektury.pl - - - - - {% stylesheet '2022' %} - {% tracking_code %} - {% block extrahead %}{% endblock %} - - - {% include '2022/header.html' %} - - {% block under-menu %}{% endblock %} - - {% if not funding_no_show_current %} -
    - {% cache 120 funding_top_bar LANGUAGE_CODE %} - {% funding_top_bar_2022 %} - {% endcache %} -
    - {% endif %} - - {% block global-content %} -
    - -
    - -
    - {% block main %}{% endblock %} -
    - {% endblock %} - - {% block footer %} - {% include '2022/footer.html' %} - {% endblock %} - - - {% javascript '2022' %} - {% javascript '2022_player' %} - {% block extrabody %}{% endblock %} - {% include '2022/hotjar.html' %} - {% csrf_token %} - - diff --git a/src/wolnelektury/templates/2022/base_simple.html b/src/wolnelektury/templates/2022/base_simple.html deleted file mode 100644 index 481d81436..000000000 --- a/src/wolnelektury/templates/2022/base_simple.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "2022/base.html" %} - - -{% block main %} -
    - {% block body %} - {% block content %} -

    {{ title }}

    - {% block simple-content %}{% endblock %} - {% endblock %} - {% endblock %} -
    -{% endblock main %} diff --git a/src/wolnelektury/templates/2022/footer.html b/src/wolnelektury/templates/2022/footer.html deleted file mode 100644 index 777b55e65..000000000 --- a/src/wolnelektury/templates/2022/footer.html +++ /dev/null @@ -1,33 +0,0 @@ -{% load static %} - - diff --git a/src/wolnelektury/templates/2022/header.html b/src/wolnelektury/templates/2022/header.html deleted file mode 100644 index 4fa616d2c..000000000 --- a/src/wolnelektury/templates/2022/header.html +++ /dev/null @@ -1,106 +0,0 @@ -{% load cache %} -{% load static %} -{% load menu %} -{% load latest_blog_posts from blog %} -{% load preview_ad from catalogue_tags %} - - - -{% block under-menu %}{% endblock %} diff --git a/src/wolnelektury/templates/2022/hotjar.html b/src/wolnelektury/templates/2022/hotjar.html deleted file mode 100644 index a4cbd22f9..000000000 --- a/src/wolnelektury/templates/2022/hotjar.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/src/wolnelektury/templates/2022/main_page.html b/src/wolnelektury/templates/2022/main_page.html deleted file mode 100644 index 8a826e6e7..000000000 --- a/src/wolnelektury/templates/2022/main_page.html +++ /dev/null @@ -1,328 +0,0 @@ -{% extends "2022/base.html" %} -{% load static %} -{% load thumbnail %} -{% load catalogue_tags %} -{% load social_tags %} -{% load sponsors %} - -{% block under-menu %} - {% comment %} -
    -
    -
    -
    -

    Czytaj dalej

    -
    - -
    -
    -
    -

    Moja półka

    -
    - - -
    -
    - -
    -
    -
    - {% endcomment %} -{% endblock %} - -{% block global-content %} -
    - - {% if widget %} -

    {{ widget.description }}

    -
    - -
    - {% endif %} - - {% if recommended_collection %} -
    -
    - -
    - {% for book in recommended_collection.get_books %} - {% include 'catalogue/2022/book_box.html' %} - {% endfor %} -
    - -
    - -
    - {% endif %} - -
    -
    - -
    -
    - Dorzuć się! -
    -
    -

    - Nasze książki są dostępne dla tysięcy - dzieciaków dzięki darowiznom od - osób takich jak Ty! -

    - Dorzuć się! -
    -
    - -
    -
    - -
    -
    - {% for ambassador in ambassadors %} -
    - {% thumbnail ambassador.photo '100x100' crop="center" as ambphoto %} - {{ ambassador.name }} - {% endthumbnail %} -

    {{ ambassador.name }}

    -

    - {{ ambassador.text }} -

    -
    - {% endfor %} -
    - -
    - {% preview_ad_homepage %} -
    - -
    - -
    -
    -
    -
    - Dorzuć się! -
    -
    -

    - Wolne Lektury to lektury szkolne - i tysiące innych książek – za darmo - i bez rejestracji. -

    -

    Czytaj i słuchaj online, ściągaj na swój telefon lub komputer, dziel się z innymi.

    -

    Dla uczennic i uczniów dodajemy przypisy, motywy literackie, biogramy i geotagowanie.

    - Dowiedz się więcej -
    -
    -
    -
    -
    - Dorzuć się! -
    -
    -

    - Jesteśmy częścią ruchu wolnej kultury! -

    - Dowiedz się więcej -
    -
    -
    -
    - Dorzuć się! -
    -
    -

    - Jak budujemy najpopularniejszą bibliotekę online w Polsce -

    - Dowiedz się więcej -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -

    Nowości

    -
    - - -
    -
    -
    - {% for book in last_published %} - {% include 'catalogue/2022/book_box.html' %} - {% endfor %} -
    -
    -
    - -
    -
    -
    -
    -

    Bądź na bieżąco

    - -
    - - {% sponsor_page 'footer' %} - -
    -
    -
    - -{% endblock %} diff --git a/src/wolnelektury/templates/2022/paginate.html b/src/wolnelektury/templates/2022/paginate.html deleted file mode 100644 index 79ac19137..000000000 --- a/src/wolnelektury/templates/2022/paginate.html +++ /dev/null @@ -1,27 +0,0 @@ -{% if is_paginated %} -
    - {% if page_obj.has_previous %} - - - - {% endif %} -
      - {% for page in pages %} - {% if page %} - {% if page == page_obj.number %} -
    • {{ page }}
    • - {% else %} -
    • {{ page }}
    • - {% endif %} - {% else %} -
    • …
    • - {% endif %} - {% endfor %} -
    - {% if page_obj.has_next %} - - - - {% endif %} -
    -{% endif %} diff --git a/src/wolnelektury/templates/2022/user_actions.html b/src/wolnelektury/templates/2022/user_actions.html deleted file mode 100644 index 28ea5e726..000000000 --- a/src/wolnelektury/templates/2022/user_actions.html +++ /dev/null @@ -1,40 +0,0 @@ -{% load static %} - -{% if request.user.is_authenticated %} - -
    - -
    - - {% if request.user.is_staffs %} - - {% elif request.user.membership %} - - {% else %} - - {% endif %} - -{% else %} - -{% endif %} diff --git a/src/wolnelektury/templates/404.html b/src/wolnelektury/templates/404.html index 372c94118..b2bc74c2c 100644 --- a/src/wolnelektury/templates/404.html +++ b/src/wolnelektury/templates/404.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% load i18n %} {% block settings %} diff --git a/src/wolnelektury/templates/account/base.html b/src/wolnelektury/templates/account/base.html index 5f9693d51..40c1de9e7 100644 --- a/src/wolnelektury/templates/account/base.html +++ b/src/wolnelektury/templates/account/base.html @@ -1,4 +1,4 @@ -{% extends "2022/base_simple.html" %} +{% extends "base_simple.html" %} {% block body %}
    diff --git a/src/wolnelektury/templates/base.html b/src/wolnelektury/templates/base.html new file mode 100644 index 000000000..713a5b559 --- /dev/null +++ b/src/wolnelektury/templates/base.html @@ -0,0 +1,66 @@ + +{% load cache %} +{% load pipeline %} +{% load static %} +{% load funding_tags %} +{% load piwik_tags %} +{% load title %} + +{% block settings %} +{% endblock %} + + + + + + + {% if title %}{{ title }} | {% endif %}WolneLektury.pl + + + + + {% stylesheet 'main' %} + {% tracking_code %} + {% block extrahead %}{% endblock %} + + + {% include 'header.html' %} + + {% block under-menu %}{% endblock %} + + {% if not funding_no_show_current %} +
    + {% cache 120 funding_top_bar LANGUAGE_CODE %} + {% funding_top_bar %} + {% endcache %} +
    + {% endif %} + + {% block global-content %} +
    + +
    + +
    + {% block main %}{% endblock %} +
    + {% endblock %} + + {% block footer %} + {% include 'footer.html' %} + {% endblock %} + + + {% javascript 'main' %} + {% javascript 'player' %} + {% block extrabody %}{% endblock %} + {% include 'hotjar.html' %} + {% csrf_token %} + + diff --git a/src/wolnelektury/templates/base_simple.html b/src/wolnelektury/templates/base_simple.html new file mode 100644 index 000000000..01d89b960 --- /dev/null +++ b/src/wolnelektury/templates/base_simple.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + + +{% block main %} +
    + {% block body %} + {% block content %} +

    {{ title }}

    + {% block simple-content %}{% endblock %} + {% endblock %} + {% endblock %} +
    +{% endblock main %} diff --git a/src/wolnelektury/templates/footer.html b/src/wolnelektury/templates/footer.html new file mode 100644 index 000000000..777b55e65 --- /dev/null +++ b/src/wolnelektury/templates/footer.html @@ -0,0 +1,33 @@ +{% load static %} + + diff --git a/src/wolnelektury/templates/forms/form_detail.html b/src/wolnelektury/templates/forms/form_detail.html index 32df9d05f..c94d70244 100644 --- a/src/wolnelektury/templates/forms/form_detail.html +++ b/src/wolnelektury/templates/forms/form_detail.html @@ -1,4 +1,4 @@ -{% extends form.base_template|default:"2022/base.html" %} +{% extends form.base_template|default:"base.html" %} {% load forms_builder_tags %} {% load title %} diff --git a/src/wolnelektury/templates/forms/form_sent.html b/src/wolnelektury/templates/forms/form_sent.html index ee4cc1f07..515a643ea 100644 --- a/src/wolnelektury/templates/forms/form_sent.html +++ b/src/wolnelektury/templates/forms/form_sent.html @@ -1,4 +1,4 @@ -{% extends form.base_template|default:"2022/base_simple.html" %} +{% extends form.base_template|default:"base_simple.html" %} {% load forms_builder_tags %} {% load title %} {% load i18n %} diff --git a/src/wolnelektury/templates/header.html b/src/wolnelektury/templates/header.html new file mode 100644 index 000000000..225672487 --- /dev/null +++ b/src/wolnelektury/templates/header.html @@ -0,0 +1,109 @@ +{% load cache %} +{% load static %} +{% load menu %} +{% load latest_blog_posts from blog %} +{% load preview_ad from catalogue_tags %} + + + +{% block under-menu %}{% endblock %} diff --git a/src/wolnelektury/templates/hotjar.html b/src/wolnelektury/templates/hotjar.html new file mode 100644 index 000000000..a4cbd22f9 --- /dev/null +++ b/src/wolnelektury/templates/hotjar.html @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/src/wolnelektury/templates/lang-switcher.html b/src/wolnelektury/templates/lang-switcher.html new file mode 100644 index 000000000..ea59d9f2a --- /dev/null +++ b/src/wolnelektury/templates/lang-switcher.html @@ -0,0 +1,20 @@ +{% comment %} +{% load i18n %} +
    +
    + + {{ LANGUAGE_CODE|language_name_local }} + +
    +
    + {% csrf_token %} +
    + {% for lang in LANGUAGES %} + + {% endfor %} +
    +
    +
    +{% endcomment %} diff --git a/src/wolnelektury/templates/main_page.html b/src/wolnelektury/templates/main_page.html new file mode 100644 index 000000000..386ebe620 --- /dev/null +++ b/src/wolnelektury/templates/main_page.html @@ -0,0 +1,328 @@ +{% extends "base.html" %} +{% load static %} +{% load thumbnail %} +{% load catalogue_tags %} +{% load social_tags %} +{% load sponsors %} + +{% block under-menu %} + {% comment %} +
    +
    +
    +
    +

    Czytaj dalej

    +
    + +
    +
    +
    +

    Moja półka

    +
    + + +
    +
    + +
    +
    +
    + {% endcomment %} +{% endblock %} + +{% block global-content %} +
    + + {% if widget %} +

    {{ widget.description }}

    +
    + +
    + {% endif %} + + {% if recommended_collection %} +
    +
    + +
    + {% for book in recommended_collection.get_books %} + {% include 'catalogue/book_box.html' %} + {% endfor %} +
    + +
    + +
    + {% endif %} + +
    +
    + +
    +
    + Dorzuć się! +
    +
    +

    + Nasze książki są dostępne dla tysięcy + dzieciaków dzięki darowiznom od + osób takich jak Ty! +

    + Dorzuć się! +
    +
    + +
    +
    + +
    +
    + {% for ambassador in ambassadors %} +
    + {% thumbnail ambassador.photo '100x100' crop="center" as ambphoto %} + {{ ambassador.name }} + {% endthumbnail %} +

    {{ ambassador.name }}

    +

    + {{ ambassador.text }} +

    +
    + {% endfor %} +
    + +
    + {% preview_ad_homepage %} +
    + +
    + +
    +
    +
    +
    + Dorzuć się! +
    +
    +

    + Wolne Lektury to lektury szkolne + i tysiące innych książek – za darmo + i bez rejestracji. +

    +

    Czytaj i słuchaj online, ściągaj na swój telefon lub komputer, dziel się z innymi.

    +

    Dla uczennic i uczniów dodajemy przypisy, motywy literackie, biogramy i geotagowanie.

    + Dowiedz się więcej +
    +
    +
    +
    +
    + Dorzuć się! +
    +
    +

    + Jesteśmy częścią ruchu wolnej kultury! +

    + Dowiedz się więcej +
    +
    +
    +
    + Dorzuć się! +
    +
    +

    + Jak budujemy najpopularniejszą bibliotekę online w Polsce +

    + Dowiedz się więcej +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +

    Nowości

    +
    + + +
    +
    +
    + {% for book in last_published %} + {% include 'catalogue/book_box.html' %} + {% endfor %} +
    +
    +
    + +
    +
    +
    +
    +

    Bądź na bieżąco

    + +
    + + {% sponsor_page 'footer' %} + +
    +
    +
    + +{% endblock %} diff --git a/src/wolnelektury/templates/pagination/pagination.html b/src/wolnelektury/templates/pagination/pagination.html index 460932127..79ac19137 100644 --- a/src/wolnelektury/templates/pagination/pagination.html +++ b/src/wolnelektury/templates/pagination/pagination.html @@ -1,27 +1,27 @@ -{% load i18n %} - {% if is_paginated %} -