diff --git a/frappe/__init__.py b/frappe/__init__.py index e19327fcff..97ac94afc6 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -830,6 +830,7 @@ def rename_doc(*args, **kwargs): Calls `frappe.model.rename_doc.rename_doc` """ + kwargs.pop('cmd', None) kwargs.pop('ignore_permissions', None) from frappe.model.rename_doc import rename_doc return rename_doc(*args, **kwargs) diff --git a/frappe/public/build.json b/frappe/public/build.json index 75a89e5010..88f5aac577 100755 --- a/frappe/public/build.json +++ b/frappe/public/build.json @@ -350,5 +350,8 @@ ], "js/data_import_tools.min.js": [ "public/js/frappe/data_import/index.js" + ], + "css/tailwind.css": [ + "public/tailwind.css" ] } diff --git a/frappe/public/css/email.css b/frappe/public/css/email.css index 40c6149927..92ac433fd2 100644 --- a/frappe/public/css/email.css +++ b/frappe/public/css/email.css @@ -1,64 +1,82 @@ /* csslint ignore:start */ + /* palette colors*/ + body { line-height: 1.5; color: #36414c; } + p { margin: 1em 0 !important; } + hr { border-top: 1px solid #d1d8dd; } + .body-table { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; } + .body-table td { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; } + .email-header, .email-body, .email-footer { width: 100% !important; min-width: 100% !important; } + .email-body { font-size: 14px; } + .email-footer { border-top: 1px solid #d1d8dd; font-size: 12px; } + .email-header { border: 1px solid #d1d8dd; border-radius: 4px 4px 0 0; } + .email-header .brand-image { width: 24px; height: 24px; display: block; } + .email-header-title { font-weight: bold; } + .body-table.has-header .email-body { border: 1px solid #d1d8dd; border-radius: 0 0 4px 4px; border-top: none; } + .body-table.has-header .email-footer { border-top: none; } + .email-footer-container { margin-top: 30px; } + .email-footer-container > div:not(:last-child) { margin-bottom: 5px; } + .email-unsubscribe a { color: #8d99a6; text-decoration: underline; } + .btn { text-decoration: none; padding: 7px 10px; @@ -66,20 +84,24 @@ hr { border: 1px solid; border-radius: 3px; } + .btn.btn-default { color: #fff; background-color: #f0f4f7; border-color: transparent; } + .btn.btn-primary { color: #fff; background-color: #5e64ff; border-color: #444bff; } + .table { width: 100%; border-collapse: collapse; } + .table td, .table th { padding: 8px; @@ -88,53 +110,68 @@ hr { border-top: 1px solid #d1d8dd; text-align: left; } + .table th { font-weight: bold; } + .table > thead > tr > th { vertical-align: middle; border-bottom: 2px solid #d1d8dd; } + .table > thead:first-child > tr:first-child > th { border-top: none; } + .table.table-bordered { border: 1px solid #d1d8dd; } + .table.table-bordered td, .table.table-bordered th { border: 1px solid #d1d8dd; } + .more-info { font-size: 80% !important; color: #8d99a6 !important; border-top: 1px solid #ebeff2; padding-top: 10px; } + .text-right { text-align: right !important; } + .text-center { text-align: center !important; } + .text-muted { color: #8d99a6 !important; } + .text-extra-muted { color: #d1d8dd !important; } + .text-regular { font-size: 14px; } + .text-medium { font-size: 12px; } + .text-small { font-size: 10px; } + .text-bold { font-weight: bold; } + .indicator { width: 8px; height: 8px; @@ -143,33 +180,43 @@ hr { display: inline-block; margin-right: 5px; } + .indicator.indicator-blue { background-color: #5e64ff; } + .indicator.indicator-green { background-color: #98d85b; } + .indicator.indicator-orange { background-color: #ffa00a; } + .indicator.indicator-red { background-color: #ff5858; } + .indicator.indicator-yellow { background-color: #feef72; } + .screenshot { box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1); border: 1px solid #d1d8dd; margin: 8px 0; max-width: 100%; } + .list-unstyled { list-style-type: none; padding: 0; } + /* auto email report */ + .report-title { margin-bottom: 20px; } + /* csslint ignore:end */ diff --git a/frappe/public/tailwind.css b/frappe/public/tailwind.css new file mode 100644 index 0000000000..98a3b3a032 --- /dev/null +++ b/frappe/public/tailwind.css @@ -0,0 +1,8 @@ +@tailwind base; +@tailwind components; + +details.dropdown summary::-webkit-details-marker { + display: none; +} + +@tailwind utilities; diff --git a/frappe/templates/base.html b/frappe/templates/base.html index 1c5f286442..3a1cfc0da3 100644 --- a/frappe/templates/base.html +++ b/frappe/templates/base.html @@ -25,15 +25,26 @@ {{ head_html or "" }} {%- endif %} - {% if theme.theme_url %} - + {%- if theme.based_on == 'Bootstrap 4' -%} + {%- if theme.theme_url -%} + + {%- else -%} + + {%- endif -%} {% else %} - + {%- if developer_mode -%} + + + {%- else -%} + + + + {% endif %} + {%- endif -%} {%- for link in web_include_css %} {%- endfor -%} - {% endif %} {%- endblock -%} {%- block head_include %} @@ -50,7 +61,7 @@ } window.dev_server = {{ dev_server }}; window.socketio_port = {{ frappe.socketio_port }}; - +
{%- block banner -%} diff --git a/frappe/templates/components/button.html b/frappe/templates/components/button.html new file mode 100644 index 0000000000..985e80315c --- /dev/null +++ b/frappe/templates/components/button.html @@ -0,0 +1,27 @@ +--- +name: "button" +variant: "secondary" +disabled: 0 +url: null +--- + +{%- set static_classes = "px-4 py-2 border rounded-md inline-flex justify-center items-center focus:outline-none leading-5 font-medium text-sm" -%} +{%- set dynamic_classes = { + "opacity-50 cursor-not-allowed pointer-events-none": disabled, + "bg-blue-500 border-transparent hover:bg-blue-400 text-white focus:shadow-outline-blue focus:border-blue-700": + variant == "primary", + "bg-white border-gray-400 hover:text-gray-800 text-gray-900 focus:shadow-outline-blue focus:border-blue-300": + variant == "secondary", + "bg-red-500 border-transparent hover:bg-red-400 text-white focus:shadow-outline-red focus:border-red-700": + variant == "danger" + } +-%} +{%- set html_tag = "a" if url else "button" -%} + +<{{html_tag}} + class="{{ resolve_class([static_classes, dynamic_classes, class]) }}" + {{ 'disabled' if disabled else '' }} + {{ ('href="' + url + '"') if url else '' }} +> + {{ label }} +{{html_tag}}> diff --git a/frappe/templates/components/card.html b/frappe/templates/components/card.html new file mode 100644 index 0000000000..0ba34dd5f1 --- /dev/null +++ b/frappe/templates/components/card.html @@ -0,0 +1,7 @@ +{{ subtitle }}
+