diff --git a/SQL/0000-00-03-ConfigTables.sql b/SQL/0000-00-03-ConfigTables.sql index d14ad593f7f..59d10f0a370 100644 --- a/SQL/0000-00-03-ConfigTables.sql +++ b/SQL/0000-00-03-ConfigTables.sql @@ -48,6 +48,11 @@ CREATE TABLE `Config` ( INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, Label, OrderNumber) VALUES ('study', 'Settings related to details of the study', 1, 0, 'Study', 1); INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'title', 'Full descriptive title of the study', 1, 0, 'text', ID, 'Study title', 1 FROM ConfigSettings WHERE Name="study"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'studylogo', 'Filename containing logo of the study. File should be located under the htdocs/images/ folder', 1, 0, 'text', ID, 'Study logo', 2 FROM ConfigSettings WHERE Name="study"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'login_logo_left', 'Path for top left logo on the login page.', 1, 0, 'text', ID, 'Login Top Left Logo', 3 FROM ConfigSettings WHERE Name="study"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'login_logo_right', 'Path for top right logo on the login page.', 1, 0, 'text', ID, 'Login Top Right Logo', 3 FROM ConfigSettings WHERE Name="study"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'login_logo_left_link', 'Optional link to redirect when clicking on top left logo', 1, 0, 'text', ID, 'Login Top Left Logo Link', 4 FROM ConfigSettings WHERE Name="study"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'login_logo_right_link', 'Optional link to redirect when clicking on top right logo', 1, 0, 'text', ID, 'Login Top Right Logo Link', 4 FROM ConfigSettings WHERE Name="study"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'partner_logos', 'Logos for partners to be displayed in the homepage', 1, 1, 'text', ID, 'Partner Logos', 4 FROM ConfigSettings WHERE Name="study"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'startYear', "Start year for study recruitment or data collection", 1, 0, 'text', ID, 'Start year', 5 FROM ConfigSettings WHERE Name="study"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'endYear', "End year for study recruitment or data collection", 1, 0, 'text', ID, 'End year', 6 FROM ConfigSettings WHERE Name="study"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'ageMin', 'Minimum candidate age in years (0+)', 1, 0, 'text', ID, 'Minimum candidate age', 7 FROM ConfigSettings WHERE Name="study"; @@ -204,6 +209,10 @@ INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, INSERT INTO Config (ConfigID, Value) SELECT ID, 1 FROM ConfigSettings WHERE Name="additional_user_info"; INSERT INTO Config (ConfigID, Value) SELECT ID, "Example Study" FROM ConfigSettings WHERE Name="title"; INSERT INTO Config (ConfigID, Value) SELECT ID, "

Example Study Description

\r\n

This is a sample description for this study, because it is a new LORIS install that has not yet customized this text.

\r\n

A LORIS administrator can customize this text in the configuration module, under the configuration option labeled \"Study Description\"

\r\n

Useful Links

