Skip to content

fix: More fixes for narrow screens#3662

Merged
jennifer-richards merged 8 commits into
ietf-tools:feat/bs5from
larseggert:more-fixes-for-narrow-screens
Mar 24, 2022
Merged

fix: More fixes for narrow screens#3662
jennifer-richards merged 8 commits into
ietf-tools:feat/bs5from
larseggert:more-fixes-for-narrow-screens

Conversation

@larseggert
Copy link
Copy Markdown
Collaborator

Need to keep checking for issues, there are more.

@larseggert larseggert marked this pull request as ready for review March 18, 2022 11:00
Copy link
Copy Markdown
Member

@rjsparks rjsparks left a comment

Choose a reason for hiding this comment

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

Please verify the new loop construction in requests.html doesn't leave an unclosed <tbody>

Comment thread ietf/static/js/ietf.js
Comment thread ietf/templates/meeting/requests.html
{% else %}
{% with constraint.name.slug as constraint_name_slug %}
<span class="{% if constraint_name_slug == 'conflict' %}text-danger{% elif constraint_name_slug == 'conflic2' %}text-warning{% elif constraint_name_slug == 'conflic3' %}text-success{% else %}{{ constraint_name_slug }}{% endif %}">
<span class="{% if constraint_name_slug == 'chair_conflict' %}text-danger{% elif constraint_name_slug == 'tech_overlap' %}text-info{% elif constraint_name_slug == 'key_participant' %}text-success{% else %}{{ constraint_name_slug }}{% endif %}">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should become aware of the constraints in use by a given meeting: https://github.com/ietf-tools/datatracker/blob/main/ietf/meeting/models.py#L125.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might be a spot for a template filter to convert a constraint into a "badness" level

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I can do a filter, but the line Robert indicated doesn't give me enough information about what the desired behavior is?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is probably bigger than this first pass and should be split into a separate ticket. A meeting knows which constraint names are in use. Right now, we have hardcoded how to present each constraint into the template (chair_conflict is text-danger, etc). We would need to add a filter, as jennifer is suggesting, that encapsulated what class to provide for each constraint type.

@larseggert
Copy link
Copy Markdown
Collaborator Author

I don't think it does - the tidy check that the test suite now runs would have caught that.

@rjsparks
Copy link
Copy Markdown
Member

The tidy check must not do what you think it does.

I checked out the PR and looked at the html generated by ietf.meeting.tests_views.SessionTests.test_meeting_requests.
I put it in a file and got this result:

rjsparks@undex lars % grep tbody ~/tmp/foo.html
                    <tbody>
                    </tbody>
                    <tbody>

Looking into the call to tidy:

    r.status_code: '200'
    r["content-type"]: 'text/html; charset=utf-8'
    skip_verify: 'False'
    errors: 'line 430 column 13 - Warning: trimming empty <i>
line 527 column 21 - Warning: trimming empty <i>
line 520 column 17 - Warning: trimming empty <button>
line 598 column 17 - Warning: trimming empty <i>
line 638 column 17 - Warning: trimming empty <i>
line 687 column 17 - Warning: trimming empty <i>
line 730 column 29 - Warning: trimming empty <i>
line 735 column 33 - Warning: trimming empty <i>
'

@larseggert
Copy link
Copy Markdown
Collaborator Author

I looked into this, and HTML Tidy misses a bunch of HTML errors. Gah. I am adding HTML5 validation based on vnu in #3682 and will rework this PR once that is done.

Copy link
Copy Markdown
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

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

Looks ok to me aside from what @rjsparks already flagged

Action Holder{{ doc.documentactionholder_set.all|pluralize }}:
{% for action_holder in doc.documentactionholder_set.all %}
{% person_link action_holder.person title=action_holder.role_for_doc %} {{ action_holder|action_holder_badge }}{% if not forloop.last %},{% endif %}
{% person_link action_holder.person title=action_holder.role_for_doc %}{% if action_holder|action_holder_badge %} {{ action_holder|action_holder_badge }}{% endif %}{% if not forloop.last %},{% endif %}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the {% if... %} wrapper should be a no-op. The action_holder-badge tag returns '' if there's nothing to include, so either way there should be no text inserted. Is this doing something subtle?

Copy link
Copy Markdown
Collaborator Author

@larseggert larseggert Mar 22, 2022

Choose a reason for hiding this comment

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

The issue is that if there is no action_holder, there should also not be a space before the (empty) badge. (And if there is one, there should be a space.) Is there a better way to do this?

Copy link
Copy Markdown
Member

@rjsparks rjsparks Mar 22, 2022

Choose a reason for hiding this comment

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

Look to see if that space is appropriate for everywhere the action_holder templatetag is used. If it is, then add it to the html that the templatetag emits when a badge should be present.

Or, to make it much more obvious why you're adding the space, try

{% if action_holder|action_holder_badge %} {% endif %}{% action_holder|action_holder_badge %}

Or better yet, look to see if action_holder_badge being empty only happens when there is no action holder, and if so reduce that to

{% if action_holder %} {% endif %}{% action_holder|action_holder_badge %}

But this isn't enough to hold up the PR over.

{% else %}
{% with constraint.name.slug as constraint_name_slug %}
<span class="{% if constraint_name_slug == 'conflict' %}text-danger{% elif constraint_name_slug == 'conflic2' %}text-warning{% elif constraint_name_slug == 'conflic3' %}text-success{% else %}{{ constraint_name_slug }}{% endif %}">
<span class="{% if constraint_name_slug == 'chair_conflict' %}text-danger{% elif constraint_name_slug == 'tech_overlap' %}text-info{% elif constraint_name_slug == 'key_participant' %}text-success{% else %}{{ constraint_name_slug }}{% endif %}">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might be a spot for a template filter to convert a constraint into a "badness" level

@jennifer-richards jennifer-richards self-requested a review March 19, 2022 14:29
@jennifer-richards
Copy link
Copy Markdown
Member

jennifer-richards commented Mar 19, 2022

Oops, didn't realize my approval would authorize github to allow merge - should have just been a comment but I don't see a way to change that.

@larseggert larseggert force-pushed the more-fixes-for-narrow-screens branch from 507e200 to 54cba46 Compare March 22, 2022 08:52
@larseggert
Copy link
Copy Markdown
Collaborator Author

Modulo the open question about the filter, this PR is ready from my side.

@jennifer-richards jennifer-richards merged commit 870fed0 into ietf-tools:feat/bs5 Mar 24, 2022
@larseggert larseggert deleted the more-fixes-for-narrow-screens branch April 26, 2022 18:03
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants