Skip to content
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
9 changes: 9 additions & 0 deletions SQL/0000-00-03-ConfigTables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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, "<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/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";
Expand Down
10 changes: 10 additions & 0 deletions SQL/New_patches/2025-10-15-custom_homepage_logos_and_path.sql
Original file line number Diff line number Diff line change
@@ -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");
Copy link
Contributor

@skarya22 skarya22 Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to make the images work in an overridden project setting? I tried to change the logo to one in my project folder but it doesn't seem to work

INSERT INTO Config (ConfigID, Value) VALUES ((SELECT ID FROM ConfigSettings WHERE Name="login_logo_left"), "../project/images/ctu.png");

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its possible, that's what we do on CBIG. you would need to put the logo in the static directory of a project module. I have a project module specific to anything that can be reached by an anonymous user and another module for things that require login but basically the logos sit in the publicly accessible one.

Copy link
Contributor

@jeffersoncasimir jeffersoncasimir Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ways to achieve this:

  • Modify apache settings (see docs/config/apache2-site to see what your config probably is currently. you'll see how and why /images redirects images from htdocs/images, etc)
    or
  • Use images.loris.ca - every project can have their own folder there

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we need to go that far, the project module way works fine

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, so the image would be at /project/static/images/ctu.png
And then I can reference it with what from config?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skarya22 What he means is that every module's static/ directory has the correct settings already. To override, you can place and reference an image in, for example: project/modules/login/static/ctu.png.

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");
90 changes: 67 additions & 23 deletions htdocs/css/public_layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the sizing changes, the github logo looks blurry now. Could you update it to be a higher quality image, or change to an svg?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the asset to a svg

margin-left: auto;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logos feel a little too big on mobile devices now

Image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjust the mobile display of the asset to be smaller

}

.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 {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 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.
1 change: 1 addition & 0 deletions htdocs/images/github-mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions modules/login/css/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,31 @@
.study-description {
flex-direction: column-reverse;
}
}

.partner-container-desktop .panel-body,
.partner-container-mobile .panel-body {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 8px;
}

.partner-container-desktop .panel-body img,
.partner-container-mobile .panel-body img {
width: calc(50% - 8px);
object-fit: contain;
max-height: 150px;
}

@media (max-width: 991px) {
.partner-container-desktop {
display: none;
}
}

@media (min-width: 992px) {
.partner-container-mobile {
display: none;
}
}
31 changes: 31 additions & 0 deletions modules/login/jsx/loginIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Login extends Component {
study: {
logo: '',
title: '',
partner_logos: [],
links: [],
description: '',
},
Expand Down Expand Up @@ -90,6 +91,8 @@ class Login extends Component {
state.study.title = json.login.title;
state.study.logo = window.location.origin
+ '/' + json.login.logo;
state.study.partner_logos = json?.login?.partner_logos
? [...json?.login?.partner_logos] : [];
// request account setup.
state.component.requestAccount = json.requestAccount;
state.oidc = json.oidc;
Expand Down Expand Up @@ -222,6 +225,14 @@ class Login extends Component {
/>
: null;
const oidc = this.state.oidc ? this.getOIDCLinks() : '';
const partnerLogos = this.state.study.partner_logos.map((logo) => (
<>
<img
src={logo}
alt={`${(logo ?? '').split('/').pop().split('.')[0]} Logo`}
/>
</>
));
const login = (
<div>
<section className={'study-logo'}>
Expand Down Expand Up @@ -290,6 +301,16 @@ class Login extends Component {
>
{login}
</Panel>
{partnerLogos.length > 0 ? (
<Panel
title="Our Partners"
class="panel-default partner-container-desktop"
collapsing={false}
bold
>
{partnerLogos}
</Panel>
) : <></>}
</section>
<section className={'col-md-8 col-md-pull-4'}>
<Panel
Expand All @@ -308,6 +329,16 @@ class Login extends Component {
{study}
</div>
</Panel>
{partnerLogos.length > 0 ? (
<Panel
title="Our Partners"
class="panel-default partner-container-mobile"
collapsing={false}
bold
>
{partnerLogos}
</Panel>
) : <></>}
</section>
<section>
</section>
Expand Down
9 changes: 5 additions & 4 deletions modules/login/php/authentication.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
4 changes: 4 additions & 0 deletions raisinbread/RB_files/RB_Config.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
5 changes: 5 additions & 0 deletions raisinbread/RB_files/RB_ConfigSettings.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
29 changes: 20 additions & 9 deletions smarty/templates/public_layout.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,31 @@
</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)} d-none{/if}">
{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)} d-none{/if}">
{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
13 changes: 9 additions & 4 deletions src/Middleware/AnonymousPageDecorationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Loading