\r\n " FROM ConfigSettings WHERE Name="StudyDescription"; +INSERT INTO Config (ConfigID, Value) SELECT ID, "/images/LORIS_logo_white.svg" FROM ConfigSettings WHERE Name="login_logo_left"; +INSERT INTO Config (ConfigID, Value) SELECT ID, "/images/github-mark.svg" FROM ConfigSettings WHERE Name="login_logo_right"; +INSERT INTO Config (ConfigID, Value) SELECT ID, "/" FROM ConfigSettings WHERE Name="login_logo_left_link"; +INSERT INTO Config (ConfigID, Value) SELECT ID, "https://github.com/aces/Loris" FROM ConfigSettings WHERE Name="login_logo_right_link"; INSERT INTO Config (ConfigID, Value) SELECT ID, "images/neurorgb_web.jpg" FROM ConfigSettings WHERE Name="studylogo"; INSERT INTO Config (ConfigID, Value) SELECT ID, "false" FROM ConfigSettings WHERE Name="useEDC"; INSERT INTO Config (ConfigID, Value) SELECT ID, "false" FROM ConfigSettings WHERE Name="useDoB"; diff --git a/SQL/New_patches/2025-10-15-custom_homepage_logos_and_path.sql b/SQL/New_patches/2025-10-15-custom_homepage_logos_and_path.sql new file mode 100644 index 00000000000..3ec4c369439 --- /dev/null +++ b/SQL/New_patches/2025-10-15-custom_homepage_logos_and_path.sql @@ -0,0 +1,10 @@ +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) VALUES('login_logo_left', 'Path for top left logo on the login page.', 1, 0, 'text', 1, 'Login Top Left Logo', 3); +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) VALUES('login_logo_right', 'Path for top right logo on the login page.', 1, 0, 'text', 1, 'Login Top Right Logo', 3); +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) VALUES('login_logo_left_link', 'Optional link to redirect when clicking on top left logo', 1, 0, 'text', 1, 'Login Top Left Logo Link', 4); +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) VALUES('login_logo_right_link', 'Optional link to redirect when clicking on top right logo', 1, 0, 'text', 1, 'Login Top Right Logo Link', 4); +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) VALUES('partner_logos', 'Logos for partners to be displayed in the homepage', 1, 1, 'text', 1, 'Partner Logos', 4); + +INSERT INTO Config (ConfigID, Value) VALUES ((SELECT ID FROM ConfigSettings WHERE Name="login_logo_left"), "/images/LORIS_logo_white.svg"); +INSERT INTO Config (ConfigID, Value) VALUES ((SELECT ID FROM ConfigSettings WHERE Name="login_logo_right"), "/images/GitHub-Mark-Light-64px.png"); +INSERT INTO Config (ConfigID, Value) VALUES ((SELECT ID FROM ConfigSettings WHERE Name="login_logo_left_link"), "/"); +INSERT INTO Config (ConfigID, Value) VALUES ((SELECT ID FROM ConfigSettings WHERE Name="login_logo_right_link"), "https://github.com/aces/Loris"); \ No newline at end of file diff --git a/htdocs/css/public_layout.css b/htdocs/css/public_layout.css index 09fc8874b13..58ac50683b3 100644 --- a/htdocs/css/public_layout.css +++ b/htdocs/css/public_layout.css @@ -46,54 +46,78 @@ h1, h2, h3, h4 { .header { height: 100px; background-color: #064785; - padding: 5px 0; + padding: 0; + position: relative; +} + +.header-container { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; + height: 100%; + display: flex; + align-items: center; } .flex-wrapper { display: flex; align-items: center; + justify-content: space-between; + width: 100%; + height: 100%; + position: relative; + padding: 0 20px; + box-sizing: border-box; + max-width: 1170px; + margin: auto; } -.header .loris-logo { - margin-right: auto; +.logo-wrapper { + display: flex; + align-items: center; + justify-content: center; + max-height: 100%; + max-width: 120px; } -.header .loris-logo img { - height: 80px; +.logo-wrapper img { + max-height: 120px; + height:auto; + width: auto; } -.header .github-logo { - margin-left: auto; -. +.logo-left { + margin-right: auto; } -.header .github-logo img { - height: 40px; - padding-right: 10px; - opacity: 0.8; +.logo-right { + margin-left: auto; } -.header .github-logo img:hover { - opacity: 1; - -webkit-transition: opacity 0.2s ease-in; - transition: opacity 0.2s ease-in; +.logo-right img { + width: 100%; + height: 100%; + max-width: 64px; + max-height: 64px; } -.header .nav-link { - color: #fff; - font-size: 22px; - line-height: 130px; +.d-none { + display: none; } -.header .study-title { - width: 500px; +.study-title { + flex: 1; padding: 0 20px; color: #eee; font-size: 25px; - line-height: 1.15; font-weight: 600; font-variant: small-caps; text-align: center; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + padding: 0 10px; } .main-content { @@ -162,6 +186,26 @@ h1, h2, h3, h4 { padding: 0 20px 40px 20px; } +@media (max-width: 768px) { + .flex-wrapper { + padding-left: 0; + padding-right: 0; + } + + .logo-left img { + width: 100%; + } + + .logo-right a { + display: flex; + justify-content: end; + } + + .logo-right img { + max-width: 80%; + } +} + /* Tablets and bigger */ @media (min-width: 768px) { .header { diff --git a/htdocs/images/LORIS_logo_white.svg b/htdocs/images/LORIS_logo_white.svg index 897215799ac..9f9c02b940d 100644 --- a/htdocs/images/LORIS_logo_white.svg +++ b/htdocs/images/LORIS_logo_white.svg @@ -1,7 +1,7 @@ - + {`${(logo + + )); const login = (
@@ -290,6 +301,16 @@ class Login extends Component { > {login} + {partnerLogos.length > 0 ? ( + + {partnerLogos} + + ) : <>}
+ {partnerLogos.length > 0 ? ( + + {partnerLogos} + + ) : <>}
diff --git a/modules/login/php/authentication.class.inc b/modules/login/php/authentication.class.inc index 3556929e536..e6118277a81 100644 --- a/modules/login/php/authentication.class.inc +++ b/modules/login/php/authentication.class.inc @@ -113,12 +113,13 @@ class Authentication extends \NDB_Page implements ETagCalculator 'windowName' => $windowName, ]; } - $loginData['description'] = html_entity_decode( + $loginData['description'] = html_entity_decode( $config->getSetting('StudyDescription') ); - $loginData['title'] = $config->getSetting('title'); - $loginData['logo'] = $config->getSetting('studylogo'); - $values['login'] = $loginData; + $loginData['title'] = $config->getSetting('title'); + $loginData['logo'] = $config->getSetting('studylogo'); + $loginData['partner_logos'] = $config->getSetting('partner_logos'); + $values['login'] = $loginData; // Request Account Setup. $requestAccountData = []; diff --git a/raisinbread/RB_files/RB_Config.sql b/raisinbread/RB_files/RB_Config.sql index a113f26df33..6563d58b8ef 100644 --- a/raisinbread/RB_files/RB_Config.sql +++ b/raisinbread/RB_files/RB_Config.sql @@ -107,5 +107,9 @@ INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (128,131,'/data/EEGUploa INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (129,132,'false'); INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (130,133,'EEGS3DataPath'); INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (131,134,'false'); +INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (132,137,'/images/LORIS_logo_white.svg'); +INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (133,138,'/images/github-mark.svg'); +INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (134,139,'/'); +INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (135,140,'https://github.com/aces/Loris'); UNLOCK TABLES; SET FOREIGN_KEY_CHECKS=1; diff --git a/raisinbread/RB_files/RB_ConfigSettings.sql b/raisinbread/RB_files/RB_ConfigSettings.sql index 71db7a8c885..49f924a89cc 100644 --- a/raisinbread/RB_files/RB_ConfigSettings.sql +++ b/raisinbread/RB_files/RB_ConfigSettings.sql @@ -126,5 +126,10 @@ INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMult INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`, `Multilingual`) VALUES (134,'useAdvancedPermissions','Restricts access to data based on both sites and projects and require a special permission to access data not affiliated to a session (SessionID null). Keeping this setting to NO should ensure backwards compatibility (access to all data when module loads)',1,0,'boolean',50,'Use Advanced Permissions',5,0); INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`, `Multilingual`) VALUES (135,'biobank','Settings related to the biobank module',1,0,NULL,NULL,'Biobank',14,0); INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`, `Multilingual`) VALUES (136,'printEndpoint','Endpoint address for label printing logic',1,0,'text',135,'Label Printing Endpoint',1,0); +INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`, `Multilingual`) VALUES (137,'login_logo_left','Path for top left logo on the login page.',1,0,'text',1,'Login Top Left Logo',3,0); +INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`, `Multilingual`) VALUES (138,'login_logo_right','Path for top right logo on the login page.',1,0,'text',1,'Login Top Right Logo',3,0); +INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`, `Multilingual`) VALUES (139,'login_logo_left_link','Optional link to redirect when clicking on top left logo',1,0,'text', 1,'Login Top Left Logo Link',4,0); +INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`, `Multilingual`) VALUES (140,'login_logo_right_link','Optional link to redirect when clicking on top right logo',1,0,'text',1,'Login Top Right Logo Link',4,0); +INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`, `Multilingual`) VALUES (141,'partner_logos','Logos for partners to be displayed in the homepage',1,1,'text',1,'Partner Logos',4,0); UNLOCK TABLES; SET FOREIGN_KEY_CHECKS=1; diff --git a/smarty/templates/public_layout.tpl b/smarty/templates/public_layout.tpl index 175ceefc1d5..371373ea0e8 100644 --- a/smarty/templates/public_layout.tpl +++ b/smarty/templates/public_layout.tpl @@ -22,20 +22,31 @@
-
+
- diff --git a/src/Middleware/AnonymousPageDecorationMiddleware.php b/src/Middleware/AnonymousPageDecorationMiddleware.php index d9d5ab07db3..304e6bbc9b5 100644 --- a/src/Middleware/AnonymousPageDecorationMiddleware.php +++ b/src/Middleware/AnonymousPageDecorationMiddleware.php @@ -34,10 +34,15 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface { // Basic page outline variables $tpl_data = array( - 'study_title' => $this->Config->getSetting('title'), - 'baseurl' => $this->BaseURL, - 'currentyear' => date('Y'), - 'sandbox' => ($this->Config->getSetting("sandbox") === '1'), + 'study_title' => $this->Config->getSetting('title'), + 'logo_left' => $this->Config->getSetting('login_logo_left'), + 'logo_right' => $this->Config->getSetting('login_logo_right'), + 'logo_left_link' => $this->Config->getSetting('login_logo_left_link'), + 'logo_right_link' => $this->Config->getSetting('login_logo_right_link'), + 'baseurl' => $this->BaseURL, + 'currentyear' => date('Y'), + 'sandbox' => ($this->Config->getSetting("sandbox") === '1'), + 'partner_logos' => $this->Config->getSetting('partner_logos'), ); $tpl_data['css'] = 'main.css';