Merge branch 'rebrand-ui' of https://github.com/frappe/frappe into rebrand-ui

This commit is contained in:
Suraj Shetty 2020-08-18 19:41:36 +05:30
commit fa04572fa5
19 changed files with 276 additions and 153 deletions

View file

@ -16,11 +16,8 @@
<symbol viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" id="icon-select">
<path d="M4.5 3.636L6.136 2l1.637 1.636M4.5 8.364L6.136 10l1.637-1.636" stroke-linecap="round" stroke-linejoin="round"></path>
</symbol>
<symbol viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" id="icon-down">
<g fill="#112B42">
<path opacity=".5" d="M3 5h6L6 2 3 5z"></path>
<path d="M6 10l3-3H3l3 3z"></path>
</g>
<symbol id="icon-down" viewBox="0 0 32 32">
<path stroke-linejoin="round" stroke-linecap="round" stroke-miterlimit="4" stroke-width="2" d="M6 11l10 10 10-10"></path>
</symbol>
<symbol viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" id="icon-both">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 2l3 3H3l3-3zm3 5l-3 3-3-3h6z" fill="#112B42"></path>
@ -217,12 +214,13 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.936 2a2 2 0 0 0-2 2v.649h1V4a1 1 0 0 1 1-1h5.566a1 1 0 0 1 1 1v4.595a1 1 0 0 1-1 1h-.642v1h.642a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H6.936zM3.5 5.402a2 2 0 0 0-2 2v4.595a2 2 0 0 0 2 2h5.566a2 2 0 0 0 2-2V7.402a2 2 0 0 0-2-2H3.5zm-1 2a1 1 0 0 1 1-1h5.566a1 1 0 0 1 1 1v4.595a1 1 0 0 1-1 1H3.5a1 1 0 0 1-1-1V7.402z"
fill="#12283A"></path>
</symbol>
<symbol viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" id="icon-duplicate">
<path d="M9 6.5v3a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3m2-1.5h3v2.625M5 7l5.5-5.5" stroke="var(--icon-stroke)" stroke-linecap="round" stroke-linejoin="round"></path>
<symbol viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" id="icon-duplicate">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.936 2a2 2 0 0 0-2 2v.649h1V4a1 1 0 0 1 1-1h5.566a1 1 0 0 1 1 1v4.595a1 1 0 0 1-1 1h-.642v1h.642a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H6.936zM3.5 5.402a2 2 0 0 0-2 2v4.595a2 2 0 0 0 2 2h5.566a2 2 0 0 0 2-2V7.402a2 2 0 0 0-2-2H3.5zm-1 2a1 1 0 0 1 1-1h5.566a1 1 0 0 1 1 1v4.595a1 1 0 0 1-1 1H3.5a1 1 0 0 1-1-1V7.402z"
stroke="none" fill="#192734"></path>
</symbol>
<symbol viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" id="icon-drag">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.875 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm-1.5-3a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm6.75-6a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zM8.625 12a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm1.5-6a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"
fill="#ACB5BD" stroke="none" stroke-width="0"></path>
fill="#ACB5BD" stroke-width="0"></path>
</symbol>
<symbol viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" id="icon-drag-1">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.9 3a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0 10a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zM5.4 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM12.15 3a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm-1.5 11.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm1.5-6.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"
@ -237,8 +235,12 @@
<symbol viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" id="icon-dot-vertical">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 5a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm1 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" fill="#12283A"></path>
</symbol>
<symbol viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" id="icon-delete">
<path d="M3 3.5v9.059c0 1.072.746 1.941 1.667 1.941h6.666c.921 0 1.667-.869 1.667-1.941V3.5m-11 0h12m-9 0v-1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1M8 6.9v4.286M10.5 6.9v4.29m-5-4.29v4.286" stroke="var(--icon-stroke)" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
<symbol id="icon-delete" viewBox="0 0 32 32" fill="none">
<path stroke-linejoin="round" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M7 7v18.118c0 2.145 1.492 3.882 3.333 3.882h11.333c1.842 0 3.333-1.737 3.333-3.882v-18.118"></path>
<path stroke-linejoin="round" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M5 7h22"></path>
<path stroke-linejoin="round" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M10 7v-1c0-1.657 1.343-3 3-3h6c1.657 0 3 1.343 3 3v1"></path>
<path stroke-linejoin="round" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M18.8 14.4v8.571"></path>
<path stroke-linejoin="round" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M13.2 14.4v8.571"></path>
</symbol>
<symbol viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" id="icon-create">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.146 11.217a.5.5 0 1 0 .708.708l3.182-3.182 3.181 3.182a.5.5 0 1 0 .708-.708l-3.182-3.18 3.182-3.182a.5.5 0 1 0-.708-.708l-3.18 3.181-3.183-3.182a.5.5 0 0 0-.708.708l3.182 3.182-3.182 3.181z" fill="#70818F"></path>
@ -459,6 +461,9 @@
<path d="M8.024 6.5H3a.5.5 0 0 0-.5.5v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V9.5A.5.5 0 0 0 17 9h-6.783a.5.5 0 0 1-.417-.224L8.441 6.724a.5.5 0 0 0-.417-.224z" stroke="var(--icon-stroke)" stroke-miterlimit="10" stroke-linecap="square"></path>
<path d="M3.88 4.5v-1a.5.5 0 0 1 .5-.5h11.24a.5.5 0 0 1 .5.5V7" stroke="var(--icon-stroke)" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
</symbol>
<symbol viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" id="icon-primitive-dot">
<path d="M9.5 6a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0z"></path>
</symbol>
<symbol viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" id="icon-image">
<path d="M11.5 2.5H5A1.5 1.5 0 0 0 3.5 4v12A1.5 1.5 0 0 0 5 17.5h10a1.5 1.5 0 0 0 1.5-1.5V7.5l-5-5z" stroke="var(--icon-stroke)" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M5.876 15.4a.2.2 0 0 1-.166-.312l1.841-2.735a.2.2 0 0 1 .291-.045l1.224.98a.2.2 0 0 0 .283-.034l1.973-2.527a.2.2 0 0 1 .329.019l2.663 4.35a.2.2 0 0 1-.171.304H5.876z" stroke="var(--icon-stroke)" stroke-miterlimit="10" stroke-linecap="square"
@ -486,19 +491,6 @@
<path d="M9.273 12.91v2.908c0 1.205 1.953 2.182 4.364 2.182 2.41 0 4.363-.977 4.363-2.182V12.91" stroke="var(--icon-stroke)" stroke-miterlimit="10"></path>
<path d="M13.637 12.182c2.41 0 4.363-.977 4.363-2.182s-1.953-2.182-4.363-2.182S9.273 8.795 9.273 10s1.954 2.182 4.364 2.182z" stroke="var(--icon-stroke)" stroke-miterlimit="10" stroke-linecap="square"></path>
</symbol>
<symbol viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" id="icon-keyboard">
<rect x="2.5" y="4" width="15" height="12" rx="2" stroke="var(--icon-stroke)"></rect>
<circle cx="5.8" cy="7.65" r=".65" fill="#192734"></circle>
<circle cx="7.9" cy="7.65" r=".65" fill="#192734"></circle>
<circle cx="10" cy="7.65" r=".65" fill="#192734"></circle>
<circle cx="12.1" cy="7.65" r=".65" fill="#192734"></circle>
<circle cx="14.2" cy="7.65" r=".65" fill="#192734"></circle>
<path d="M6.5 13h7" stroke="var(--icon-stroke)" stroke-linecap="round" stroke-linejoin="round"></path>
<circle cx="6.85" cy="9.75" r=".65" fill="#192734"></circle>
<circle cx="8.95" cy="9.75" r=".65" fill="#192734"></circle>
<circle cx="11.05" cy="9.75" r=".65" fill="#192734"></circle>
<circle cx="13.15" cy="9.75" r=".65" fill="#192734"></circle>
</symbol>
<symbol viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" id="icon-liabilities">
<path d="M8.588 17H5a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8.5a2 2 0 0 1 2 2v5.5" stroke="var(--icon-stroke)" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M5.76 6.09h6.785M5.76 9.5h6.785M5.76 12.91h2.727" stroke="var(--icon-stroke)" stroke-miterlimit="10" stroke-linecap="round"></path>
@ -534,10 +526,6 @@
stroke="none">
</path>
</symbol>
<!-- <symbol viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" id="icon-heart-active">
<path d="M12.706 1.15a3.784 3.784 0 0 0-5.434 0c-.104.106-.183.227-.272.34-.089-.113-.168-.234-.272-.34a3.784 3.784 0 0 0-5.434 0C.73 1.727.495 2.704.5 3.78c.015 3.468 3 5.85 5.745 7.886.45.334 1.06.334 1.51 0 2.746-2.035 5.73-4.418 5.745-7.886.005-1.077-.231-2.054-.794-2.63z"
stroke="none" fill="#E24C4C"></path>
</symbol> -->
<symbol viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" id="icon-solid-error">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM8.0429 8.04289C8.43342 7.65237 9.06659 7.65237 9.45711 8.04289L12.0011 10.5869L14.5451 8.04294C14.9356 7.65242 15.5688 7.65242 15.9593 8.04294C16.3499 8.43347 16.3499 9.06663 15.9593 9.45716L13.4154 12.0011L15.9593 14.5451C16.3499 14.9356 16.3499 15.5688 15.9593 15.9593C15.5688 16.3499 14.9357 16.3499 14.5451 15.9593L12.0011 13.4154L9.45711 15.9594C9.06659 16.3499 8.43342 16.3499 8.0429 15.9594C7.65237 15.5689 7.65237 14.9357 8.0429 14.5452L10.5869 12.0011L8.0429 9.45711C7.65237 9.06658 7.65237 8.43342 8.0429 8.04289Z" fill="#F56B6B" stroke="none"/>
</symbol>
@ -580,6 +568,19 @@
<path d="M10.5589 14.8213L4.693 9.77014L10.5589 5.04483V7.97057V8.47518L11.0635 8.47055C14.6022 8.43809 17.598 10.8976 18.3297 14.213C16.5316 12.3421 13.9036 11.4411 11.0589 11.4411H10.5589V11.9411V14.8213Z" stroke="#A6B1B9" stroke-miterlimit="10"/>
<path d="M8.14703 15.9117L1 9.75733L8.14703 4" stroke="#A6B1B9" stroke-miterlimit="10"/>
</symbol>
<symbol fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-keyboard" viewBox="0 0 42 32">
<path fill="none" stroke="#192734" style="stroke: var(--color1, #192734)" stroke-linejoin="miter" stroke-linecap="butt" stroke-miterlimit="4" stroke-width="2.4615" d="M7.385 2.462h27.077c2.719 0 4.923 2.204 4.923 4.923v17.231c0 2.719-2.204 4.923-4.923 4.923h-27.077c-2.719 0-4.923-2.204-4.923-4.923v-17.231c0-2.719 2.204-4.923 4.923-4.923z"></path>
<path d="M12.8 11.323c0 0.816-0.661 1.477-1.477 1.477s-1.477-0.661-1.477-1.477c0-0.816 0.661-1.477 1.477-1.477s1.477 0.661 1.477 1.477z"></path>
<path d="M17.723 11.323c0 0.816-0.661 1.477-1.477 1.477s-1.477-0.661-1.477-1.477c0-0.816 0.661-1.477 1.477-1.477s1.477 0.661 1.477 1.477z"></path>
<path d="M15.262 16.246c0 0.816-0.661 1.477-1.477 1.477s-1.477-0.661-1.477-1.477c0-0.816 0.661-1.477 1.477-1.477s1.477 0.661 1.477 1.477z"></path>
<path d="M22.646 11.323c0 0.816-0.661 1.477-1.477 1.477s-1.477-0.661-1.477-1.477c0-0.816 0.661-1.477 1.477-1.477s1.477 0.661 1.477 1.477z"></path>
<path d="M20.185 16.246c0 0.816-0.661 1.477-1.477 1.477s-1.477-0.661-1.477-1.477c0-0.816 0.661-1.477 1.477-1.477s1.477 0.661 1.477 1.477z"></path>
<path d="M27.569 11.323c0 0.816-0.661 1.477-1.477 1.477s-1.477-0.661-1.477-1.477c0-0.816 0.661-1.477 1.477-1.477s1.477 0.661 1.477 1.477z"></path>
<path d="M25.108 16.246c0 0.816-0.661 1.477-1.477 1.477s-1.477-0.661-1.477-1.477c0-0.816 0.661-1.477 1.477-1.477s1.477 0.661 1.477 1.477z"></path>
<path d="M32.492 11.323c0 0.816-0.661 1.477-1.477 1.477s-1.477-0.661-1.477-1.477c0-0.816 0.661-1.477 1.477-1.477s1.477 0.661 1.477 1.477z"></path>
<path d="M30.031 16.246c0 0.816-0.661 1.477-1.477 1.477s-1.477-0.661-1.477-1.477c0-0.816 0.661-1.477 1.477-1.477s1.477 0.661 1.477 1.477z"></path>
<path fill="none" stroke="#192734" style="stroke: var(--color1, #192734)" stroke-linejoin="round" stroke-linecap="round" stroke-miterlimit="4" stroke-width="2.4615" d="M12.308 22.154h17.231"></path>
</symbol>
<view xmlns="http://www.w3.org/2000/svg" id="icon-right-view" viewBox="0 0 16 16"/>
<use xmlns="http://www.w3.org/2000/svg" href="#icon-right" width="16" height="16" x="0" y="0"/>
</svg>

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View file

