Fix profile creation and add a link to the profile app

pull/1/head
yflory 8 years ago
parent f357ec32c2
commit 472a62730b

@ -241,7 +241,9 @@ define(function () {
out.canvas_widthLabel = "taille: {0}";
// Profile
out.profileButton = "Profil"; // dropdown menu
out.profile_urlPlaceholder = 'URL';
out.profile_namePlaceholder = 'Nom ou pseudo pour le profil';
out.profile_avatar = "Avatar";
out.profile_upload = " Importer un nouvel avatar";
out.profile_error = "Erreur lors de la création du profil : {0}";

@ -243,7 +243,9 @@ define(function () {
out.canvas_widthLabel = "Width: {0}";
// Profile
out.profileButton = "Profile"; // dropdown menu
out.profile_urlPlaceholder = 'URL';
out.profile_namePlaceholder = 'Name displayed in your profile';
out.profile_avatar = "Avatar";
out.profile_upload = " Upload a new avatar";
out.profile_error = "Error while creating your profile: {0}";

@ -1476,6 +1476,13 @@ define([
content: Messages.user_rename
});
}
if (account) {
options.push({
tag: 'a',
attributes: {'class': 'profile'},
content: Messages.profileButton
});
}
if (parsed && (!parsed.type || parsed.type !== 'settings')) {
options.push({
tag: 'a',
@ -1535,6 +1542,13 @@ define([
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 () {
if (window.location.pathname !== "/") {
sessionStorage.redirectTo = window.location.href;

@ -156,11 +156,11 @@ define([
var getValue = function (cb) {
cb(APP.lm.proxy.name);
};
var placeholder = Messages.anonymous;
var placeholder = Messages.profile_namePlaceholder;
if (APP.readOnly) {
var $span = $('<span>', {'class': DISPLAYNAME_ID}).appendTo($block);
getValue(function (value) {
$span.text(value || placeholder);
$span.text(value || Messages.anonymous);
});
return;
}
@ -257,7 +257,6 @@ define([
Cryptpad.whenRealtimeSyncs(APP.lm.realtime, function () {
var driveRt = Cryptpad.getStore().getProxy().info.realtime;
Cryptpad.whenRealtimeSyncs(driveRt, function () {
Cryptpad.changeDisplayName();
displayAvatar();
});
});
@ -393,14 +392,12 @@ define([
}
obj.profile.edit = Cryptpad.getEditHashFromKeys(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);
});
};
if (!Cryptpad.isLoggedIn()) {
var $p = $('<p>').text(Messages.error_register);
var $p = $('<p>', {id: CREATE_ID}).append(Messages.profile_register);
var $a = $('<a>', {
href: '/register/'
});

@ -129,4 +129,11 @@
}
}
}
#createProfile {
height: 100%;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
}
}

Loading…
Cancel
Save