Skip to content

[login] allow for customization of the top left and righ logos #9787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 26.0-release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions SQL/0000-00-03-ConfigTables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ 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 '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";
Expand Down Expand Up @@ -187,6 +191,10 @@ INSERT INTO Config (ConfigID, Value) SELECT ID, 1 FROM ConfigSettings WHERE Name
INSERT INTO Config (ConfigID, Value) SELECT ID, "Example Study" FROM ConfigSettings WHERE Name="title";
INSERT INTO Config (ConfigID, Value) SELECT ID, "<h3>Example Study Description</h3>\r\n <p>This is a sample description for this study, because it is a new LORIS install that has not yet customized this text.</p>\r\n <p>A LORIS administrator can customize this text in the configuration module, under the configuration option labeled \"Study Description\"</p>\r\n <h3>Useful Links</h3>\r\n <ul>\r\n <li><a href=\"https://github.com/aces/Loris\" >LORIS GitHub Repository</a></li>\r\n <li><a href=\"https://github.com/aces/Loris/wiki/Setup\" >LORIS Setup Guide</a></li>\r\n <li><a href=\"https://www.youtube.com/watch?v=2Syd_BUbl5A\" >A video of a loris on YouTube</a></li>\r\n </ul>" FROM ConfigSettings WHERE Name="StudyDescription";
INSERT INTO Config (ConfigID, Value) SELECT ID, "images/neurorgb_web.jpg" FROM ConfigSettings WHERE Name="studylogo";
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-Light-64px.png" 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, "false" FROM ConfigSettings WHERE Name="useEDC";
INSERT INTO Config (ConfigID, Value) SELECT ID, 8 FROM ConfigSettings WHERE Name="ageMin";
INSERT INTO Config (ConfigID, Value) SELECT ID, 11 FROM ConfigSettings WHERE Name="ageMax";
Expand Down
9 changes: 9 additions & 0 deletions SQL/New_patches/2025-05-01-custom_login_logos.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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 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");
66 changes: 38 additions & 28 deletions htdocs/css/public_layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,60 +42,70 @@ h1, h2, h3, h4 {
-webkit-transition: background-color 0.2s ease-in;
transition: background-color 0.2s ease-in;
}

.header {
height: 100px;
background-color: #064785;
padding: 5px 0;
padding: 0;
position: relative;
}

.flex-wrapper {
.header-container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
height: 100%;
display: flex;
align-items: center;
}

.header .loris-logo {
margin-right: auto;
}

.header .loris-logo img {
height: 80px;
.flex-wrapper {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 100%;
position: relative;
padding: 0 20px;
box-sizing: border-box;
}

.header .github-logo {
margin-left: auto;
.
.logo-wrapper {
display: flex;
align-items: center;
justify-content: center;
max-height: 100%;
max-width: 120px;
}

.header .github-logo img {
height: 40px;
padding-right: 10px;
opacity: 0.8;
.logo-wrapper img {
max-height: 120px;
height:auto;
width: auto;
}

.header .github-logo img:hover {
opacity: 1;
-webkit-transition: opacity 0.2s ease-in;
transition: opacity 0.2s ease-in;
.logo-left {
margin-right: auto;
}

.header .nav-link {
color: #fff;
font-size: 22px;
line-height: 130px;
.logo-right {
margin-left: auto;
}

.header .study-title {
width: 500px;
padding: 0 20px;
.study-title {
flex: 1;
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 {
background-color: #f8f8f8;
padding: 30px 0;
Expand Down
9 changes: 7 additions & 2 deletions htdocs/images/LORIS_logo_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions raisinbread/RB_files/RB_Config.sql
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (124,128,'');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (126,129,'365');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (127,130,'/data/EEGUploadIncomingPath/');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (128,131,'EEGS3DataPath');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (129,132,'/images/LORIS_logo_white.svg');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (130,133,'/images/GitHub-Mark-Light-64px.png');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (131,134,'/');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (132,135,'https://github.com/aces/Loris');

UNLOCK TABLES;
SET FOREIGN_KEY_CHECKS=1;
4 changes: 4 additions & 0 deletions raisinbread/RB_files/RB_ConfigSettings.sql
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMult
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (129,'UserMaximumDaysInactive','The maximum number of days since last login before making a user inactive.',1,0,'text',1,'Maximum Days Before Making User Inactive',30);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (130,'EEGUploadIncomingPath','Path to the upload directory for incoming EEG studies',1,0,'text',45,'EEG Incoming Directory',15);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (131,'EEGS3DataPath','EEG S3 data path for assembly data',1,0,'text',45,'EEG S3 data path',15);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (132,'login_logo_left','Path for top left logo on the login page.',1,0,'text',1,'Login Top Left Logo',3);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (133,'login_logo_right','Path for top right logo on the login page.',1,0,'text',1,'Login Top Right Logo',3);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (134,'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` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (135,'login_logo_right_link','Optional link to redirect when clicking on top right logo',1,0,'text',1,'Login Top Right Logo Link',4);

UNLOCK TABLES;
SET FOREIGN_KEY_CHECKS=1;
31 changes: 22 additions & 9 deletions smarty/templates/public_layout.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,33 @@
</head>
<body>
<header class="header">
<div class="container">
<div class="header-container">
<div class="flex-wrapper">
<div class="loris-logo">
<a href="{$baseurl}">
<img src="{$baseurl}/images/LORIS_logo_white.svg" class="loris-logo" alt="Loris Logo"/>
</a>
<!-- Left Logo (conditionally a link) -->
<div class="logo-wrapper logo-left">
{if isset($logo_left_link)}
<a href="{$logo_left_link}">
<img src="{$logo_left}" alt="Left Logo"/>
</a>
{else}
<img src="{$logo_left}" alt="Left Logo"/>
{/if}
</div>

<!-- Center Study Title -->
<div class="study-title hidden-xs">
{$study_title}
</div>
<div class="github-logo">
<a href="https://github.com/aces/Loris" target="_blank" rel="noopener noreferrer">
<img src="{$baseurl}/images/GitHub-Mark-Light-64px.png" alt="Github"/>
</a>

<!-- Right Logo (conditionally a link) -->
<div class="logo-wrapper logo-right">
{if isset($logo_right_link)}
<a href="{$logo_right_link}" target="_blank" rel="noopener noreferrer">
<img src="{$logo_right}" alt="Right Logo"/>
</a>
{else}
<img src="{$logo_right}" alt="Right Logo"/>
{/if}
</div>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/Middleware/AnonymousPageDecorationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
// Basic page outline variables
$tpl_data = array(
'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'),
Expand Down
Loading