Skip to content
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

[NEW] Custom login wallpapers #11025

Merged
merged 17 commits into from
Jun 20, 2018
Merged
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
10 changes: 10 additions & 0 deletions packages/rocketchat-assets/server/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ const assets = {
order: 2
}
},
background: {
label: 'login background (svg, png, jpg)',
defaultUrl: undefined,
constraints: {
type: 'image',
extensions: ['svg', 'png', 'jpg', 'jpeg'],
width: undefined,
height: undefined
}
},
favicon_ico: {
label: 'favicon (ico)',
defaultUrl: 'favicon.ico',
Expand Down
5 changes: 5 additions & 0 deletions packages/rocketchat-theme/client/imports/general/base_old.css
Original file line number Diff line number Diff line change
Expand Up @@ -4626,6 +4626,11 @@ body:not(.is-cordova) {
align-items: center;
flex-flow: row nowrap;

background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;

& .wrapper {
position: relative;
z-index: 10;
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-ui-login/client/login/layout.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template name="loginLayout">
<section class="rc-old full-page color-tertiary-font-color">
<section class="rc-old full-page color-tertiary-font-color" style="{{#with backgroundUrl}}background-image: url('{{.}}'){{/with}}">
<div class="wrapper">
{{> loginHeader }}
{{> Template.dynamic template=center}}
Expand Down
10 changes: 10 additions & 0 deletions packages/rocketchat-ui-login/client/login/layout.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Template.loginLayout.onRendered(function() {
$('#initial-page-loading').remove();
});

Template.loginLayout.helpers({
backgroundUrl() {
const asset = RocketChat.settings.get('Assets_background');
const prefix = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX || '';
if (asset && (asset.url || asset.defaultUrl)) {
return `${ prefix }/${ asset.url || asset.defaultUrl }`;
}
}
});
2 changes: 1 addition & 1 deletion packages/rocketchat-ui-login/client/username/layout.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template name="usernameLayout">
<section class="rc-old full-page color-tertiary-font-color">
<section class="rc-old full-page color-tertiary-font-color" style="{{#with backgroundUrl}}background-image: url('{{.}}'){{/with}}">
<div class="wrapper">
{{> Template.dynamic template=render}}
</div>
Expand Down
9 changes: 9 additions & 0 deletions packages/rocketchat-ui-login/client/username/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Template.usernameLayout.helpers({
backgroundUrl() {
const asset = RocketChat.settings.get('Assets_background');
const prefix = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX || '';
if (asset && (asset.url || asset.defaultUrl)) {
return `${ prefix }/${ asset.url || asset.defaultUrl }`;
}
}
});
2 changes: 1 addition & 1 deletion packages/rocketchat-ui-login/client/username/username.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template name="username">
<section class="rc-old full-page color-tertiary-font-color">
<section class="rc-old full-page color-tertiary-font-color" style="{{#with backgroundUrl}}background-image: url('{{.}}'){{/with}}">
<div class="wrapper">
<form id="login-card" class="content-background-color color-primary-font-color" method='/'>
<header>
Expand Down
8 changes: 8 additions & 0 deletions packages/rocketchat-ui-login/client/username/username.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ Template.username.onCreated(function() {
Template.username.helpers({
username() {
return Template.instance().username.get();
},

backgroundUrl() {
const asset = RocketChat.settings.get('Assets_background');
const prefix = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX || '';
if (asset && (asset.url || asset.defaultUrl)) {
return `${ prefix }/${ asset.url || asset.defaultUrl }`;
}
}
});

Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-ui-login/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ Package.onUse(function(api) {
api.addFiles('client/login/header.js', 'client');
api.addFiles('client/login/services.js', 'client');
api.addFiles('client/login/social.js', 'client');
api.addFiles('client/username/layout.js', 'client');
api.addFiles('client/username/username.js', 'client');
});