Re: Admin accessibility

2020-05-26 Thread Tom Carrick
Some further thoughts...

Mariusz, I don't think I agree that WCAG is massive. It can look a little
large but I think that's mostly because each guideline is split into
smaller pieces and it's quite wordy to avoid ambiguity. There are in 2.1 50
success criteria for AA, many of which can be checked automatically, and
many of those that can't don't apply to us as we don't use audio / video.
There's also a nice quick reference
 that can be filtered to remove
AAA and anything else unwanted. Once you drill down it can again get quite
wordy, but it covers a lot. I think it's worth remembering here is that the
point is not to strictly adhere to a standard for the sake of it, just to
improve the overall accessibility, and WCAG is a useful and measurable tool
to get us some of the way there.

Thibaud, I more or less agree with everything there. I'm not sure
developers should have to do full accessibility checks for their changes in
the admin. Using a screen reader for example can be very frustrating and
confusing if you're not used to it, and it can take an inordinate amount of
time, and I don't really wish that burden on (for example) first time
committers who already have a lot of stuff to do, I think this will only
discourage contributions. I think it should be the responsibility of the
accessibility team to provide feedback, suggestions, etc. on relevant PRs
or fix things when they're noticed after manual audits.

ATAG looks handy, but at first glance we couldn't even get to A, it
requires auto-saving. It also generally seems like something that would
cover a rich text editor plugged into the admin more than the admin itself,
though I think it's laudable as a future target.

The more I think about it, I think the DEP should be a process DEP rather
than a feature DEP. As others have mentioned, we don't need a DEP to fix
accessibility issues - just fix them. But forming a team seems useful, and
I think a DEP is required for that. I think the DEP should be limited to:

1. The accessibility team, how membership is decided, who it's accountable
to, it's role/responsibilities, etc.
2. Perhaps the initial standard(s) to target, although this could also be
decided by the a11y team post-assembly and agreed with the technical board
and/or core devs.

As I said, I'm happy to write up the DEP, but since it'll be a process DEP,
I think I'd need the support of a core dev, someone on the technical board,
or just someone who has more knowledge of Django's "bureaucracy", for lack
of a better word.

Tom

On Tue, 26 May 2020 at 01:20, Thibaud Colas  wrote:

> Hi Tom,
>
> It’s exciting to see this getting started! To me a DEP would be highly
> beneficial, because there is a lot to this that goes beyond finding and
> fixing individual issues – it’s more about detailing the a process for
> parts of Django to stay accessible over time. Here are things I’d suggest
> to cover, in addition to your list:
>
> - Going further than the targeted standard and tests in CI –  outline
> clear steps developers should take when testing their work: using developer
> tools, screen readers, etc. It’s not practical to just state the standard
> as WCAG is quite big, and open to interpretation. And CI testing will never
> be enough to reach any degree of compliance.
>   - I’m not familiar with Django’s development process but generally I
> would recommend to use a combination of linting, browser extensions, manual
> testing instructions – and CI tests.
> - If the accessibility team was to cover more than the Django admin, I
> think it would be worthwhile to also include accessibility of sites built
> with Django. Django is largely unopinionated about markup, but I remember
> its forms markup not being particularly good for screen readers, and the
> HTML code snippets in the docs would also be worth reviewing.
> - Same goes for admin docs – not too familiar with them myself so I’m not
> sure whether they are considered to be part of the admin, or separate.
> - I wouldn’t find it surprising if an audit of the Django admin turned up
> a lot of issues. IMHO part of the DEP should cover how to manage this –
> whether individual issues warrant individual tickets or not, and how to
> prioritize the issues if relevant. Which kinds of issues are likely to need
> design input. If the DEP is done first, also talk about what kind of
> auditing would be valuable, and how to make it happen.
>
> To help with the initial audit and prioritisation of issues, I would
> suggest to first start by creating a map of all of the parts of the Django
> admin that are to be audited – list all of the individual pages, and all of
> the states the pages can be in (success, error, loading – empty content /
> some content / paginating, etc). I also find it worthwhile to add a
> succinct definition of how each of those pages is likely to be used – for
> example things that are only configured once for a site’s lifetime are
> presumably not as wor

Additional arguments for url lookup in sitemap index

2020-05-26 Thread Sandro Covo
Hello,

I'm trying to add sitemaps on a per object base to my project. I have 
created a wrapper around sitemaps.views.sitemap that captures additional 
parameters to get the object and create the required sitemap. But I can't 
create a sitemap index, since the index views tries to resolve the sitemap 
view with only the section parameter.

The solution would be to allow additional parameters to the 
sitemaps.views.index function that would be used in the lookup for the 
section-urls. I created a branch and tried to implement this here: 
https://github.com/django/django/commit/d4ee80daabcf9af4e7cfe6b966522849e8018224

Not sure how to proceed from here, if you think that's ok I think I'll 
create a pull request?

Best regards
Sandro

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/b74b4fe0-3479-4363-8169-0d5fe2ac122a%40googlegroups.com.


Re: Additional arguments for url lookup in sitemap index

2020-05-26 Thread Adam Johnson
>
> I'm trying to add sitemaps on a per object base to my project.


Can you explain this a little more? I don't follow what sitemap structure
you're pursuing that's different to the default, nor why.

On Tue, 26 May 2020 at 09:24, Sandro Covo  wrote:

