Skip to content

Commit 84c47ea

Browse files
committed
Visual improvements of comments display
* Comments now start from the beginning of the row – helps with recognizing when comments start * Lighter colors * Paddings and margins have better harmony * Highlighted comments are using less harsh colors than yellow
1 parent 7b30e51 commit 84c47ea

File tree

4 files changed

+43
-22
lines changed

4 files changed

+43
-22
lines changed

code_comments/htdocs/code-comments.css

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,25 @@ table.code-comments td.check {
2323
width: auto !important;
2424
}
2525
ul.comments .active {
26-
background-color: #FFFFCD;
26+
border-color: #555;
27+
}
28+
ul.comments .active .meta {
29+
background-color: #555;
30+
}
31+
ul.comments>li.active .meta .author {
32+
color: #eee;
33+
}
34+
ul.comments>li .time {
35+
font-size: 10px;
36+
margin-left: 5px;
37+
}
38+
ul.comments>li.active a.time,
39+
ul.comments>li.active .meta .delete {
40+
color: #eee;
41+
}
42+
ul.comments>li.active a.time:hover,
43+
ul.comments>li.active .meta .delete:hover {
44+
background: #222;
2745
}
2846
ul.comments {
2947
margin: 0;
@@ -33,32 +51,34 @@ ul.comments {
3351
}
3452
ul.comments>li {
3553
border-radius: 4px;
36-
border: 1px solid #dfdfdf;
54+
border: 1px solid #f5f5f5;
3755
margin-bottom: 4px;
3856
list-style-type: none;
3957
}
4058
ul.comments>li .meta {
41-
padding: 6px;
42-
background-color: #dfdfdf;
59+
padding: 6px 10px;
60+
background-color: #f5f5f5;
4361
}
4462
ul.comments>li .time {
4563
font-size: 10px;
64+
margin-left: 5px;
4665
}
4766
ul.comments>li .meta img.gravatar {
4867
vertical-align: middle;
49-
padding: 1px;
50-
border: 1px solid #888;
68+
border: 1px solid #ddd;
69+
margin-right: 5px;
5170
}
5271
ul.comments>li .meta .author {
5372
font-weight: bold;
5473
}
5574
ul.comments>li .meta .delete {
5675
float: right;
5776
margin-right: 1em;
77+
margin-top: 2px;
5878
}
5979

6080
ul.comments>li .text {
61-
padding: 1px 8px;
81+
padding: 1px 15px;
6282
border: 0;
6383
margin: 0;
6484
}
@@ -86,13 +106,19 @@ table.code tr,
86106
.trac-diff tbody tr {
87107
height: 17px;
88108
}
89-
90-
table.code tr:hover td,
91-
#content table.trac-diff tbody tr:hover td {
92-
background-color: #FFFFCA;
109+
a.bubble {
110+
position: relative;
93111
}
94-
95112
a.bubble span.ui-icon {
96113
/* this centers the icon horizontally and vertically */
114+
background-color: #fff;
115+
border-radius: 3px;
116+
border: 4px solid #fff;
117+
position: absolute;
118+
left: 24px;
97119
margin: -2px auto 0;
98-
}
120+
}
121+
.diff table.trac-diff td.comments {
122+
padding: 10px;
123+
border-top: 1px solid #f5f5f5;
124+
}

code_comments/htdocs/code-comments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ var underscore = _.noConflict();
4747
this.is_active = this.model.id == CodeComments.active_comment_id;
4848
},
4949
render: function() {
50+
$(this.el).toggleClass('active', this.is_active);
5051
$(this.el).html(this.template(_.extend(this.model.toJSON(), {
5152
delete_url: CodeComments.delete_url,
52-
active: this.is_active,
5353
can_delete: CodeComments.is_admin
5454
})));
5555
return this;
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
<a id="comment-<%= id %>"></a>
22
<div class="meta">
33
<img class="gravatar" src="http://0.gravatar.com/avatar/<%= email_md5 %>?size=20" width="20" height="20" alt="gravatar for <%= author %>" />
4-
<span class="author"><%= author %></span> @ <span class="time"><%= formatted_date %></span>
5-
6-
<a href="<%= permalink %>">#<%= id %></a>
4+
<span class="author"><%= author %></span> <a class="time" href="<%= permalink %>"><%= formatted_date %></a>
75
<% if (can_delete) { %>
86
<a href="<%= delete_url %>?id=<%= id %>" class="delete">Delete</a>
97
<% } %>
108

119
</div>
12-
<div class="text <%= active? 'active' : ''%>">
10+
<div class="text">
1311
<%= html %>
1412
</div>
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
<th colspan='<%= colspan %>' class='comments'>
2-
&nbsp;
3-
</th>
4-
<td>
1+
<td colspan='<%= colspan + 1 %>' class='comments'>
52
<ul class="comments"></ul>
63
<button>Reply</button>
74
</td>

0 commit comments

Comments
 (0)