Fix profile creation and add a link to the profile app
This commit is contained in:
parent
f357ec32c2
commit
472a62730b
@ -241,7 +241,9 @@ define(function () {
|
|||||||
out.canvas_widthLabel = "taille: {0}";
|
out.canvas_widthLabel = "taille: {0}";
|
||||||
|
|
||||||
// Profile
|
// Profile
|
||||||
|
out.profileButton = "Profil"; // dropdown menu
|
||||||
out.profile_urlPlaceholder = 'URL';
|
out.profile_urlPlaceholder = 'URL';
|
||||||
|
out.profile_namePlaceholder = 'Nom ou pseudo pour le profil';
|
||||||
out.profile_avatar = "Avatar";
|
out.profile_avatar = "Avatar";
|
||||||
out.profile_upload = " Importer un nouvel avatar";
|
out.profile_upload = " Importer un nouvel avatar";
|
||||||
out.profile_error = "Erreur lors de la création du profil : {0}";
|
out.profile_error = "Erreur lors de la création du profil : {0}";
|
||||||
|
|||||||
@ -243,7 +243,9 @@ define(function () {
|
|||||||
out.canvas_widthLabel = "Width: {0}";
|
out.canvas_widthLabel = "Width: {0}";
|
||||||
|
|
||||||
// Profile
|
// Profile
|
||||||
|
out.profileButton = "Profile"; // dropdown menu
|
||||||
out.profile_urlPlaceholder = 'URL';
|
out.profile_urlPlaceholder = 'URL';
|
||||||
|
out.profile_namePlaceholder = 'Name displayed in your profile';
|
||||||
out.profile_avatar = "Avatar";
|
out.profile_avatar = "Avatar";
|
||||||
out.profile_upload = " Upload a new avatar";
|
out.profile_upload = " Upload a new avatar";
|
||||||
out.profile_error = "Error while creating your profile: {0}";
|
out.profile_error = "Error while creating your profile: {0}";
|
||||||
|
|||||||
@ -1476,6 +1476,13 @@ define([
|
|||||||
content: Messages.user_rename
|
content: Messages.user_rename
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (account) {
|
||||||
|
options.push({
|
||||||
|
tag: 'a',
|
||||||
|
attributes: {'class': 'profile'},
|
||||||
|
content: Messages.profileButton
|
||||||
|
});
|
||||||
|
}
|
||||||
if (parsed && (!parsed.type || parsed.type !== 'settings')) {
|
if (parsed && (!parsed.type || parsed.type !== 'settings')) {
|
||||||
options.push({
|
options.push({
|
||||||
tag: 'a',
|
tag: 'a',
|
||||||
@ -1535,6 +1542,13 @@ define([
|
|||||||
window.location.href = '/settings/';
|
window.location.href = '/settings/';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$userAdmin.find('a.profile').click(function () {
|
||||||
|
if (parsed && parsed.type) {
|
||||||
|
window.open('/profile/');
|
||||||
|
} else {
|
||||||
|
window.location.href = '/profile/';
|
||||||
|
}
|
||||||
|
});
|
||||||
$userAdmin.find('a.login').click(function () {
|
$userAdmin.find('a.login').click(function () {
|
||||||
if (window.location.pathname !== "/") {
|
if (window.location.pathname !== "/") {
|
||||||
sessionStorage.redirectTo = window.location.href;
|
sessionStorage.redirectTo = window.location.href;
|
||||||
|
|||||||
@ -156,11 +156,11 @@ define([
|
|||||||
var getValue = function (cb) {
|
var getValue = function (cb) {
|
||||||
cb(APP.lm.proxy.name);
|
cb(APP.lm.proxy.name);
|
||||||
};
|
};
|
||||||
var placeholder = Messages.anonymous;
|
var placeholder = Messages.profile_namePlaceholder;
|
||||||
if (APP.readOnly) {
|
if (APP.readOnly) {
|
||||||
var $span = $('<span>', {'class': DISPLAYNAME_ID}).appendTo($block);
|
var $span = $('<span>', {'class': DISPLAYNAME_ID}).appendTo($block);
|
||||||
getValue(function (value) {
|
getValue(function (value) {
|
||||||
$span.text(value || placeholder);
|
$span.text(value || Messages.anonymous);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -257,7 +257,6 @@ define([
|
|||||||
Cryptpad.whenRealtimeSyncs(APP.lm.realtime, function () {
|
Cryptpad.whenRealtimeSyncs(APP.lm.realtime, function () {
|
||||||
var driveRt = Cryptpad.getStore().getProxy().info.realtime;
|
var driveRt = Cryptpad.getStore().getProxy().info.realtime;
|
||||||
Cryptpad.whenRealtimeSyncs(driveRt, function () {
|
Cryptpad.whenRealtimeSyncs(driveRt, function () {
|
||||||
Cryptpad.changeDisplayName();
|
|
||||||
displayAvatar();
|
displayAvatar();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -393,14 +392,12 @@ define([
|
|||||||
}
|
}
|
||||||
obj.profile.edit = Cryptpad.getEditHashFromKeys(channel, secret.keys);
|
obj.profile.edit = Cryptpad.getEditHashFromKeys(channel, secret.keys);
|
||||||
obj.profile.view = Cryptpad.getViewHashFromKeys(channel, secret.keys);
|
obj.profile.view = Cryptpad.getViewHashFromKeys(channel, secret.keys);
|
||||||
obj.profile.name = APP.rt.proxy[Cryptpad.displayNameKey] || '';
|
|
||||||
Cryptpad.changeDisplayName();
|
|
||||||
andThen(obj.profile.edit);
|
andThen(obj.profile.edit);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!Cryptpad.isLoggedIn()) {
|
if (!Cryptpad.isLoggedIn()) {
|
||||||
var $p = $('<p>').text(Messages.error_register);
|
var $p = $('<p>', {id: CREATE_ID}).append(Messages.profile_register);
|
||||||
var $a = $('<a>', {
|
var $a = $('<a>', {
|
||||||
href: '/register/'
|
href: '/register/'
|
||||||
});
|
});
|
||||||
|
|||||||
@ -129,4 +129,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#createProfile {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user