Skip to content

Commit 78cd92e

Browse files
committed
cleanup commit header in history view for elements to stay in place
1 parent febcfcd commit 78cd92e

File tree

3 files changed

+64
-111
lines changed

3 files changed

+64
-111
lines changed

Resources/html/views/history/history.css

Lines changed: 17 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,27 @@ a.servicebutton:hover {
4949
border: 2px solid #3465a4;
5050
}
5151

52-
#gravatar {
53-
margin-left: 5px;
54-
padding: 2px;
55-
width: 60px;
56-
height: 60px;
52+
.commit_info {
53+
table-layout: fixed;
54+
width: 100%;
55+
}
5756

58-
border: solid gray 1px;
59-
-webkit-border-radius: 2px;
57+
.commit_info th {
58+
vertical-align: top;
59+
}
60+
61+
.commit_info .date {
62+
font-family: Menlo, Monaco, monospace;
63+
}
64+
65+
.gravatar {
66+
float: left;
67+
margin-right: 5px;
6068
}
6169

6270
.gravatar img {
63-
width: 2.9em;
64-
height: 2.9em;
65-
max-height: 60px;
66-
max-width: 60px;
71+
height: 30px;
72+
width: 30px;
6773
}
6874

6975
.property_name {
@@ -266,51 +272,6 @@ a {
266272
right: 30px;
267273
}
268274

269-
/*
270-
div.button
271-
{
272-
color: #666666;
273-
274-
font-size: 60%;
275-
text-align: center;
276-
277-
width: 70px;
278-
279-
margin-right: 10px;
280-
281-
padding: 2px;
282-
283-
float: left;
284-
clear: both;
285-
286-
border: 1px solid;
287-
-webkit-border-radius: 3px;
288-
}
289-
290-
div.created
291-
{
292-
background-color: #ccffcc;
293-
border-color: #66ff66;
294-
}
295-
296-
div.changed
297-
{
298-
background-color: #ffcc99;
299-
border-color: #ff9933;
300-
}
301-
302-
div.deleted
303-
{
304-
background-color: #ffcccc;
305-
border-color: #ff6666;
306-
}
307-
308-
div.renamed
309-
{
310-
// No colour needed right now.
311-
}
312-
*/
313-
314275
#notification_message .cancel {
315276
color: red;
316277
}

Resources/html/views/history/history.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ var reload = function() {
139139
var showRefs = function() {
140140
var refs = $("refs");
141141
if (commit.refs) {
142-
refs.parentNode.classList.remove("hidden");
142+
refs.classList.remove("hidden");
143143
refs.textContent = "";
144144
for (var i = 0; i < commit.refs.length; i++) {
145145
var ref = commit.refs[i];
@@ -152,7 +152,7 @@ var showRefs = function() {
152152
refs.appendChild(span);
153153
}
154154
} else
155-
refs.parentNode.classList.add("hidden");
155+
refs.classList.add("hidden");
156156
}
157157

158158
var loadCommit = function(commitObject, currentRef) {
@@ -190,16 +190,22 @@ var loadCommit = function(commitObject, currentRef) {
190190
$("date").textContent = commit.author_date;
191191
setGravatar(commit.author_email, $("author_gravatar"));
192192

193-
if (commit.committer_name != commit.author_name) {
194-
$("committerID").parentNode.classList.remove("hidden");
193+
if (commit.committer_name != commit.author_name || commit.committer_email != commit.author_email) {
194+
$("committerID").parentNode.parentNode.classList.remove("hidden");
195195
setFormattedEmailContent($("committerID"), commit.committer_name, commit.committer_email);
196-
197-
$("committerDate").parentNode.classList.remove("hidden");
198196
$("committerDate").textContent = commit.committer_date;
199197
setGravatar(commit.committer_email, $("committer_gravatar"));
198+
199+
$("commitDate").parentNode.classList.add("hidden");
200+
} else if (commit.committer_date != commit.author_date) {
201+
$("commitDate").parentNode.classList.remove("hidden");
202+
203+
$("commitDate").textContent = commit.committer_date;
204+
205+
$("committerID").parentNode.parentNode.classList.add("hidden");
200206
} else {
201-
$("committerID").parentNode.classList.add("hidden");
202-
$("committerDate").parentNode.classList.add("hidden");
207+
$("committerID").parentNode.parentNode.classList.add("hidden");
208+
$("commitDate").parentNode.classList.add("hidden");
203209
}
204210

205211
var textToHTML = function (txt) {

Resources/html/views/history/index.html

Lines changed: 33 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -24,60 +24,46 @@
2424
</div>
2525
</div>
2626

27-
<table>
27+
<table class="commit_info">
2828
<tr>
29-
<td width="50%">
30-
<table>
31-
<tr>
32-
<td class="property_name">Subject:</td>
33-
<td id="subjectID"></td>
34-
</tr>
35-
<td colspan="2">
36-
<table id="authorTable">
37-
<tr>
38-
<td class="property_name">Author:</td>
39-
<td class="gravatar hidden" rowspan="2" align="center">
40-
<img id="author_gravatar" src=""></img>
41-
</td>
42-
<td id="authorID"></td>
43-
</tr>
44-
<tr>
45-
<td class="property_name">Date:</td>
46-
<td id="date"></td>
47-
</tr>
48-
<tr class="hidden">
49-
<td class="property_name">Committer:</td>
50-
<td class="gravatar hidden" rowspan="2" align="center">
51-
<img id="committer_gravatar" src=""></img>
52-
</td>
53-
<td id="committerID"></td>
54-
</tr>
55-
<tr class="hidden">
56-
<td class="property_name">Date:</td>
57-
<td id="committerDate"></td>
58-
</tr>
59-
</table>
60-
</td>
61-
</table>
29+
<th class="property_name">Subject</th>
30+
<td id="subjectID"></td>
31+
</tr>
32+
<tr>
33+
<th class="property_name">ID</th>
34+
<td>
35+
<span id="commitID" class="SHA"></span>
36+
<span id="refs"></span>
37+
</td>
38+
</tr>
39+
<tr>
40+
<th class="property_name">Author</th>
41+
<td>
42+
<div class="gravatar hidden">
43+
<img id="author_gravatar" src="" />
44+
</div>
45+
<div id="authorID"></div>
46+
<div id="date" class="date"></div>
47+
<div class="hidden">
48+
<span id="commitDate" class="date"></span>
49+
(Commit date)
50+
</div>
6251
</td>
63-
<td width="50%">
64-
<table id="commit_header">
65-
<tr></tr>
66-
<tr>
67-
<td class="property_name">SHA:</td>
68-
<td id="commitID" class="SHA"></td>
69-
</tr>
70-
<tr class="hidden">
71-
<td class="property_name">Refs:</td>
72-
<td id="refs"></td>
73-
</tr>
74-
</table>
52+
</tr>
53+
<tr class="hidden">
54+
<th class="property_name">Committer</th>
55+
<td>
56+
<div class="gravatar hidden">
57+
<img id="committer_gravatar" src="" />
58+
</div>
59+
<div id="committerID"></div>
60+
<div id="committerDate" class="date"></div>
7561
</td>
7662
</tr>
7763
</table>
7864

7965
<div id="notification" class="hidden">
80-
<img src="../../images/spinner.gif" alt="Spinner" id="spinner"></img>
66+
<img src="../../images/spinner.gif" alt="Spinner" id="spinner" />
8167
<div id="notification_message"></div>
8268
</div>
8369

0 commit comments

Comments
 (0)