Skip to content

Commit 12816d4

Browse files
committed
Moves yank button to crate version header
1 parent ae8682f commit 12816d4

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

app/styles/crate/version.module.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,3 @@ div.header {
273273
.yanked {
274274
composes: yanked from '../shared/typography.module.css';
275275
}
276-
277-
.version {
278-
padding: 4px 0;
279-
}

app/styles/crate/versions.module.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
.arrow {
3838
display: inline-block;
3939
float: right;
40-
margin-left: 8px;
4140

4241
svg {
4342
background: #EEECDD;

app/templates/crate/version.hbs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
{{svg-jar "crate" local-class='crate-icon'}}
77
<h1 data-test-crate-name>{{ this.crate.name }}</h1>
88
<h2 data-test-crate-version>{{ this.currentVersion.num }}</h2>
9+
{{#if this.isOwner }}
10+
<YankButton @version={{this.currentVersion}} />
11+
{{/if}}
912
</div>
1013

1114
{{#if this.session.currentUser}}
@@ -163,17 +166,13 @@
163166
<h3>Versions</h3>
164167
<ul>
165168
{{#each this.smallSortedVersions as |version|}}
166-
<li local-class="version">
169+
<li>
167170
<LinkTo @route="crate.version" @model={{version.num}} data-test-version-link={{version.num}}>
168171
{{ version.num }}
169172
</LinkTo>
170173
{{moment-format version.created_at 'll'}}
171-
{{#if this.isOwner}}
172-
<YankButton @version={{version}}/>
173-
{{else}}
174-
{{#if version.yanked}}
175-
<span local-class='yanked'>yanked</span>
176-
{{/if}}
174+
{{#if version.yanked}}
175+
<span local-class='yanked'>yanked</span>
177176
{{/if}}
178177
</li>
179178
{{/each}}

app/templates/crate/versions.hbs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
<span local-class='yanked'>yanked</span>
1818
{{/if}}
1919
</div>
20-
<div>
21-
{{#if this.isOwner}}
22-
<YankButton @version={{version}} />
23-
{{/if}}
20+
{{#if this.isOwner}}
21+
<YankButton @version={{version}} />
22+
{{else}}
2423
<LinkTo @route="crate.version" @model={{version.num}} local-class="arrow">
2524
{{svg-jar "right-arrow"}}
2625
</LinkTo>
27-
</div>
26+
{{/if}}
2827
</div>
2928
{{/each}}
3029
</div>

0 commit comments

Comments
 (0)