Skip to content

WEB: Fix maintainers grid not displaying correctly (GH41438) #41447

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

Merged
merged 4 commits into from
May 14, 2021

Conversation

calvh
Copy link
Contributor

@calvh calvh commented May 13, 2021

Screenshot taken on Google Chrome 90.0.4430.93

screenshot

To reproduce,

@attack68
Copy link
Contributor

have you tried instead:

    <div class="card-group maintainers">
        {% for person in maintainers.people %}
                <div class="card">
                ...
                </div>
        {% endfor %}
    </div>

seems to cut out maybe a lot of unnecessary batch grouping?

@calvh
Copy link
Contributor Author

calvh commented May 13, 2021

Thanks! I tried it but I ended up with very small cards. See:
card-group_only

I can use CSS to set min-width:10rem;. See:
min-width_option

Would this be preferable?

Edit: What is the recommended way to edit PRs?

@MarcoGorelli
Copy link
Member

Edit: What is the recommended way to edit PRs?

If I've understood the question correctly: by just adding a new commit (they'll all get merged at the end anyway)

@calvh
Copy link
Contributor Author

calvh commented May 13, 2021

Edit: What is the recommended way to edit PRs?

If I've understood the question correctly: by just adding a new commit (they'll all get merged at the end anyway)

Thanks. I was wondering if I should amend my local commit and force push but I don't know how it'll affect this PR (or if I should make a new PR). Or do something like squashing commits.

@calvh calvh changed the title WEB: Remove row div from maintainers (GH41438) WEB: Fix maintainers grid not displaying correctly (GH41438) May 13, 2021
@calvh
Copy link
Contributor Author

calvh commented May 13, 2021

After further testing, setting min-width alone doesn't work either because if you set the screen size wide enough the last row (Patrick) ends up takes up the whole row . I'll tinker further to see if I can come up with a solution.

@datapythonista datapythonista added the Web pandas website label May 13, 2021
@datapythonista
Copy link
Member

Thanks @calvh

This should be what we want: https://bootstrapcreative.com/pattern/responsive-card-deck-example/

The CI should be now fix if you merge master into your branch.

@calvh
Copy link
Contributor Author

calvh commented May 13, 2021

I've come up with a solution that keeps the structure as:

<div class="card-group maintainers">
  <div class="card">
  <div class="card">
  ...

by adding the following CSS:

@media (min-width: 576px) {
    div.card {
        min-width: 10rem;
        max-width: 10rem;
    }
}

See:
demo

If I want to avoid changing the CSS and use classes like in the example given by @datapythonista I could use something like:

<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-5">
  <div class="col mb-1">
  <div class="card"
  ...

but that requires a higher version of bootstrap (e.g., 4.6). Current version is 4.0.

Should I update bootstrap and follow the example?

@datapythonista
Copy link
Member

If you want to upgrade bootstrap, that surely sounds good. But let's have a separate PR for the upgrade, and another one for this fix. Up to you.

@calvh
Copy link
Contributor Author

calvh commented May 13, 2021

I think upgrading Bootstrap is a good idea. They just dropped a stable version (5.0) and it will open up new features for future developers to improve the website. In addition, v5 no longer uses jQuery so one less dependency is better in my opinion. I will do some testing on my local machine.

Edit: should I be creating a new issue?

@datapythonista
Copy link
Member

Yes, a new issue can help give it more visibility, in case anyone else has opinions.

Overwrites previous commit
Uses a single card-group container
Uses CSS to fix width issues
Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Just one thing that can be simplified. But if this is the code used for the animation you shared, looks really great.

</div>
<div class="card-group maintainers">
{% for person in maintainers.people %}
{% if person %}
Copy link
Member

Choose a reason for hiding this comment

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

If I'm not wrong, this was the if used to discriminate the maintainers from the empty loop iterations generated by Jinja's batch, so not needed anymore. All the maintainers are people now ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks. My bad. I'll make the change on the inside as well.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Thanks @calvh, looks great!

Copy link
Contributor

@attack68 attack68 left a comment

Choose a reason for hiding this comment

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

I think there are many ways you could do this, and this looks good to me as is.

Subjectively, each card is small enough to fit on even a small smartphone display, so personally I would code all the cards to be same size regardless of display device and design each card so that text wrapping etc, was good looking, and then just use the flex-wrap to align everything (as you already have done), which for a smartphone might be 1 or two cards per row, for a tablet 4 or 5, and for a large display display 6 - 10. I'd use the flex-box justify-content so that for a single row it aligns to the center. But, still can do any of these as a follow on (or not) and its good enough for me!

@jreback jreback added this to the 1.3 milestone May 14, 2021
@calvh
Copy link
Contributor Author

calvh commented May 14, 2021

@datapythonista Please remove approval for now there is a conflict with the community/blog page because it also uses the div.card style. I'll try to fix this asap

Edit: sorry the inconvenience. I should have checked all pages.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Thanks @calvh, let me know when it's ready

Add .card-group.maintainers to limit rule to team page
@jreback
Copy link
Contributor

jreback commented May 14, 2021

@datapythonista pls merge when ready

@calvh
Copy link
Contributor Author

calvh commented May 14, 2021

Just pushed. I fixed it by adding additional selectors to the new rule so it only applies to the team page and not the blog page.

Edit: sorry again @datapythonista I hope its not too much trouble.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @calvh, and for double checking the websie. Looks good. Feel free to ping me once the CI is green and I'll merge.

@datapythonista datapythonista merged commit 4048227 into pandas-dev:master May 14, 2021
@datapythonista
Copy link
Member

Thanks for the fix @calvh. If you want to have a look at the production website in couple of hours (after it's updated), and see if everything looks as expected, that would be great.

@calvh
Copy link
Contributor Author

calvh commented May 14, 2021

Your welcome I am happy to do so later. Thanks for the support!

@calvh calvh deleted the 41438-maintainers-grid branch May 14, 2021 20:23
@datapythonista
Copy link
Member

Looks like the grid if now displayed correctly, and Patrick's card is shown as the others. The rest of the website looks as before. Thanks for the fix @calvh

MarcoGorelli pushed a commit to MarcoGorelli/pandas that referenced this pull request May 15, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Web pandas website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WEB: Format broken in team page (maintainers grid)
5 participants