|
| 1 | +<div |
| 2 | + data-test-preprint-card |
| 3 | + data-analytics-scope='Preprint Card' |
| 4 | + local-class='preprint-card' |
| 5 | +> |
| 6 | + <div local-class='card-contents'> |
| 7 | + <div |
| 8 | + local-class='card-body {{if (is-mobile) 'mobile'}}' |
| 9 | + > |
| 10 | + <h4 local-class='list-group-item-heading heading' data-test-preprint-card-heading> |
| 11 | + {{#unless @preprint.public}} |
| 12 | + <span> |
| 13 | + <FaIcon @icon='lock' /> |
| 14 | + <EmberTooltip> |
| 15 | + {{t 'preprints.preprint_card.private_tooltip'}} |
| 16 | + </EmberTooltip> |
| 17 | + </span> | |
| 18 | + {{/unless}} |
| 19 | + <OsfLink |
| 20 | + local-class='osf-link {{if (is-mobile) 'mobile'}}' |
| 21 | + data-analytics-name='Title' |
| 22 | + data-test-preprint-title='{{@preprint.id}}' |
| 23 | + @route='resolve-guid' |
| 24 | + @models={{array @preprint.id}} |
| 25 | + > |
| 26 | + {{@preprint.title}} |
| 27 | + </OsfLink> |
| 28 | + <div local-class='status-label'> |
| 29 | + {{#if (eq @preprint.reviewsState 'pending')}} |
| 30 | + <span local-class='label label-info'>{{t 'preprints.preprint_card.statuses.pending'}}</span> |
| 31 | + {{else if (eq @preprint.reviewsState 'accepted')}} |
| 32 | + <span local-class='label label-primary'>{{t 'preprints.preprint_card.statuses.accepted'}}</span> |
| 33 | + {{else if (eq @preprint.reviewsState 'rejected')}} |
| 34 | + <span local-class='label label-danger'>{{t 'preprints.preprint_card.statuses.rejected'}}</span> |
| 35 | + {{/if}} |
| 36 | + </div> |
| 37 | + </h4> |
| 38 | + <div data-test-preprint-card-body local-class='body'> |
| 39 | + <dl> |
| 40 | + <div> |
| 41 | + <dt data-test-provider-label> |
| 42 | + {{t 'preprints.preprint_card.provider'}} |
| 43 | + </dt> |
| 44 | + <dd data-test-provider-value> |
| 45 | + {{@preprint.provider.name}} |
| 46 | + </dd> |
| 47 | + </div> |
| 48 | + <div> |
| 49 | + <dt data-test-created-timestamp-label> |
| 50 | + {{t 'preprints.preprint_card.date_created'}} |
| 51 | + </dt> |
| 52 | + <dd data-test-created-timestamp-value> |
| 53 | + {{moment-format @preprint.dateCreated 'YYYY-MM-DD'}} |
| 54 | + </dd> |
| 55 | + </div> |
| 56 | + <div> |
| 57 | + <dt data-test-updated-timestamp-label> |
| 58 | + {{t 'preprints.preprint_card.date_modified'}} |
| 59 | + </dt> |
| 60 | + <dd data-test-updated-timestamp-value> |
| 61 | + {{moment-format @preprint.dateModified 'YYYY-MM-DD'}} |
| 62 | + </dd> |
| 63 | + </div> |
| 64 | + <div> |
| 65 | + <dt data-test-contributors-label> |
| 66 | + {{t 'preprints.preprint_card.contributors'}} |
| 67 | + </dt> |
| 68 | + <dd> |
| 69 | + <ContributorList |
| 70 | + @model={{@preprint}} |
| 71 | + @shouldLinkUsers={{true}} |
| 72 | + /> |
| 73 | + </dd> |
| 74 | + </div> |
| 75 | + {{#if (and this.showTags @preprint.tags)}} |
| 76 | + <div> |
| 77 | + <dt local-class='tags' data-test-tags-label> |
| 78 | + {{t 'preprints.preprint_card.tags'}} |
| 79 | + </dt> |
| 80 | + <dd> |
| 81 | + <TagsWidget |
| 82 | + @taggable={{@preprint}} |
| 83 | + @inline={{true}} |
| 84 | + /> |
| 85 | + </dd> |
| 86 | + </div> |
| 87 | + {{/if}} |
| 88 | + </dl> |
| 89 | + <div local-class='PreprintButtons'> |
| 90 | + <OsfLink |
| 91 | + local-class='link' |
| 92 | + data-analytics-name='View Preprint' |
| 93 | + data-test-view-button='{{@preprint.id}}' |
| 94 | + @route='resolve-guid' |
| 95 | + @models={{array @preprint.id}} |
| 96 | + > |
| 97 | + {{t 'preprints.preprint_card.view_button'}} |
| 98 | + </OsfLink> |
| 99 | + {{#if this.shouldShowUpdateButton}} |
| 100 | + <OsfLink |
| 101 | + local-class='link update-button' |
| 102 | + data-analytics-name='Edit Preprint' |
| 103 | + data-test-update-button='{{@preprint.id}}' |
| 104 | + @route='preprints.edit' |
| 105 | + @models={{array @preprint.provider.id @preprint.id}} |
| 106 | + > |
| 107 | + {{t 'preprints.preprint_card.update_button'}} |
| 108 | + </OsfLink> |
| 109 | + {{/if}} |
| 110 | + </div> |
| 111 | + </div> |
| 112 | + </div> |
| 113 | + </div> |
| 114 | +</div> |
0 commit comments