Skip to content

Commit

Permalink
Record view / Social network link points to permalink.
Browse files Browse the repository at this point in the history
  • Loading branch information
fxprunayre committed Sep 19, 2023
1 parent 9b3a5fb commit 06036cb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,27 @@
}
]);

module.directive("gnMetadataSocialLink", [
"gnUtilityService",
"$http",
function (gnUtilityService, $http) {
return {
templateUrl: "../../catalog/components/search/mdview/partials/social.html",
scope: {
md: "=gnMetadataSocialLink"
},
link: function (scope, element, attrs) {
scope.mdService = gnUtilityService;
$http
.get("../api/records/" + scope.md.getUuid() + "/permalink")
.then(function (r) {
scope.socialMediaLink = r.data;
});
}
};
}
]);

module.directive("gnQualityMeasuresTable", [
"gnGlobalSettings",
function (gnGlobalSettings) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<section class="gn-md-side-social" data-ng-show="isSocialbarEnabled">
<section class="gn-md-side-social">
<h2 data-translate="">shareOn</h2>
<div class="btn-group">
<a
Expand All @@ -16,14 +16,14 @@ <h2 data-translate="">shareOn</h2>
><i class="fa fa-fw fa-facebook"></i
></a>
<a
data-ng-href="http://www.linkedin.com/shareArticle?mini=true&amp;summary={{mdView.current.record.resourceTitle}}&amp;url={{socialMediaLink | encodeURIComponent}}"
data-ng-href="http://www.linkedin.com/sharing/share-offsite/?url={{socialMediaLink | encodeURIComponent}}"
title="{{'shareOnLinkedIn' | translate}}"
target="_blank"
class="btn btn-default"
><i class="fa fa-fw fa-linkedin"></i
></a>
<a
data-ng-href="mailto:?subject={{mdView.current.record.resourceTitle}}&amp;body={{socialMediaLink | encodeURIComponent}}"
data-ng-href="mailto:?subject={{md.resourceTitle}}&amp;body={{socialMediaLink | encodeURIComponent}}"
title="{{'shareByEmail' | translate}}"
target="_blank"
class="btn btn-default"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div ng-include="'../../catalog/views/default/templates/recordView/social.html'" />
<div gn-metadata-social-link="mdView.current.record" data-ng-show="isSocialbarEnabled" />

<div data-ng-show="isRatingEnabled" class="gn-md-side-rating gn-margin-bottom">
<h2>
Expand Down

0 comments on commit 06036cb

Please sign in to comment.