cryptpad/www/form/app-form.less

617 lines
20 KiB
Text
Raw Normal View History

2021-05-20 08:43:29 +00:00
@import (reference) '../../customize/src/less2/include/framework.less';
@import (reference) '../../customize/src/less2/include/tools.less';
@import (reference) '../../customize/src/less2/include/avatar.less';
&.cp-app-form {
@form_input-width: 400px;
.framework_main(
@bg-color: @colortheme_apps[form]
);
display: flex;
flex-flow: column;
2021-05-21 15:40:41 +00:00
font: @colortheme_app-font;
color: @cryptpad_text_col;
background-color: @cp_app-bg;
2021-05-20 08:43:29 +00:00
#cp-app-form-editor {
flex: 1;
display: flex;
flex-flow: row;
height: 100%;
overflow: hidden;
}
2021-05-21 11:39:33 +00:00
&.cp-app-form-results {
div.cp-form-creator-content, .cp-app-form-button-results {
display: none !important;
}
}
&:not(.cp-app-form-results) {
div.cp-form-creator-results, .cp-app-form-button-creator {
display: none !important;
}
}
2021-05-20 08:43:29 +00:00
#cp-app-form-container {
display: flex;
flex: 1;
justify-content: center;
2021-06-03 15:29:03 +00:00
min-width: 300px;
2021-05-20 08:43:29 +00:00
2021-05-26 15:02:34 +00:00
.cp-form-input-block {
display: flex;
}
2021-05-20 08:43:29 +00:00
div.cp-form-creator-container {
display: flex;
flex: 1;
2021-06-03 15:29:03 +00:00
justify-content: center;
min-width: 300px;
2021-06-04 15:17:12 +00:00
//flex-wrap: wrap;
2021-06-03 15:29:03 +00:00
overflow: auto;
2021-06-04 15:17:12 +00:00
@media screen and (max-width: 1000px) {
flex-wrap: wrap;
justify-content: flex-start;
.cp-form-creator-control {
width: 100% !important;
.cp-form-creator-settings {
display: flex;
justify-content: space-evenly;
flex-wrap: wrap;
}
}
}
2021-06-03 15:29:03 +00:00
.cp-form-creator-settings {
padding: 30px;
2021-06-07 11:38:53 +00:00
.cp-form-actions {
margin-top: 5px;
}
2021-06-03 15:29:03 +00:00
& > div:not(:last-child) {
margin-bottom: 20px;
}
}
div.cp-form-filler-container {
width: 300px;
min-width: 0;
flex: 0 300 300px;
}
2021-05-20 08:43:29 +00:00
div.cp-form-creator-control {
padding: 10px;
display: flex;
flex-flow: column;
width: 300px;
2021-05-21 11:39:33 +00:00
.cp-form-creator-types {
margin-top: 20px;
display: flex;
flex-flow: column;
}
2021-05-20 08:43:29 +00:00
}
2021-05-21 11:39:33 +00:00
div.cp-form-creator-content, div.cp-form-creator-results {
2021-06-03 15:29:03 +00:00
max-width: 1000px;
min-width: 300px;
2021-06-07 11:38:53 +00:00
margin-top: 10px;
2021-05-20 08:43:29 +00:00
padding: 10px;
display: flex;
flex-flow: column;
2021-06-03 15:29:03 +00:00
flex: 1 1 1000px;
2021-05-21 15:40:41 +00:00
overflow: auto;
2021-06-02 16:50:36 +00:00
.cp-form-creator-add-inline {
display: flex;
flex-flow: row;
2021-06-02 16:50:36 +00:00
align-items: center;
margin-bottom: 20px;
button {
width: 50px;
i {
margin-right: 0;
}
}
.cp-form-creator-inline-add {
font-size: 25px;
margin-right: 30px;
2021-06-02 16:50:36 +00:00
.add-close { display: none; }
&.displayed {
.add-close { display: inline; }
.add-open { display: none; }
}
}
.cp-form-creator-control-inline {
display: flex;
justify-content: space-around;
button:not(:last-child) {
margin-right: 5px;
}
.cp-form-creator-types {
2021-06-04 15:17:12 +00:00
.btn-default {
background: transparent;
&:hover, &:not(:disabled):active, &:focus {
background-color: @cp_buttons-default;
}
}
button {
border: 0px;
//padding-bottom: 3px;
i {
font-size: 35px;
line-height: 35px;
}
}
&:first-child {
margin-right: 50px;
}
2021-06-02 16:50:36 +00:00
}
}
}
.cp-form-creator-add-full {
display: flex;
align-items: center;
2021-06-04 13:38:45 +00:00
margin: 50px 0px 100px 0px;
2021-06-02 16:50:36 +00:00
&> div:first-child {
2021-06-04 13:38:45 +00:00
border-right: 1px solid fade(@cryptpad_text_col, 25%);
2021-06-02 16:50:36 +00:00
display: flex;
height: 100%;
align-items: center;
padding-right: 10px;
margin-right: 10px;
2021-06-04 13:38:45 +00:00
i {
color: fade(@cryptpad_text_col, 25%);
font-size: 30px;
}
2021-06-02 16:50:36 +00:00
}
.cp-form-creator-control-inline {
display: flex;
flex-flow: column;
justify-content: space-around;
button:not(:last-child) {
margin-right: 5px;
}
2021-06-04 13:38:45 +00:00
.cp-form-creator-types {
2021-06-04 15:17:12 +00:00
.btn-default {
background: transparent;
&:hover, &:not(:disabled):active, &:focus {
background-color: @cp_buttons-default;
}
}
2021-06-04 13:38:45 +00:00
button {
border: 0px;
padding:5px;
margin-right: 10px;
i {
font-size: 35px;
line-height: 35px;
}
}
&:first-child {
margin-bottom: 20px;
margin-right: 50px;
}
2021-06-02 16:50:36 +00:00
}
}
}
.cp-form-page + .cp-form-send-container {
margin-top: 10px;
}
2021-06-01 15:45:04 +00:00
.cp-form-page-container {
display: flex;
justify-content: center;
margin: 10px 0;
& > span {
margin: 0 20px;
width: 100px;
display: inline-flex;
align-items: center;
justify-content: center;
}
button {
2021-06-01 16:37:29 +00:00
&.cp-next {
2021-06-01 15:45:04 +00:00
.fa {
margin-right: 0;
margin-left: 5px;
}
}
}
}
2021-05-20 08:43:29 +00:00
.cp-form-block {
2021-05-21 15:40:41 +00:00
.tools_unselectable();
background: @cp_form-bg1;
padding: 10px;
2021-05-20 08:43:29 +00:00
&:not(:last-child) {
margin-bottom: 20px;
}
2021-06-03 15:29:03 +00:00
.cp-form-block-drag-handle {
display: flex;
flex-flow: column;
align-items: center;
color: @cp_sidebar-hint;
i {
cursor: grab;
&:first-child {
height: 3px;
margin-top: -10px;
margin-bottom: 1px;
}
}
}
&.sortable-ghost { visibility: hidden; }
&.sortable-drag { opacity: 0.9 !important; }
.flatpickr-calendar.inline {
box-shadow: unset;
border: 1px solid @cryptpad_text_col;
}
2021-05-21 15:40:41 +00:00
.cp-form-block-question {
margin-bottom: 5px;
}
.cp-form-block-content {
overflow-x: auto;
2021-06-01 15:45:04 +00:00
.cp-form-page-break-edit {
2021-06-07 11:38:53 +00:00
font-size: 20px;
2021-06-01 15:45:04 +00:00
text-align: center;
padding: 10px;
i {
margin-right: 5px;
}
}
2021-06-03 15:29:03 +00:00
.cp-form-edit-buttons-container {
2021-06-07 10:06:22 +00:00
margin-top: 20px;
2021-06-03 15:29:03 +00:00
display: flex;
justify-content: space-between;
}
input:invalid {
border: 1px solid @cp_form-invalid;
}
2021-06-08 12:08:52 +00:00
media-tag {
& > * {
max-width: 100%;
}
}
}
2021-05-20 08:43:29 +00:00
.cp-form-input-block {
//width: @form_input-width;
2021-06-03 15:29:03 +00:00
padding-bottom: 10px;
border-bottom: 2px solid @cp_sidebar-hint;
margin-bottom: 10px;
2021-05-21 15:40:41 +00:00
&:not(.editing) {
2021-05-20 08:43:29 +00:00
input {
background: transparent;
border: none;
2021-05-21 15:40:41 +00:00
padding: 0 !important;
2021-05-20 08:43:29 +00:00
& ~ button:not(:disabled) {
.cp-form-edit { display: inline; }
.cp-form-save { display: none; }
}
}
}
input {
flex: 1;
min-width: 100px;
2021-05-21 15:40:41 +00:00
padding: 0 10px !important;
height: auto;
2021-06-03 15:29:03 +00:00
font-size: 20px;
2021-05-20 08:43:29 +00:00
}
button {
.cp-form-edit {
display: none;
}
.cp-form-save { display: inline; }
}
2021-05-21 15:40:41 +00:00
.cp-form-block-drag {
font-size: 22px;
width: 20px;
margin-left: 5px;
text-align: center;
line-height: 31px;
}
2021-05-20 08:43:29 +00:00
}
2021-06-07 10:06:22 +00:00
&.editable {
cursor: grab;
.cp-form-edit-save {
margin-top: 20px;
button {
margin-right: 10px;
}
}
.cp-form-edit-type {
margin-bottom: 10px;
.cp-dropdown-container {
margin-left: 10px;
}
}
}
2021-05-20 08:43:29 +00:00
}
2021-05-27 15:46:46 +00:00
.cp-form-edit-max-options {
display: flex;
align-items: center;
2021-06-07 10:06:22 +00:00
margin-bottom: 10px;
2021-05-27 15:46:46 +00:00
input {
width: 100px;
margin-left: 10px;
}
}
.cp-form-edit-options-block {
display: flex;
flex-wrap: wrap;
2021-06-03 15:29:03 +00:00
align-items: baseline;
2021-05-31 16:23:25 +00:00
.CodeMirror {
cursor: default;
flex: 1;
margin: auto;
min-width: 80%;
width: 80%;
min-height: 200px;
height: 200px;
border: 1px solid @cp_forms-border;
.CodeMirror-placeholder {
color: #777;
}
}
2021-05-27 15:46:46 +00:00
}
2021-05-20 08:43:29 +00:00
.cp-form-edit-block {
2021-06-07 10:06:22 +00:00
button.btn-secondary {
margin-left: 30px;
}
2021-05-31 13:32:04 +00:00
.cp-form-handle {
display: flex;
align-items: center;
justify-content: center;
width: 30px;
2021-06-03 15:29:03 +00:00
color: @cp_sidebar-hint;
i:first-child {
margin-right: 1px;
}
2021-05-31 13:32:04 +00:00
}
2021-05-20 08:43:29 +00:00
.cp-form-edit-block-input {
2021-06-07 10:06:22 +00:00
margin-bottom: 5px; // XXX DB margin bug
2021-06-03 15:29:03 +00:00
&.sortable-ghost { visibility: hidden; }
&.sortable-drag { opacity: 0.9 !important; }
2021-05-20 08:43:29 +00:00
display: flex;
width: 400px;
input {
flex: 1;
min-width: 100px;
2021-06-07 10:06:22 +00:00
border-color: @cryptpad_text_col;
border-right: 0px;
2021-05-20 08:43:29 +00:00
}
button {
i { margin: 0 !important; }
}
}
}
}
}
2021-05-21 11:39:33 +00:00
div.cp-form-creator-results {
display: flex;
flex-flow: column;
position: relative;
& > div {
2021-05-21 15:40:41 +00:00
background: @cp_form-bg1;
2021-05-21 11:39:33 +00:00
padding: 10px;
&:not(:last-child) {
margin-bottom: 20px;
}
}
.cp-form-block-question {
margin-bottom: 5px;
}
.cp-form-block-type {
float: right;
padding: 5px;
margin-top: -10px;
margin-right: -10px;
i { margin-right: 5px; }
2021-05-21 15:40:41 +00:00
background: @cp_form-bg2;
2021-05-21 11:39:33 +00:00
}
.cp-form-results-type-text {
max-height: 300px;
overflow: auto;
.cp-form-results-type-text-data {
padding: 5px 10px;
2021-05-21 15:40:41 +00:00
background: @cp_form-bg2;
2021-05-21 11:39:33 +00:00
&:not(:last-child) { margin-bottom: 1px; }
}
}
.cp-form-results-type-textarea-data {
white-space: pre-wrap;
font-size: 14px;
border: 1px solid @cp_profile-hint;
padding: 0 5px;
}
2021-05-21 11:39:33 +00:00
.cp-form-results-type-radio {
display: table;
2021-05-27 15:46:46 +00:00
.cp-form-results-type-multiradio-data {
display: flex;
flex-flow: column;
}
2021-05-21 11:39:33 +00:00
.cp-form-results-type-radio-data {
display: table-row;
2021-05-21 15:40:41 +00:00
border: 1px solid @cp_form-border;
2021-05-21 11:39:33 +00:00
& > span {
2021-05-21 15:40:41 +00:00
border: 1px solid @cp_form-border;
2021-05-21 11:39:33 +00:00
display: table-cell;
padding: 5px 10px;
2021-05-21 15:40:41 +00:00
background: @cp_form-bg2;
2021-05-21 11:39:33 +00:00
&.cp-value {
min-width: 200px;
}
}
}
}
2021-06-02 13:37:16 +00:00
.cp-form-individual {
& > *:not(:last-child) {
margin-right: 10px;
}
.cp-form-warning {
color: @cp-limit-bar-warning;
}
.cp-form-friend {
color: @cp_profile-hint;
.fa {
margin-right: 5px;
}
}
}
2021-05-21 11:39:33 +00:00
}
2021-05-20 08:43:29 +00:00
}
2021-05-27 15:46:46 +00:00
.cp-form-type-radio, .cp-form-type-checkbox {
2021-05-21 15:40:41 +00:00
display: flex;
flex-flow: column;
align-items: baseline;
.cp-radio {
display: inline-flex;
}
}
2021-05-27 15:46:46 +00:00
.cp-form-type-multiradio {
display: table;
& > * {
display: table-row;
& > * {
display: table-cell;
padding: 5px 20px;
vertical-align: middle;
&:first-child {
min-width: 200px;
}
.cp-radio-mark {
margin: auto;
}
}
}
}
.cp-form-type-sort {
cursor: grab;
padding: 2px;
.cp-form-handle {
margin-right: 5px;
}
.cp-form-sort-order {
border: 1px solid @cp_profile-hint;
padding: 0 5px;
margin-right: 5px;
}
}
2021-05-21 15:40:41 +00:00
2021-05-28 12:04:24 +00:00
.cp-form-type-poll {
display: inline-flex;
2021-05-28 12:04:24 +00:00
flex-flow: column;
& > div {
display: flex;
}
2021-06-08 14:47:21 +00:00
.cp-form-poll-body {
flex-flow: column;
max-height: 200px;
overflow: auto;
& > div {
display: flex;
}
}
2021-05-28 12:04:24 +00:00
.cp-poll-cell {
width: 100px;
height: 40px;
display: inline-flex;
align-items: center;
justify-content: center;
&:first-child {
width: 200px;
}
button {
width: 100%;
}
}
2021-06-07 15:45:41 +00:00
.cp-poll-answer-name {
2021-06-08 14:47:21 +00:00
padding: 0 5px;
display: flex;
:last-child {
flex: 1;
min-width: 0;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
2021-06-07 15:45:41 +00:00
.cp-avatar {
.avatar_main(30px);
margin-right: 10px;
}
}
.cp-poll-time-day {
flex-basis: 100px;
border-right: 1px solid @cryptpad_text_col;
border-left: 1px solid @cryptpad_text_col;
border-top: 1px solid @cryptpad_text_col;
}
2021-05-28 12:04:24 +00:00
&.cp-form-poll-switch {
flex-flow: row;
2021-06-08 14:47:21 +00:00
.cp-avatar {
.avatar_main(20px);
}
2021-05-28 12:04:24 +00:00
& > div {
flex-flow: column;
2021-06-08 14:47:21 +00:00
&.cp-form-poll-body {
flex-flow: row;
max-width: 500px;
max-height: unset;
scroll-snap-type: x mandatory;
& > div {
flex-flow: column;
}
}
2021-05-28 12:04:24 +00:00
}
.cp-poll-cell:not(.cp-poll-switch) {
&:first-child {
width: 100px;
}
}
.cp-form-poll-option, .cp-poll-switch {
width: 200px;
}
.cp-poll-time-day {
flex-basis: 40px;
border-right: none;
border-bottom: 1px solid @cryptpad_text_col;
border-left: 1px solid @cryptpad_text_col;
border-top: 1px solid @cryptpad_text_col;
}
2021-05-28 12:04:24 +00:00
}
.cp-form-poll-choice, .cp-form-poll-answer {
.fa {
display: none;
}
color: @cp_form-poll-color;
&[data-value="0"] {
background: @cp_form-poll-no;
.cp-no { display: inline; }
}
&[data-value="1"] {
background: @cp_form-poll-yes;
.cp-yes { display: inline; }
}
&[data-value="2"] {
background: @cp_form-poll-maybe;
.cp-maybe { display: inline; }
}
}
div.cp-form-poll-choice {
cursor: pointer;
padding: 5px;
border: 5px double @cp_form-bg1;
}
div.cp-form-poll-answer {
color: @cp_form-poll-yes-color;
2021-05-28 12:04:24 +00:00
}
}
2021-05-20 08:43:29 +00:00
}