Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
ansuz 5 years ago
commit 469d674ca0

@ -96,9 +96,9 @@
@colortheme_drive-color: #fff;
@colortheme_drive-warn: #cd2532;
@colortheme_team-bg: #0b0061;
@colortheme_team-color: #fff;
@colortheme_team-warn: #cd2532;
@colortheme_teams-bg: #0b0061;
@colortheme_teams-color: #fff;
@colortheme_teams-warn: #cd2532;
@colortheme_file-bg: #cd2532;
@colortheme_file-color: #fff;

@ -21,6 +21,7 @@
.cp-icon-color-sheet { color: @colortheme_oocell-bg; }
.cp-icon-color-kanban { color: @colortheme_kanban-bg; }
.cp-icon-color-admin { color: @colortheme_admin-bg; }
.cp-icon-color-teams { color: @colortheme_teams-bg; }
.cp-border-color-pad { border-color: @colortheme_pad-bg !important; }
.cp-border-color-code { border-color: @colortheme_code-bg !important; }
@ -39,5 +40,6 @@
.cp-border-color-sheet { border-color: @colortheme_oocell-bg !important; }
.cp-border-color-kanban { border-color: @colortheme_kanban-bg !important; }
.cp-border-color-admin { border-color: @colortheme_admin-bg !important; }
.cp-border-color-teams { border-color: @colortheme_teams-bg !important; }
}

