Merge lp:~wgrant/loggerhead/pretty-view into lp:loggerhead

Proposed by William Grant
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: 472
Merged at revision: 470
Proposed branch: lp:~wgrant/loggerhead/pretty-view
Merge into: lp:loggerhead
Diff against target: 163 lines (+36/-35)
5 files modified
NEWS (+3/-0)
loggerhead/static/css/diff.css (+1/-7)
loggerhead/static/css/view.css (+16/-23)
loggerhead/static/javascript/diff.js (+2/-2)
loggerhead/templates/view.pt (+14/-3)
To merge this branch: bzr merge lp:~wgrant/loggerhead/pretty-view
Reviewer Review Type Date Requested Status
Loggerhead Reviewers Pending
Review via email: mp+94103@code.launchpad.net

Commit message

Fix diff and view page styling to be more compact and more easily copyable.

Description of the change

    - Fix diff and view page styling to be more compact and more easily
      copyable. (William Grant, #743295)

diffs are just a size change, but I had to add the 'code' class to blank cells to shrink the text size to avoid gaps.

view gets a pretty major rework -- it's now a table with just two cells, to align two big pre columns for the lines and content. This makes the content copyable and makes the spacing more sensible. Some CSS changes were needed here, and those styles are shared with annotate, so annotate also became a bit more compact.

Tested all three views in Firefox, Chromium and IE9. Screenshots of the new and old view views at <http://people.canonical.com/~wgrant/launchpad/lh-view>.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

+1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2012-02-09 03:25:36 +0000
+++ NEWS 2012-02-22 08:57:20 +0000
@@ -59,6 +59,9 @@
59 non-existent file or revision.59 non-existent file or revision.
60 (William Grant, #728209, #929275)60 (William Grant, #728209, #929275)
6161
62 - Fix diff and view page styling to be more compact and more easily
63 copyable. (William Grant, #743295)
64
6265
631.18.1 [24Mar2011]661.18.1 [24Mar2011]
64------------------67------------------
6568
=== modified file 'loggerhead/static/css/diff.css'
--- loggerhead/static/css/diff.css 2011-02-18 05:41:17 +0000
+++ loggerhead/static/css/diff.css 2012-02-22 08:57:20 +0000
@@ -68,17 +68,11 @@
68 color: #000;68 color: #000;
69 font-size: 85%;69 font-size: 85%;
70 font-family: 'UbuntuBeta Mono', 'Ubuntu Mono', monospace;70 font-family: 'UbuntuBeta Mono', 'Ubuntu Mono', monospace;
71 line-height: 180%;
72 }
73.blank {
74 float: left;
75 padding: 0 1%;
76 }71 }
77.unified .code {72.unified .code {
78 width: 89%;73 width: 89%;
79 }74 }
80.sbs .code,75.sbs .code {
81.blank {
82 width: 43%;76 width: 43%;
83 overflow: hidden;77 overflow: hidden;
84 }78 }
8579
=== modified file 'loggerhead/static/css/view.css'
--- loggerhead/static/css/view.css 2011-04-22 17:22:26 +0000
+++ loggerhead/static/css/view.css 2012-02-22 08:57:20 +0000
@@ -1,47 +1,40 @@
1/*table*/1/*table*/
2#logentries,2#logentries,
3.viewRev,
4.viewLine {3.viewLine {
5 border: 1px solid #d2d2d2;4 border: 1px solid #d2d2d2;
6}5 }
7.viewRev {6.viewRev {
8 border-right: none;7 border-right: none;
9 white-space: nowrap;8 white-space: nowrap;
10 width: 1px;9 width: 1px;
11 padding: .3em .6em;10 padding: .3em .6em;
12}11 }
13.viewComm,12.viewComm,
14.viewCont {13.viewCont {
15 border: none;14 border: none;
16 }15 }
17.viewLine {16.viewLine {
18 border-style: none solid none none;17 border-style: none solid none none;
19 width: 20px;
20 padding-left: .6em;
21 padding-right: .2em;
22 }18 }
23.viewLine.first {19.viewLine.first {
24 border-style: solid solid none none;20 border-style: solid solid none none;
25}21 }
26.viewCont {22.viewCont {
27 padding-left: .4em;23 padding: 0.2em 0.5em;
28 }24 }
29.viewLine,25.viewLine {
30.viewCont {26 padding: 0.2em 0.2em;
31 font-size: 116%;27 }
28.viewLine pre,
29.viewCont pre {
32 font-family: 'UbuntuBeta Mono', 'Ubuntu Mono', monospace;30 font-family: 'UbuntuBeta Mono', 'Ubuntu Mono', monospace;
33 line-height: 108%;31 font-size: 100%;
34 whitespace: pre;32 line-height: 110%;
35 }
36.viewCont pre {
37 margin: 0;33 margin: 0;
38 }34 }
39.viewLine {35.viewLine pre {
40 text-align: center;36 text-align: right;
41 }
42.viewLine {
43 font-size: 93%;
44 }37 }
45.viewAuthors {38.viewAuthors {
46 color: #999999;39 color: #999999;
47}40 }
4841
=== modified file 'loggerhead/static/javascript/diff.js'
--- loggerhead/static/javascript/diff.js 2009-03-31 21:11:38 +0000
+++ loggerhead/static/javascript/diff.js 2012-02-22 08:57:20 +0000
@@ -54,14 +54,14 @@
54 if (added.length > removed.length) {54 if (added.length > removed.length) {
55 for (var j = common; j < added.length; j++) {55 for (var j = common; j < added.length; j++) {
56 a = added[j];56 a = added[j];
57 a.insertBefore(a.create('<div class="blank">&nbsp;</div>'), a.query('.lineNumber.second'));57 a.insertBefore(a.create('<div class="code blank">&nbsp;</div>'), a.query('.lineNumber.second'));
58 }58 }
59 }59 }
60 else if (added.length < removed.length) {60 else if (added.length < removed.length) {
61 for (var j = common; j < removed.length; j++) {61 for (var j = common; j < removed.length; j++) {
62 r = removed[j];62 r = removed[j];
63 r.insertBefore(r.query('.code.delete'), r.query('.lineNumber.second'));63 r.insertBefore(r.query('.code.delete'), r.query('.lineNumber.second'));
64 r.insertBefore(r.create('<div class="blank">&nbsp;</div>'), r.query('.clear'));64 r.insertBefore(r.create('<div class="code blank">&nbsp;</div>'), r.query('.clear'));
65 }65 }
66 }66 }
67 added.length = 0;67 added.length = 0;
6868
=== modified file 'loggerhead/templates/view.pt'
--- loggerhead/templates/view.pt 2012-02-02 07:42:24 +0000
+++ loggerhead/templates/view.pt 2012-02-22 08:57:20 +0000
@@ -71,7 +71,7 @@
7171
72 <div class="view">72 <div class="view">
73 <table id="logentries">73 <table id="logentries">
74 <tal:rep tal:repeat="line contents">74 <tal:rep tal:condition="annotated" tal:repeat="line contents">
75 <tr>75 <tr>
76 <td tal:condition="python:path('repeat/line/number') in annotated"76 <td tal:condition="python:path('repeat/line/number') in annotated"
77 tal:define="anno python:annotated.get(path('repeat/line/number'), None)"77 tal:define="anno python:annotated.get(path('repeat/line/number'), None)"
@@ -86,12 +86,23 @@
86 <span tal:content="python:anno.message"></span>86 <span tal:content="python:anno.message"></span>
87 </td>87 </td>
88 <td tal:attributes="class python:path('repeat/line/number') in annotated and 'viewLine first' or 'viewLine'">88 <td tal:attributes="class python:path('repeat/line/number') in annotated and 'viewLine first' or 'viewLine'">
89 <a tal:attributes="id string:L${repeat/line/number}; href string:#L${repeat/line/number}"89 <pre><a tal:attributes="id string:L${repeat/line/number}; href string:#L${repeat/line/number}"
90 tal:content="repeat/line/number">1</a>90 tal:content="repeat/line/number">1</a></pre>
91 </td>91 </td>
92 <td class="viewCont"><pre tal:content="structure line"></pre></td>92 <td class="viewCont"><pre tal:content="structure line"></pre></td>
93 </tr>93 </tr>
94 </tal:rep>94 </tal:rep>
95 <tr tal:condition="not: annotated">
96 <td class="viewLine">
97 <pre><tal:blah repeat="line python:range(1, len(contents) + 1)"><a
98 tal:attributes="id string:L${line}; href string:#L${line}"
99 tal:content="line">1</a>
100 </tal:blah></pre>
101 </td>
102 <td class="viewCont">
103 <pre tal:content="structure python:''.join(contents)"></pre>
104 </td>
105 </tr>
95 </table>106 </table>
96 </div>107 </div>
97108

Subscribers

People subscribed via source and target branches