Learn icon indicating copy to clipboard operation
Learn copied to clipboard

Lesson Plans: Landing page, archive and single page layouts

Open danhthong opened this issue 3 years ago • 9 comments
trafficstars

This PR for #153

Steps to update Lesson Plans landing page.

  • Update Dashicon & select categories to show on landing page https://a.cl.ly/kpu8xe5d
  • Update Dashicon & select Audiences to show on landing page https://a.cl.ly/DOudYJ92

danhthong avatar Jul 29 '22 17:07 danhthong

This landing page looks great! Excellent work and thanks for contributing @danhthong! I will need someone from the dev team to do a code review - perhaps @adamwoodnz? - but the layout works well from my side!

One note is that this will not be set as the home page of the site, but will need to live at /lesson-plans. That means we will need to ensure this page works at that URL while maintaining the filtered lesson plans archive page that the buttons on this landing page link to. I'm unsure how to make that work, but I'm sure it can be figured out.

hlashbrooke avatar Jul 31 '22 20:07 hlashbrooke

Page needs to exist at /lesson-plans while still maintaining the filtered lesson plan archive pages.

@hlashbrooke I have updated as your requested to keep current url by d8783ab.

danhthong avatar Aug 01 '22 12:08 danhthong

This archive-title-prefix isn't in the Figma file.

I can see it's existing though. Do we want to keep it @courtneyr-dev @hlashbrooke ?

Screen Shot 2022-08-16 at 1 04 59 PM

adamwoodnz avatar Aug 16 '22 01:08 adamwoodnz

Bug: if I submit an 'Edit audience' or 'Edit Lesson Category' form with sticky unchecked I get an error page with

Notice: Undefined index: sticky in /var/www/html/wp-content/plugins/wporg-learn/inc/taxonomy.php on line 643 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/wporg-learn/inc/taxonomy.php:643) in /var/www/html/wp-includes/pluggable.php on line 1420 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/wporg-learn/inc/taxonomy.php:643) in /var/www/html/wp-includes/pluggable.php on line 1423

adamwoodnz avatar Aug 16 '22 04:08 adamwoodnz

Great job @danhthong!

There is a lot of feedback here but a lot of it is pretty minor; renaming and refactoring, etc. If you're open to it I could help out addressing some of these things?

Let me know!

Thank you so much @adamwoodnz

I will update and let you know once i updated all your feedback.

danhthong avatar Aug 16 '22 07:08 danhthong

Nice updates @danhthong, thanks!

I didn't test in small screens last time and I'm seeing a few responsive issues now. Vertical spacing between sections, and where buttons drop below text needs attention on all small sizes. On the 460 > 767 range the cards don't have margin on the sides.

iPad 460 > 767 iPhone
Screen Shot 2022-08-19 at 9 47 39 AM Screen Shot 2022-08-19 at 9 49 48 AM Screen Shot 2022-08-19 at 9 48 51 AM

On iPad some of the column layout isn't quite right; I think Level and Duration could still sit side-by-side

Screen Shot 2022-08-19 at 9 48 04 AM

The Format grid of buttons should still be 4 column I think:

Screen Shot 2022-08-19 at 9 48 19 AM

If you need design guidance on this maybe @melchoyce could assist? Otherwise I'm happy to make some adjustments to vertical spacing once the column and horizontal margins are sorted.

adamwoodnz avatar Aug 18 '22 22:08 adamwoodnz

@hlashbrooke apologies is there anything else you need from me.

azhiya avatar Aug 24 '22 19:08 azhiya

I didn't test in small screens last time and I'm seeing a few responsive issues now. Vertical spacing between sections, and where buttons drop below text needs attention on all small sizes. On the 460 > 767 range the cards don't have margin on the sides.

I have updated as commit 9848f6d

Iphone mini(375): https://a.cl.ly/yAuQPogP 460 > 767: https://a.cl.ly/YEuWj86Q Ipad: https://a.cl.ly/6quGR0Ar

danhthong avatar Aug 25 '22 04:08 danhthong

I haven't tested it locally, but the code looks good. I left a few comments, but most are minor.

@iandunn I have updated your requested as 37ef929 Thank for your suggested!

danhthong avatar Aug 25 '22 04:08 danhthong

Bug: if I submit an 'Edit audience' or 'Edit Lesson Category' form with sticky unchecked I get an error page with

Notice: Undefined index: sticky in /var/www/html/wp-content/plugins/wporg-learn/inc/taxonomy.php on line 643 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/wporg-learn/inc/taxonomy.php:643) in /var/www/html/wp-includes/pluggable.php on line 1420 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/wporg-learn/inc/taxonomy.php:643) in /var/www/html/wp-includes/pluggable.php on line 1423

@danhthong I am still seeing this issue if 'Check to show on landing page' is left unchecked when saving, eg.

Screen Shot 2022-09-05 at 3 56 59 PM

