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

Student Management: Notices should be full width #5094

Open
m1r0 opened this issue May 4, 2022 · 3 comments · May be fixed by #5278
Open

Student Management: Notices should be full width #5094

m1r0 opened this issue May 4, 2022 · 3 comments · May be fixed by #5278
Labels

Comments

@m1r0
Copy link
Member

m1r0 commented May 4, 2022

Steps to Reproduce

  1. Have some notices in the admin panel.
  2. Go to Sensei LMS -> Students.

What I Expected

The notices should be full width.

What Happened Instead

The notices are half-width.

PHP / WordPress / Sensei LMS version

PHP: 7.0
WordPress: 5.9.3
Sensei LMS: 4.4.0

Browser / OS version

Browser: Chrome
OS: MacOS

Screenshot / Video

Screenshot on 2022-05-04 at 17-42-11

@Bones5
Copy link

Bones5 commented May 23, 2022

I've had a look into this, it appears to be more to do with where admin notices are printed in the DOM than styling.

Different admin pages are printing in different places

image

image

image

I'm finding it difficult to control where the admin notices action fires. There are hacks such as mimicking the end of wp-header by adding<hr class="wp-header-end"> to templates but it's results are inconsistent and can print notices twice.

Happy to work on a PR but currently unable to find a proper fix, hope this is useful.

@m1r0
Copy link
Member Author

m1r0 commented May 25, 2022

Thanks, @Bones5! That pointed me in the right direction.

Yeah, this looks like a tricky one to solve.

To add some more context - notices are placed after the .wp-header-end or if that is not present, after the first H1 (source). So that complicates things.

Maybe we should change how the header/navigation is structured to avoid noticed placed inside the navigation holder. Another option would be to add a .wp-header-end in the right place.

@Bones5
Copy link

Bones5 commented May 26, 2022

Thanks for that @m1r0, I couldn't find that detail about the placement in the PHP, I knew it would be somewhere, I didn't realise it was being controlled in the JS.

Looking at core admin pages such as the Plugins page, the standard way to do this does appear to be to add <hr class="wp-header-end"> where required.

I will look in to adding this after the navigation section of admin pages and see how we get on.

@Bones5 Bones5 linked a pull request Jun 16, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants