From 787e0528d50e2bec8d49a828a4992709becdeca0 Mon Sep 17 00:00:00 2001 From: Antoon Prins Date: Fri, 17 May 2024 09:53:53 +0200 Subject: [PATCH] Add institute logos to WAYF page. Fix translation errors. Fix link in README. Activate plain text mail template. --- README.md | 2 +- css/invitation.css | 50 +++++++++++++++++-------- l10n/nl.json | 3 +- lib/Controller/InvitationController.php | 5 +-- lib/Controller/PageController.php | 4 ++ templates/wayf/wayf.php | 2 +- 6 files changed, 44 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index b7b13e8..c92a77d 100644 --- a/README.md +++ b/README.md @@ -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).
+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).
Deploy the app by copying the extracted `invitation` folder of the official release or your own custom build to the Owncloud `apps` folder.
Finally the admin should activate the app. It should than be present as a menu entrance for all users. diff --git a/css/invitation.css b/css/invitation.css index 6c9d856..dfc5bd7 100644 --- a/css/invitation.css +++ b/css/invitation.css @@ -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 { diff --git a/l10n/nl.json b/l10n/nl.json index aa8c7a8..271fb0d 100644 --- a/l10n/nl.json +++ b/l10n/nl.json @@ -1,5 +1,6 @@ { "translations": { + "Create invitation": "Nieuwe Uitnodiging", "Recipient email": "Email ontvanger", "Recipient name": "Naam ontvanger", "Invitation to": "Uitnodiging naar", @@ -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", diff --git a/lib/Controller/InvitationController.php b/lib/Controller/InvitationController.php index c7ba22d..a928cad 100644 --- a/lib/Controller/InvitationController.php +++ b/lib/Controller/InvitationController.php @@ -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]); diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index dbfff16..b9f492f 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -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(), ]; diff --git a/templates/wayf/wayf.php b/templates/wayf/wayf.php index 36f231d..4da98e5 100644 --- a/templates/wayf/wayf.php +++ b/templates/wayf/wayf.php @@ -18,7 +18,7 @@
' . $item['providerName'] . '

'); + print_r('
'); } ?>