Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit e9705cf

Browse files
Merge pull request #123 from dBucik/hidePreviousSocialWhenExtendedList
When user displays ext. list, hide previous selection
2 parents 05de141 + 8b77d42 commit e9705cf

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
1010
#### Changed
1111
- Changed the way of getting attribute names for interfaces: through internal attribute names in perun_attributes.php config
1212
- Return sorted eduPersonEntitlement
13+
- Don't show previous selection when user show all entries on the discovery page
1314

1415
## [v3.9.0]
1516
#### Added

lib/Disco.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,14 @@ public static function showTaggedEntry($t, $metadata, $showSignInWith = false)
446446
return $html;
447447
}
448448

449-
public static function getOr()
449+
public static function getOr($id = NULL)
450450
{
451-
$or = '<div class="hrline">';
451+
$or = '';
452+
if (!is_null($id)) {
453+
$or .= '<div class="hrline" id="' . $id . '">';
454+
} else {
455+
$or .= '<div class="hrline">';
456+
}
452457
$or .= ' <span>or</span>';
453458
$or .= '</div>';
454459
return $or;
@@ -514,6 +519,9 @@ public static function showEntriesScript()
514519
$script = '<script type="text/javascript">
515520
$(document).ready(function() {
516521
$("#showEntries").click(function() {
522+
$("#last-used-idp").hide();
523+
$("#last-used-idp-desc").hide();
524+
$("#last-used-idp-or").hide();
517525
$("#entries").show();
518526
$("#showEntries").hide();
519527
});

themes/perun/perun/disco-tpl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@
123123

124124
if (!$warningIsOn || $warningType === WARNING_TYPE_INFO || $warningType === WARNING_TYPE_WARNING) {
125125
if (!empty($this->getPreferredIdp())) {
126-
echo '<p class="descriptionp">' . $this->t('{perun:disco:previous_selection}') . '</p>';
126+
echo '<p class="descriptionp" id="last-used-idp-desc">' . $this->t('{perun:disco:previous_selection}') . '</p>';
127127
echo '<div id="last-used-idp" class="metalist list-group">';
128128
echo Disco::showEntry($this, $this->getPreferredIdp(), true);
129129
echo '</div>';
130130

131-
echo Disco::getOr();
131+
echo Disco::getOr("last-used-idp-or");
132132

133133
echo '<a id="showEntries" class="metaentry btn btn-block btn-default btn-lg" href="#">' .
134134
$this->t('{perun:disco:sign_with_other_institution}') . '</a>' ;

0 commit comments

Comments
 (0)