diff --git a/customize.dist/src/less2/include/colortheme.less b/customize.dist/src/less2/include/colortheme.less index 24959179c..57d0a84f7 100644 --- a/customize.dist/src/less2/include/colortheme.less +++ b/customize.dist/src/less2/include/colortheme.less @@ -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; diff --git a/customize.dist/src/less2/include/icon-colors.less b/customize.dist/src/less2/include/icon-colors.less index 5c4909628..776a7c443 100644 --- a/customize.dist/src/less2/include/icon-colors.less +++ b/customize.dist/src/less2/include/icon-colors.less @@ -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; } } diff --git a/www/common/application_config_internal.js b/www/common/application_config_internal.js index 09f1604f3..be0ba3f47 100644 --- a/www/common/application_config_internal.js +++ b/www/common/application_config_internal.js @@ -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. diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index e450606f7..26b848ca9 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -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'); diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 601c2a32d..d1b360bdf 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -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; } diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 78f96ffdf..a2c909c50 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -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 diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index e7de1f684..224f7eeb6 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -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({ diff --git a/www/common/translations/messages.de.json b/www/common/translations/messages.de.json index b0a44067e..e87b0c6e7 100644 --- a/www/common/translations/messages.de.json +++ b/www/common/translations/messages.de.json @@ -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 {1} 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?" } diff --git a/www/common/translations/messages.fr.json b/www/common/translations/messages.fr.json index 561572adc..dbbadd86b 100644 --- a/www/common/translations/messages.fr.json +++ b/www/common/translations/messages.fr.json @@ -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", diff --git a/www/common/translations/messages.json b/www/common/translations/messages.json index ed85b6752..20525bc13 100644 --- a/www/common/translations/messages.json +++ b/www/common/translations/messages.json @@ -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", diff --git a/www/share/main.js b/www/share/main.js index 5e541a9eb..43e514f58 100644 --- a/www/share/main.js +++ b/www/share/main.js @@ -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]; } diff --git a/www/teams/app-team.less b/www/teams/app-team.less index 41d03640a..96f2aa6fd 100644 --- a/www/teams/app-team.less +++ b/www/teams/app-team.less @@ -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(); diff --git a/www/teams/inner.js b/www/teams/inner.js index 5e9bdc7a8..d5c02741b 100644 --- a/www/teams/inner.js +++ b/www/teams/inner.js @@ -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,