Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions client/app/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ define([
'/common/common-ui-elements.js',
'/accounts/app/dpa.js',
'/accounts/app/stats.js',
'/customize/messages.js'
'/customize/messages.js',
'/common/common-icons.js',
], ($, h, Util, Clipboard, UI, UIElements,
Dpa, Stats, MessagesCP) => {
Dpa, Stats, MessagesCP, Icons) => {
const onAdminTab = Util.mkEvent();


Expand Down Expand Up @@ -45,7 +46,7 @@ const init = (APP, Plans, Api, Messages) => {
$plan[0],
beneficiary = h('input', {placeholder: "Beneficiary's key [{user}@{domain}/{key}]"}),
note = h('input', {placeholder: "Note"}),
button = h('button.btn.btn-primary', "Give free subscription"),
button = h('button.btn.btn-primary', [Icons.get('add'), "Give free subscription"]),
]);
$(button).on("click", () => {
const key = $(beneficiary).val();
Expand All @@ -71,7 +72,7 @@ const init = (APP, Plans, Api, Messages) => {
var getKeyInput = h('input.cp-admin-edit-fromkey', {
type: 'text'
});
var getFormSubmit = h('button.btn.btn-default', "Find subscription(s)");
var getFormSubmit = h('button.btn.btn-default', [Icons.get('search'), "Find subscription(s)"]);
var getResult = h('div.cp-admin-edit-found');
var getForm = h('div.cp-admin-edit-getform', [
h('h3', "Get a subscription"),
Expand Down Expand Up @@ -157,7 +158,7 @@ const init = (APP, Plans, Api, Messages) => {
});
data.id = sub.id;
console.log(data);
$editForm.html('<span class="cp-spinner fa fa-spinner fa-pulse fa-3x fa-fw"></span>');
$editForm.html('<i class="cp-spinner" data-lucide="loader"></i>');
Api.updateSubAdmin(data, function (err) {
if (err) {
var error = h('div.cp-admin-edit-error', err);
Expand All @@ -169,7 +170,7 @@ const init = (APP, Plans, Api, Messages) => {
});

$(queryButton).click(function () {
$editForm.html('<span class="cp-spinner fa fa-spinner fa-pulse fa-3x fa-fw"></span>');
$editForm.html('<i class="cp-spinner" data-lucide="loader"></i>');
Api.stripeSync(sub.id, function (err) {
if (err) {
var error = h('div.cp-admin-edit-error', err);
Expand Down Expand Up @@ -320,7 +321,7 @@ const init = (APP, Plans, Api, Messages) => {
const c = Plans.getPlanPrice(sub.plan);
cost = Messages._getKey('pricePer'+(Plans.isYearly(sub.plan) ? 'Year' : 'Month'), [c]);
}
const key = h('button.btn.fa.fa-key.cp-copy-key');
const key = h('button.btn.cp-copy-key', Icons.get('key'));
$(key).click(function () {
Clipboard.copy(sub.benificiary_pubkey, () => {
UI.log('Copied to clipboard');
Expand Down
14 changes: 7 additions & 7 deletions client/app/app-accounts.less
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@
width: 200px;
align-items: center;
margin: 10px;
& > i {
& > svg {
font-size: 72px;
stroke-width: 1;
}
& > span {
margin-top: 10px;
Expand Down Expand Up @@ -105,7 +106,7 @@
flex-flow: column;
}
a {
i {
svg {
margin-right: 10px;
}
color: @cryptpad_color_link;
Expand Down Expand Up @@ -287,25 +288,25 @@
user-select: none;
flex-wrap: wrap;
@media screen and (max-width:@content-width) {
i {
svg {
display: none;
}
}
}
.cp-actions {
display: flex;
gap: 10px;
i[role="button"] {
svg[role="button"] {
&:hover, &:active, &:focus {
color: @color2;
}
}
}
i {
svg {
font-size: 36px;
color: @color1;
}
& > i, .cp-actions i {
& > svg, .cp-actions svg {
width: 40px;
text-align: center;
}
Expand Down Expand Up @@ -501,4 +502,3 @@

}
}

21 changes: 10 additions & 11 deletions client/app/dpa.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ define([
'/common/hyperscript.js',
'/common/common-util.js',
'/common/common-interface.js',
'/common/common-icons.js',
'/customize/messages.js',
'/common/extensions.js'
], ($, h, Util, UI, MessagesCP, Extensions) => {
], ($, h, Util, UI, Icons, MessagesCP, Extensions) => {

let Messages = {};
// Get translations from plugin
Expand Down Expand Up @@ -106,15 +107,15 @@ define([
const data = obj.data;

const showBtn = h('button.btn.btn-default.cp-show-dpa', [
h('i.fa.fa-file-text-o'), Messages.dpa_title
Icons.get('notebook'), Messages.dpa_title
]);
$(showBtn).click(() => {
dpaState = true;
$div.find('.dpa-block').show();
$(showBtn).hide();
});
const hideBtn = h('button.btn.btn-default', [
h('i.fa.fa-times'), Messages.closeDetails]);
Icons.get('close'), Messages.closeDetails]);
$(hideBtn).click(() => {
dpaState = true;
$div.find('.dpa-block').hide();
Expand All @@ -126,7 +127,7 @@ define([

const showDownloadBanner = signed => {
const uploadButton = h('button.btn.btn-primary', [
h('i.fa.fa-upload'),
Icons.get('upload'),
Messages.dpa_sendSigned
]);
$(uploadButton).click(() => {
Expand All @@ -150,7 +151,7 @@ define([
const buttonKey = signed ? 'dpa_download'
: 'dpa_downloadUnsigned';
const button = h('button.btn.btn-secondary', [
h('i.fa.fa-download'),
Icons.get('download'),
Messages[buttonKey]
]);
$(button).click(() => {
Expand Down Expand Up @@ -204,7 +205,6 @@ define([
redraw();
});
});

$div.append([
showBtn,
dpaForm
Expand Down Expand Up @@ -240,7 +240,7 @@ define([
const tr = h('tr');

let deleteSigned = h('button.btn.btn-danger', [
h('i.fa.fa-trash'),
Icons.get('trash-empty'),
h('span', Messages.dpa_deleteSigned)
]);
UI.confirmButton(deleteSigned, {
Expand All @@ -257,7 +257,7 @@ define([
if (!data.signed_on) { deleteSigned = undefined; }

const btn = h('button.btn.btn-danger', [
h('i.fa.fa-times'),
Icons.get('close'),
h('span', Messages.dpa_delete)
]);
UI.confirmButton(btn, {
Expand Down Expand Up @@ -298,10 +298,10 @@ define([


const showBtn = h('button.btn.btn-default.cp-show-dpa', [
h('i.fa.fa-file-text-o'), Messages.dpa_title
Icons.get('notebook'), Messages.dpa_title
]);
const hideBtn = h('button.btn.btn-default', [
h('i.fa.fa-times'), Messages.closeDetails]);
Icons.get('close'), Messages.closeDetails]);
const dpaForm = getDpaForm(Api, hideBtn, false, data => {
Api.createDpaAdmin(data, function (err, obj) {
if (err || obj?.allowed === false) {
Expand All @@ -321,7 +321,6 @@ define([
$(dpaBlock).hide();
$(showBtn).show();
});

$div.append([
showBtn,
dpaBlock
Expand Down
42 changes: 21 additions & 21 deletions client/app/inner.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ define([
'/common/common-signing-keys.js',
'/common/common-util.js',
'/common/common-hash.js',
'/common/common-icons.js',
'/customize/messages.js',
'/common/extensions.js',
'/accounts/app/admin.js',
Expand All @@ -18,7 +19,6 @@ define([
'/accounts/api.js',

'css!/components/bootstrap/dist/css/bootstrap.min.css',
'css!/components/components-font-awesome/css/font-awesome.min.css',
'less!/accounts/app/app-accounts.less',
], function (
$,
Expand All @@ -32,6 +32,7 @@ define([
Keys,
Util,
Hash,
Icons,
MessagesCP,
Extensions,
Admin,
Expand Down Expand Up @@ -71,7 +72,7 @@ define([
const subs = APP.myPlan ? h('button.btn#cp-accounts-goto-mysub', {
href: '/accounts'
}, [
h('i.fa.fa-arrow-circle-left'),
Icons.get('circle-left'),
h('span', Messages.goto_mysub)
]) : undefined;
if (APP.myPlan) {
Expand All @@ -86,7 +87,7 @@ define([
const admin = APP.isAdmin ? h('button.btn', {
href: '/accounts'
}, [
h('i.fa.fa-cogs'),
Icons.get('administration'),
h('span', Messages.goto_admin)
]) : undefined;
if (APP.isAdmin) {
Expand All @@ -107,7 +108,7 @@ define([
const plans = h('a', {
href: '/accounts'
}, [
h('i.fa.fa-credit-card'),
Icons.get('credit-card'),
h('span', Messages.goto_plans)
]);
$(plans).click(e => {
Expand Down Expand Up @@ -174,7 +175,7 @@ define([
]);

const cancel = h('button.btn.btn-danger', [
h('i.fa.fa-times'),
Icons.get('close'),
Messages.cancel
]);
Util.onClickEnter($(cancel), () => {
Expand Down Expand Up @@ -213,7 +214,7 @@ define([


const manageButton = h('button.btn.btn-case.btn-primary-alt', [
h('i.fa.fa-id-card-o'),
Icons.get('user-directory'),
h('span', Messages.stripe_manage)
]);
const user = h('div.cp-accounts-user', [
Expand All @@ -228,7 +229,7 @@ define([

const switchCls = canceled ? 'btn-primary' : 'btn-default';
const switchButton = h(`button.btn.btn-case.${switchCls}`, [
h('i.fa.fa-ticket'),
Icons.get('subscribe'),
h('span', canceled ? Messages.stripe_renew
: Messages.stripe_switch)
]);
Expand Down Expand Up @@ -395,17 +396,17 @@ define([

const isMe = key === privData.edPublic;

const teamIcon = h('i.fa.fa-users', {
const teamIcon = Icons.get('users', {
title: Messages.team_drive,
'aria-label': Messages.team_drive
});
const profile = h('i.fa.fa-user', {
const profile = Icons.get('user', {
role: 'button',
tabindex: 0,
title: MessagesCP.profileButton,
'aria-label': MessagesCP.profileButton
});
const remove = h('i.fa.fa-times', {
const remove = Icons.get('close', {
role: 'button',
tabindex: 0,
title: Messages.remove_label,
Expand All @@ -420,7 +421,7 @@ define([

const userClass = isMe ? '.cp-me' : '.cp-user';
return h('div.cp-accounts-drive'+userClass, [
h('i.fa.fa-hdd-o'),
Icons.get('drive'),
avatar,
h('span.cp-drive-data', name),
actions
Expand All @@ -429,17 +430,17 @@ define([
const data = addAdded ? h('span.cp-drive-data') :
UI.setHTML(h('span.cp-drive-data'),
Messages._getKey('drive_add', [
h('i.fa.fa-user').outerHTML,
h('i.fa.fa-users').outerHTML
Icons.get('user').outerHTML,
Icons.get('users').outerHTML
]));
addAdded = true;
return h('div.cp-accounts-drive.cp-add', {
'aria-label': data.innerText,
'role': 'button',
tabindex: 0
}, [
h('i.fa.fa-hdd-o'),
h('i.fa.fa-plus'),
Icons.get('drive'),
Icons.get('add'),
data
]);
};
Expand Down Expand Up @@ -513,7 +514,7 @@ define([
onClick: () => {}
}, {
name: Messages.add_key,
iconClass: '.fa.fa-plus',
iconClass: 'add',
className: 'btn-primary',
onClick: () => {
const val = $(key).val();
Expand Down Expand Up @@ -560,7 +561,7 @@ define([
onClick: () => {}
}, {
name: Messages.add_key,
iconClass: '.fa.fa-plus',
iconClass: 'add',
className: 'btn-primary',
onClick: () => {
const val = $(keyInput).val();
Expand All @@ -583,12 +584,12 @@ define([
const tabs = [{
content: contactsModal,
title: Messages.from_contacts,
icon: 'fa fa-users',
icon: 'users',
active: true
}, {
content: keyModal,
title: Messages.from_key,
icon: 'fa fa-key',
icon: 'key',
active: false
}];

Expand Down Expand Up @@ -696,7 +697,7 @@ define([
h('div.cp-spinner-div center',
h('p.alert.alert-primary', Messages.processing_wait),
h('div.cp-spinner-container', [
h('i.fa.fa-spinner.fa-pulse.fa-3x.fa-fw.loading'),
Icons.get('loading'),
h('span.loading-message', Messages.processing)
])
)
Expand Down Expand Up @@ -770,7 +771,6 @@ define([
andThen();
return void UI.removeLoadingScreen();
}

nThen(waitFor => {
sframeChan.query('ACCOUNTS_GET_KEYS', null, waitFor((err, keys) => {
if (err) {
Expand Down
Loading