Compare commits

...

1 Commits

Author SHA1 Message Date
Ruben van de Ven 99c786ced5 Tweaks for the final version on registration and theming 2024-04-11 19:46:07 +02:00
10 changed files with 25 additions and 14 deletions

View File

@ -65,7 +65,7 @@ App.propTypes = {
App.defaultProps = { App.defaultProps = {
children: null, children: null,
language: null, language: null,
theme: 'light' theme: 'dark'
}; };
const mapStateToProps = state => ({ const mapStateToProps = state => ({

View File

@ -11,8 +11,8 @@ const initialState = {
textOutput: false, textOutput: false,
gridOutput: false, gridOutput: false,
soundOutput: false, soundOutput: false,
theme: 'light', theme: 'dark',
autorefresh: false, autorefresh: true,
language: 'en-US' language: 'en-US'
}; };

View File

@ -22,7 +22,7 @@ import FooterTabSwitcher from '../../components/mobile/TabSwitcher';
import FooterTab from '../../components/mobile/Tab'; import FooterTab from '../../components/mobile/Tab';
import Loader from '../App/components/loader'; import Loader from '../App/components/loader';
const EXAMPLE_USERNAME = process.env.EXAMPLE_USERNAME || 'p5'; const EXAMPLE_USERNAME = process.env.EXAMPLE_USERNAME || 'digitalplayground';
// @ghalestrilo 08/13/2020: I'm sorry // @ghalestrilo 08/13/2020: I'm sorry
const ContentWrapper = styled(Content)` const ContentWrapper = styled(Content)`

View File

@ -1,4 +1,4 @@
$base-font-size: 12; $base-font-size: 20;
//colors //colors
$p5js-pink: #FFE117; /*DP Colours*/ $p5js-pink: #FFE117; /*DP Colours*/

View File

@ -1,6 +1,7 @@
.CodeMirror { .CodeMirror {
font-family: Inconsolata, monospace; font-family: Inconsolata, monospace;
height: 100%; height: 100%;
font-size:$base-font-size !important;
} }
.CodeMirror-linenumbers { .CodeMirror-linenumbers {

View File

@ -37,7 +37,7 @@
} }
.form__label { .form__label {
font-size: #{12 / $base-font-size}rem; font-size: #{16 / $base-font-size}rem;
margin-top: #{25 / $base-font-size}rem; margin-top: #{25 / $base-font-size}rem;
margin-bottom: #{7 / $base-font-size}rem; margin-bottom: #{7 / $base-font-size}rem;
display: block; display: block;

View File

@ -158,7 +158,7 @@
color: getThemifyVariable('secondary-text-color'); color: getThemifyVariable('secondary-text-color');
} }
margin-left: #{5 / $base-font-size}rem; margin-left: #{5 / $base-font-size}rem;
font-size: #{12 / $base-font-size}rem; font-size: #{15 / $base-font-size}rem;
} }
.toolbar__edit-name-button { .toolbar__edit-name-button {

View File

@ -64,8 +64,8 @@ const userSchema = new Schema({
textOutput: { type: Boolean, default: false }, textOutput: { type: Boolean, default: false },
gridOutput: { type: Boolean, default: false }, gridOutput: { type: Boolean, default: false },
soundOutput: { type: Boolean, default: false }, soundOutput: { type: Boolean, default: false },
theme: { type: String, default: 'light' }, theme: { type: String, default: 'dark' },
autorefresh: { type: Boolean, default: false }, autorefresh: { type: Boolean, default: true },
language: { type: String, default: 'en-US' } language: { type: String, default: 'en-US' }
}, },
totalSize: { type: Number, default: 0 } totalSize: { type: Number, default: 0 }

View File

@ -191,16 +191,26 @@ app.use('/api', (error, req, res, next) => {
// overview of users: // overview of users:
app.get('/users', (req, res) => { app.get('/users', (req, res) => {
User.collection.getIndexes().then((indexes) =>{ // hacky migration here
User.collection.getIndexes(({full: true})).then((indexes) =>{
console.log('indexes', indexes); console.log('indexes', indexes);
// migrate unique
indexes.forEach(function (index) {
if(index.name !=='email_1') return;
if(!index.unique) return;
console.log('Drop index!', index);
User.collection.dropIndex('email_1');
console.log('Recreate index!');
User.collection.createIndex({ email: 1 }, { collation: { locale: 'en', strength: 2 } });
});
}) })
// let results = []; // let results = [];
User.find({}).sort({ createdAt: -1 }).exec() User.find({}).sort({ createdAt: -1 }).exec()
.then((users) => { .then((users) => {
const usernames = users.map((user) => user.username); // const usernames = users.map((user) => user.username);
let names = "<ul>"; let names = "<ul>";
usernames.forEach((username) => names += `<li><a href="/${username}/sketches">${username}</a></li>`); users.forEach((user) => names += `<li><a href="/${user.username}/sketches">${user.username}</a> - ${user.createdAt.toGMTString()}</li>`);
names += "</ul>"; names += "</ul>";
res.send(names); res.send(names);
}); });

View File

@ -29,7 +29,7 @@ export function renderIndex() {
window.process.env.CLIENT = true; window.process.env.CLIENT = true;
window.process.env.LOGIN_ENABLED = ${process.env.LOGIN_ENABLED === 'false' ? false : true}; window.process.env.LOGIN_ENABLED = ${process.env.LOGIN_ENABLED === 'false' ? false : true};
window.process.env.EXAMPLES_ENABLED = ${process.env.EXAMPLES_ENABLED === 'false' ? false : true}; window.process.env.EXAMPLES_ENABLED = ${process.env.EXAMPLES_ENABLED === 'false' ? false : true};
window.process.env.EXAMPLE_USERNAME = '${process.env.EXAMPLE_USERNAME || 'p5'}'; window.process.env.EXAMPLE_USERNAME = '${process.env.EXAMPLE_USERNAME || 'digitalplayground'}';
window.process.env.UI_ACCESS_TOKEN_ENABLED = ${process.env.UI_ACCESS_TOKEN_ENABLED === 'false' ? false : true}; window.process.env.UI_ACCESS_TOKEN_ENABLED = ${process.env.UI_ACCESS_TOKEN_ENABLED === 'false' ? false : true};
window.process.env.UI_COLLECTIONS_ENABLED = ${process.env.UI_COLLECTIONS_ENABLED === 'false' ? false : true}; window.process.env.UI_COLLECTIONS_ENABLED = ${process.env.UI_COLLECTIONS_ENABLED === 'false' ? false : true};
window.process.env.UPLOAD_LIMIT = ${process.env.UPLOAD_LIMIT ? `${process.env.UPLOAD_LIMIT}` : undefined}; window.process.env.UPLOAD_LIMIT = ${process.env.UPLOAD_LIMIT ? `${process.env.UPLOAD_LIMIT}` : undefined};