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

Layout breaks with read only field with null value #33

Closed
skndn60 opened this issue Mar 17, 2013 · 11 comments
Closed

Layout breaks with read only field with null value #33

skndn60 opened this issue Mar 17, 2013 · 11 comments
Labels

Comments

@skndn60
Copy link

skndn60 commented Mar 17, 2013

On an entry form with a read only field with a null value, the layout breaks. See attached sample with a read only field Phone number with a null value: white area of label breaks into grey coloured data area.

See also issue 29

Screen Shot 2013-03-17 at 13 57 45

@darklow
Copy link
Owner

darklow commented Mar 17, 2013

Could not reproduce.

  1. are you using latest development branch version?
  2. what is the field class for this field?
  3. Could you please check the content (html) of that empty cell, it should be like this:
<div class="controls">
    <span class="readonly"></span>
</div>

@skndn60
Copy link
Author

skndn60 commented Mar 17, 2013

  1. I downloaded yesterday evening.
  2. I do not assign a specific field class. The fields that should be read-only are based on a business rule which gets applied by overriding the method get_readonly_fields in the model admin class.
  3. See below:
<div class="control-group form-row field-phone ">
  <div>
    <div class="control-label">
      <label>Phone:</label>
    </div>
    <div class="controls">
      <span class="readonly"></span>
    </div>
  </div>
</div>

darklow added a commit that referenced this issue Mar 17, 2013
Refactored fieldset by wrapping in another container which hides
by overflow: hidden control column background
@darklow
Copy link
Owner

darklow commented Mar 17, 2013

Could you please check this issue with latest develop version? Fixing multiline labels should fix this issue too

@skndn60
Copy link
Author

skndn60 commented Mar 17, 2013

AFAIK both issues still persist with latest development version:

Screen Shot 2013-03-17 at 22 07 00

@darklow
Copy link
Owner

darklow commented Mar 17, 2013

This is very strange, are you sure you run collectstatic in case if this is with Debug=False or emptied browser cache?

  1. Also i see horizontal lines for labels are gone, is this a new bug or your customization?
  2. Is this latest Chrome/Mac?

I tested on windows for both Firefox and Chrome and everything looks perfect. Can't believe there is so much difference just because of Mac, because as far as i know Chrome uses same rendering engine for both win and mac.

@skndn60
Copy link
Author

skndn60 commented Mar 17, 2013

Hmm... my site appears broken since that last update. I have to figure out what went wrong first....

@darklow
Copy link
Owner

darklow commented Mar 17, 2013

One new thing in referenced commit was new wrapper / tag for fieldset.html. In case you extend and use your own fieldset.html, you should update it (see commit changes)

@skndn60
Copy link
Author

skndn60 commented Mar 17, 2013

Right, I forgot to copy overridden templates to my templates/admin directory. Looked pretty scary :-( .... I can confirm that both issues #29 and #33 are fixed now. I tested on OS X with Chrome, Firefox and Safari. With Safari you only get a squeezed layout for layout of multi line labels. Probably a Safari bug...

Chrome:
Screen Shot 2013-03-17 at 22 50 17

Safari:
Screen Shot 2013-03-17 at 22 49 48

@darklow
Copy link
Owner

darklow commented Mar 17, 2013

Good :) Could you take a look on #25, is it fixed too?

@skndn60
Copy link
Author

skndn60 commented Mar 17, 2013

#25 is fixed as well.

@darklow
Copy link
Owner

darklow commented Mar 17, 2013

3 issues with 1 commit - not bad :) ok, closing issues, time to sleep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants