From a84a40cfca976fe8ea04abddcaeb2f13c43e2a29 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Sun, 2 Apr 2017 17:59:07 +0530 Subject: [PATCH] Cleanup html, add css for mobile, fixed class names in code --- frappe/public/build.json | 2 - frappe/public/css/list.css | 35 ++++++-- .../list/header_select_all_like_filter.html | 2 +- .../list/item_assigned_to_comment_count.html | 32 ++++--- .../public/js/frappe/list/list_item_main.html | 85 +++++++++---------- .../js/frappe/list/list_item_main_1.html | 40 --------- .../js/frappe/list/list_item_main_head.html | 6 +- .../public/js/frappe/list/list_item_row.html | 35 +++----- .../js/frappe/list/list_item_row_1.html | 22 ----- .../js/frappe/list/list_item_row_head.html | 6 +- .../js/frappe/list/list_item_subject.html | 2 +- frappe/public/js/frappe/list/list_view.js | 4 +- .../js/frappe/views/gantt/gantt_view.js | 2 +- .../js/frappe/views/kanban/kanban_board.js | 6 +- frappe/public/less/list.less | 39 +++++++-- 15 files changed, 146 insertions(+), 172 deletions(-) delete mode 100644 frappe/public/js/frappe/list/list_item_main_1.html delete mode 100644 frappe/public/js/frappe/list/list_item_row_1.html diff --git a/frappe/public/build.json b/frappe/public/build.json index 09603109e9..fdb6da93c5 100755 --- a/frappe/public/build.json +++ b/frappe/public/build.json @@ -233,9 +233,7 @@ "public/js/frappe/list/list_sidebar.html", "public/js/frappe/list/list_sidebar_stat.html", "public/js/frappe/list/list_item_main.html", - "public/js/frappe/list/list_item_main_1.html", "public/js/frappe/list/list_item_row.html", - "public/js/frappe/list/list_item_row_1.html", "public/js/frappe/list/list_item_main_head.html", "public/js/frappe/list/list_item_row_head.html", "public/js/frappe/list/list_item_subject.html", diff --git a/frappe/public/css/list.css b/frappe/public/css/list.css index f8e02603c4..ff3f0a7092 100644 --- a/frappe/public/css/list.css +++ b/frappe/public/css/list.css @@ -386,7 +386,6 @@ } .list-items { width: 100%; - font-size: 12px; } .list-item-container { border-bottom: 1px solid #d1d8dd; @@ -399,8 +398,17 @@ align-items: center; height: 40px; padding-left: 15px; + font-size: 12px; } -.list-item__head { +@media (max-width: 767px) { + .list-item { + height: 50px; + padding-left: 10px; + font-size: 14px; + font-weight: normal; + } +} +.list-item--head { background-color: #F7FAFC; border-bottom: 1px solid #d1d8dd; } @@ -414,13 +422,30 @@ margin-left: 5px; margin-right: 10px; } -.list-item--content { +.list-item__content { flex: 1; margin-right: 15px; + display: flex; + align-items: center; } -.list-item--content__flex-2 { +.list-item__content--flex-2 { flex: 2; } -.list-item--content:last-child { +.list-item__content--activity { + justify-content: flex-end; margin-right: 5px; } +.list-item__content--activity .list-row-modified, +.list-item__content--activity .avatar-small { + margin-right: 10px; +} +.list-item__content--indicator span::before { + height: 12px; + width: 12px; +} +.list-item__content--id { + justify-content: flex-end; +} +.frappe-timestamp { + white-space: nowrap; +} diff --git a/frappe/public/js/frappe/list/header_select_all_like_filter.html b/frappe/public/js/frappe/list/header_select_all_like_filter.html index 239a08c4fb..1cb81c9dc9 100644 --- a/frappe/public/js/frappe/list/header_select_all_like_filter.html +++ b/frappe/public/js/frappe/list/header_select_all_like_filter.html @@ -1,5 +1,5 @@ {% if (_checkbox) { %} - {% } %} diff --git a/frappe/public/js/frappe/list/item_assigned_to_comment_count.html b/frappe/public/js/frappe/list/item_assigned_to_comment_count.html index 676fab1457..91df275ac9 100644 --- a/frappe/public/js/frappe/list/item_assigned_to_comment_count.html +++ b/frappe/public/js/frappe/list/item_assigned_to_comment_count.html @@ -1,17 +1,15 @@ - + + {%= comment_when(data.modified, true) %} + +{% if (data._assign_list.length) { %} + + {%= frappe.avatar(data._assign_list[data._assign_list.length - 1]) %} +{% } else { %} + +{% } %} + + + {%= (data._comment_count > 99 ? "99+" : data._comment_count) || 0 %} + diff --git a/frappe/public/js/frappe/list/list_item_main.html b/frappe/public/js/frappe/list/list_item_main.html index 42f00765ea..928943abcd 100644 --- a/frappe/public/js/frappe/list/list_item_main.html +++ b/frappe/public/js/frappe/list/list_item_main.html @@ -1,49 +1,40 @@ -
- {% var total_cols=0; for (var i=0, l=columns.length; i < l; i++ ) { - var col = columns[i], value=data[col.fieldname]; total_cols += parseInt(col.colspan); %} - {% if (total_cols <= 12) { %} -
- {% if(col.type!=="Indicator") { %}{% } %} - {% if (col.type==="Subject") { %} - {%= subject %} - {% } else if (col.type==="Indicator") { %} - {%= indicator %} - {% } else if (col.render) { %} - {%= col.render(data) %} - {% } else if (col.fieldtype==="Image") { %} - {% if(data[col.df.options]) { %} - - {% } else { %} -
- {% } %} - {% } else if(col.fieldtype==="Select") { %} - {%= __(value) %} - {% } else if(col.fieldtype==="Link") { %} - {%= value %} - {% } else { %} - {% if(formatters && formatters[col.fieldname]) { %} - {{ formatters[col.fieldname](value, col.df, data) }} - {% } else { %} - {{ frappe.format(value, col.df, null, data) }} - {% } %} - {% } %} - {% if(col.type!=="Indicator") { %}
{% } %} -
+
+ {% if (col.type==="Subject") { %} + {%= subject %} + {% } else if (col.type==="Indicator") { %} + {%= indicator %} + {% } else if (col.render) { %} + {%= col.render(data) %} + {% } else if (col.fieldtype==="Image") { %} + {% if(data[col.df.options]) { %} + + {% } else { %} +
+ {% } %} + {% } else if(col.fieldtype==="Select") { %} + {%= __(value) %} + {% } else if(col.fieldtype==="Link") { %} + {%= value %} + {% } else { %} + + {% if(formatters && formatters[col.fieldname]) { %} + {{ formatters[col.fieldname](value, col.df, data) }} + {% } else { %} + {{ frappe.format(value, col.df, null, data) }} {% } %} + {% } %} -
+
\ No newline at end of file diff --git a/frappe/public/js/frappe/list/list_item_main_1.html b/frappe/public/js/frappe/list/list_item_main_1.html deleted file mode 100644 index 8dcdb02e1d..0000000000 --- a/frappe/public/js/frappe/list/list_item_main_1.html +++ /dev/null @@ -1,40 +0,0 @@ -
- {% if (col.type==="Subject") { %} - {%= subject %} - {% } else if (col.type==="Indicator") { %} - {%= indicator %} - {% } else if (col.render) { %} - {%= col.render(data) %} - {% } else if (col.fieldtype==="Image") { %} - {% if(data[col.df.options]) { %} - - {% } else { %} -
- {% } %} - {% } else if(col.fieldtype==="Select") { %} - {%= __(value) %} - {% } else if(col.fieldtype==="Link") { %} - {%= value %} - {% } else { %} - - {% if(formatters && formatters[col.fieldname]) { %} - {{ formatters[col.fieldname](value, col.df, data) }} - {% } else { %} - {{ frappe.format(value, col.df, null, data) }} - {% } %} - - {% } %} -
\ No newline at end of file diff --git a/frappe/public/js/frappe/list/list_item_main_head.html b/frappe/public/js/frappe/list/list_item_main_head.html index c2ae973eb7..9dc8f16b58 100644 --- a/frappe/public/js/frappe/list/list_item_main_head.html +++ b/frappe/public/js/frappe/list/list_item_main_head.html @@ -1,6 +1,6 @@ -
{{ __(col.title) || __(col.label) || "" }} + {{ __(col.title) || __(col.label) || "" }}
\ No newline at end of file diff --git a/frappe/public/js/frappe/list/list_item_row.html b/frappe/public/js/frappe/list/list_item_row.html index 0db51d0a25..d67feabf3b 100644 --- a/frappe/public/js/frappe/list/list_item_row.html +++ b/frappe/public/js/frappe/list/list_item_row.html @@ -1,31 +1,24 @@ -
-
- - {%= main %} -
+
+ {%= main %} {% if (meta.title_field && !settings.hide_name_column) { - var is_different = data.name !== data[meta.title_field]; - %} -