> Hello,
>
> I'm trying to add sitemaps on a per object base to my project. I have
> created a wrapper around sitemaps.views.sitemap that captures additional
> parameters to get the object and create the required sitemap. But I can't
> create a sitemap index, since the index views tries to resolve the sitemap
> view with only the section parameter.
>
> The solution would be to allow additional parameters to the
> sitemaps.views.index function that would be used in the lookup for the
> section-urls. I created a branch and tried to implement this here:
> https://github.com/django/django/commit/d4ee80daabcf9af4e7cfe6b966522849e8018224
>
> Not sure how to proceed from here, if you think that's ok I think I'll
> create a pull request?
>
> Best regards
> Sandro
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/b74b4fe0-3479-4363-8169-0d5fe2ac122a%40googlegroups.com
> 
> .
>


-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2TzZDfi0%2BnYAMLS7KEYdau-ENkfevHCpXMv4uwueoriQ%40mail.gmail.com.


Re: Additional arguments for url lookup in sitemap index

2020-05-26 Thread Sandro Covo

Sure, my urls look like this:
urlpatterns = (
path('/', views.page_detail, name="page"),
path('/sitemap.xml', cache_page(60*60)(views.sitemap_view),
 name="sitemap-index"),
)

And i have this view for the sitemap_view, that creates the sitemap for 
each page under the path of the request.

def sitemap_view(request, path='/'):
sitemaps = {}

top_page = get_object_or_404(
Page.objects.active(),
path=f"/{path}/" if path else '/',
)

sitemaps['pages'] = PageSitemap(top_page)

for blog_page in top_page.descendants(include_self=True).filter(
application='blog'):
sitemaps[blog_page.slug] = ArticleSitemap(blog_page)

for event_page in top_page.descendants(include_self=True).filter(
application='events'):
sitemaps[event_page.slug] = EventSitemap(event_page)

for category_page in top_page.descendants(include_self=True).filter(
application='categories'):
sitemaps[category_page.slug] = CategorySitemap(category_page)

return sitemap_view(
request, sitemaps,
)

So under one path lives a seperate structure that has different content.


On Tuesday, May 26, 2020 at 2:33:42 PM UTC+2, Sandro Covo wrote:
>
> Hello,
>
> I'm trying to add sitemaps on a per object base to my project. I have 
> created a wrapper around sitemaps.views.sitemap that captures additional 
> parameters to get the object and create the required sitemap. But I can't 
> create a sitemap index, since the index views tries to resolve the sitemap 
> view with only the section parameter.
>
> The solution would be to allow additional parameters to the 
> sitemaps.views.index function that would be used in the lookup for the 
> section-urls. I created a branch and tried to implement this here: 
> https://github.com/django/django/commit/d4ee80daabcf9af4e7cfe6b966522849e8018224
>
> Not sure how to proceed from here, if you think that's ok I think I'll 
> create a pull request?
>
> Best regards
> Sandro
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/7791e496-e225-4dca-a57b-fca9851c34db%40googlegroups.com.


Re: Additional arguments for url lookup in sitemap index

2020-05-26 Thread Adam Johnson
Oh I see. I think your sitemap structure is quite different to what
Django's sitemaps index is intended for. I think it's probably better that
you create your own index view based copy-pasting the built-in one, rather
than adding extra parameters to it. It's not much code, and Django can't be
infinitely flexible.

On Tue, 26 May 2020 at 14:34, Sandro Covo  wrote:

> Sure, my urls look like this:
> urlpatterns = (
> path('/', views.page_detail, name="page"),
> path('/sitemap.xml', cache_page(60*60)(views.sitemap_view),
>  name="sitemap-index"),
> )
>
> And i have this view for the sitemap_view, that creates the sitemap for
> each page under the path of the request.
>
> def sitemap_view(request, path='/'):
> sitemaps = {}
>
> top_page = get_object_or_404(
> Page.objects.active(),
> path=f"/{path}/" if path else '/',
> )
>
> sitemaps['pages'] = PageSitemap(top_page)
>
> for blog_page in top_page.descendants(include_self=True).filter(
> application='blog'):
> sitemaps[blog_page.slug] = ArticleSitemap(blog_page)
>
> for event_page in top_page.descendants(include_self=True).filter(
> application='events'):
> sitemaps[event_page.slug] = EventSitemap(event_page)
>
> for category_page in top_page.descendants(include_self=True).filter(
> application='categories'):
> sitemaps[category_page.slug] = CategorySitemap(category_page)
>
> return sitemap_view(
> request, sitemaps,
> )
>
> So under one path lives a seperate structure that has different content.
>
>
> On Tuesday, May 26, 2020 at 2:33:42 PM UTC+2, Sandro Covo wrote:
>>
>> Hello,
>>
>> I'm trying to add sitemaps on a per object base to my project. I have
>> created a wrapper around sitemaps.views.sitemap that captures additional
>> parameters to get the object and create the required sitemap. But I can't
>> create a sitemap index, since the index views tries to resolve the sitemap
>> view with only the section parameter.
>>
>> The solution would be to allow additional parameters to the
>> sitemaps.views.index function that would be used in the lookup for the
>> section-urls. I created a branch and tried to implement this here:
>> https://github.com/django/django/commit/d4ee80daabcf9af4e7cfe6b966522849e8018224
>>
>> Not sure how to proceed from here, if you think that's ok I think I'll
>> create a pull request?
>>
>> Best regards
>> Sandro
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/7791e496-e225-4dca-a57b-fca9851c34db%40googlegroups.com
> 
> .
>


-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM09kJ5Anf8wRdPuKjKRtKK-ikYnHTxPB_RL6a7Ubt2%3DuA%40mail.gmail.com.