@ -317,10 +317,10 @@ frappe.get_modal = function(title, content) {
<div class="modal-header">
<div class="fill-width flex">
<span class="indicator hidden"></span>
<h4 class="modal-title" style="font-weight: bold;">${title}</h4>
<h4 class="modal-title">${title}</h4>
</div>
<div>
<div class="text-right buttons">
<div class="text-right buttons">
<button type="button" class="btn btn-default btn-sm btn-modal-minimize hide">
<i class="octicon octicon-chevron-down" style="padding: 1px 0px;"></i>
</button>

View file

@ -2,7 +2,7 @@ frappe.ui.form.ControlMultiSelectList = frappe.ui.form.ControlData.extend({
make_input() {
let template = `
<div class="multiselect-list dropdown">
<div class="form-control cursor-pointer dropdown-toggle input-sm" data-toggle="dropdown" tabindex=0>
<div class="form-control cursor-pointer input-xs" data-toggle="dropdown" tabindex=0>
<div class="status-text ellipsis"></div>
</div>
<ul class="dropdown-menu">

View file

@ -75,22 +75,22 @@ export default class Grid {
data-action="delete_all_rows">
${__("Delete All")}
</button>
<button class="grid-add-multiple-rows btn btn-xs btn-default hidden"
<button class="grid-add-multiple-rows btn btn-xs btn-secondary hidden"
style="margin-right: 4px;">
${__("Add Multiple")}</a>
</button>
<!-- hack to allow firefox include this in tabs -->
<button class="btn btn-xs btn-default grid-add-row">
<button class="btn btn-xs btn-secondary grid-add-row">
${__("Add Row")}
</button>
</div>
<div class="col-sm-4 grid-pagination">
</div>
<div class="col-sm-3 text-right">
<a href="#" class="grid-download btn btn-xs btn-default hidden"
<a href="#" class="grid-download btn btn-xs btn-secondary hidden"
style="margin-left: 4px;">
${__("Download")}</a>
<a href="#" class="grid-upload btn btn-xs btn-default hidden"
<a href="#" class="grid-upload btn btn-xs btn-secondary hidden"
style="margin-left: 4px;">
${__("Upload")}</a>
</div>
@ -865,7 +865,7 @@ export default class Grid {
// add / unhide a custom button
var btn = this.custom_buttons[label];
if (!btn) {
btn = $('<button class="btn btn-default btn-xs btn-custom">' + label + '</button>')
btn = $('<button class="btn btn-secondary btn-xs btn-custom">' + label + '</button>')
.css('margin-right', '4px')
.prependTo(this.grid_buttons)
.on('click', click);

View file

@ -226,10 +226,13 @@ export default class GridRow {
if(this.doc && !this.grid.df.in_place_edit) {
// remove row
if(!this.open_form_button) {
this.open_form_button = $('<a class="close btn-open-row">\
<span class="octicon octicon-triangle-down"></span></a>')
.appendTo($('<div class="col col-xs-1"></div>').appendTo(this.row))
.on('click', function() { me.toggle_view(); return false; });
this.open_form_button = $(`
<div class="btn-open-row"><a>
${frappe.utils.icon('edit', 'xs')}</a>
<div>Edit</div></div>`
)
.appendTo($('<div class="col col-xs-1"></div>').appendTo(this.row))
.on('click', function() { me.toggle_view(); return false; });
if(this.is_too_small()) {
// narrow

View file

@ -42,25 +42,25 @@ export default class GridRowForm {
<div class="toolbar grid-header-toolbar">
<span class="panel-title">
${ __("Editing Row") } #<span class="grid-form-row-index"></span></span>
<button class="btn btn-default btn-xs pull-right" style="margin-left: 7px;">
<i class="octicon octicon-check visible-xs" style="padding-bottom: 2px;"></i>
<span class="hidden-xs octicon octicon-triangle-up"></span></button>
<div class="btn btn-secondary btn-sm pull-right" style="margin-left: 7px;">
${frappe.utils.icon('down')}</div>
<span class="row-actions">
<button class="btn btn-default btn-xs pull-right grid-move-row hidden-xs"
<button class="btn btn-secondary btn-sm pull-right grid-move-row hidden-xs"
style="margin-left: 7px;">
${ __("Move") }</button>
<button class="btn btn-default btn-xs pull-right grid-duplicate-row hidden-xs"
<button class="btn btn-secondary btn-sm pull-right grid-duplicate-row hidden-xs"
style="margin-left: 7px;">
${ __("Duplicate") }</button>
<button class="btn btn-default btn-xs pull-right grid-insert-row"
${frappe.utils.icon('duplicate')}
${ __("Duplicate") }
</button>
<button class="btn btn-secondary btn-sm pull-right grid-insert-row"
style="margin-left: 7px;">
${ __("Insert Above") }</button>
<button class="btn btn-default btn-xs pull-right grid-insert-row-below hidden-xs"
<button class="btn btn-secondary btn-sm pull-right grid-insert-row-below hidden-xs"
style="margin-left: 7px;">
${ __("Insert Below") }</button>
<button class="btn btn-danger btn-xs pull-right grid-delete-row">
<i class="octicon octicon-trashcan"
style="padding-bottom: 2px; margin-top: 1px;"></i>
<button class="btn btn-danger btn-sm pull-right grid-delete-row">
${frappe.utils.icon('delete')}
</button>
</span>
</div>
@ -68,11 +68,10 @@ export default class GridRowForm {
<div class="grid-form-body">
<div class="form-area"></div>
<div class="grid-footer-toolbar clearfix hidden-xs">
<span class="text-muted">
<i class="octicon octicon-keyboard"></i> &ndash;
<kbd>${ __("Ctrl + Up") }</kbd>, <kbd>${ __("Ctrl + Down") }</kbd>, <kbd>${ __("ESC") }</kbd>
</span>
<button class="btn btn-default btn-xs pull-right grid-append-row"
<span> ${frappe.utils.icon("keyboard", "md")} </span>
<span class="text-medium"> ${ __("Keyboard Shortcuts") }: </span>
<kbd>${ __("Ctrl + Up") }</kbd> . <kbd>${ __("Ctrl + Down") }</kbd> . <kbd>${ __("ESC") }</kbd>
<button class="btn btn-secondary btn-sm pull-right grid-append-row"
style="margin-left: 7px;">
${ __("Insert Below") }</button>
</div>

View file

@ -44,7 +44,7 @@ frappe.ui.form.QuickEntryForm = Class.extend({
});
},
set_meta_and_mandatory_fields: function(){
set_meta_and_mandatory_fields: function() {
this.meta = frappe.get_meta(this.doctype);
let fields = this.meta.fields;
@ -60,7 +60,7 @@ frappe.ui.form.QuickEntryForm = Class.extend({
}
},
is_quick_entry: function(){
is_quick_entry: function() {
if(this.meta.quick_entry != 1) {
return false;
}
@ -74,7 +74,7 @@ frappe.ui.form.QuickEntryForm = Class.extend({
return true;
},
too_many_mandatory_fields: function(){
too_many_mandatory_fields: function() {
if(this.mandatory.length > 7) {
// too many fields, show form
return true;
@ -91,14 +91,14 @@ frappe.ui.form.QuickEntryForm = Class.extend({
return false;
},
validate_for_prompt_autoname: function(){
validate_for_prompt_autoname: function() {
if(this.meta.autoname && this.meta.autoname.toLowerCase()==='prompt') {
this.mandatory = [{fieldname:'__newname', label:__('{0} Name', [this.meta.name]),
reqd: 1, fieldtype:'Data'}].concat(this.mandatory);
}
},
render_dialog: function(){
render_dialog: function() {
var me = this;
this.dialog = new frappe.ui.Dialog({
title: __("New {0}", [__(this.doctype)]),
@ -131,7 +131,7 @@ frappe.ui.form.QuickEntryForm = Class.extend({
}
},
register_primary_action: function(){
register_primary_action: function() {
var me = this;
this.dialog.set_primary_action(__('Save'), function() {
if(me.dialog.working) {
@ -259,10 +259,14 @@ frappe.ui.form.QuickEntryForm = Class.extend({
frappe.set_route('Form', this.doctype, this.doc.name);
},
render_edit_in_full_page_link: function(){
render_edit_in_full_page_link: function() {
var me = this;
var $link = $('<div style="padding-left: 7px; padding-top: 30px; padding-bottom: 10px;">' +
'<button class="edit-full btn-default btn-sm">' + __("Edit in full page") + '</button></div>').appendTo(this.dialog.body);
var $link = $(`<div>
<button class="edit-full btn btn-default btn-sm">
${frappe.utils.icon('edit', 'xs')}
${__("Edit in full page")}
</button>
</div>`).appendTo(this.dialog.body);
$link.find('.edit-full').on('click', function() {
// edit in form
@ -270,7 +274,7 @@ frappe.ui.form.QuickEntryForm = Class.extend({
});
},
set_defaults: function(){
set_defaults: function() {
var me = this;
// set defaults
$.each(this.dialog.fields_dict, function(fieldname, field) {

View file

@ -201,6 +201,7 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.FieldGroup {
this.get_close_btn().trigger("click");
}
toggle_minimize() {
this.$wrapper.prev('.modal-backdrop').toggleClass('show').toggleClass('hide');
let modal = this.$wrapper.closest('.modal').toggleClass('modal-minimize');
modal.attr('tabindex') ? modal.removeAttr('tabindex') : modal.attr('tabindex', -1);
this.get_minimize_btn().find('i').toggleClass('octicon-chevron-down').toggleClass('octicon-chevron-up');

View file

@ -332,9 +332,9 @@ frappe.ui.Page = Class.extend({
let shortcut_obj = this.prepare_shortcut_obj(shortcut, click, label);
$li = $(`<li><a class="grey-link dropdown-item" href="#" onClick="return false;">
<span class="menu-item-label">${label}</span>
<div class="text-muted pull-right menu-shorcut">
<kbd class="pull-right">
<span>${shortcut_obj.shortcut_label}</span>
</div>
</kbd>
</a><li>`);
frappe.ui.keys.add_shortcut(shortcut_obj);
} else {
@ -588,9 +588,10 @@ frappe.ui.Page = Class.extend({
//
},
add_button: function(label, click, button_class) {
if (!button_class) button_class = "btn-secondary btn-default";
let button = $(`<button class="btn ${button_class} btn-sm">${label}</button>`);
add_button: function(label, click, button_class, button_size) {
if (!button_class) button_class = "btn-default";
if (!button_size) button_size = "btn-sm";
let button = $(`<button class="btn ${button_class} ${button_size}">${label}</button>`);
button.appendTo(this.custom_actions);
button.on('click', click);
this.custom_actions.removeClass('hide');

View file

@ -152,13 +152,13 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
this.create_chart_button && this.create_chart_button.remove()
this.create_chart_button = this.page.add_button(__("Set Chart"), () => {
this.open_create_chart_dialog();
});
}, null, 'btn-xs');
if (this.chart_fields || this.chart_options) {
this.add_to_dashboard_button && this.add_to_dashboard_button.remove()
this.add_to_dashboard_button = this.page.add_button(__("Add Chart to Dashboard"), () => {
this.add_chart_to_dashboard();
});
}, null, 'btn-xs');
}
} else {
this.create_chart_button && this.create_chart_button.remove()
@ -1578,26 +1578,26 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
}
show_footer_message() {
const message = __('For comparison, use >5, <10 or =324. For ranges, use 5:10 (for values between 5 & 10).');
const execution_time_msg = __('Execution Time: {0} sec', [this.execution_time || 0.1]);
this.page.footer.removeClass('hide').addClass('text-muted col-md-12').html(`
<span class="text-left col-md-6">${message}</span><span class="text-right col-md-6">${execution_time_msg}</span>
`);
this.page.wrapper.find('.tree-footer').remove();
this.$report_footer && this.$report_footer.remove();
this.$report_footer = $(`<div class="report-footer"></div>`).appendTo(this.page.main);
if (this.tree_report) {
this.$tree_footer = this.page.footer.clone().addClass('tree-footer');
this.$tree_footer.html(`<div class="col-md-12">
this.$tree_footer = $(`<div class="tree-footer col-md-6">
<button class="btn btn-xs btn-default" data-action="expand_all_rows">
${__('Expand All')}</button>
<button class="btn btn-xs btn-default" data-action="collapse_all_rows">
${__('Collapse All')}</button>
</div>`);
this.page.footer.before(this.$tree_footer);
$(this.$report_footer).append(this.$tree_footer);
this.$tree_footer.find('[data-action=collapse_all_rows]').show();
this.$tree_footer.find('[data-action=expand_all_rows]').hide();
}
const message = __('For comparison, use >5, <10 or =324. For ranges, use 5:10 (for values between 5 & 10).');
const execution_time_msg = __('Execution Time: {0} sec', [this.execution_time || 0.1]);
this.$report_footer.append(`<div class="col-md-12">
<span">${message}</span><span class="pull-right">${execution_time_msg}</span>
</div>`);
}
expand_all_rows() {

View file

@ -129,24 +129,24 @@ textarea.form-control {
background-color: @light-bg;
}
.modal-backdrop {
opacity: 0.5;
position: fixed;
}
// .modal-backdrop {
// opacity: 0.5;
// position: fixed;
// }
.modal-header {
padding: 10px 15px;
}
// .modal-header {
// padding: 10px 15px;
// }
.modal-title {
margin: auto 0px;
}
// .modal-title {
// margin: auto 0px;
// }
.modal-message {
margin: 30px 15px;
color: @text-muted;
text-align: center;
}
// .modal-message {
// margin: 30px 15px;
// color: @text-muted;
// text-align: center;
// }
.btn-primary.disabled {
background-color: #b1bdca;
@ -689,10 +689,6 @@ li.user-progress {
}
}
.checkbox label {
padding-left: 2px;
}
// Will not be required after commonifying lists with empty state
.multiselect-empty-state{
min-height: 300px;
@ -950,7 +946,7 @@ img.img-loading:after {
ul {
margin: 0px;
li {
padding: 10px;
// padding: 10px;
cursor: pointer;
&:hover {
background: @btn-bg;
@ -986,26 +982,26 @@ body.no-sidebar {
white-space: nowrap;
}
.modal-minimize {
position: initial;
.modal-backdrop {
display: none;
}
.modal-dialog {
z-index: 101;
position: fixed;
right: 15px;
bottom: 0;
margin: 0;
max-width: 500px;
.modal-content {
min-height: 0;
}
}
.modal-body {
display: none;
}
}
// .modal-minimize {
// position: initial;
// .modal-backdrop {
// display: none;
// }
// .modal-dialog {
// z-index: 101;
// position: fixed;
// right: 15px;
// bottom: 0;
// margin: 0;
// max-width: 500px;
// .modal-content {
// min-height: 0;
// }
// }
// .modal-body {
// display: none;
// }
// }
.app-logo {
width: 24px;

View file

@ -29,7 +29,7 @@
border: 1px solid var(--border-color);
left: 0;
margin: 0;
padding: 0;
padding: 4px;
z-index: 1;
top: calc(100% + var(--margin-xs));
@ -38,6 +38,7 @@
font-size: 12px;
padding: var(--padding-sm);
color: var(--text-light);
border-radius: var(--border-radius-sm);
}
&> li .link-option {

View file

@ -43,6 +43,14 @@
}
}
.modal {
.form-section {
.form-column {
padding: 0;
}
}
}
.form-section.card-section {
margin: var(--margin-lg) 0px;
@extend .frappe-card;
@ -215,3 +223,7 @@
}
}
}
.form-message {
padding: var(--padding-md) var(--padding-xl);
}

View file

@ -130,22 +130,31 @@ img {
}
}
.btn-secondary, .btn-default {
.btn-secondary {
background-color: var(--control-bg);
color: var(--text-color);
&:hover, &:active {
background: var(--gray-200);
background: var(--gray-300);
color: var(--text-color);
}
}
.btn-default {
background-color: var(--fg-color);
color: var(--text-color);
&:hover, &:active {
background: var(--gray-200);
color: var(--text-color);
}
}
.btn-primary {
background-color: var(--primary-color);
}
.btn-danger {
background-color: var(--red-400);
}
h1, h2, h3 {
color: $text-color;
@ -327,6 +336,15 @@ input[type="checkbox"] {
color: var(--heading-color);
}
kbd {
background-color: var(--gray-500);
font-family: Inter;
color: var(--fg-color);
line-height: 1.2em;
height: 20px;
padding: 4px 8px;
}
.appreciation {
background-color: var(--dark-green-100) !important;
color: var(--dark-green-600) !important;

View file

@ -1,3 +1,9 @@
.form-grid {
// border: 1px solid var(--border-color);
// border-radius: var(--border-radius);
color: var(--text-color);
}
.form-grid.error {
border-color: var(--red-500);
}
@ -12,10 +18,6 @@
padding: 0px 15px;
border-bottom: 1px solid var(--border-color);
@include transition(.2s);
.form-control {
background-color: transparent;
}
}
.grid-row:last-child {
@ -101,7 +103,13 @@
.grid-body {
.btn-open-row {
padding-top: 5px;
display: flex;
padding-top: var(--padding-sm);
justify-content: center;
div {
margin-left: var(--margin-xs);
line-height: 1.7em;
}
}
.editable-row {
@ -247,7 +255,36 @@
height: 0;
opacity: 0;
z-index: 1021;
border-radius: var(--border-radius-md);
@include base-grid();
.btn {
box-shadow: none;
}
.form-section {
padding: 15px;
&:not(:first-child) {
border-top: 1px solid var(--border-color);
}
.section-head {
padding: 0;
}
.form-column:first-child {
padding-left: 0;
}
}
.grid-delete-row {
padding: 4px 6px;
.icon use {
stroke: var(--fg-color);
}
}
}
.recorder-form-in-grid {
@ -260,12 +297,13 @@
height: auto;
overflow: visible;
margin: 0px -15px;
padding: 10px 15px;
}
.grid-form-heading {
padding: 10px 15px;
font-size: 120%;
border-bottom: 1px solid var(--border-color);
// border-bottom: 1px solid var(--border-color);
}
.grid-form-body {
@ -287,8 +325,7 @@
padding: 10px 0px;
background-color: #fff;
.btn-default {
background-color: var(--control-bg);
.btn {
box-shadow: none;
}
}
@ -320,8 +357,11 @@ a.next-page {
}
.grid-footer-toolbar {
padding: 10px 15px;
border-top: 1px solid var(--border-color);
padding: 15px 10px 5px 10px;
// border-top: 1px solid var(--border-color);
span {
margin-right: var(--margin-xs);
}
}
.grid-overflow-no-ellipsis {

View file

@ -1,7 +1,58 @@
h4.modal-title {
font-size: 1em;
}
h5.modal-title {
margin: 0px !important;
}
.modal {
.modal-header {
padding: var(--padding-md) 25px;
.modal-title {
font-weight: 500;
line-height: 2em;
font-size: $font-size-lg;
}
}
.buttons {
button:not(:last-child) {
margin-right: 3px;
}
}
.modal-body {
padding: var(--padding-lg) 25px;
}
.modal-footer {
padding: var(--padding-md);
}
@include media-breakpoint-up(md) {
.modal-dialog {
width: 575px;
max-width: 575px;
}
}
}
.modal-minimize {
position: initial;
.modal-dialog {
z-index: 101;
position: fixed;
right: 15px;
bottom: 0;
margin: 0;
max-width: 575px;
.modal-content {
min-height: 0;
}
}
.modal-body {
display: none;
}
}

View file

@ -57,18 +57,6 @@
}
}
.menu-shorcut {
padding: 0 8px;
height: 20px;
background: var(--gray-600);
border-radius: 4px;
span {
color: $white;
line-height: 20px;
}
}
.page-form {
margin: 0;
padding: var(--padding-sm);

View file

@ -224,6 +224,14 @@
}
}
.report-footer {
padding: var(--padding-sm) 0;
}
.tree-footer {
margin-bottom: var(--margin-sm);
}
// for sm and above
@include media-breakpoint-up(xs) {
.group-by-box .row > div[class*="col-sm-"] {

View file

@ -5,7 +5,7 @@
}
.print-format {
background-color: white;
box-shadow: var(--shadow-xs);
box-shadow: var(--shadow-sm);
border: 1px solid var(--border-color);
max-width: 8.3in;
min-height: 11.69in;