File tree 7 files changed +100
-87
lines changed
7 files changed +100
-87
lines changed Original file line number Diff line number Diff line change
1
+ <PageHeader local-class =" header" data-test-heading>
2
+ <div local-class =" header-row" >
3
+ <div local-class =" heading" >
4
+ {{ svg-jar " crate" local-class =" crate-icon" }}
5
+ <h1 data-test-crate-name>{{ @crate.name }} </h1 >
6
+ {{ #if @version }}
7
+ <h2 data-test-crate-version>{{ @version.num }} </h2 >
8
+ {{ /if }}
9
+ </div >
10
+
11
+ {{ #if this.session.currentUser }}
12
+ <FollowButton @crate ={{ @crate }} />
13
+ {{ /if }}
14
+ </div >
15
+
16
+ <ul local-class =" quick-links" >
17
+ {{ #if @crate.homepage }}
18
+ <li ><a href =" {{ @crate.homepage }} " >Homepage</a ></li >
19
+ {{ /if }}
20
+ {{ #if @crate.wiki }}
21
+ <li ><a href =" {{ @crate.wiki }} " >Wiki</a ></li >
22
+ {{ /if }}
23
+ {{ #if @crate.mailing_list }}
24
+ <li ><a href =" {{ @crate.mailing_list }} " >Mailing list</a ></li >
25
+ {{ /if }}
26
+ {{ #if this.documentationLink }}
27
+ <li ><a href =" {{ this.documentationLink }} " data-test-docs-link>Documentation</a ></li >
28
+ {{ /if }}
29
+ {{ #if @crate.repository }}
30
+ <li ><a href =" {{ @crate.repository }} " >Repository</a ></li >
31
+ {{ /if }}
32
+ </ul >
33
+ </PageHeader >
Original file line number Diff line number Diff line change
1
+ import { inject as service } from '@ember/service' ;
2
+ import Component from '@glimmer/component' ;
3
+
4
+ export default class CrateHeader extends Component {
5
+ @service session ;
6
+
7
+ get documentationLink ( ) {
8
+ return this . args . version ?. documentationLink ?? this . args . crate . documentation ;
9
+ }
10
+ }
Original file line number Diff line number Diff line change
1
+ .header {
2
+ padding-top : 30px ;
3
+ padding-bottom : 30px ;
4
+ }
5
+
6
+ .header-row {
7
+ display : flex;
8
+ justify-content : space-between;
9
+ padding-bottom : 10px ;
10
+ }
11
+
12
+ .heading {
13
+ display : flex;
14
+ align-items : center;
15
+
16
+ h1 , h2 {
17
+ margin : 0 ;
18
+ padding : 0 ;
19
+ }
20
+
21
+ h2 {
22
+ color : var (--main-color-light );
23
+ margin-left : 10px ;
24
+ }
25
+ }
26
+
27
+ .crate-icon {
28
+ flex-shrink : 0 ;
29
+ margin-right : 10px ;
30
+ width : 32px ;
31
+ height : 32px ;
32
+ }
33
+
34
+ .quick-links {
35
+ display : flex;
36
+ flex-direction : row;
37
+ flex-wrap : wrap;
38
+
39
+ font-size : 80% ;
40
+ list-style-type : none;
41
+ margin : 1em 0 0 0 ;
42
+ padding : 0 ;
43
+
44
+
45
+ li {
46
+ margin-right : 1em ;
47
+
48
+ & : last-child {
49
+ margin-right : 0 ;
50
+ }
51
+ }
52
+ }
Original file line number Diff line number Diff line change 1
- div .header {
2
- padding-top : 30px ;
3
- padding-bottom : 30px ;
4
- }
5
-
6
- .header-row {
7
- display : flex;
8
- justify-content : space-between;
9
- padding-bottom : 10px ;
10
- }
11
-
12
- .heading {
13
- display : flex;
14
- align-items : center;
15
-
16
- h1 , h2 {
17
- margin : 0 ;
18
- padding : 0 ;
19
- }
20
-
21
- h2 {
22
- color : var (--main-color-light );
23
- margin-left : 10px ;
24
- }
25
- }
26
-
27
- .crate-icon {
28
- flex-shrink : 0 ;
29
- margin-right : 10px ;
30
- width : 32px ;
31
- height : 32px ;
32
- }
33
-
34
- .quick-links {
35
- display : flex;
36
- flex-direction : row;
37
- flex-wrap : wrap;
38
-
39
- font-size : 80% ;
40
- list-style-type : none;
41
- margin : 1em 0 0 0 ;
42
- padding : 0 ;
43
-
44
-
45
- li {
46
- margin-right : 1em ;
47
-
48
- & : last-child {
49
- margin-right : 0 ;
50
- }
51
- }
52
- }
53
-
54
1
.crate-info {
55
2
display : flex;
56
3
flex-direction : column;
Original file line number Diff line number Diff line change
1
+ <CrateHeader @crate ={{ this.crate }} />
2
+
1
3
<div local-class =" back-link" >
2
4
<LinkTo @route =" crate" @model ={{ this.crate.id }} >⬅ Back to {{ this.crate.name }} </LinkTo >
3
5
</div >
Original file line number Diff line number Diff line change 1
1
{{ page-title this.crate.name }}
2
2
3
- <PageHeader local-class =" header" data-test-heading>
4
- <div local-class =" header-row" >
5
- <div local-class =" heading" >
6
- {{ svg-jar " crate" local-class =' crate-icon' }}
7
- <h1 data-test-crate-name>{{ this.crate.name }} </h1 >
8
- <h2 data-test-crate-version>{{ this.currentVersion.num }} </h2 >
9
- {{ #if this.isOwner }}
10
- {{!-- <YankButton @version ={{this.currentVersion}} @tan ={{true}} /> --}}
11
- {{ /if }}
12
- </div >
13
-
14
- {{ #if this.session.currentUser }}
15
- <FollowButton @crate ={{ this.crate }} />
16
- {{ /if }}
17
- </div >
18
-
19
- <ul local-class =" quick-links" >
20
- {{ #if this.crate.homepage }}
21
- <li ><a href =" {{ this.crate.homepage }} " >Homepage</a ></li >
22
- {{ /if }}
23
- {{ #if this.crate.wiki }}
24
- <li ><a href =" {{ this.crate.wiki }} " >Wiki</a ></li >
25
- {{ /if }}
26
- {{ #if this.crate.mailing_list }}
27
- <li ><a href =" {{ this.crate.mailing_list }} " >Mailing list</a ></li >
28
- {{ /if }}
29
- {{ #if this.currentVersion.documentationLink }}
30
- <li ><a href =" {{ this.currentVersion.documentationLink }} " data-test-docs-link>Documentation</a ></li >
31
- {{ /if }}
32
- {{ #if this.crate.repository }}
33
- <li ><a href =" {{ this.crate.repository }} " >Repository</a ></li >
34
- {{ /if }}
35
- </ul >
36
- </PageHeader >
3
+ <CrateHeader @crate ={{ this.crate }} @version ={{ this.currentVersion }} />
37
4
38
5
<div local-class =' crate-info' >
39
6
<div local-class =" docs" >
Original file line number Diff line number Diff line change
1
+ <CrateHeader @crate ={{ this.model }} />
2
+
1
3
<LinkTo @route =" crate" @model ={{ this.model }} local-class =" back-link" >⬅ Back to Main Page</LinkTo >
2
4
3
5
<span local-class =" page-description" data-test-page-description>
You can’t perform that action at this time.
0 commit comments