@ -106,6 +106,7 @@ define(function() {
ooslide: 'fa-file-powerpoint-o',
sheet: 'fa-file-excel-o',
drive: 'fa-hdd-o',
teams: 'fa-users',
};
// Ability to create owned pads and expiring pads through a new pad creation screen.

@ -241,22 +241,20 @@ define([
});
$div.append(addCol.div);
if (priv.enableTeams) {
var teamsData = Util.tryParse(JSON.stringify(priv.teams)) || {};
Object.keys(teamsData).forEach(function (id) {
var t = teamsData[id];
t.teamId = id;
if (owners.indexOf(t.edPublic) !== -1 || pending_owners.indexOf(t.edPublic) !== -1) {
delete teamsData[id];
}
});
var teamsList = UIElements.getUserGrid(Messages.owner_addTeamText, {
common: common,
noFilter: true,
data: teamsData
}, function () {});
$div.append(teamsList.div);
}
var teamsData = Util.tryParse(JSON.stringify(priv.teams)) || {};
Object.keys(teamsData).forEach(function (id) {
var t = teamsData[id];
t.teamId = id;
if (owners.indexOf(t.edPublic) !== -1 || pending_owners.indexOf(t.edPublic) !== -1) {
delete teamsData[id];
}
});
var teamsList = UIElements.getUserGrid(Messages.owner_addTeamText, {
common: common,
noFilter: true,
data: teamsData
}, function () {});
$div.append(teamsList.div);
// When clicking on the add button, we get the selected users.
var addButton = h('button.no-margin', Messages.owner_addButton);
@ -865,27 +863,25 @@ define([
var privateData = common.getMetadataMgr().getPrivateData();
var teamsData = Util.tryParse(JSON.stringify(privateData.teams)) || {};
var teams = {};
if (privateData.enableTeams) {
Object.keys(teamsData).forEach(function (id) {
// config.teamId only exists when we're trying to share a pad from a team drive
// In this case, we don't want to share the pad with the current team
if (config.teamId && config.teamId === id) { return; }
var t = teamsData[id];
teams[t.edPublic] = {
notifications: true,
displayName: t.name,
edPublic: t.edPublic,
avatar: t.avatar,
id: id
};
});
var teamsList = UIElements.getUserGrid(Messages.share_linkTeam, {
common: common,
noFilter: true,
data: teams
}, refreshButtons);
$div.append(teamsList.div);
}
Object.keys(teamsData).forEach(function (id) {
// config.teamId only exists when we're trying to share a pad from a team drive
// In this case, we don't want to share the pad with the current team
if (config.teamId && config.teamId === id) { return; }
var t = teamsData[id];
teams[t.edPublic] = {
notifications: true,
displayName: t.name,
edPublic: t.edPublic,
avatar: t.avatar,
id: id
};
});
var teamsList = UIElements.getUserGrid(Messages.share_linkTeam, {
common: common,
noFilter: true,
data: teams
}, refreshButtons);
$div.append(teamsList.div);
var shareButtons = [{
className: 'primary cp-share-with-friends',
@ -2499,7 +2495,18 @@ define([
'href': origin+'/drive/',
'class': 'fa fa-hdd-o'
},
content: h('span', Messages.login_accessDrive)
content: h('span', Messages.type.drive)
});
}
if (padType !== 'teams' && accountName) {
options.push({
tag: 'a',
attributes: {
'target': '_blank',
'href': origin+'/teams/',
'class': 'fa fa-users'
},
content: h('span', Messages.type.teams)
});
}
options.push({ tag: 'hr' });
@ -2781,7 +2788,7 @@ define([
var i = 0;
var types = AppConfig.availablePadTypes.filter(function (p) {
if (p === 'drive') { return; }
if (p === 'team') { return; }
if (p === 'teams') { return; }
if (p === 'contacts') { return; }
if (p === 'todo') { return; }
if (p === 'file') { return; }
@ -2993,7 +3000,7 @@ define([
// * a team ID ==> store in the team drive, and the team will be the owner
// * -1 ==> store in the user drive, and the user will be the owner
// * undefined ==> ask
if (teamExists && privateData.enableTeams) {
if (teamExists) {
var teams = Object.keys(privateData.teams).map(function (id) {
var data = privateData.teams[id];
var avatar = h('span.cp-creation-team-avatar.cp-avatar');

@ -2263,7 +2263,7 @@ define([
var arr = [];
AppConfig.availablePadTypes.forEach(function (type) {
if (type === 'drive') { return; }
if (type === 'team') { return; }
if (type === 'teams') { return; }
if (type === 'contacts') { return; }
if (type === 'todo') { return; }
if (type === 'file') { return; }

@ -321,7 +321,6 @@ define([
password: password,
channel: secret.channel,
enableSF: localStorage.CryptPad_SF === "1", // TODO to remove when enabled by default
enableTeams: localStorage.CryptPad_teams === "1",
devMode: localStorage.CryptPad_dev === "1",
fromFileData: Cryptpad.fromFileData ? {
title: Cryptpad.fromFileData.title

@ -922,7 +922,6 @@ MessengerUI, Messages) {
var pads_options = [];
Config.availablePadTypes.forEach(function (p) {
if (p === 'drive') { return; }
if (p === 'team') { return; }
if (!Common.isLoggedIn() && Config.registeredOnlyTypes &&
Config.registeredOnlyTypes.indexOf(p) !== -1) { return; }
pads_options.push({

@ -13,7 +13,7 @@
"todo": "Aufgaben",
"contacts": "Kontakte",
"sheet": "Tabelle (Beta)",
"team": "Teams"
"teams": "Teams"
},
"button_newpad": "Neues Rich-Text-Pad",
"button_newcode": "Neues Code-Pad",
@ -39,7 +39,7 @@
"error": "Fehler",
"saved": "Gespeichert",
"synced": "Alles gespeichert",
"deleted": "Pad wurde aus deinem CryptDrive gelöscht",
"deleted": "Gelöscht",
"deletedFromServer": "Pad wurde vom Server gelöscht",
"mustLogin": "Du musst angemeldet sein, um auf diese Seite zuzugreifen",
"disabledApp": "Diese Anwendung wurde deaktiviert. Kontaktiere den Administrator dieses CryptPads, um mehr Informationen zu erhalten.",
@ -1201,5 +1201,16 @@
"team_maxOwner": "Jeder Benutzer kann nur Eigentümer eines Teams sein.",
"team_maxTeams": "Jeder Benutzer kann nur Mitglied von {0} Teams sein.",
"team_listTitle": "Deine Teams",
"team_listSlot": "Verfügbare Teamplätze"
"team_listSlot": "Verfügbare Teamplätze",
"owner_addTeamText": "... oder ein Team",
"owner_team_add": "{0} möchte dich zum Eigentümer des Teams <b>{1}</b> machen. Bist du damit einverstanden?",
"team_rosterPromoteOwner": "Eigentümerschaft anbieten",
"team_ownerConfirm": "Mit-Eigentümer können das Team ändern öder löschen, sowie dich als Eigentümer entfernen. Bist du sicher?",
"team_kickConfirm": "{0} wird über die Entfernung aus dem Team benachrichtigt. Bist du sicher?",
"sent": "Nachricht versandt",
"team_pending": "Eingeladen",
"team_deleteTitle": "Löschung des Teams",
"team_deleteHint": "Das Team und alle Dokumente, die ausschließlich Eigentum des Teams sind, löschen.",
"team_deleteButton": "Löschen",
"team_deleteConfirm": "Du bist gerade dabei, alle Daten eines Teams zu löschen. Andere Teammitglieder können dann möglicherweise nicht mehr auf ihre Daten zugreifen. Dies kann nicht rückgängig gemacht werden. Bist du sicher, dass du fortfahren möchtest?"
}

@ -13,7 +13,7 @@
"todo": "Todo",
"contacts": "Contacts",
"sheet": "Tableur (Beta)",
"team": "Équipes"
"teams": "Équipes"
},
"button_newpad": "Nouveau document texte",
"button_newcode": "Nouvelle page de code",

@ -13,7 +13,7 @@
"todo": "Todo",
"contacts": "Contacts",
"sheet": "Sheet (Beta)",
"team": "Teams"
"teams": "Teams"
},
"button_newpad": "New Rich Text pad",
"button_newcode": "New Code pad",

@ -94,7 +94,6 @@ define([
password: config.data.password,
isTemplate: config.data.isTemplate,
file: config.data.file,
enableTeams: localStorage.CryptPad_teams === "1",
};
for (var k in additionalPriv) { metaObj.priv[k] = additionalPriv[k]; }

@ -7,9 +7,9 @@
&.cp-app-team {
.framework_min_main(
@bg-color: @colortheme_team-bg,
@warn-color: @colortheme_team-warn,
@color: @colortheme_team-color
@bg-color: @colortheme_teams-bg,
@warn-color: @colortheme_teams-warn,
@color: @colortheme_teams-color
);
.drive_main();

@ -829,16 +829,12 @@ define([
var metadataMgr = common.getMetadataMgr();
var privateData = metadataMgr.getPrivateData();
if (!privateData.enableTeams) {
return void UI.errorLoadingScreen(Messages.comingSoon);
}
readOnly = driveAPP.readOnly = metadataMgr.getPrivateData().readOnly;
driveAPP.loggedIn = common.isLoggedIn();
if (!driveAPP.loggedIn) { throw new Error('NOT_LOGGED_IN'); }
common.setTabTitle(Messages.type.team);
common.setTabTitle(Messages.type.teams);
// Drive data
if (privateData.newSharedFolder) {
@ -850,7 +846,7 @@ define([
var $bar = $('#cp-toolbar');
var configTb = {
displayed: ['useradmin', 'pageTitle', 'newpad', 'limit', 'notifications'],
pageTitle: Messages.type.team,
pageTitle: Messages.type.teams,
metadataMgr: metadataMgr,
readOnly: privateData.readOnly,
sfCommon: common,

Loading…
Cancel
Save