|
1 | | -<div local-class="row {{if @token.isNew "create-token"}}" data-test-api-token={{@token.id}}> |
2 | | - <div local-class="name" data-test-name> |
3 | | - {{#if @token.isNew}} |
| 1 | +{{#if @token.isNew}} |
| 2 | + <form local-class="row create-token" {{on "submit" (perform this.saveTokenTask)}}> |
| 3 | + <div local-class="name"> |
4 | 4 | <Input |
5 | 5 | @type="text" |
6 | 6 | placeholder="New token name" |
7 | 7 | @disabled={{@token.isSaving}} |
8 | 8 | @value={{@token.name}} |
9 | | - @enter={{perform this.saveTokenTask}} |
10 | 9 | data-test-focused-input |
11 | 10 | {{auto-focus}} |
12 | 11 | /> |
13 | | - {{else}} |
| 12 | + </div> |
| 13 | + |
| 14 | + <div local-class="actions"> |
| 15 | + <button |
| 16 | + type="submit" |
| 17 | + local-class="save-button" |
| 18 | + disabled={{this.disableCreate}} |
| 19 | + title={{if this.emptyName "You must specify a name" ""}} |
| 20 | + data-test-save-token-button |
| 21 | + > |
| 22 | + Create |
| 23 | + </button> |
| 24 | + {{#if @token.isSaving}} |
| 25 | + <LoadingSpinner local-class="spinner" data-test-saving-spinner /> |
| 26 | + {{/if}} |
| 27 | + </div> |
| 28 | + </form> |
| 29 | +{{else}} |
| 30 | + <div local-class="row" data-test-api-token={{@token.id}}> |
| 31 | + <div local-class="name" data-test-name> |
14 | 32 | {{@token.name}} |
15 | | - {{/if}} |
16 | | - </div> |
| 33 | + </div> |
17 | 34 |
|
18 | | - {{#unless @token.isNew}} |
19 | | - <div local-class='dates'> |
| 35 | + <div local-class="dates"> |
20 | 36 | <span title={{@token.created_at}} local-class="created-at" data-test-created-at> |
21 | 37 | Created {{moment-from-now @token.created_at}} |
22 | 38 | </span> |
|
28 | 44 | {{/if}} |
29 | 45 | </span> |
30 | 46 | </div> |
31 | | - {{/unless}} |
32 | 47 |
|
33 | | - <div local-class='actions'> |
34 | | - {{#if @token.isNew}} |
35 | | - <button |
36 | | - type="button" |
37 | | - local-class="save-button" |
38 | | - disabled={{this.disableCreate}} |
39 | | - title={{if this.emptyName "You must specify a name" ""}} |
40 | | - data-test-save-token-button |
41 | | - {{on "click" (perform this.saveTokenTask)}} |
42 | | - > |
43 | | - Create |
44 | | - </button> |
45 | | - {{else}} |
| 48 | + <div local-class="actions"> |
46 | 49 | <button |
47 | 50 | type="button" |
48 | 51 | local-class="revoke-button" |
|
52 | 55 | > |
53 | 56 | Revoke |
54 | 57 | </button> |
55 | | - {{/if}} |
56 | | - {{#if @token.isSaving}} |
57 | | - <LoadingSpinner local-class="spinner" data-test-saving-spinner /> |
58 | | - {{/if}} |
| 58 | + {{#if @token.isSaving}} |
| 59 | + <LoadingSpinner local-class="spinner" data-test-saving-spinner /> |
| 60 | + {{/if}} |
| 61 | + </div> |
59 | 62 | </div> |
60 | | -</div> |
61 | 63 |
|
62 | | -{{#if @token.token}} |
63 | | - <div local-class="row new-token" data-test-token> |
64 | | - <div> |
65 | | - Please record this token somewhere, you cannot retrieve |
66 | | - its value again. For use on the command line you can save it to <code>~/.cargo/credentials</code> |
67 | | - with: |
| 64 | + {{#if @token.token}} |
| 65 | + <div local-class="row new-token" data-test-token> |
| 66 | + <div> |
| 67 | + Please record this token somewhere, you cannot retrieve |
| 68 | + its value again. For use on the command line you can save it to <code>~/.cargo/credentials</code> |
| 69 | + with: |
68 | 70 |
|
69 | | - <pre>cargo login {{@token.token}}</pre> |
| 71 | + <pre>cargo login {{@token.token}}</pre> |
| 72 | + </div> |
70 | 73 | </div> |
71 | | - </div> |
| 74 | + {{/if}} |
72 | 75 | {{/if}} |
0 commit comments