Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#29047 closed defect (bug) (fixed)

upload new media item error style

Reported by: afercia's profile afercia Owned by: ocean90's profile ocean90
Milestone: 4.0 Priority: normal
Severity: normal Version: 4.0
Component: Media Keywords: has-patch needs-testing
Focuses: ui, administration Cc:

Description

Small CSS thing, see attached screenshot.
Patch applies to trunk, since in 3.9.1 #media-items div still has a width of 623px which is already removed in trunk.

Attachments (7)

upload-new-media-item-error.png (12.2 KB) - added by afercia 11 years ago.
29047.patch (1.0 KB) - added by afercia 11 years ago.
29047.2.patch (2.2 KB) - added by afercia 11 years ago.
takes care of .error-div
29047.3.patch (2.5 KB) - added by afercia 11 years ago.
targets just items inside .media-upload-form, normalizes font size, line-height and padding for small screen devices
29047.4.patch (2.3 KB) - added by afercia 11 years ago.
please ignore patch 3, forgot to uncomment something
29047.5.diff (3.1 KB) - added by michalzuber 11 years ago.
Replaced #media-items with .media-upload-form
29047.6.patch (3.3 KB) - added by afercia 11 years ago.
removes items border-bottom and uses box-shadow

Download all attachments as: .zip

Change History (21)

@afercia
11 years ago

#1 @afercia
11 years ago

  • Keywords has-patch added

#2 follow-up: @michalzuber
11 years ago

  • Keywords needs-refresh added; has-patch removed

Tried and looked good 1 2, but you removed also .error-div which is used /wp-admin/async-upload.php#L89

#3 in reply to: ↑ 2 @afercia
11 years ago

Replying to michalzuber:

but you removed also .error-div which is used /wp-admin/async-upload.php#L89

Hi,
you're definitely right, it's used but it looks like it doesn't do that much, see before patch and after patch.
Refreshed patch to try to standardize on the default div.error style. See after patch 2

@afercia
11 years ago

takes care of .error-div

#4 @SergeyBiryukov
11 years ago

  • Focuses ui administration added
  • Keywords has-patch added; needs-refresh removed
  • Milestone changed from Awaiting Review to 4.0

#5 follow-up: @michalzuber
11 years ago

  • Keywords needs-testing added

Thank you afercia.
Changing margin of .wrap div.error might break in other views
My test question to the patch:
Why is that new error class needed to error-div, it's specific enough I think, no need for a new one

Sorry for "arguing" just wanna make sure it doesn't break other stuff ;)

#6 in reply to: ↑ 5 @afercia
11 years ago

Replying to michalzuber:
hi michalzuber,
you're right again, thx for watching my back :)

Changing margin of .wrap div.error might break in other views

right, messages shown for example on top of "edit post" like "There is an autosave of this post..." need that margin. Bit confusing though because in common.css div.updated and div.error have a default bottom margin of 2px then it's redefined to 15px for the ones inside .wrap. I assumed the default was 2px but I was wrong.

However, when you upload multiple items at once you can get a list with "successfully uploaded" items mixed with error messages. Should errors have margin in this case?

I'll revert the patch and try to target specifically the errors inside .media-upload-form

My test question to the patch:
Why is that new error class needed to error-div, it's specific enough I think, no need for a new one

It's the class that gives the "error style" with the left red border and some box-shadow. I would like to don't replicate those declarations on .error-div and use just the generic .error class. Say in the future you want to change the error style, you should be able to do that editing just one CSS rule.

@afercia
11 years ago

targets just items inside .media-upload-form, normalizes font size, line-height and padding for small screen devices

#7 @afercia
11 years ago

refreshed patch doesn't touch common.css and keeps all this media-specific in media.css
See before and after

@afercia
11 years ago

please ignore patch 3, forgot to uncomment something

@michalzuber
11 years ago

Replaced #media-items with .media-upload-form

#8 @michalzuber
11 years ago

Thanks afercia, nice.

Result http://i.imgur.com/bRcbFmW.png

#9 @afercia
11 years ago

Thanks Michal, nice.
We can also fix a small borders issue just not using borders at all and using box-shadow instead. What do you think about?

@afercia
11 years ago

removes items border-bottom and uses box-shadow

#10 @ocean90
11 years ago

Have you tested this in the old media modal too? #28220 has some demo code.

#11 follow-up: @michalzuber
11 years ago

ocean90 did you mean uploading from Add/Edit Post page https://youtu.be/bEjNrldS8Cw ?

#12 in reply to: ↑ 11 @ocean90
11 years ago

Replying to michalzuber:
No, that's not the old modal. From #28220:

3) Add this codes to your functions.php file .

#13 @afercia
11 years ago

hi ocean90,
clicked on "Arkaplan Görseli Ayarla" :) and looks fine to me

http://i.imgur.com/muBVqrD.png

#14 @ocean90
11 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 29355:

Media Upload: Improve styling of error messages.

props afercia, michalzuber.
fixes #29047.

Note: See TracTickets for help on using tickets.