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