Skip to content

Commit

Permalink
pkp#10319 Implement ORCID brand guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
taslangraham committed Sep 11, 2024
1 parent 14e1f63 commit 7a12a99
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 27 deletions.
8 changes: 7 additions & 1 deletion locale/en/emails.po
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,21 @@ msgstr ""
"submission to your ORCID profile on publication.<br>\n"
"Visit the link to the official ORCID website, login with your profile and "
"authorize the access by following the instructions.<br>\n"
"<a href=\"{$authorOrcidUrl}\"><img id=\"orcid-id-logo\" src=\""
"<br>\n"
"<a href=\"{$authorOrcidUrl}\" style=\"display: inline-flex; align-items: center; background-color: white; text-align: center; padding: 10px 20px; text-decoration: none; border-radius: 5px; border: 2px solid #d7d4d4;\">"
"<img id=\"orcid-id-logo\" src=\""
"https://info.orcid.org/wp-content/uploads/2020/12/ORCIDiD_icon16x16.png\" "
"width='16' height='16' alt=\"ORCID iD icon\" style=\"display: block; margin: "
"0 .5em 0 0; padding: 0; float: left;\"/>Register or Connect your ORCID "
"iD</a><br/>\n"
"<br>\n"
"<br>\n"
"If the button above does not work, please use this link to register or connect your ORCID iD: <a href=\"{$authorOrcidUrl}\">{$authorOrcidUrl}.</a>\n"
"<br>\n"
"<br>\n"
"<a href=\"{$orcidAboutUrl}\">More about ORCID at {$contextName}</a><br/>\n"
"<br>\n"
"<br>\n"
"If you have any questions, please contact me.<br>\n"
"<br>\n"
"{$principalContactSignature}<br>\n"
Expand Down
8 changes: 7 additions & 1 deletion locale/en/user.po
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,9 @@ msgstr "The submission will be added to your ORCID record during publication."
msgid "orcid.verify.success"
msgstr "Your ORCID iD has been verified and successfully associated with the submission."

msgid "orcid.verify.success.redirect"
msgstr "You will now be automatically directed back to {$contextName}."

msgid "orcid.verify.failure"
msgstr "Your ORCID iD could not be verified. The link is no longer valid."

Expand Down Expand Up @@ -766,7 +769,10 @@ msgid "orcid.field.verification.request"
msgstr "Request verification"

msgid "orcid.field.verification.requested"
msgstr "Verification requested!"
msgstr "ORCID Verification has been requested!"

msgid "orcid.field.verification.resendRequest"
msgstr "Resend Verification Email"

msgid "orcid.field.authorEmailModal.title"
msgstr "Request ORCID verification"
Expand Down
1 change: 1 addition & 0 deletions pages/orcid/OrcidHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function verify(array $args, Request $request): void
'sendSubmission' => false,
'sendSubmissionSuccess' => false,
'denied' => false,
'contextName' => $request->getContext()->getName($request->getContext()->getPrimaryLocale()),
]);

// Get the author
Expand Down
3 changes: 3 additions & 0 deletions styles/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
// Right-to-left styles
@import "lib/pkp/styles/rtl.less";

// Orcid styles
@import "lib/pkp/styles/orcid.less";

/**
* Legacy styles needing refactoring
*/
Expand Down
2 changes: 1 addition & 1 deletion styles/orcid.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

.orcid_icon {
display: inline-block;
margin-right: 0.25em;
margin-right: 0.5em;
width: 24px;
height: 24px;
vertical-align: middle;
Expand Down
28 changes: 11 additions & 17 deletions templates/form/orcidProfile.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,21 @@

{capture name=orcidButton assign=orcidButton}
<button id="connect-orcid-button" class="pkp_button" onclick="return openORCID();">
{if $orcid && $orcidAuthenticated }
{$orcidIcon}
{translate key='orcid.authorise'}
{if $orcid && !$orcidAuthenticated }
<div class="orcid_button_container">{$orcidIcon}{translate key='orcid.authorise'}</div>
{else}
{translate key='orcid.connect'}
<div class="orcid_button_container">{$orcidIcon} {translate key='orcid.connect'}</div>
{/if}
</button>
<a href="{url router="page" page="orcid" op="about"}">{translate key='orcid.about.title'}</a>
<a href="{url router="page" page="orcid" op="about"}"> {translate key='orcid.about.title'}</a>
{/capture}


{capture name=orcidLink assign=orcidLink}
{if $orcidAuthenticated}
<a href="{$orcid}" target="_blank" id='orcid-link' >{$orcidIcon}{$orcid}</a>
<style>
#orcid-link {
display: flex;
gap: 0.5rem;
}
#orcid-link svg {
width: 2rem;
height: 1.5rem;
}
</style>
<a href="{$orcid}" target="_blank" id='orcid-link'>{$orcidIcon}{$orcid}</a>
{else}
<a href="{$orcid}" target="_blank">{$orcid}</a>&nbsp;{$orcidButton}
{$orcidButton}
{/if}
{/capture}

Expand Down Expand Up @@ -79,3 +68,8 @@
{$orcidButton}
{/if}

<style>
.orcid_button_container {
padding:0.5rem;
}
</style>
11 changes: 11 additions & 0 deletions templates/frontend/pages/orcidVerify.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
{elseif $submissionNotPublished}
{translate key="orcid.verify.sendSubmissionToOrcid.notpublished"}
{/if}
<span class='orcid-redirect'>
{translate key="orcid.verify.success.redirect" contextName=$contextName}
</span>
{else}
<div class="orcid-failure">
{if $orcidAPIError}
Expand All @@ -59,3 +62,11 @@
</div>

{include file="frontend/components/footer.tpl"}

{if $verifySuccess}
<script type="text/javascript">
setTimeout(function() {
window.location.href = "{$currentUrl}";
}, 5000); // 5 seconds
</script>
{/if}
23 changes: 16 additions & 7 deletions templates/user/identityForm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,25 @@
{/fbvFormSection}

{if $orcidEnabled}

<div class="orcid_container section">
{* FIXME: The form element is still required for "connect ORCID" functionality to work. *}
{fbvFormSection}
{fbvElement type="text" label="user.orcid" name="orcid" id="orcid" value=$orcid maxlength="46"}
{fbvFormSection }
{fbvElement type="text" label="user.orcid" name="orcid" id="orcid" value=$orcid maxlength="46"}

{include file="form/orcidProfile.tpl"}
{if $orcid && $orcidAuthenticated}
{include file="linkAction/buttonConfirmationLinkAction.tpl" titleIcon="modal_delete" buttonSelector="#deleteOrcidButton" dialogText="orcid.field.deleteOrcidModal.message"}
{fbvElement type="button" id="deleteOrcidButton" label="common.delete" class="pkp_button pkp_button_offset"}
{/if}
{include file="form/orcidProfile.tpl"}
{if $orcid && $orcidAuthenticated}
{include file="linkAction/buttonConfirmationLinkAction.tpl" titleIcon="modal_delete" buttonSelector="#deleteOrcidButton" dialogText="orcid.field.deleteOrcidModal.message"}
{* {fbvElement type="button" label="common.delete" class="pkp_button pkp_button_offset"}*}
<button id="deleteOrcidButton" type="button" class="pkp_button pkp_button_offset" style="margin-left: 1rem">{translate key='common.delete'}</button>
{/if}
{/fbvFormSection}
</div>
<style>
.orcid_container> .section {
display:flex;
}
</style>
{/if}

<p>
Expand Down

0 comments on commit 7a12a99

Please sign in to comment.