Notice: Undefined index: sticky in /var/www/html/wp-content/plugins/wporg-learn/inc/taxonomy.php on line 637 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/wporg-learn/inc/taxonomy.php:637) in /var/www/html/wp-includes/pluggable.php on line 1420 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/wporg-learn/inc/taxonomy.php:637) in /var/www/html/wp-includes/pluggable.php on line 1423

I guess $_POST['sticky'] is undefined?

update_term_meta(
		$term_id,
		'sticky',
		rest_sanitize_boolean( $_POST['sticky'] ) ?? 0
	);

adamwoodnz avatar Sep 05 '22 03:09 adamwoodnz

Hi @danhthong last couple of things and then I'll be happy to deploy this, thanks!

adamwoodnz avatar Sep 05 '22 04:09 adamwoodnz

Hi @danhthong last couple of things and then I'll be happy to deploy this, thanks!

Thank @adamwoodnz , I have updated as above.

danhthong avatar Sep 05 '22 12:09 danhthong

@danhthong @isvictorious this last commit was a little unexpected... was it intentional?

Screen Shot 2022-09-06 at 8 55 24 AM

adamwoodnz avatar Sep 05 '22 20:09 adamwoodnz

@danhthong @isvictorious this last commit was a little unexpected... was it intentional?

Screen Shot 2022-09-06 at 8 55 24 AM

It was intentional but not where it was supposed to go. We can roll back.

isvictorious avatar Sep 06 '22 02:09 isvictorious

@danhthong @isvictorious this last commit was a little unexpected... was it intentional?

Screen Shot 2022-09-06 at 8 55 24 AM

@adamwoodnz I rolled back to last commit.

danhthong avatar Sep 06 '22 03:09 danhthong

Hi @danhthong this just needs a rebase now and then let's get it merged!

adamwoodnz avatar Sep 09 '22 02:09 adamwoodnz

Hi @danhthong this just needs a rebase now and then let's get it merged!

Hi @adamwoodnz, I have rebased and have a commit for css codes lint at 9d2524e7a. Please let me know if you need anything else.

danhthong avatar Sep 09 '22 18:09 danhthong

Thanks @danhthong, seems we've got a bunch of new unexpected PHP lint issues relating to code in wporg-mu-plugins now that we've rebased. An existing exclude rule exists for mu-plugins/pub but it doesn't seem to be covering mu-plugins/wporg-mu-plugins:

<exclude-pattern>/wp-content/mu-plugins/pub/(?!locales.php)</exclude-pattern>

I think adding a new exclude like this will remove most:

<exclude-pattern>/wp-content/mu-plugins/wporg-mu-plugins</exclude-pattern>

The remaining fixes required should be close to this:

Screen Shot 2022-09-12 at 2 01 26 PM

adamwoodnz avatar Sep 12 '22 02:09 adamwoodnz

I'll try to get some of these fixed today so you can rebase on trunk again.

adamwoodnz avatar Sep 12 '22 02:09 adamwoodnz

I have created https://github.com/WordPress/Learn/pull/934 to fix these failures. You may want to rebase on that unless it's been merged when you read this @danhthong

adamwoodnz avatar Sep 12 '22 03:09 adamwoodnz

@danhthong the lint failures have now been fixed in trunk. You'll need to rebase again I'm afraid, but then we should be good to merge.

adamwoodnz avatar Sep 13 '22 00:09 adamwoodnz

@adamwoodnz All done. Thank you a lot!

danhthong avatar Sep 13 '22 04:09 danhthong

I'm seeing some odd styling on the Learn homepage cards

Screen Shot 2022-09-13 at 4 43 28 PM

They appear to be missing this padding rule

Screen Shot 2022-09-13 at 4 45 11 PM

Same for you @danhthong ?

adamwoodnz avatar Sep 13 '22 04:09 adamwoodnz

IIRC that padding will be off for you because it is actually coming from the Customiser on the live Learn site. I will confess that I added it (along with some other custom CSS) when I wasn't able to contribute code properly but needed the styling to be done.

Now that I think of it, I'll create a new issue for moving any CSS from the Customiser into the actual theme files.

UPDATE: Added an issue here: https://github.com/WordPress/Learn/issues/937

hlashbrooke avatar Sep 13 '22 04:09 hlashbrooke

IIRC that padding will be off for you because it is actually coming from the Customiser on the live Learn site.

Adding this locally fixed it, thanks @hlashbrooke

I'll approve this now, and merge and deploy once I get the all clear from @iandunn.

We'll need to select the categories and audiences for the landing page cards and choose dashicons for them after deployment.

adamwoodnz avatar Sep 13 '22 05:09 adamwoodnz

Thanks for all the hard work here @danhthong and @adamwoodnz - this is going be great to have live!

hlashbrooke avatar Sep 13 '22 05:09 hlashbrooke

@adamwoodnz I updated for last issue and add check to skip phpcs ignores.

danhthong avatar Sep 14 '22 10:09 danhthong