Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1675] Added extra_css field to SiteConfiguration and master template #740

Merged
merged 4 commits into from
Aug 28, 2023

Conversation

Bartvaderkin
Copy link
Contributor

@Bartvaderkin Bartvaderkin commented Aug 21, 2023

Including @jiromaykin because I did some SCSS.

@Bartvaderkin Bartvaderkin force-pushed the feature/1675-css-override-admin branch from 9b38dfe to 503eb8a Compare August 22, 2023 12:16
@Bartvaderkin Bartvaderkin marked this pull request as ready for review August 22, 2023 14:02
Copy link
Contributor

@jiromaykin jiromaykin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! And also: nicely hidden and hard to find, only for advanced users :-)

src/open_inwoner/configurations/admin.py Show resolved Hide resolved
grid-column-gap: 2em;
&__column {
font-family: monospace;
font-size: 95%;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for this 5% decrease? I can barely tell the difference from looking at the screen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make it slightly smaller because monospace is so chonky.

"""
split `iterable `in parts of `chunk_size` length

implements Python 3.12 itertools.batched()
Copy link
Contributor

@pi-sigma pi-sigma Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Cool, but is there a reason for not simply copying over the function definition from Python 3.12?

  • If we do type annotations, they should be consistent I think. So either def batched(iterable: Iterable, chunk_size: int) or def batched(iterable, n), letting the n speak for itself (see the docs).

  • Perhaps a different name for the module to avoid confusion with the inbuilt itertools?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This seems good enough. We should update python in general but that is out of scope.
  • I updated the type hint, with generics
  • I renamed the module to iteration


def test_clean_stylesheet_allows_any_string(self):
"""
proofs we need to escape this if we print in html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean "proves"?

It's good to know that we need to do this, hence it should be documented. But what's the point of proving it via a test? I would prefer to have this information included in the docstring of utils.clean_stylesheet, where it's more prominent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

The problem with comments about code behaviour is they go stale.

@Bartvaderkin
Copy link
Contributor Author

@jiromaykin You've marked yourself as 'requested changes' here but I don't see any requests. Did you meant to just add a comment?

@jiromaykin
Copy link
Contributor

"You've marked yourself as 'requested changes' here but I don't see any requests"

Well I did :-) I asked for the unused colon to be removed (but putting in a useful title in there instead is also acceptable), so now I can approve.

]

@admin.display(
description=_("Allowed CSS properties"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what solved my issue in the request; approved.

@alextreme alextreme merged commit 29997a4 into develop Aug 28, 2023
12 checks passed
@alextreme alextreme deleted the feature/1675-css-override-admin branch August 28, 2023 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants