-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add different set of navbar links for preprints
- Loading branch information
1 parent
ae41bc1
commit 68caa77
Showing
6 changed files
with
122 additions
and
1 deletion.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
lib/osf-components/addon/components/osf-navbar/preprint-links/component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Component from '@glimmer/component'; | ||
import { inject as service } from '@ember/service'; | ||
import CurrentUserService from 'ember-osf-web/services/current-user'; | ||
import config from 'ember-osf-web/config/environment'; | ||
|
||
interface Args { | ||
onLinkClicked: () => void; | ||
} | ||
export default class OsfNavbarPreprintLinks extends Component<Args> { | ||
@service currentUser!: CurrentUserService; | ||
|
||
donateURL = `${config.OSF.donateUrl}`; | ||
supportURL = `${config.support.faqPageUrl}`; | ||
} |
57 changes: 57 additions & 0 deletions
57
lib/osf-components/addon/components/osf-navbar/preprint-links/template.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<li data-test-nav-my-preprints-link> | ||
<OsfLink | ||
@href='/myprojects/#preprints/' | ||
data-analytics-name='My preprints' | ||
{{on 'click' @onLinkClicked}} | ||
> | ||
{{t 'navbar.my_preprints'}} | ||
</OsfLink> | ||
</li> | ||
{{#if this.currentUser.user.canViewReviews}} | ||
<li data-test-nav-reviews-link> | ||
<OsfLink | ||
@href='/reviews/' | ||
data-analytics-name='My reviews' | ||
{{on 'click' @onLinkClicked}} | ||
> | ||
{{t 'navbar.reviews'}} | ||
</OsfLink> | ||
</li> | ||
{{/if}} | ||
<li data-test-nav-submit-preprint-link> | ||
<OsfLink | ||
@href='/preprints/submit/' | ||
data-analytics-name='Add a preprint' | ||
{{on 'click' @onLinkClicked}} | ||
> | ||
{{t 'navbar.add_a_preprint' preprintWord=(t 'documentType.preprint.singularCapitalized')}} | ||
</OsfLink> | ||
</li> | ||
<li data-test-nav-search-link> | ||
<OsfLink | ||
@route='search' | ||
@queryParams={{hash resourceType='Preprint'}} | ||
data-analytics-name='Search' | ||
{{on 'click' @onLinkClicked}} | ||
> | ||
{{t 'navbar.search'}} | ||
</OsfLink> | ||
</li> | ||
<li data-test-nav-support-link> | ||
<OsfLink | ||
@href={{this.supportURL}} | ||
data-analytics-name='Support' | ||
{{on 'click' @onLinkClicked}} | ||
> | ||
{{t 'navbar.support'}} | ||
</OsfLink> | ||
</li> | ||
<li class='navbar-donate-button' data-test-nav-donate-link> | ||
<OsfLink | ||
@href={{this.donateURL}} | ||
data-analytics-name='Donate' | ||
{{on 'click' @onLinkClicked}} | ||
> | ||
{{t 'navbar.donate'}} | ||
</OsfLink> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
lib/osf-components/app/components/osf-navbar/preprint-links/component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'osf-components/components/osf-navbar/preprint-links/component'; |
1 change: 1 addition & 0 deletions
1
lib/osf-components/app/components/osf-navbar/preprint-links/template.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'osf-components/components/osf-navbar/preprint-links/template'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters