Skip to content

Commit

Permalink
Initial steps to update the template
Browse files Browse the repository at this point in the history
  • Loading branch information
bp-cos committed Aug 23, 2023
1 parent b38e92d commit ae03b73
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/preprints/detail/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default class PrePrintsDetailController extends Controller {
}

authors(): ContributorModel[] {
return this.model.contributors;
return this.model.preprint.contributors;
}

fullLicenseText(): string {
Expand Down
10 changes: 0 additions & 10 deletions app/preprints/detail/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export default class PreprintsDetail extends Route {

/*
export default Route.extend({
currentUser: service(),
features: service(),
model(params) {
const opts = {
Expand All @@ -88,15 +87,6 @@ export default Route.extend({
},
};
this.get('currentUser').authenticatedAJAX(opts).then((res) => {
if (Array.isArray(res.meta.active_flags)) {
this.get('features').setup(res.meta.active_flags.reduce(function(acc, flag) {
acc[flag] = true;
return acc;
}, {}));
}
});
return this.store.findRecord(
'preprint', params.preprint_id,
{
Expand Down
16 changes: 7 additions & 9 deletions app/preprints/detail/template.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{{page-title this.model.preprint.title replace=true}}
{{ this.theme.provider.id}}
{{ this.theme.provider.brand.primaryColor}}
{{page-title this.model.preprint.title replace=false}}


<div id='view-page'>
Expand All @@ -10,14 +8,14 @@
<div class='container'>
<div class='row'>
<div class='col-xs-12 preprint-title-container'>
<h1 id='preprintTitle'>{{this.model.title}}</h1>
<h1 id='preprintTitle'>{{this.model.preprint.title}}</h1>
{{#unless this.isWithdrawn}}
<div class='p-b-md edit-preprint-button'>
{{#if (and this.userIsContrib (not this.isPendingWithdrawal))}}
<a type='button'
class='btn btn-success edit-btn'
href={{concat this.theme.guidPathPrefix this.model.id '/edit'}}
onclick={{action 'click' 'link' 'Content - Edit Preprint' (concat this.model.links.html 'edit')}}
onclick={{action 'click' 'link' 'Content - Edit Preprint' (concat this.model.preprint?.links?.html 'edit')}}
>
{{t @editButtonLabel documentType=this.model.provider.documentType}}
</a>
Expand All @@ -31,7 +29,7 @@
<div class='col-xs-12 col-sm-12'>
<h5 class='view-authors'>
<div class='detail-header-label'>
<strong>{{t 'content.header.authors_label'}}</strong>
<strong>{{t 'preprints.detail.header.authors_label'}}</strong>
</div>
<ul class='comma-list'>
{{#if this.authors}}
Expand All @@ -57,7 +55,7 @@
</h5>
</div>
</div>
{{author-assertions preprint=this.model}}
{{!author-assertions preprint=this.model.preprint}}
</div>
{{!END CONTAINER DIV}}
</div>
Expand Down Expand Up @@ -152,9 +150,9 @@
<div>
<span>{{t this.dateLabel}}: {{moment-format this.model.dateCreated 'MMMM DD, YYYY'}}</span>
{{#if this.isWithdrawn}}
| <span>{{t 'content.header.withdrawn_on'}}: {{moment-format this.model.dateWithdrawn 'MMMM DD, YYYY'}}</span>
| <span>{{t 'preprint.detail.header.withdrawn_on'}}: {{moment-format this.model.dateWithdrawn 'MMMM DD, YYYY'}}</span>
{{else}}
| <span>{{t 'content.header.last_edited'}}: {{moment-format this.model.dateModified 'MMMM DD, YYYY'}}</span>
| <span>{{t 'preprint.detail.header.last_edited'}}: {{moment-format this.model.dateModified 'MMMM DD, YYYY'}}</span>
{{/if}}
</div>
<button
Expand Down
6 changes: 6 additions & 0 deletions translations/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,11 @@ preprints:
discover:
title: 'Search'
title: 'Preprints'
detail:
header:
last_edited: 'Last edited'
authors_label: 'Authors'
withdrawn_on: 'Withdrawn'
header:
osf_registrations: 'OSF Preprints'
registrations: 'Preprints'
Expand All @@ -1123,6 +1128,7 @@ preprints:
or: 'or'
submit_label: 'Submit a preprint'
example: 'See an example'
authors_label:
subjects:
heading:
provider: 'Browse by provider'
Expand Down

0 comments on commit ae03b73

Please sign in to comment.