Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3573752 authored by Ronak Patel's avatar Ronak Patel
Browse files

Add guest share stylesheet and form fixes

parent b637dd98
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -7,7 +7,9 @@ use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent as FilesSharingBeforeTemplateRenderedEvent;
use OCA\EcloudThemeHelper\Listeners\BeforeTemplateRenderedListener;
use OCA\EcloudThemeHelper\Listeners\FilesSharingBeforeTemplateRenderedListener;

class Application extends App implements IBootstrap {
	public const APP_ID = 'ecloud-theme-helper';
@@ -18,6 +20,7 @@ class Application extends App implements IBootstrap {

	public function register(IRegistrationContext $context): void {
		$context->registerEventListener(BeforeTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class);
		$context->registerEventListener(FilesSharingBeforeTemplateRenderedEvent::class, FilesSharingBeforeTemplateRenderedListener::class);
	}

	public function boot(IBootContext $context): void {
+25 −0
Original line number Diff line number Diff line
<?php

namespace OCA\EcloudThemeHelper\Listeners;

use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent as FilesSharingBeforeTemplateRenderedEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Util;

class FilesSharingBeforeTemplateRenderedListener implements IEventListener {
	private Util $util;
	private string $appName;

	public function __construct($appName, Util $util) {
		$this->appName = $appName;
		$this->util = $util;
	}

	public function handle(Event $event): void {
		if (!($event instanceof FilesSharingBeforeTemplateRenderedEvent)) {
			return;
		}
		$this->util->addStyle($this->appName, 'files-share');
	}
}

scss/files-share.scss

0 → 100644
+99 −0
Original line number Diff line number Diff line
/* Guest/public share styles */
#body-login .v-align .guest-box {
	#password-input-form,
	#email-input-form {
		max-width: 500px;
	}
	#password-input-form,
	#email-input-form {
		.warning {
			background: var(--color-main-background);
			border: 1px solid var(--color-border);
			border-radius: 16px;
			box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
			color: var(--color-main-text);
			padding: 20px 22px 18px;
		}
		.warning-info {
			color: var(--color-text-maxcontrast);
			font-weight: 600;
			margin-bottom: 10px;
			width: 300px;
			margin: 10px auto;
		}
		.warning.wrongPasswordMsg {
			background: color-mix(in srgb, var(--color-error) 12%, var(--color-main-background));
			border-color: var(--color-error);
			color: var(--color-error);
			width: fit-content;
			margin-bottom: 12px;
		}
		.warning#identification-failure {
			background: color-mix(in srgb, var(--color-error) 12%, var(--color-main-background));
			border-color: var(--color-error);
			color: var(--color-error);
			margin-top: 12px;
			padding: 12px 14px;
			width: 92%;
			max-width: 420px;
		}
		label.infield,
		#password,
		#email {
			color: var(--color-main-text);
		}
		#password,
		#email {
			background: var(--color-main-background);
			border: 1px solid var(--color-border);
			border-radius: 12px;
			box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
			padding: 12px 44px 12px 12px;
			transition: border-color 120ms ease, box-shadow 120ms ease;
		}
		#password:focus,
		#email:focus {
			border-color: var(--color-primary);
			box-shadow: 0 0 0 3px rgba(0, 118, 255, 0.15);
			outline: none;
		}
		#password-submit,
		#password-request {
			border-radius: 10px;
		}
	}
}

@media (max-width: 640px) {
	#body-login .v-align .guest-box {
		#password-input-form,
		#email-input-form {
			.warning {
				max-width: 100% !important;
				margin: unset !important;
				width: auto;
			}
		}
	}
	#password-input-form,
	#email-input-form {
		width: 100% !important;
	}
	
}

#request-password-button-not-talk, #request-password-back-button {
	display: inline-block;
	margin-top: 12px;
}

.v-align.warning-messsage > div {
	width: 100% !important;
}

body .icon-download {
	background-image: var(--icon-download-white) !important;
}
body .icon-download-dark {
	background-image: var(--icon-download-dark) !important;
}