Skip to content

Commit 6dfc8c4

Browse files
Merge pull request #668 from juleskers/experimenting-with-cssflex
quick-links in crate header
2 parents 99bcd9b + ac30409 commit 6dfc8c4

File tree

2 files changed

+60
-36
lines changed

2 files changed

+60
-36
lines changed

app/styles/crate.scss

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55
margin-bottom: 20px;
66
@include border-radius(5px);
77
@include display-flex;
8+
@include flex-wrap(wrap);
89
@include align-items(center);
910

11+
.wide {
12+
width: 100%;
13+
}
14+
1015
.info {
1116
@include display-flex;
1217
@include flex-wrap(wrap);
@@ -129,21 +134,24 @@
129134
.downloads { @include display-flex; @include align-items(center); }
130135

131136
.rev-dep-downloads {padding-left: 7px}
137+
}
138+
139+
.quick-links {
140+
ul {
141+
@include display-flex;
142+
@include flex-direction(row);
143+
144+
font-size: 80%;
145+
list-style-type: none;
146+
margin: 1em 0 0 0;
147+
padding: 0;
132148

133-
.quick-links {
134-
ul {
135-
@include display-flex;
136-
font-size: 80%;
137-
list-style-type: none;
138-
margin: 1em 0 0 0;
139-
padding: 0;
140149

141-
li {
142-
margin-right: 1em;
150+
li {
151+
margin-right: 1em;
143152

144-
&:last-child {
145-
margin-right: 0;
146-
}
153+
&:last-child {
154+
margin-right: 0;
147155
}
148156
}
149157
}

app/templates/crate/version.hbs

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,50 @@
11
{{title crate.name}}
22

33
<div id='crates-heading'>
4-
<div class='info'>
5-
<img class='logo crate' src="/assets/crate.png"/>
6-
<h1>{{ crate.name }}</h1>
7-
<h2>{{ currentVersion.num }}</h2>
8-
</div>
4+
<div class="wide">
5+
<div class='info'>
6+
<img class='logo crate' src="/assets/crate.png"/>
7+
<h1>{{ crate.name }}</h1>
8+
<h2>{{ currentVersion.num }}</h2>
9+
</div>
910

10-
<div class='right'>
11-
{{#if session.currentUser}}
12-
<button class='tan-button' {{action 'toggleFollow' this}}>
13-
{{#if fetchingFollowing}}
14-
<img src="/assets/ajax-loader.gif"/>
15-
{{else}}
16-
{{#if following}}
17-
Unfollow
11+
<div class='right'>
12+
{{#if session.currentUser}}
13+
<button class='tan-button' {{action 'toggleFollow' this}}>
14+
{{#if fetchingFollowing}}
15+
<img src="/assets/ajax-loader.gif"/>
1816
{{else}}
19-
Follow
17+
{{#if following}}
18+
Unfollow
19+
{{else}}
20+
Follow
21+
{{/if}}
2022
{{/if}}
21-
{{/if}}
22-
</button>
23+
</button>
24+
{{/if}}
25+
{{!--
26+
<a class='yellow-button' download
27+
{{action 'download' currentVersion}}
28+
href='{{currentVersion.dl_path}}'>
29+
<img class="button-download" src="/assets/button-download.png"/>
30+
Download
31+
</a>
32+
--}}
33+
</div>
34+
</div>
35+
36+
<div class="quick-links">
37+
<ul>
38+
{{#if crate.homepage}}
39+
<li><a href="{{crate.homepage}}">Homepage</a></li>
2340
{{/if}}
24-
{{!--
25-
<a class='yellow-button' download
26-
{{action 'download' currentVersion}}
27-
href='{{currentVersion.dl_path}}'>
28-
<img class="button-download" src="/assets/button-download.png"/>
29-
Download
30-
</a>
31-
--}}
41+
{{#if crate.documentation}}
42+
<li><a href="{{crate.documentation}}">Documentation</a></li>
43+
{{/if}}
44+
{{#if crate.repository}}
45+
<li><a href="{{crate.repository}}">Repository</a></li>
46+
{{/if}}
47+
</ul>
3248
</div>
3349
</div>
3450

0 commit comments

Comments
 (0)