mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Implement review changes
This commit is contained in:
parent
8bc8a7c459
commit
c11a0db954
@ -163,6 +163,7 @@ define(req, function(AppConfig, Default, Language) {
|
||||
Messages.form_guestAuthorBody = "This author link is currently not stored anywhere since you are not logged in. To avoid loosing access in future please save this link now:";
|
||||
Messages.form_guestAuthorBodyStored = "This author link is currently only stored on this device, please save it to avoid loosing access to your form.";
|
||||
Messages.form_guestAuthorCopied = "Author link copied";
|
||||
Messages.form_guestAuthorCopy = "Copy author link";
|
||||
Messages.form_guestAuthorContinuePublic = "Continue to public link";
|
||||
Messages.form_guestPublicTitle = "Copy your public link";
|
||||
Messages.form_guestPublicBody = "Share this link with participants so they can fill out your form.";
|
||||
|
||||
@ -268,55 +268,64 @@
|
||||
.cp-creation-help {
|
||||
flex: none;
|
||||
}
|
||||
.cp-creation-team-avatar {
|
||||
.avatar_main(20px);
|
||||
flex: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
svg, .lucide {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
.cp-creation-team-name {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
}
|
||||
.cp-dropdown-container {
|
||||
flex: 1 1 0;
|
||||
width: 0;
|
||||
min-width: 0;
|
||||
display: block;
|
||||
button.btn {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
justify-content: flex-start;
|
||||
text-align: left;
|
||||
overflow: hidden;
|
||||
color: @cp_creation-fg;
|
||||
background: @cp_forms-bg;
|
||||
border: 1px solid @cp_forms-border;
|
||||
text-transform: none;
|
||||
.cp-dropdown-button-title {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 0.5rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
.cp-dropdown-content {
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: auto;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow-x: hidden;
|
||||
li[role="menuitem"] > a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
li[role="menuitem"] {
|
||||
overflow: hidden;
|
||||
.cp-creation-team-avatar {
|
||||
.avatar_main(20px);
|
||||
flex: none;
|
||||
display: inline-flex;
|
||||
> a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
svg, .lucide {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
.cp-creation-team-name {
|
||||
flex: 1 1 0;
|
||||
gap: 0.5rem;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2822,26 +2822,38 @@ define([
|
||||
if (!val || val === 'none') { return Messages.autostore_hide; }
|
||||
return privateData.teams?.[val]?.name || val;
|
||||
};
|
||||
var getTeamAvatar = function (val) {
|
||||
if (val === '-1') {
|
||||
return h('span.cp-creation-team-avatar', Icons.get('drive'));
|
||||
}
|
||||
if (!val || val === 'none') {
|
||||
return h('span.cp-creation-team-avatar', Icons.get('close'));
|
||||
}
|
||||
var data = privateData.teams?.[val];
|
||||
var avatar = h('span.cp-creation-team-avatar.cp-avatar');
|
||||
if (data) {
|
||||
common.displayAvatar($(avatar), data.avatar, data.name);
|
||||
}
|
||||
return avatar;
|
||||
};
|
||||
var teamOptions = [{
|
||||
tag: 'a',
|
||||
attributes: { 'data-value': '-1' },
|
||||
content: [h('span.cp-creation-team-avatar', Icons.get('drive')), h('span.cp-creation-team-name', Messages.settings_cat_drive)]
|
||||
content: [getTeamAvatar('-1'), h('span.cp-creation-team-name', Messages.settings_cat_drive)]
|
||||
}];
|
||||
Object.keys(privateData.teams || {}).forEach(function (id) {
|
||||
var data = privateData.teams[id];
|
||||
if (!data) { return; }
|
||||
var avatar = h('span.cp-creation-team-avatar.cp-avatar');
|
||||
common.displayAvatar($(avatar), data.avatar, data.name);
|
||||
teamOptions.push({
|
||||
tag: 'a',
|
||||
attributes: { 'data-value': id },
|
||||
content: [avatar, h('span.cp-creation-team-name', data.name)]
|
||||
content: [getTeamAvatar(id), h('span.cp-creation-team-name', data.name)]
|
||||
});
|
||||
});
|
||||
teamOptions.push({
|
||||
tag: 'a',
|
||||
attributes: { 'data-value': 'none' },
|
||||
content: [h('span.cp-creation-team-avatar', Icons.get('close')), h('span.cp-creation-team-name', Messages.autostore_hide)]
|
||||
content: [getTeamAvatar('none'), h('span.cp-creation-team-name', Messages.autostore_hide)]
|
||||
});
|
||||
var $teamSelect = UIElements.createDropdown({
|
||||
text: getTeamLabel(teamValue),
|
||||
@ -2853,16 +2865,19 @@ define([
|
||||
common: common
|
||||
});
|
||||
var $teamBtn = $teamSelect.find('button').addClass('btn');
|
||||
var setTeamTitle = function (label) {
|
||||
var setTeamButton = function (val) {
|
||||
var label = getTeamLabel(val);
|
||||
$teamBtn[0]?._tippy?.destroy();
|
||||
$teamBtn.attr('title', label).find('.cp-dropdown-button-title').removeAttr('title');
|
||||
$teamBtn.attr('title', label);
|
||||
$teamBtn.find('.cp-dropdown-button-title').empty().append([
|
||||
getTeamAvatar(val),
|
||||
h('span.cp-creation-team-name', label)
|
||||
]).removeAttr('title');
|
||||
};
|
||||
setTeamTitle(getTeamLabel(teamValue));
|
||||
setTeamButton(teamValue);
|
||||
$teamSelect.onChange.reg(function (text, value) {
|
||||
teamValue = value == null ? 'none' : String(value);
|
||||
var label = getTeamLabel(teamValue);
|
||||
$teamBtn.find('.cp-dropdown-button-title').text(label);
|
||||
setTeamTitle(label);
|
||||
setTeamButton(teamValue);
|
||||
});
|
||||
team = h('div.cp-creation-teams', [
|
||||
h('span.cp-creation-store-label', Messages.team_pcsSelectLabel),
|
||||
|
||||
@ -1553,3 +1553,12 @@
|
||||
.charts_main();
|
||||
}
|
||||
|
||||
.alertify .cp-form-guest-share-modal {
|
||||
h4, h5, h6, p {
|
||||
color: @cryptpad_text_col;
|
||||
}
|
||||
textarea {
|
||||
color: @cryptpad_text_col;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4921,7 +4921,7 @@ define([
|
||||
rows: 2,
|
||||
'aria-label': Messages.form_guestPublicTitle
|
||||
});
|
||||
var content = h('div', [
|
||||
var content = h('div.cp-form-guest-share-modal', [
|
||||
h('h4', Messages.form_guestPublicTitle),
|
||||
h('p', Messages.form_guestPublicBody),
|
||||
linkInput
|
||||
@ -4929,8 +4929,13 @@ define([
|
||||
var frame;
|
||||
var modal = UI.dialog.customModal(content, {
|
||||
buttons: [{
|
||||
className: 'cancel',
|
||||
name: Messages.cancel,
|
||||
onClick: function () {},
|
||||
keys: [27]
|
||||
}, {
|
||||
className: 'primary',
|
||||
name: Messages.share_linkCopy,
|
||||
name: Messages.form_geturl,
|
||||
iconClass: 'copy',
|
||||
onClick: function () {
|
||||
Clipboard.copy(viewUrl, function (copyErr) {
|
||||
@ -4966,7 +4971,7 @@ define([
|
||||
rows: 2,
|
||||
'aria-label': Messages.form_guestAuthorTitle
|
||||
});
|
||||
var content = h('div', [
|
||||
var content = h('div.cp-form-guest-share-modal', [
|
||||
h('h4', Messages.form_guestAuthorTitle),
|
||||
h('p', Messages.form_guestEditLinkDefinition),
|
||||
h('p', bodyMsg),
|
||||
@ -4974,8 +4979,13 @@ define([
|
||||
]);
|
||||
var modal = UI.dialog.customModal(content, {
|
||||
buttons: [{
|
||||
className: 'cancel',
|
||||
name: Messages.cancel,
|
||||
onClick: function () {},
|
||||
keys: [27]
|
||||
}, {
|
||||
className: 'secondary',
|
||||
name: Messages.share_linkCopy,
|
||||
name: Messages.form_guestAuthorCopy,
|
||||
iconClass: 'copy',
|
||||
onClick: function () {
|
||||
Clipboard.copy(editUrl, function (copyErr) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user