Skip to content

Commit 3cb0c21

Browse files
Minor styling tweaks
Many thanks to Marie Nordin for helping with these!
1 parent 91d5525 commit 3cb0c21

3 files changed

Lines changed: 29 additions & 17 deletions

File tree

‎codespeed/models.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class Revision(models.Model):
130130
Branch, on_delete=models.CASCADE, related_name="revisions")
131131

132132
def get_short_commitid(self):
133-
return self.commitid[:10]
133+
return self.commitid[:12]
134134

135135
def get_browsing_url(self):
136136
return self.branch.project.commit_browsing_url.format(**self.__dict__)
@@ -139,10 +139,11 @@ def __str__(self):
139139
if self.date is None:
140140
date = None
141141
else:
142-
date = self.date.isoformat(sep=" ")
143-
string = " - ".join(filter(None, (date, self.commitid, self.tag)))
142+
date = self.date.strftime("%Y-%m-%d %H:%M")
143+
string = " - ".join(
144+
filter(None, (date, self.get_short_commitid(), self.tag)))
144145
if self.branch.name != self.branch.project.default_branch:
145-
string += " - " + self.branch.name
146+
string += " (%s)" % self.branch.name
146147
return string
147148

148149
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 div.menubox 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,7 +584,6 @@ 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
}
577589

‎speed_pypy/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">

0 commit comments

Comments
 (0)