Merge pull request #12504 from prssanna/redesign-fixes
This commit is contained in:
commit
1213040cc2
15 changed files with 58 additions and 23 deletions
|
|
@ -16,8 +16,18 @@ def get_leaderboards():
|
|||
|
||||
@frappe.whitelist()
|
||||
def get_energy_point_leaderboard(date_range, company = None, field = None, limit = None):
|
||||
all_users = frappe.db.get_all('User',
|
||||
filters = {
|
||||
'name': ['not in', ['Administrator', 'Guest']],
|
||||
'enabled': 1,
|
||||
'user_type': ['!=', 'Website User']
|
||||
},
|
||||
order_by = 'name ASC')
|
||||
all_users_list = list(map(lambda x: x['name'], all_users))
|
||||
|
||||
filters = [
|
||||
['type', '!=', 'Review'],
|
||||
['user', 'in', all_users_list]
|
||||
]
|
||||
if date_range:
|
||||
date_range = frappe.parse_json(date_range)
|
||||
|
|
@ -28,15 +38,7 @@ def get_energy_point_leaderboard(date_range, company = None, field = None, limit
|
|||
group_by = 'user',
|
||||
order_by = 'value desc'
|
||||
)
|
||||
all_users = frappe.db.get_all('User',
|
||||
filters = {
|
||||
'name': ['not in', ['Administrator', 'Guest']],
|
||||
'enabled': 1,
|
||||
'user_type': ['!=', 'Website User']
|
||||
},
|
||||
order_by = 'name ASC')
|
||||
|
||||
all_users_list = list(map(lambda x: x['name'], all_users))
|
||||
energy_point_users_list = list(map(lambda x: x['name'], energy_point_users))
|
||||
for user in all_users_list:
|
||||
if user not in energy_point_users_list:
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@
|
|||
"fieldname": "custom_html_help",
|
||||
"fieldtype": "HTML",
|
||||
"label": "Custom HTML Help",
|
||||
"options": "<h3>Custom CSS Help</h3>\n\n<p>Notes:</p>\n\n<ol>\n<li>All field groups (label + value) are set attributes <code>data-fieldtype</code> and <code>data-fieldname</code></li>\n<li>All values are given class <code>value</code></li>\n<li>All Section Breaks are given class <code>section-break</code></li>\n<li>All Column Breaks are given class <code>column-break</code></li>\n</ol>\n\n<h4>Examples</h4>\n\n<p>1. Left align integers</p>\n\n<pre><code>[data-fieldtype=\"Int\"] .value { text-left: left; }</code></pre>\n\n<p>1. Add border to sections except the last section</p>\n\n<pre><code>.section-break { padding: 30px 0px; border-bottom: 1px solid #eee; }\n.section-break:last-child { padding-bottom: 0px; border-bottom: 0px; }</code></pre>\n"
|
||||
"options": "<h3>Custom CSS Help</h3>\n\n<p>Notes:</p>\n\n<ol>\n<li>All field groups (label + value) are set attributes <code>data-fieldtype</code> and <code>data-fieldname</code></li>\n<li>All values are given class <code>value</code></li>\n<li>All Section Breaks are given class <code>section-break</code></li>\n<li>All Column Breaks are given class <code>column-break</code></li>\n</ol>\n\n<h4>Examples</h4>\n\n<p>1. Left align integers</p>\n\n<pre><code>[data-fieldtype=\"Int\"] .value { text-align: left; }</code></pre>\n\n<p>1. Add border to sections except the last section</p>\n\n<pre><code>.section-break { padding: 30px 0px; border-bottom: 1px solid #eee; }\n.section-break:last-child { padding-bottom: 0px; border-bottom: 0px; }</code></pre>\n"
|
||||
},
|
||||
{
|
||||
"depends_on": "custom_format",
|
||||
|
|
@ -211,7 +211,7 @@
|
|||
"idx": 1,
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2020-12-14 11:38:49.132061",
|
||||
"modified": "2021-03-01 15:25:46.578863",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Printing",
|
||||
"name": "Print Format",
|
||||
|
|
|
|||
|
|
@ -269,6 +269,7 @@ frappe.ui.form.PrintView = class {
|
|||
based_on: data.based_on,
|
||||
};
|
||||
frappe.set_route('print-format-builder');
|
||||
this.print_sel.val(data.print_format_name);
|
||||
},
|
||||
__('New Custom Print Format'),
|
||||
__('Start')
|
||||
|
|
@ -641,10 +642,13 @@ frappe.ui.form.PrintView = class {
|
|||
|
||||
refresh_print_options() {
|
||||
this.print_formats = frappe.meta.get_print_formats(this.frm.doctype);
|
||||
return this.print_sel.empty().add_options([
|
||||
const print_format_select_val = this.print_sel.val();
|
||||
this.print_sel.empty().add_options([
|
||||
this.get_default_option_for_select(__('Select Print Format')),
|
||||
...this.print_formats
|
||||
]);
|
||||
return this.print_formats.includes(print_format_select_val)
|
||||
&& this.print_sel.val(print_format_select_val);
|
||||
}
|
||||
|
||||
selected_format() {
|
||||
|
|
|
|||
|
|
@ -784,6 +784,7 @@ frappe.PrintFormatBuilder = Class.extend({
|
|||
btn: this.page.btn_primary,
|
||||
callback: function(r) {
|
||||
me.print_format = r.message;
|
||||
locals['Print Format'][me.print_format.name] = r.message;
|
||||
frappe.show_alert({message: __("Saved"), indicator: 'green'});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<span class="drag-handle">
|
||||
<svg class="icon icon-xs"><use xlink:href="#icon-drag"></use></svg>
|
||||
</span>
|
||||
{%= __(f.label) %}
|
||||
{%= __(f.label) || __(f.fieldname) %}
|
||||
</div>
|
||||
</div>
|
||||
{% } %}
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ frappe.ui.form.ControlSelect = frappe.ui.form.ControlData.extend({
|
|||
label = is_label_null ? __(value) : __(v.label);
|
||||
}
|
||||
}
|
||||
|
||||
$('<option>').html(cstr(label))
|
||||
.attr('value', value)
|
||||
.prop('disabled', is_disabled)
|
||||
|
|
@ -129,6 +130,7 @@ frappe.ui.form.ControlSelect = frappe.ui.form.ControlData.extend({
|
|||
}
|
||||
// select the first option
|
||||
this.selectedIndex = 0;
|
||||
$(this).trigger('select-change');
|
||||
return $(this);
|
||||
};
|
||||
$.fn.set_working = function() {
|
||||
|
|
|
|||
|
|
@ -649,7 +649,7 @@ export default class Grid {
|
|||
duplicate_row(d, copy_doc) {
|
||||
$.each(copy_doc, function (key, value) {
|
||||
if (!["creation", "modified", "modified_by", "idx", "owner",
|
||||
"parent", "doctype", "name", "parentield"].includes(key)) {
|
||||
"parent", "doctype", "name", "parentfield"].includes(key)) {
|
||||
d[key] = value;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -156,10 +156,11 @@ frappe.views.ListViewSelect = class ListViewSelect {
|
|||
items.map(item => {
|
||||
if (item.name.toLowerCase() == page_name.toLowerCase()) {
|
||||
placeholder = item.name;
|
||||
} else {
|
||||
html += `<li><a class="dropdown-item" href="${item.route}">${
|
||||
item.name
|
||||
}</a></li>`;
|
||||
}
|
||||
html += `<li><a class="dropdown-item" href="${item.route}">${
|
||||
item.name
|
||||
}</a></li>`;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ frappe.msgprint = function(msg, title, is_minimizable) {
|
|||
}
|
||||
|
||||
frappe.msg_dialog.set_primary_action(
|
||||
__(data.primary_action.label || "Done"),
|
||||
__(data.primary_action.label || data.primary_action_label || "Done"),
|
||||
data.primary_action.action
|
||||
);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -203,7 +203,9 @@ frappe.views.CommunicationComposer = Class.extend({
|
|||
if(this.dialog.fields_dict.sender) {
|
||||
this.dialog.fields_dict.sender.set_value(this.sender || '');
|
||||
}
|
||||
this.dialog.fields_dict.subject.set_value(this.subject || '');
|
||||
this.dialog.fields_dict.subject.set_value(
|
||||
frappe.utils.html2text(this.subject) || ''
|
||||
);
|
||||
|
||||
this.setup_earlier_reply();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -605,7 +605,7 @@ frappe.provide("frappe.views");
|
|||
function make_dom() {
|
||||
var opts = {
|
||||
name: card.name,
|
||||
title: remove_img_tags(card.title),
|
||||
title: frappe.utils.html2text(card.title),
|
||||
disable_click: card._disable_click ? 'disable-click' : '',
|
||||
creation: card.creation,
|
||||
image_url: cur_list.get_image_url(card),
|
||||
|
|
|
|||
|
|
@ -1203,11 +1203,11 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
|
|||
// Rerender the reports dropdown,
|
||||
// so that this report is included in the dropdown as well.
|
||||
frappe.boot.user.all_reports[r.message] = {
|
||||
ref_doctype: "Item",
|
||||
ref_doctype: this.doctype,
|
||||
report_type: "Report Builder",
|
||||
title: r.message,
|
||||
};
|
||||
this.list_sidebar.setup_reports();
|
||||
|
||||
frappe.set_route('List', this.doctype, 'Report', r.message);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,14 @@
|
|||
|
||||
font-family: inherit;
|
||||
z-index: 9999 !important;
|
||||
background: var(--bg-color);
|
||||
color: var(--text-color);
|
||||
border-radius: var(--border-radius);
|
||||
border: 1px solid var(--border-color);
|
||||
|
||||
&--nav {
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
&--time-current-hours, &--time-current-minutes, &--time-current-seconds {
|
||||
font-family: inherit;
|
||||
|
|
@ -45,6 +53,10 @@
|
|||
|
||||
}
|
||||
|
||||
&--time, &--buttons {
|
||||
border-top: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
&--time-row {
|
||||
background-image: linear-gradient(to right, #0089FF, #0089FF);
|
||||
background-repeat: no-repeat;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
--dt-text-color: var(--text-light);
|
||||
--dt-text-light: var(--bg-color);
|
||||
--dt-spacer-1: 0.25rem;
|
||||
--dt-spacer-2: 0.5rem;
|
||||
--dt-spacer-2: var(--padding-xs);
|
||||
--dt-spacer-3: 1rem;
|
||||
--dt-border-radius: var(--border-radius);
|
||||
--dt-cell-bg: var(--fg-color);
|
||||
|
|
@ -26,6 +26,16 @@
|
|||
border-radius: 0px;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
height: 100%;
|
||||
|
||||
&:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
&[data-fieldtype="Select"] .select-icon {
|
||||
top: 5px;
|
||||
right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.dt-header {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@ a.badge-hover {
|
|||
}
|
||||
|
||||
pre {
|
||||
color: var(--text-light)
|
||||
color: var(--text-light);
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.col-xs-1 { @extend .col-1; }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue