Improve the styling of the summary state labels in the datagrids.
Review Request #7228 — Created April 17, 2015 and submitted
The summary labels ("Draft", "Submitted", "Discarded") were just simple text prefixes before, which were a bit ugly with the new datagrids, and didn't do a great job of standing out. This adds some styling to those to make them appear as little labels. They're placed to the left of the text block, and each have their own distinct color. The summary text retains its own solid block. It no longer wraps below the label, but instead stays to the right of it. It also has some additional line spacing, helping to improve readability when it does wrap. I also changed the "No Summary" text to be slightly faded out, so that it doesn't blend in with actual summaries as easily.
Tested the labels at various widths, to ensure the wrapping was correct
an the default state was correct.
-
-
reviewboard/datagrids/columns.py (Diff revision 1) Can we format as:
display_data += ('<label class="%s">%s</label>' % labels[label], label)
-
Change Summary:
- Removed an unused import.
- Added missing blank lines.
- Switched to using
format_html
everywhere in the function.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+69 -22) |
-
Tool: Pyflakes Processed Files: reviewboard/datagrids/columns.py Ignored Files: reviewboard/static/rb/css/ui/datagrids.less reviewboard/static/rb/css/defs.less reviewboard/static/rb/css/common.less Tool: PEP8 Style Checker Processed Files: reviewboard/datagrids/columns.py Ignored Files: reviewboard/static/rb/css/ui/datagrids.less reviewboard/static/rb/css/defs.less reviewboard/static/rb/css/common.less
-
-
reviewboard/datagrids/columns.py (Diff revisions 1 - 2) Out of curiousity, any reason not to use
display_data += format_html_join('', '<label class={}>{}</label>', ( (label_class, label) for label, label_class in six.iteritems(labels) ))
Wouldn't that be more efficient than multiple concatentations?
Change Summary:
- Switched to using
format_html_join
. - We now use a
<span class="no-summary">
instead of<i>
.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+71 -21) |
-
Tool: Pyflakes Processed Files: reviewboard/datagrids/columns.py Ignored Files: reviewboard/static/rb/css/ui/datagrids.less reviewboard/static/rb/css/defs.less reviewboard/static/rb/css/common.less Tool: PEP8 Style Checker Processed Files: reviewboard/datagrids/columns.py Ignored Files: reviewboard/static/rb/css/ui/datagrids.less reviewboard/static/rb/css/defs.less reviewboard/static/rb/css/common.less