+
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.contrib import admin
from django.db.models.functions import Now
from django.db.models import Q
+from django import forms
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
q = Q(expires_at__isnull=False, expires_at__lt=Now())
+class ScheduleForm(forms.ModelForm):
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.fields['email'].required = False
+ self.fields['method'].required = False
+ self.fields['consent'].required = False
+
+ class Meta:
+ model = models.Schedule
+ fields = '__all__'
+
+
class ScheduleAdmin(admin.ModelAdmin):
+ form = ScheduleForm
+
list_display = [
'email', 'started_at', 'payed_at', 'expires_at', 'amount', 'monthly', 'yearly', 'is_cancelled',
'method'
]
+ list_display_links = ['email', 'started_at']
search_fields = ['email']
list_filter = ['is_cancelled', 'monthly', 'yearly', 'method', PayedFilter, ExpiredFilter, 'source']
filter_horizontal = ['consent']
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %}
{% load i18n %}
{% load active_schedule from club %}
{% load chunks %}
{% block body %}
- <div class="white-box normal-text">
- <h1>{% trans "Wolne Lektury need your help!" %}</h1>
+ <h1>{% trans "Wolne Lektury need your help!" %}</h1>
+ <div class="white-box normal-text">
{% chunk 'club' %}
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %}
{% load i18n %}
{% block body %}
-<div class="white-box normal-text">
<h1>
Cieszymy się, że jesteś z nami! Dziękujemy za wsparcie!
</h1>
- <p>
+ <div class="white-box normal-text">
+ <p>
{% if schedule.payed_at %}
--- /dev/null
+{% load i18n %}
+{% load sorl_thumbnail %}
+
+<article class="l-books__item" data-pop="-{{ book.popularity.count }}">
+ <figure class="l-books__item__img" style="height:240px">
+ <a href="{{ funding.get_absolute_url }}">
+ {% if funding.cover %}
+ <img src="{{ funding.cover.url }}" alt="{{ funding.title }}">
+ {% endif %}
+ </a>
+ </figure>
+ <div class="l-books__item__actions">
+ <div class="l-checkout__support__bar">
+ {% with funding.basic_info as info %}
+ <span class="{% if info.percentage < 15 %}little-progress{% endif %}" style="width: {{ info.percentage|stringformat:'.2f' }}%;"></span>
+ {% endwith %}
+ </div>
+ </div>
+ <h3>
+ {{ funding.author }}
+ </h3>
+ <h2><a href="{{ funding.get_absolute_url }}">{{ funding.title }}</a></h2>
+</article>
<div class="l-article__overlay" data-max-height="91">
{{ object.status }}
{{ object.status_more }}
+ {% chunk 'funding_rules' %}
</div>
<button class="l-article__read-more" aria-label="Kliknij aby rozwinąć" data-label="Więcej" data-action="Mniej">Więcej</button>
</div>
{% fundings object %}
</article>
- {# pomóż uwolnić #}
{# 1% #}
{# share? #}
-
{% endblock %}
--- /dev/null
+{% extends '2022/base.html' %}
+
+
+{% block settings %}
+ {% load title %}
+ {% title 'X' %}
+{% endblock %}
+
+
+{% block main %}
+ <div class="l-section">
+ <div class="l-books__header">
+ <div class="l-books__input">
+ <i class="icon icon-filter"></i>
+ <input type="text" placeholder="filtry, tytuł" class="quick-filter" data-for="book-list">
+ </div>
+ </div>
+ </div>
+
+
+ <div class="l-section l-section--col">
+ <div class="l-books__grid" id="book-list">
+ {% for funding in object_list %}
+ {% include "funding/2022/includes/funding_box.html" %}
+ {% endfor %}
+ </div>
+ </div>
+
+{% endblock %}
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %}
{% load i18n %}
{% load fnp_share %}
-{% block titleextra %}{% trans "Payment failed" %}{% endblock %}
+{% block titleextra %}{% trans "Disable notifications" %}{% endblock %}
{% block body %}
<h1>{% trans "Disable notifications" %}</h1>
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %}
{% load i18n %}
{% load fnp_share %}
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %}
{% load i18n %}
{% load fnp_share %}
{% load polls_tags %}
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %}
{% load i18n %}
{% block titleextra %}{% trans "Remaining funds" %}{% endblock %}
class OfferListView(ListView):
queryset = Offer.public()
+ def get_template_names(self):
+ if self.request.EXPERIMENTS['layout'].value:
+ return 'funding/2022/offer_list.html'
+ return 'funding/offer_list.html'
+
def get_context_data(self, **kwargs):
ctx = super(OfferListView, self).get_context_data(**kwargs)
ctx['funding_no_show_current'] = True
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %}
{% load i18n %}
+{% block settings %}
+ {% load title %}
+ {% trans 'Library directories' as title %}
+ {% title title %}
+{% endblock %}
+
+{% block breadcrumbs %}
+ <a href="{% url 'libraries_main_view' %}"><span>{% trans 'Libraries directory' %}</span></a>
+{% endblock %}
+
{% block titleextra %}{% trans 'Libraries directory' %}{% endblock %}
</ul>
</div>
</div>
-{% endblock %}
\ No newline at end of file
+{% endblock %}
-{% extends "base/base.html" %}\r
+{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %}\r
{% load i18n %}\r
\r
+{% block settings %}\r
+ {% load title %}\r
+ {% title library.name %}\r
+{% endblock %}\r
+\r
+{% block breadcrumbs %}\r
+ <a href="{% url 'libraries_main_view' %}"><span>{% trans 'Libraries directory' %}</span></a>\r
+ <a href="{{ library.catalog.get_absolute_url }}"><span>{{ library.catalog.name }}</span></a>\r
+{% endblock %}\r
+\r
{% block titleextra %}{{ library.name }}{% endblock %}\r
\r
{% block body %}\r
<p>Adres strony www: <a href="{{library.url}}">{{library.url}}</a></p>\r
{% autoescape off %}{{library.description}}{% endautoescape%}\r
</div>\r
-{% endblock %}
\ No newline at end of file
+{% endblock %}\r
-{% extends "base/base.html" %}\r
+{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %}\r
{% load i18n %}\r
\r
+{% block settings %}\r
+ {% load title %}\r
+ {% trans 'Library directories' as title %}\r
+ {% title title %}\r
+{% endblock %}\r
+\r
{% block titleextra %}{% trans 'Library directories' %}{% endblock %}\r
\r
{% block body %}\r
</ul>\r
</div>\r
</div>\r
-{% endblock %}
\ No newline at end of file
+{% endblock %}\r
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %}
{% load i18n %}
{% load polls_tags %}
{% block body %}
+ <h1>Ankieta</h1>
<div class="normal-text">
{% if voted_already %}
<p class="poll-msg">{% trans "Thanks for voting! You can see current results below." %}</p>
{% endif %}
{% poll poll %}
</div>
-{% endblock %}
\ No newline at end of file
+{% endblock %}
{% endif %}
{% else %}
<div class="poll">
- <p>{{poll.question}}</p>
+ <p>{{poll.question}}</p>
+ <br>
<form action="{{poll.get_absolute_url}}" method="post">{% csrf_token %}
{{ form.vote }}
<input type="submit" value="{% trans "Submit" %}" />
}
}
+.l-checkout__support__bar {
+ overflow: hidden;
+}
+
.l-change-pop {
margin-bottom: 18px;
background: #92BD39;
}
}
+
+
+.poll-bar {
+ height: 10px;
+ width: 100%;
+ display: block;
+ border-radius: 5px;
+ position: relative;
+ overflow: hidden;
+
+ .poll-bar-inner {
+ height: 100%;
+ position: absolute;
+ border-radius: 5px;
+ background-color: #006066;
+ top: 0; left: 0;
+ }
+}