Skip to content

Commit

Permalink
Add institute logos to WAYF page.
Browse files Browse the repository at this point in the history
Fix translation errors.
Fix link in README.
Activate plain text mail template.
  • Loading branch information
redblom committed May 17, 2024
1 parent 99d4487 commit 787e052
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This will create the `invitation_version_number.tar.gz` file in the `build/artif
Now you can activate it and start experimenting. For a full experience you should setup 2 instances between which you can send invitations and create federated shares.

#### Using (official) releases
Use one of the [official releases](/sara-nl/oc-invitation/releases) or build your own compressed archive as explained [here](release/README.md).<br>
Use one of the [official releases](https://github.com/sara-nl/oc-invitation/releases) or build your own compressed archive as explained [here](release/README.md).<br>
Deploy the app by copying the extracted `invitation` folder of the official release or your own custom build to the Owncloud `apps` folder.<br>
Finally the admin should activate the app. It should than be present as a menu entrance for all users.

Expand Down
50 changes: 34 additions & 16 deletions css/invitation.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,40 +206,58 @@ div.wayf-surf-logo {
}

div.wayf div.wayf-header {
height: 1.9em;
padding: 1em;
padding-left: 1.6em;
border: 1px solid silver;
background-color: lightgray;
padding-left: 0.3em;
width: 35em;
}

div.wayf div.wayf-header h2 {
color: darkslategray;
font-weight: normal;
font-weight: bolder;
margin: 0;
margin-bottom: .2em;
}

div.wayf div.text {
font-size: smaller;
margin: .5em;
margin-bottom: 1.8em;
margin-left: .5em;
margin-bottom: 2em;
}

div.wayf div.institutes {
width: 27em;
width: 40em;
border-top: 1px solid gray;
}

div.wayf div.institutes p {
padding-left: 2em;
padding-bottom: .5em;
margin-right: .3em;
margin-left: .3em;
div.wayf div.institute {
padding-top: 1em;
padding-bottom: 1em;
border-bottom: 1px solid gray;
}

div.wayf div.institutes p a {
div.wayf div.institute:hover {
background-color: lightgray;
}

div.wayf div.institute-logo {
display: inline-block;
vertical-align: middle;
width: 10em;
text-align: center;
padding-right: .5em;
}

div.wayf div.invite-link {
display: inline-block;
}

div.wayf div.institutes a {
text-decoration: none;
font-size: 1.1em;
color: darkblue;
}

div.wayf div.institute-logo img {
max-width: 8em;
max-height: 2.5em;
}

div.app-invitation>div.oc-dialog {
Expand Down
3 changes: 2 additions & 1 deletion l10n/nl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"translations": {
"Create invitation": "Nieuwe Uitnodiging",
"Recipient email": "Email ontvanger",
"Recipient name": "Naam ontvanger",
"Invitation to": "Uitnodiging naar",
Expand All @@ -14,7 +15,7 @@
"Remote user name": "Naam remote gebruiker",
"Remote user institute": "Organisatie remote gebruiker",
"Remote user cloud ID": "Cloud ID remote gebruiker",
"Sent to": "Verzonder naar",
"Sent to": "Verzonden naar",
"Sender name": "Naam zender",
"Your name": "Uw naam",
"REMOTE_USER_TYPE_INFO_INVITED": "Federated - Uitgenodigde remote gebruiker",
Expand Down
5 changes: 2 additions & 3 deletions lib/Controller/InvitationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,8 @@ public function generateInvite(string $email = '', string $recipientName = '', s
$language = 'en'; // actually not used, the email itself is multi language
$htmlText = $this->getMailBody($inviteLink, $recipientName, $message, 'html', $language);
$mail->setHtmlBody($htmlText);
// TODO do we even need this ?
// $plainText = $this->getMailBody($inviteLink, $recipientName, $message, 'text', $language);
// $mail->setPlainBody($plainText);
$plainText = $this->getMailBody($inviteLink, $recipientName, $message, 'text', $language);
$mail->setPlainBody($plainText);
$failedRecipients = $mailer->send($mail);
if (sizeof($failedRecipients) > 0) {
$this->logger->error(' - failed recipients: ' . print_r($failedRecipients, true), ['app' => InvitationApp::APP_NAME]);
Expand Down
4 changes: 4 additions & 0 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ private function getWayfItems(string $token, string $providerEndpoint): array
$tokenParam = MeshRegistryService::PARAM_NAME_TOKEN;
$providerEndpointParam = MeshRegistryService::PARAM_NAME_PROVIDER_ENDPOINT;
$link = "$serviceEndpoint/$handleInviteEndpoint?$tokenParam=$token&$providerEndpointParam=$providerEndpoint";
// discover url of institute logo
$fragments = explode("/apps/invitation", $invitationServiceProvider->getEndpoint());
$logoUrl = $fragments[0] . '/dashboard/images/logo.png';
$wayfItems[$i] = [
"logoUrl" => $logoUrl,
"handleInviteUrl" => $link,
"providerName" => $invitationServiceProvider->getName(),
];
Expand Down
2 changes: 1 addition & 1 deletion templates/wayf/wayf.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="institutes">
<?php
foreach ($_['wayfItems'] as $item) {
print_r('<p><a href="' . $item['handleInviteUrl'] . '">' . $item['providerName'] . '</a></p>');
print_r('<a href="' . $item['handleInviteUrl'] . '"><div class="institute"><div class="institute-logo"><img src="' . $item['logoUrl'] . '" /></div><div class="invite-link">' . $item['providerName'] . '</div></div></a>');
}
?>
</div>
Expand Down

0 comments on commit 787e052

Please sign in to comment.