Skip to content

Commit 1f790ec

Browse files
Minor styling tweaks
Many thanks to Marie Nordin for helping with these!
1 parent a14ae2d commit 1f790ec

5 files changed

Lines changed: 32 additions & 20 deletions

File tree

‎codespeed/models.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class Revision(models.Model):
135135
Branch, on_delete=models.CASCADE, related_name="revisions")
136136

137137
def get_short_commitid(self):
138-
return self.commitid[:10]
138+
return self.commitid[:12]
139139

140140
def get_browsing_url(self):
141141
return self.branch.project.commit_browsing_url.format(**self.__dict__)
@@ -144,9 +144,11 @@ def __str__(self):
144144
if self.date is None:
145145
date = None
146146
else:
147-
date = self.date.isoformat(sep=" ")
147+
date = self.date.strftime("%Y-%m-%d %H:%M")
148148
string = " - ".join(
149-
filter(None, (date, self.commitid, self.tag, self.branch.name)))
149+
filter(None, (date, self.get_short_commitid(), self.tag)))
150+
if self.branch.name:
151+
string += " (%s)" % self.branch.name
150152
return string
151153

152154
class Meta:

‎codespeed/static/css/main.css‎

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ div#title {
7171
align-items: center;
7272
gap: 0.6em;
7373
min-height: 56px;
74-
margin: 0 calc(-1 * var(--gap)) 1.2em;
74+
margin: var(--gap) 0 1.2em;
7575
padding: 0.4em var(--gap);
7676
background-color: var(--surface);
77-
border-bottom: 1px solid var(--border);
78-
border-radius: 0 0 var(--radius) var(--radius);
77+
border: 1px solid var(--border);
78+
border-radius: var(--radius);
79+
box-shadow: var(--shadow);
7980
}
8081
div#title a { display: inline-flex; align-items: center; }
8182
div#title img { display: block; height: 40px; padding: 0; margin: 0; }
@@ -151,8 +152,18 @@ div.about_content,
151152
box-shadow: var(--shadow);
152153
}
153154

154-
/* Home page */
155-
div#presentation { text-align: center; }
155+
/* Home page: a centred column with three menu boxes in a row and the
156+
results below them at the same width */
157+
div#presentation {
158+
max-width: 900px;
159+
margin: 0 auto;
160+
display: grid;
161+
grid-template-columns: repeat(3, minmax(0, 1fr));
162+
gap: var(--gap);
163+
text-align: center;
164+
}
165+
div#presentation > a { display: flex; }
166+
div#presentation div#reports, div#presentation div#historical { grid-column: 1 / -1; }
156167
div#presentation h2, div#presentation h4 { margin-top: 0.2em; margin-bottom: 0.2em; }
157168

158169
div#presentation > a { text-decoration: none; color: inherit; }
@@ -162,9 +173,9 @@ div#presentation div {
162173
vertical-align: top;
163174
}
164175
div#presentation div.menubox {
165-
width: 290px;
166-
min-height: 11em;
167-
margin: 0.6em;
176+
flex: 1;
177+
display: block;
178+
margin: 0;
168179
padding: 1em 1em 0.8em;
169180
color: var(--text);
170181
text-align: center;
@@ -186,7 +197,7 @@ div#presentation div.menubox p { color: var(--text-muted); }
186197

187198
/* The three icons differ in size (98 to 147px wide); scale them to one height */
188199
div#presentation p {
189-
min-height: 5.5em;
200+
min-height: 4.6em;
190201
margin: 0.6em 0 0;
191202
padding-left: 122px;
192203
text-align: left;
@@ -198,7 +209,6 @@ div#presentation div#changes p { background-image: url(../images/changes.png); }
198209
div#presentation div#timeline p { background-image: url(../images/timeline.png); }
199210
div#presentation div#comparison p { background-image: url(../images/comparison.png); }
200211

201-
div#presentation div#reports { margin-top: 1em; }
202212

203213
/* Sidebar and content columns */
204214
div#sidebar { width: var(--sidebar-width); float: left; }
@@ -333,6 +343,8 @@ table.reports caption a { color: var(--text); }
333343
table.reports caption a img { border: 0; vertical-align: middle; height: 14px; margin-bottom: 1px; }
334344
table.reports td { padding: 0.45em 0.6em; border-top: 1px solid var(--border); }
335345
table.reports tr:first-child td { border-top: 0; }
346+
/* Only the commit column wraps; keep the executable and summary on one line */
347+
table.reports td:not(:first-child) { white-space: nowrap; }
336348
table.reports tr.status-none td.summary { opacity: 0.5; }
337349

338350
table.tablesorter { margin-right: 0.8em; margin-bottom: 0.8em; }
@@ -562,6 +574,7 @@ div.footer a:hover { color: var(--accent); text-decoration: underline; }
562574
div#title img { height: 32px; }
563575
div#title h2 { font-size: 1em; }
564576
div#nav ul { padding-left: 0; }
577+
div#presentation { grid-template-columns: 1fr; }
565578
div#plot { height: 400px; }
566579
div.miniplot { height: 100px; }
567580
div.compplot { height: 400px; }
@@ -571,6 +584,5 @@ div.footer a:hover { color: var(--accent); text-decoration: underline; }
571584
div#sidebar { float: none; width: auto; display: flex; flex-wrap: wrap; gap: 0.6em; }
572585
div#sidebar .sidebox { flex: 1 1 14em; }
573586
div#configbar, div#content, div.about_content { margin-left: 0; }
574-
div#presentation div.menubox { width: 100%; margin: 0.4em 0; }
575587
div#historical-plot, div#baseline-comparison-plot { width: 100%; }
576588
}

‎sample_project/templates/home.html‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% endblock navigation %}
66

77
{% block body %}
8-
<div id="presentation" class="clearfix">
8+
<div id="presentation">
99
<a href="{% url "changes" %}">
1010
<div id="changes" class="menubox">
1111
<h2>Changes</h2>
@@ -24,7 +24,6 @@ <h2>Comparison</h2>
2424
<p>Compare different executables and revisions</p>
2525
</div>
2626
</a>
27-
<br />
2827
<div id="reports"></div>
2928
{% if show_historical %}
3029
<div id="historical">

‎speed_python/static/css/home.css‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
div#presentation div#geomean, div#presentation div#geomean > div { display: block; }
44
div#geomean {
5-
max-width: 900px;
6-
margin: 1.5em auto 0;
5+
grid-column: 1 / -1;
6+
margin: 0.5em 0 0;
77
text-align: center;
88
}
99
div#geomean-plot { width: 100%; height: 320px; }

‎speed_python/templates/home.html‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{% endblock navigation %}
1111

1212
{% block body %}
13-
<div id="presentation" class="clearfix">
13+
<div id="presentation">
1414
<a href="{% url "changes" %}">
1515
<div id="changes" class="menubox">
1616
<h2>Changes</h2>
@@ -29,7 +29,6 @@ <h2>Comparison</h2>
2929
<p>Compare different executables and revisions</p>
3030
</div>
3131
</a>
32-
<br />
3332
<div id="geomean">
3433
<h3>How has performance changed over the last 30 days?</h3>
3534
<div id="geomean-plot"

0 commit comments

Comments
 (0)