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-color: #fff;
@colortheme_drive-warn: #cd2532; @colortheme_drive-warn: #cd2532;
@colortheme_team-bg: #0b0061; @colortheme_teams-bg: #0b0061;
@colortheme_team-color: #fff; @colortheme_teams-color: #fff;
@colortheme_team-warn: #cd2532; @colortheme_teams-warn: #cd2532;
@colortheme_file-bg: #cd2532; @colortheme_file-bg: #cd2532;
@colortheme_file-color: #fff; @colortheme_file-color: #fff;

@ -21,6 +21,7 @@
.cp-icon-color-sheet { color: @colortheme_oocell-bg; } .cp-icon-color-sheet { color: @colortheme_oocell-bg; }
.cp-icon-color-kanban { color: @colortheme_kanban-bg; } .cp-icon-color-kanban { color: @colortheme_kanban-bg; }
.cp-icon-color-admin { color: @colortheme_admin-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-pad { border-color: @colortheme_pad-bg !important; }
.cp-border-color-code { border-color: @colortheme_code-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-sheet { border-color: @colortheme_oocell-bg !important; }
.cp-border-color-kanban { border-color: @colortheme_kanban-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-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', ooslide: 'fa-file-powerpoint-o',
sheet: 'fa-file-excel-o', sheet: 'fa-file-excel-o',
drive: 'fa-hdd-o', drive: 'fa-hdd-o',
teams: 'fa-users',
}; };
// Ability to create owned pads and expiring pads through a new pad creation screen. // Ability to create owned pads and expiring pads through a new pad creation screen.

@ -241,7 +241,6 @@ define([
}); });
$div.append(addCol.div); $div.append(addCol.div);
if (priv.enableTeams) {
var teamsData = Util.tryParse(JSON.stringify(priv.teams)) || {}; var teamsData = Util.tryParse(JSON.stringify(priv.teams)) || {};
Object.keys(teamsData).forEach(function (id) { Object.keys(teamsData).forEach(function (id) {
var t = teamsData[id]; var t = teamsData[id];
@ -256,7 +255,6 @@ define([
data: teamsData data: teamsData
}, function () {}); }, function () {});
$div.append(teamsList.div); $div.append(teamsList.div);
}
// When clicking on the add button, we get the selected users. // When clicking on the add button, we get the selected users.
var addButton = h('button.no-margin', Messages.owner_addButton); var addButton = h('button.no-margin', Messages.owner_addButton);
@ -865,7 +863,6 @@ define([
var privateData = common.getMetadataMgr().getPrivateData(); var privateData = common.getMetadataMgr().getPrivateData();
var teamsData = Util.tryParse(JSON.stringify(privateData.teams)) || {}; var teamsData = Util.tryParse(JSON.stringify(privateData.teams)) || {};
var teams = {}; var teams = {};
if (privateData.enableTeams) {
Object.keys(teamsData).forEach(function (id) { Object.keys(teamsData).forEach(function (id) {
// config.teamId only exists when we're trying to share a pad from a team drive // 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 // In this case, we don't want to share the pad with the current team
@ -885,7 +882,6 @@ define([
data: teams data: teams
}, refreshButtons); }, refreshButtons);
$div.append(teamsList.div); $div.append(teamsList.div);
}
var shareButtons = [{ var shareButtons = [{
className: 'primary cp-share-with-friends', className: 'primary cp-share-with-friends',
@ -2499,7 +2495,18 @@ define([
'href': origin+'/drive/', 'href': origin+'/drive/',
'class': 'fa fa-hdd-o' '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' }); options.push({ tag: 'hr' });
@ -2781,7 +2788,7 @@ define([
var i = 0; var i = 0;
var types = AppConfig.availablePadTypes.filter(function (p) { var types = AppConfig.availablePadTypes.filter(function (p) {
if (p === 'drive') { return; } if (p === 'drive') { return; }
if (p === 'team') { return; } if (p === 'teams') { return; }
if (p === 'contacts') { return; } if (p === 'contacts') { return; }
if (p === 'todo') { return; } if (p === 'todo') { return; }
if (p === 'file') { 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 // * 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 // * -1 ==> store in the user drive, and the user will be the owner
// * undefined ==> ask // * undefined ==> ask
if (teamExists && privateData.enableTeams) { if (teamExists) {
var teams = Object.keys(privateData.teams).map(function (id) { var teams = Object.keys(privateData.teams).map(function (id) {
var data = privateData.teams[id]; var data = privateData.teams[id];
var avatar = h('span.cp-creation-team-avatar.cp-avatar'); var avatar = h('span.cp-creation-team-avatar.cp-avatar');

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

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

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

@ -13,7 +13,7 @@
"todo": "Aufgaben", "todo": "Aufgaben",
"contacts": "Kontakte", "contacts": "Kontakte",
"sheet": "Tabelle (Beta)", "sheet": "Tabelle (Beta)",
"team": "Teams" "teams": "Teams"
}, },
"button_newpad": "Neues Rich-Text-Pad", "button_newpad": "Neues Rich-Text-Pad",
"button_newcode": "Neues Code-Pad", "button_newcode": "Neues Code-Pad",
@ -39,7 +39,7 @@
"error": "Fehler", "error": "Fehler",
"saved": "Gespeichert", "saved": "Gespeichert",
"synced": "Alles gespeichert", "synced": "Alles gespeichert",
"deleted": "Pad wurde aus deinem CryptDrive gelöscht", "deleted": "Gelöscht",
"deletedFromServer": "Pad wurde vom Server gelöscht", "deletedFromServer": "Pad wurde vom Server gelöscht",
"mustLogin": "Du musst angemeldet sein, um auf diese Seite zuzugreifen", "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.", "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_maxOwner": "Jeder Benutzer kann nur Eigentümer eines Teams sein.",
"team_maxTeams": "Jeder Benutzer kann nur Mitglied von {0} Teams sein.", "team_maxTeams": "Jeder Benutzer kann nur Mitglied von {0} Teams sein.",
"team_listTitle": "Deine Teams", "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", "todo": "Todo",
"contacts": "Contacts", "contacts": "Contacts",
"sheet": "Tableur (Beta)", "sheet": "Tableur (Beta)",
"team": "Équipes" "teams": "Équipes"
}, },
"button_newpad": "Nouveau document texte", "button_newpad": "Nouveau document texte",
"button_newcode": "Nouvelle page de code", "button_newcode": "Nouvelle page de code",

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

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

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

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

Loading…
Cancel
Save