Merge branch 'main' into 9548-ci-warnings
This commit is contained in:
Коммит
19567f0add
|
@ -96,7 +96,13 @@ jobs:
|
|||
black . --check
|
||||
- name: Run HTML linting
|
||||
run: |
|
||||
djlint . --check
|
||||
# Skipping djlint format checking because it has consistency issues and issues with blocktrans.
|
||||
# This should change when formatting is moved to a version using and AST.
|
||||
# See also: https://github.com/Riverside-Healthcare/djLint/issues/493
|
||||
# djlint . --check
|
||||
#
|
||||
# Using djhtml indent check in the meantime.
|
||||
djhtml -c maintenance/ network-api/
|
||||
djlint . --lint
|
||||
continue-on-error: true
|
||||
- name: Run type checks
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
black
|
||||
coveralls
|
||||
django-debug-toolbar
|
||||
djhtml
|
||||
djlint
|
||||
flake8
|
||||
isort
|
||||
|
|
|
@ -46,6 +46,8 @@ django==3.2.16
|
|||
# django-debug-toolbar
|
||||
django-debug-toolbar==3.5.0
|
||||
# via -r dev-requirements.in
|
||||
djhtml==1.5.2
|
||||
# via -r dev-requirements.in
|
||||
djlint==1.19.7
|
||||
# via -r dev-requirements.in
|
||||
docopt==0.6.2
|
||||
|
|
|
@ -227,7 +227,7 @@ The `docker-compose.yml` file describes the 3 services that the project needs to
|
|||
#### Useful commands using Django with Docker
|
||||
|
||||
To open a terminal session inside the docker container (`docker container ls` to see active docker container ids):
|
||||
`docker exec it {docker-container-id} bash`
|
||||
`docker exec -it {docker-container-id} bash`
|
||||
Activate the python environment:
|
||||
`source dockerpythonvenv/bin/activate`
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
# Generated by Django 3.2.16 on 2023-01-17 17:03
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("events", "0001_add_tito_event_snippet"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="titoevent",
|
||||
options={"ordering": ["title"]},
|
||||
),
|
||||
]
|
|
@ -20,3 +20,6 @@ class TitoEvent(models.Model):
|
|||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
class Meta:
|
||||
ordering = ["title"]
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<div class="row">
|
||||
<div class="col">
|
||||
<div id="pni-category-wrapper" class="tw-flex tw-items-center ">
|
||||
<div id="buyersguide-category-link-container" class="tw-flex tw-items-center tw-w-4/5 tw-overflow-x-auto tw-no-scrollbar tw-mr-4">
|
||||
<div id="buyersguide-category-link-container" class="tw-flex tw-items-center tw-w-full large:tw-w-4/5 tw-overflow-x-auto tw-mr-4">
|
||||
<a class="multipage-link tw-block {% if show_all_reviews_as_active_category %} active {% endif %}" data-name="None" data-mobile="{% trans "All Categories" %}" href="{% relocalized_url home_page.localized.url %}">{% trans "All Reviews" %}</a>
|
||||
{% for cat in categories %}
|
||||
{% with original=cat.original %}
|
||||
|
|
|
@ -56,11 +56,11 @@
|
|||
<div class="tw-w-full">
|
||||
<div id="sticky-bar" class="creepiness-slider bg-white text-center tw-justify-center creep-o-meter-moved search-active">
|
||||
<div class="creep-o-meter-information tw-flex tw-items-center tw-whitespace-nowrap">
|
||||
<div class="speech-bubble-container tw-inline-block tw-mr-4">
|
||||
<div class="speech-bubble tw-relative tw-inline-block tw-whitespace-normal tw-text-left tw-bg-gradient-to-t tw-from-purple-05 tw-to-blue-05">
|
||||
<div class="speech-bubble-container tw-inline-block tw-mr-4 tw-max-w-[280px]">
|
||||
<div class="speech-bubble tw-relative tw-inline-block tw-whitespace-normal tw-bg-gradient-to-t tw-from-purple-05 tw-to-blue-05">
|
||||
<p class="text tw-text-base tw-mb-0">
|
||||
{% blocktrans trimmed %}
|
||||
Scroll to see how creepy <br/> people find these products!
|
||||
Scroll to see how creepy people find these products!
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -9,9 +9,10 @@
|
|||
We render the featured CTA only once into the markup if one exists.
|
||||
The categories only have a toggle to define if the featured CTA should be shown when the page is filtered for the category.
|
||||
The "current category" is the one the page is first loaded with. We show the CTA immediately if that category would, otherwise the CTA is initially hidden.
|
||||
JS needs to handle the show and hide of the CTA when the active category is changed with JS. The data attribute contains the information for which categories the CTA should be shown.
|
||||
JS is used to handle the show and hide of the CTA when the active category is changed. The data attribute contains the information for which categories the CTA should be shown.
|
||||
{% endcomment %}
|
||||
<div
|
||||
id="category-featured-cta"
|
||||
class="tw-col-span-2 tw-flex tw-flex-row tw-w-full {% if not current_category.show_cta %} tw-hidden {% endif %}"
|
||||
data-show-for-categories="{% for category in categories %}{% if category.show_cta %}{{ category.name }}, {% endif %}{% endfor %}"
|
||||
>
|
||||
|
|
|
@ -57,6 +57,7 @@ class DonationModal(TranslatableMixin, models.Model):
|
|||
return self.name
|
||||
|
||||
class Meta(TranslatableMixin.Meta):
|
||||
ordering = ["name"]
|
||||
verbose_name_plural = "Donation CTA"
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
# Generated by Django 3.2.16 on 2023-01-17 17:03
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("wagtailpages", "0074_remove_productpage_airtable_record_id"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="blogpagetopic",
|
||||
options={
|
||||
"ordering": ["name"],
|
||||
"verbose_name": "Blog Page Topic",
|
||||
"verbose_name_plural": "Blog Page Topics",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="buyersguidecalltoaction",
|
||||
options={
|
||||
"ordering": ["title"],
|
||||
"verbose_name": "Buyers Guide Call To Action",
|
||||
"verbose_name_plural": "Buyers Guide Call To Actions",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="buyersguidecontentcategory",
|
||||
options={
|
||||
"ordering": ["title"],
|
||||
"verbose_name": "Buyers Guide Content Category",
|
||||
"verbose_name_plural": "Buyers Guide Content Categories",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="callpower",
|
||||
options={"ordering": ["name"], "verbose_name": "Callpower"},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="donationmodal",
|
||||
options={"ordering": ["name"], "verbose_name_plural": "Donation CTA"},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="focusarea",
|
||||
options={"ordering": ["name"], "verbose_name": "Area of focus", "verbose_name_plural": "Areas of focus"},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="profile",
|
||||
options={"ordering": ["name"]},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="pulsefilter",
|
||||
options={"ordering": ["name"]},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="researchregion",
|
||||
options={"ordering": ["name"]},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="researchtopic",
|
||||
options={"ordering": ["name"]},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="signup",
|
||||
options={"ordering": ["name"], "verbose_name": "Signup"},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="update",
|
||||
options={
|
||||
"ordering": ["title"],
|
||||
"verbose_name": "Buyers Guide Product Update",
|
||||
"verbose_name_plural": "Buyers Guide Product Updates",
|
||||
},
|
||||
),
|
||||
]
|
|
@ -545,6 +545,7 @@ class FocusArea(TranslatableMixin, models.Model):
|
|||
return self.name
|
||||
|
||||
class Meta(TranslatableMixin.Meta):
|
||||
ordering = ["name"]
|
||||
verbose_name = "Area of focus"
|
||||
verbose_name_plural = "Areas of focus"
|
||||
|
||||
|
|
|
@ -66,5 +66,6 @@ class BlogPageTopic(TranslatableMixin, models.Model):
|
|||
return self.name
|
||||
|
||||
class Meta(TranslatableMixin.Meta):
|
||||
ordering = ["name"]
|
||||
verbose_name = "Blog Page Topic"
|
||||
verbose_name_plural = "Blog Page Topics"
|
||||
|
|
|
@ -66,6 +66,7 @@ class BuyersGuideCallToAction(index.Indexed, TranslatableMixin, LocalizedSnippet
|
|||
]
|
||||
|
||||
class Meta(TranslatableMixin.Meta):
|
||||
ordering = ["title"]
|
||||
verbose_name = "Buyers Guide Call To Action"
|
||||
verbose_name_plural = "Buyers Guide Call To Actions"
|
||||
|
||||
|
|
|
@ -404,6 +404,7 @@ class Update(TranslatableMixin, index.Indexed, models.Model):
|
|||
return self.title
|
||||
|
||||
class Meta(TranslatableMixin.Meta):
|
||||
ordering = ["title"]
|
||||
verbose_name = "Buyers Guide Product Update"
|
||||
verbose_name_plural = "Buyers Guide Product Updates"
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ class BuyersGuideContentCategory(wagtail_models.TranslatableMixin, models.Model)
|
|||
]
|
||||
|
||||
class Meta(wagtail_models.TranslatableMixin.Meta):
|
||||
ordering = ["title"]
|
||||
verbose_name = "Buyers Guide Content Category"
|
||||
verbose_name_plural = "Buyers Guide Content Categories"
|
||||
unique_together = wagtail_models.TranslatableMixin.Meta.unique_together + [
|
||||
|
|
|
@ -108,7 +108,8 @@ class Callpower(TranslatableMixin, CTA):
|
|||
]
|
||||
|
||||
class Meta(TranslatableMixin.Meta):
|
||||
verbose_name = "callpower snippet"
|
||||
ordering = ["name"]
|
||||
verbose_name = "Callpower"
|
||||
|
||||
|
||||
@register_snippet
|
||||
|
@ -131,7 +132,8 @@ class Signup(TranslatableMixin, CTA):
|
|||
]
|
||||
|
||||
class Meta(TranslatableMixin.Meta):
|
||||
verbose_name = "signup snippet"
|
||||
ordering = ["name"]
|
||||
verbose_name = "Signup"
|
||||
|
||||
|
||||
class OpportunityPage(MiniSiteNameSpace):
|
||||
|
|
|
@ -58,3 +58,6 @@ class Profile(TranslatableMixin, models.Model):
|
|||
def save(self, *args, **kwargs):
|
||||
self.slug = slugify(f"{self.name}-{str(self.id)}")
|
||||
super(Profile, self).save(*args, **kwargs)
|
||||
|
||||
class Meta(TranslatableMixin.Meta):
|
||||
ordering = ["name"]
|
||||
|
|
|
@ -36,6 +36,9 @@ class PulseFilter(ClusterableModel):
|
|||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class Meta(ClusterableModel.Meta):
|
||||
ordering = ["name"]
|
||||
|
||||
|
||||
class PulseFilterOption(models.Model):
|
||||
pulse_filter = ParentalKey(
|
||||
|
|
|
@ -15,6 +15,9 @@ class ResearchRegion(wagtail_models.TranslatableMixin, models.Model):
|
|||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class Meta(wagtail_models.TranslatableMixin.Meta):
|
||||
ordering = ["name"]
|
||||
|
||||
|
||||
@snippet_models.register_snippet
|
||||
class ResearchTopic(wagtail_models.TranslatableMixin, models.Model):
|
||||
|
@ -28,3 +31,6 @@ class ResearchTopic(wagtail_models.TranslatableMixin, models.Model):
|
|||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class Meta(wagtail_models.TranslatableMixin.Meta):
|
||||
ordering = ["name"]
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block slides %}
|
||||
<div class="swiper-wrapper">
|
||||
<div class="swiper-wrapper tw-items-stretch">
|
||||
{% for current_event in self.current_events %}
|
||||
{% image current_event.value.image fill-445x185 as img %}
|
||||
<div class="swiper-slide">
|
||||
<div class="swiper-slide tw-h-auto">
|
||||
{% include 'fragments/event_card.html' with title=current_event.value.title category_url=current_event.value.subheading_link.0.value.link_url category_title=current_event.value.subheading_link.0.value.label buttons=current_event.value.buttons image=img.url text=current_event.value.body %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -83,7 +83,7 @@
|
|||
"chart.js": "3.5.1",
|
||||
"classnames": "2.3.2",
|
||||
"countup.js": "^2.3.2",
|
||||
"cssnano": "^5.0.8",
|
||||
"cssnano": "^5.1.14",
|
||||
"esbuild": "^0.12.24",
|
||||
"event-stream": "3.3.4",
|
||||
"gsap": "^3.11.4",
|
||||
|
|
|
@ -67,6 +67,7 @@ django==3.2.16
|
|||
# wagtail-footnotes
|
||||
# wagtail-localize
|
||||
# wagtail-localize-git
|
||||
# wagtailmedia
|
||||
django-admin-sortable==2.3
|
||||
# via -r requirements.in
|
||||
django-cors-headers==3.13.0
|
||||
|
@ -253,7 +254,7 @@ wagtail-localize-git==0.13.0
|
|||
# via -r requirements.in
|
||||
wagtail-metadata==3.5.0
|
||||
# via -r requirements.in
|
||||
wagtailmedia==0.9.0
|
||||
wagtailmedia==0.12.0
|
||||
# via -r requirements.in
|
||||
webencodings==0.5.1
|
||||
# via html5lib
|
||||
|
|
|
@ -18,3 +18,5 @@ const NewsletterBox = {
|
|||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default NewsletterBox;
|
||||
|
|
|
@ -231,6 +231,7 @@ export class SearchFilter {
|
|||
toggleProductReviewView();
|
||||
toggleCategoryRelatedArticles(category);
|
||||
Utils.showProductsForCategory(category);
|
||||
Utils.toggleCtaForCategory(category);
|
||||
this.categoryTitle.value = category;
|
||||
Utils.sortProductCards();
|
||||
Utils.moveCreepyFace();
|
||||
|
|
|
@ -260,6 +260,22 @@ export class Utils {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ...
|
||||
* @param {*} category
|
||||
*/
|
||||
static toggleCtaForCategory(category) {
|
||||
const categoryPageCta = document.getElementById("category-featured-cta");
|
||||
const categoriesWithShowCtaEnabled =
|
||||
categoryPageCta.dataset.showForCategories;
|
||||
|
||||
if (categoriesWithShowCtaEnabled.includes(category)) {
|
||||
categoryPageCta.classList.remove("tw-hidden");
|
||||
} else {
|
||||
categoryPageCta.classList.add("tw-hidden");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ...
|
||||
* @param {*} product
|
||||
|
|
|
@ -94,9 +94,9 @@ export default () => {
|
|||
document
|
||||
.querySelector("#buyersguide-category-link-container")
|
||||
.classList.remove(
|
||||
"tw-w-4/5",
|
||||
"tw-w-full",
|
||||
"large:tw-w-4/5",
|
||||
"tw-overflow-x-auto",
|
||||
"tw-no-scrollbar",
|
||||
"tw-mr-4"
|
||||
);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ class Carousel {
|
|||
centeredSlides: false,
|
||||
simulateTouch: true,
|
||||
slidesPerView: 1,
|
||||
autoHeight: true,
|
||||
autoHeight: false,
|
||||
keyboard: {
|
||||
enabled: true,
|
||||
},
|
||||
|
|
|
@ -243,7 +243,7 @@ body {
|
|||
background-position: right 60%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -14px;
|
||||
right: -12px;
|
||||
width: 14px;
|
||||
height: 100%;
|
||||
}
|
||||
|
|
35
tasks.py
35
tasks.py
|
@ -300,7 +300,13 @@ def lint(ctx):
|
|||
@task
|
||||
def lint_html(ctx):
|
||||
"""Run HTML linting."""
|
||||
djlint_check(ctx)
|
||||
# Skipping djlint format checking because it has consistency issues and issues with blocktrans.
|
||||
# This should change when formatting is moved to a version using and AST.
|
||||
# See also: https://github.com/Riverside-Healthcare/djLint/issues/493
|
||||
# djlint_check(ctx)
|
||||
#
|
||||
# Use djhtml indent checking until format checking with djlint becomes possible.
|
||||
djhtml_check(ctx)
|
||||
djlint_lint(ctx)
|
||||
|
||||
|
||||
|
@ -337,7 +343,13 @@ def format(ctx):
|
|||
@task
|
||||
def format_html(ctx):
|
||||
"""Run HTML formatting."""
|
||||
djlint_format(ctx)
|
||||
# Skipping djlint formatting because it has consistency issues and issues with blocktrans.
|
||||
# This should change when formatting is moved to a version using and AST.
|
||||
# See also: https://github.com/Riverside-Healthcare/djLint/issues/493
|
||||
# djlint_format(ctx)
|
||||
#
|
||||
# Indent HTML until full formatting with djlint becomes possible
|
||||
djhtml_format(ctx)
|
||||
|
||||
|
||||
@task
|
||||
|
@ -373,6 +385,25 @@ def black_check(ctx):
|
|||
black(ctx, ". --check")
|
||||
|
||||
|
||||
@task(help={"args": "Override the arguments passed to djhtml."})
|
||||
def djhtml(ctx, args=None):
|
||||
"""Run djhtml code indenter."""
|
||||
args = args or "-h"
|
||||
pyrun(ctx, command=f"djhtml {args}")
|
||||
|
||||
|
||||
@task
|
||||
def djhtml_check(ctx):
|
||||
"""Run djhtml code indenter in check mode."""
|
||||
djhtml(ctx, args="-c maintenance/ network-api/")
|
||||
|
||||
|
||||
@task
|
||||
def djhtml_format(ctx):
|
||||
"""Run djhtml code indenter in formatting mode."""
|
||||
djhtml(ctx, args="-i maintenance/ network-api/")
|
||||
|
||||
|
||||
@task(help={"args": "Override the arguments passed to djlint."})
|
||||
def djlint(ctx, args=None):
|
||||
"""Run djlint code formatter and linter."""
|
||||
|
|
Загрузка…
Ссылка в новой задаче