From dc009ae6f95a891f4009f19eba4b46109954d6d8 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 15 Jan 2015 15:29:59 +0530 Subject: [PATCH] [ui] added list head --- frappe/geo/doctype/country/country.json | 111 ++++---- .../doctype/letter_head/letter_head.json | 133 ++++----- .../doctype/print_format/print_format.json | 258 +++++++++--------- frappe/public/build.json | 6 +- frappe/public/css/desk.css | 12 +- frappe/public/js/frappe/list/doclistview.js | 18 +- ...item_standard.html => list_item_main.html} | 2 + .../js/frappe/list/list_item_main_head.html | 10 + .../public/js/frappe/list/list_item_row.html | 3 +- .../js/frappe/list/list_item_row_head.html | 21 ++ frappe/public/js/frappe/list/listview.js | 27 +- frappe/public/js/frappe/misc/pretty_date.js | 2 +- frappe/public/js/frappe/ui/listing.html | 10 +- .../public/js/frappe/ui/toolbar/navbar.html | 2 +- frappe/public/less/desk.less | 15 +- .../workflow/doctype/workflow/workflow.json | 3 +- 16 files changed, 348 insertions(+), 285 deletions(-) rename frappe/public/js/frappe/list/{list_item_standard.html => list_item_main.html} (92%) create mode 100644 frappe/public/js/frappe/list/list_item_main_head.html create mode 100644 frappe/public/js/frappe/list/list_item_row_head.html diff --git a/frappe/geo/doctype/country/country.json b/frappe/geo/doctype/country/country.json index 1db0b816d5..551a8cc128 100644 --- a/frappe/geo/doctype/country/country.json +++ b/frappe/geo/doctype/country/country.json @@ -1,73 +1,74 @@ { - "allow_import": 1, - "autoname": "field:country_name", - "creation": "2013-01-19 10:23:30", - "docstatus": 0, - "doctype": "DocType", - "document_type": "Master", + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:country_name", + "creation": "2013-01-19 10:23:30", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", "fields": [ { - "fieldname": "country_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Country Name", - "oldfieldname": "country_name", - "oldfieldtype": "Data", - "permlevel": 0, + "fieldname": "country_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Country Name", + "oldfieldname": "country_name", + "oldfieldtype": "Data", + "permlevel": 0, "reqd": 1 - }, + }, { - "fieldname": "date_format", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Date Format", + "fieldname": "date_format", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Date Format", "permlevel": 0 - }, + }, { - "fieldname": "time_zones", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Time Zones", + "fieldname": "time_zones", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Time Zones", "permlevel": 0 - }, + }, { - "fieldname": "code", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Code", + "fieldname": "code", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Code", "permlevel": 0 } - ], - "icon": "icon-globe", - "idx": 1, - "in_create": 0, - "modified": "2014-05-27 03:49:08.984711", - "modified_by": "Administrator", - "module": "Geo", - "name": "Country", - "owner": "Administrator", + ], + "icon": "icon-globe", + "idx": 1, + "in_create": 0, + "modified": "2015-01-15 15:24:29.282629", + "modified_by": "Administrator", + "module": "Geo", + "name": "Country", + "owner": "Administrator", "permissions": [ { - "amend": 0, - "create": 1, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "submit": 0, + "amend": 0, + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 0, "write": 1 - }, + }, { - "apply_user_permissions": 1, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, + "apply_user_permissions": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, "role": "All" } - ], + ], "read_only": 0 -} +} \ No newline at end of file diff --git a/frappe/print/doctype/letter_head/letter_head.json b/frappe/print/doctype/letter_head/letter_head.json index e02ee7cf2e..220b585072 100644 --- a/frappe/print/doctype/letter_head/letter_head.json +++ b/frappe/print/doctype/letter_head/letter_head.json @@ -1,84 +1,85 @@ { - "autoname": "field:letter_head_name", - "creation": "2012-11-22 17:45:46", - "docstatus": 0, - "doctype": "DocType", + "allow_rename": 1, + "autoname": "field:letter_head_name", + "creation": "2012-11-22 17:45:46", + "docstatus": 0, + "doctype": "DocType", "fields": [ { - "fieldname": "letter_head_name", - "fieldtype": "Data", - "in_filter": 0, - "in_list_view": 1, - "label": "Letter Head Name", - "oldfieldname": "letter_head_name", - "oldfieldtype": "Data", - "permlevel": 0, + "fieldname": "letter_head_name", + "fieldtype": "Data", + "in_filter": 0, + "in_list_view": 1, + "label": "Letter Head Name", + "oldfieldname": "letter_head_name", + "oldfieldtype": "Data", + "permlevel": 0, "reqd": 1 - }, + }, { - "depends_on": "letter_head_name", - "fieldname": "disabled", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Disabled", - "oldfieldname": "disabled", - "oldfieldtype": "Check", + "depends_on": "letter_head_name", + "fieldname": "disabled", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Disabled", + "oldfieldname": "disabled", + "oldfieldtype": "Check", "permlevel": 0 - }, + }, { - "depends_on": "letter_head_name", - "description": "Check this to make this the default letter head in all prints", - "fieldname": "is_default", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Is Default", - "oldfieldname": "is_default", - "oldfieldtype": "Check", - "permlevel": 0, + "depends_on": "letter_head_name", + "description": "Check this to make this the default letter head in all prints", + "fieldname": "is_default", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Is Default", + "oldfieldname": "is_default", + "oldfieldtype": "Check", + "permlevel": 0, "search_index": 1 - }, + }, { - "depends_on": "letter_head_name", - "description": "Letter Head in HTML", - "fieldname": "content", - "fieldtype": "Text Editor", - "in_list_view": 1, - "label": "Content", - "oldfieldname": "content", - "oldfieldtype": "Text Editor", + "depends_on": "letter_head_name", + "description": "Letter Head in HTML", + "fieldname": "content", + "fieldtype": "Text Editor", + "in_list_view": 1, + "label": "Content", + "oldfieldname": "content", + "oldfieldtype": "Text Editor", "permlevel": 0 } - ], - "icon": "icon-font", - "idx": 1, - "max_attachments": 3, - "modified": "2014-07-21 05:57:56.052192", - "modified_by": "Administrator", - "module": "Print", - "name": "Letter Head", - "owner": "Administrator", + ], + "icon": "icon-font", + "idx": 1, + "max_attachments": 3, + "modified": "2015-01-15 15:25:02.869899", + "modified_by": "Administrator", + "module": "Print", + "name": "Letter Head", + "owner": "Administrator", "permissions": [ { - "create": 1, - "delete": 1, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "submit": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 0, "write": 1 - }, + }, { - "apply_user_permissions": 1, - "delete": 0, - "email": 0, - "permlevel": 0, - "print": 0, - "read": 1, - "report": 0, + "apply_user_permissions": 1, + "delete": 0, + "email": 0, + "permlevel": 0, + "print": 0, + "read": 1, + "report": 0, "role": "All" } ] -} +} \ No newline at end of file diff --git a/frappe/print/doctype/print_format/print_format.json b/frappe/print/doctype/print_format/print_format.json index 5e02677a9e..01a600abb9 100644 --- a/frappe/print/doctype/print_format/print_format.json +++ b/frappe/print/doctype/print_format/print_format.json @@ -1,157 +1,157 @@ { - "allow_copy": 0, - "allow_rename": 0, - "autoname": "Prompt", - "creation": "2013-01-23 19:54:43", - "docstatus": 0, - "doctype": "DocType", + "allow_copy": 0, + "allow_rename": 1, + "autoname": "Prompt", + "creation": "2013-01-23 19:54:43", + "docstatus": 0, + "doctype": "DocType", "fields": [ { - "description": "Belongs to", - "fieldname": "doc_type", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "DocType", - "options": "DocType", - "permlevel": 0, - "reqd": 1, + "description": "Belongs to", + "fieldname": "doc_type", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "DocType", + "options": "DocType", + "permlevel": 0, + "reqd": 1, "search_index": 0 - }, + }, { - "allow_on_submit": 0, - "fieldname": "module", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Module", - "no_copy": 0, - "oldfieldname": "module", - "oldfieldtype": "Select", - "options": "Module Def", - "permlevel": 0, - "print_hide": 0, - "report_hide": 0, - "reqd": 1, + "allow_on_submit": 0, + "fieldname": "module", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Module", + "no_copy": 0, + "oldfieldname": "module", + "oldfieldtype": "Select", + "options": "Module Def", + "permlevel": 0, + "print_hide": 0, + "report_hide": 0, + "reqd": 1, "search_index": 1 - }, + }, { - "fieldname": "column_break_3", - "fieldtype": "Column Break", + "fieldname": "column_break_3", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "allow_on_submit": 0, - "default": "No", - "fieldname": "standard", - "fieldtype": "Select", - "hidden": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Standard", - "no_copy": 1, - "oldfieldname": "standard", - "oldfieldtype": "Select", - "options": "No\nYes", - "permlevel": 1, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 1, + "allow_on_submit": 0, + "default": "No", + "fieldname": "standard", + "fieldtype": "Select", + "hidden": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Standard", + "no_copy": 1, + "oldfieldname": "standard", + "oldfieldtype": "Select", + "options": "No\nYes", + "permlevel": 1, + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, "search_index": 1 - }, + }, { - "default": "Server", - "description": "Client-side formats are now deprecated", - "fieldname": "print_format_type", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Print Format Type", - "options": "Server\nClient", - "permlevel": 0, + "default": "Server", + "description": "Client-side formats are now deprecated", + "fieldname": "print_format_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Print Format Type", + "options": "Server\nClient", + "permlevel": 0, "read_only": 0 - }, + }, { - "fieldname": "disabled", - "fieldtype": "Check", - "label": "Disabled", + "fieldname": "disabled", + "fieldtype": "Check", + "label": "Disabled", "permlevel": 0 - }, + }, { - "fieldname": "section_break_6", - "fieldtype": "Section Break", + "fieldname": "section_break_6", + "fieldtype": "Section Break", "permlevel": 0 - }, + }, { - "allow_on_submit": 0, - "depends_on": "", - "fieldname": "html", - "fieldtype": "Code", - "hidden": 0, - "in_filter": 0, - "label": "HTML", - "no_copy": 0, - "oldfieldname": "html", - "oldfieldtype": "Text Editor", - "options": "HTML", - "permlevel": 0, - "print_hide": 0, - "report_hide": 0, - "reqd": 0, + "allow_on_submit": 0, + "depends_on": "", + "fieldname": "html", + "fieldtype": "Code", + "hidden": 0, + "in_filter": 0, + "label": "HTML", + "no_copy": 0, + "oldfieldname": "html", + "oldfieldtype": "Text Editor", + "options": "HTML", + "permlevel": 0, + "print_hide": 0, + "report_hide": 0, + "reqd": 0, "search_index": 0 - }, + }, { - "fieldname": "print_format_help", - "fieldtype": "HTML", - "label": "Print Format Help", - "options": "

Print Format Help

\n
\n

Introduction

\n

Print itemsFormats are rendered on the server side using the Jinja Templating Language. All forms have access to the doc object which contains information about the document that is being formatted. You can also access common utilities via the frappe module.

\n

For styling, the Boostrap CSS framework is provided and you can enjoy the full range of classes.

\n
\n

References

\n
    \n\t
  1. Jinja Tempalting Language: Reference
  2. \n\t
  3. Bootstrap CSS Framework
  4. \n
\n
\n

Example

\n
<h3>{{ doc.select_print_heading or \"Invoice\" }}</h3>\n<div class=\"row\">\n\t<div class=\"col-md-3 text-right\">Customer Name</div>\n\t<div class=\"col-md-9\">{{ doc.customer_name }}</div>\n</div>\n<div class=\"row\">\n\t<div class=\"col-md-3 text-right\">Date</div>\n\t<div class=\"col-md-9\">{{ doc.get_formatted(\"invoice_date\") }}</div>\n</div>\n<table class=\"table table-bordered\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<th>Sr</th>\n\t\t\t<th>Item Name</th>\n\t\t\t<th>Description</th>\n\t\t\t<th class=\"text-right\">Qty</th>\n\t\t\t<th class=\"text-right\">Rate</th>\n\t\t\t<th class=\"text-right\">Amount</th>\n\t\t</tr>\n\t\t{%- for row in doc.items -%}\n\t\t<tr>\n\t\t\t<td style=\"width: 3%;\">{{ row.idx }}</td>\n\t\t\t<td style=\"width: 20%;\">\n\t\t\t\t{{ row.item_name }}\n\t\t\t\t{% if row.item_code != row.item_name -%}\n\t\t\t\t<br>Item Code: {{ row.item_code}}\n\t\t\t\t{%- endif %}\n\t\t\t</td>\n\t\t\t<td style=\"width: 37%;\">\n\t\t\t\t<div style=\"border: 0px;\">{{ row.description }}</div></td>\n\t\t\t<td style=\"width: 10%; text-align: right;\">{{ row.qty }} {{ row.uom or row.stock_uom }}</td>\n\t\t\t<td style=\"width: 15%; text-align: right;\">{{\n\t\t\t\trow.get_formatted(\"rate\", doc) }}</td>\n\t\t\t<td style=\"width: 15%; text-align: right;\">{{\n\t\t\t\trow.get_formatted(\"amount\", doc) }}</td>\n\t\t</tr>\n\t\t{%- endfor -%}\n\t</tbody>\n</table>
\n
\n

Common Functions

\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
doc.get_formatted(\"[fieldname]\", [parent_doc])Get document value formatted as Date, Currency etc. Pass parent doc for curreny type fields.
frappe.db.get_value(\"[doctype]\", \"[name]\", \"fieldname\")Get value from another document.
\n", + "fieldname": "print_format_help", + "fieldtype": "HTML", + "label": "Print Format Help", + "options": "

Print Format Help

\n
\n

Introduction

\n

Print itemsFormats are rendered on the server side using the Jinja Templating Language. All forms have access to the doc object which contains information about the document that is being formatted. You can also access common utilities via the frappe module.

\n

For styling, the Boostrap CSS framework is provided and you can enjoy the full range of classes.

\n
\n

References

\n
    \n\t
  1. Jinja Tempalting Language: Reference
  2. \n\t
  3. Bootstrap CSS Framework
  4. \n
\n
\n

Example

\n
<h3>{{ doc.select_print_heading or \"Invoice\" }}</h3>\n<div class=\"row\">\n\t<div class=\"col-md-3 text-right\">Customer Name</div>\n\t<div class=\"col-md-9\">{{ doc.customer_name }}</div>\n</div>\n<div class=\"row\">\n\t<div class=\"col-md-3 text-right\">Date</div>\n\t<div class=\"col-md-9\">{{ doc.get_formatted(\"invoice_date\") }}</div>\n</div>\n<table class=\"table table-bordered\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<th>Sr</th>\n\t\t\t<th>Item Name</th>\n\t\t\t<th>Description</th>\n\t\t\t<th class=\"text-right\">Qty</th>\n\t\t\t<th class=\"text-right\">Rate</th>\n\t\t\t<th class=\"text-right\">Amount</th>\n\t\t</tr>\n\t\t{%- for row in doc.items -%}\n\t\t<tr>\n\t\t\t<td style=\"width: 3%;\">{{ row.idx }}</td>\n\t\t\t<td style=\"width: 20%;\">\n\t\t\t\t{{ row.item_name }}\n\t\t\t\t{% if row.item_code != row.item_name -%}\n\t\t\t\t<br>Item Code: {{ row.item_code}}\n\t\t\t\t{%- endif %}\n\t\t\t</td>\n\t\t\t<td style=\"width: 37%;\">\n\t\t\t\t<div style=\"border: 0px;\">{{ row.description }}</div></td>\n\t\t\t<td style=\"width: 10%; text-align: right;\">{{ row.qty }} {{ row.uom or row.stock_uom }}</td>\n\t\t\t<td style=\"width: 15%; text-align: right;\">{{\n\t\t\t\trow.get_formatted(\"rate\", doc) }}</td>\n\t\t\t<td style=\"width: 15%; text-align: right;\">{{\n\t\t\t\trow.get_formatted(\"amount\", doc) }}</td>\n\t\t</tr>\n\t\t{%- endfor -%}\n\t</tbody>\n</table>
\n
\n

Common Functions

\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
doc.get_formatted(\"[fieldname]\", [parent_doc])Get document value formatted as Date, Currency etc. Pass parent doc for curreny type fields.
frappe.db.get_value(\"[doctype]\", \"[name]\", \"fieldname\")Get value from another document.
\n", "permlevel": 0 } - ], - "hide_heading": 0, - "hide_toolbar": 0, - "icon": "icon-print", - "idx": 1, - "in_create": 0, - "in_dialog": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2014-12-25 03:39:35.898712", - "modified_by": "Administrator", - "module": "Print", - "name": "Print Format", - "owner": "Administrator", + ], + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "icon-print", + "idx": 1, + "in_create": 0, + "in_dialog": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2015-01-15 15:26:36.225573", + "modified_by": "Administrator", + "module": "Print", + "name": "Print Format", + "owner": "Administrator", "permissions": [ { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "submit": 0, + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 0, "write": 1 - }, + }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "permlevel": 1, - "read": 1, - "report": 1, - "role": "System Manager", + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "permlevel": 1, + "read": 1, + "report": 1, + "role": "System Manager", "submit": 0 } - ], - "read_only": 0, - "read_only_onload": 0, - "sort_field": "modified", + ], + "read_only": 0, + "read_only_onload": 0, + "sort_field": "modified", "sort_order": "DESC" -} +} \ No newline at end of file diff --git a/frappe/public/build.json b/frappe/public/build.json index 6989d5a654..b59e3200ab 100644 --- a/frappe/public/build.json +++ b/frappe/public/build.json @@ -126,9 +126,11 @@ "public/js/frappe/list/doclistview.js", "public/js/frappe/list/list_sidebar.js", "public/js/frappe/list/list_sidebar.html", - "public/js/frappe/list/list_item_subject.html", + "public/js/frappe/list/list_item_main.html", "public/js/frappe/list/list_item_row.html", - "public/js/frappe/list/list_item_standard.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", "public/js/frappe/list/listview.js", "public/js/frappe/ui/toolbar/selector_dialog.js", diff --git a/frappe/public/css/desk.css b/frappe/public/css/desk.css index 8d8d46d915..f9ff358a0d 100644 --- a/frappe/public/css/desk.css +++ b/frappe/public/css/desk.css @@ -224,6 +224,10 @@ em.link-option { transition: 0.2s; -webkit-transition: 0.2s; } +.list-row-head { + background-color: #f7fafc; + border-bottom: 1px solid #d1d8dd !important; +} .list-row:hover, .grid-row:hover { background: #f7fafc; @@ -282,6 +286,10 @@ em.link-option { .doclist-row .docstatus .octicon { font-size: 12px; } +.list-row .h6 { + margin-top: 0px; + margin-bottom: 0px; +} .doclist-row .progress { margin-top: 12px; } @@ -584,9 +592,11 @@ ul.linked-with-list li { font-weight: bold; } .list-col { - vertical-align: middle; height: 18px; } +.list-value { + vertical-align: middle; +} .grid-static-col { max-height: 200px; overflow: hidden; diff --git a/frappe/public/js/frappe/list/doclistview.js b/frappe/public/js/frappe/list/doclistview.js index 196631719a..52a8eed59d 100644 --- a/frappe/public/js/frappe/list/doclistview.js +++ b/frappe/public/js/frappe/list/doclistview.js @@ -57,15 +57,14 @@ frappe.views.DocListView = frappe.ui.Listing.extend({ make_page: function() { var me = this; this.parent.doclistview = this; + this.page = this.parent.page; + this.$page = $(this.parent).css({"min-height": "400px"}); - $('
\ -
'+__('Loading')+'...
') - .appendTo(this.$page.find(".layout-main-section")); + $('
') + .appendTo(this.page.main); - this.$page.find(".layout-main-section") - .addClass("listview-main-section"); - this.page = this.parent.page; + this.page.main.addClass("listview-main-section"); var module = locals.DocType[this.doctype].module; this.page.set_title(__("{0} List", [__(this.doctype)])); @@ -86,6 +85,13 @@ frappe.views.DocListView = frappe.ui.Listing.extend({ this.init_listview(); this.setup_filterable(); this.init_filters(); + this.init_headers(); + }, + + init_headers: function() { + var main = frappe.render_template("list_item_main_head", {columns: this.listview.columns}); + $(frappe.render_template("list_item_row_head", + {main:main, list:this})).appendTo(this.page.main.find(".list-headers")); }, init_listview: function() { diff --git a/frappe/public/js/frappe/list/list_item_standard.html b/frappe/public/js/frappe/list/list_item_main.html similarity index 92% rename from frappe/public/js/frappe/list/list_item_standard.html rename to frappe/public/js/frappe/list/list_item_main.html index 264763bad6..8b57596c16 100644 --- a/frappe/public/js/frappe/list/list_item_standard.html +++ b/frappe/public/js/frappe/list/list_item_main.html @@ -15,6 +15,7 @@ hidden-xs {% } %}" {% if(col.title) { %}title="{%= col.title + ": " + value %}"{% } %}> + {% if(col.type!=="Indicator") { %}{% } %} {% if (col.type==="Subject") { %} {%= subject %} {% } else if (col.type==="Indicator") { %} @@ -36,6 +37,7 @@ {% } else { %} {%= frappe.format(value, col.df, null, data) %} {% } %} + {% if(col.type!=="Indicator") { %}{% } %} {% } %} {% } %} diff --git a/frappe/public/js/frappe/list/list_item_main_head.html b/frappe/public/js/frappe/list/list_item_main_head.html new file mode 100644 index 0000000000..a593372490 --- /dev/null +++ b/frappe/public/js/frappe/list/list_item_main_head.html @@ -0,0 +1,10 @@ +
+ {% var total_cols=0; for (var i=0, l=columns.length; i < l; i++ ) { + var col = columns[i]; total_cols += parseInt(col.colspan); %} + {% if (total_cols <= 12) { %} +
+ {%= col.title || col.label || "" %} +
+ {% } %} + {% } %} +
diff --git a/frappe/public/js/frappe/list/list_item_row.html b/frappe/public/js/frappe/list/list_item_row.html index edf163c775..49f7b16c27 100644 --- a/frappe/public/js/frappe/list/list_item_row.html +++ b/frappe/public/js/frappe/list/list_item_row.html @@ -4,13 +4,14 @@ {% } else { %} col-sm-10 col-xs-9 {% } %} list-row-left"> + {%= main %} {% if (list.meta.title_field) { %}
- + {%= data.name %}
{% } %} diff --git a/frappe/public/js/frappe/list/list_item_row_head.html b/frappe/public/js/frappe/list/list_item_row_head.html new file mode 100644 index 0000000000..905deabdfa --- /dev/null +++ b/frappe/public/js/frappe/list/list_item_row_head.html @@ -0,0 +1,21 @@ + diff --git a/frappe/public/js/frappe/list/listview.js b/frappe/public/js/frappe/list/listview.js index d639d0c7e6..fbfb86c4d0 100644 --- a/frappe/public/js/frappe/list/listview.js +++ b/frappe/public/js/frappe/list/listview.js @@ -13,6 +13,9 @@ frappe.views.get_listview = function(doctype, parent) { frappe.provide("frappe.listview_settings"); frappe.provide("frappe.listview_parent_route"); +// Renders customized list +// usually based on `in_list_view` property + frappe.views.ListView = Class.extend({ init: function(doclistview, doctype) { this.doclistview = doclistview; @@ -103,6 +106,7 @@ frappe.views.ListView = Class.extend({ this.columns.push({ colspan: this.settings.colwidths && this.settings.colwidths.subject || 6, type: "Subject", + title: "Title" }); this.total_colspans = this.columns[0].colspan; @@ -112,6 +116,7 @@ frappe.views.ListView = Class.extend({ this.columns.push({ colspan: this.settings.colwidths && this.settings.colwidths.indicator || 3, type: "Indicator", + title: "Status" }); this.total_colspans += this.columns[1].colspan; } @@ -196,21 +201,13 @@ frappe.views.ListView = Class.extend({ } - if(this.template_name) { - var main = frappe.render_template(this.template_name, { - doc: frappe.get_format_helper(data), - list: this - }); - } else { - console.log(this); - var main = frappe.render_template("list_item_standard", { - data: data, - columns: this.columns, - subject: this.get_avatar_and_id(data, true), - me: this, - right_column: this.settings.right_column - }); - } + var main = frappe.render_template("list_item_main", { + data: data, + columns: this.columns, + subject: this.get_avatar_and_id(data, true), + me: this, + right_column: this.settings.right_column + }); $(frappe.render_template("list_item_row", {data: data, main: main, list: this})).appendTo(row); diff --git a/frappe/public/js/frappe/misc/pretty_date.js b/frappe/public/js/frappe/misc/pretty_date.js index d85a3a66dc..03bcd45721 100644 --- a/frappe/public/js/frappe/misc/pretty_date.js +++ b/frappe/public/js/frappe/misc/pretty_date.js @@ -17,7 +17,7 @@ function prettyDate(time, mini){ ret = "~s"; } else { var parts = ret.split(" "); - if(parts[0]==="a") { + if(parts[0]==="a" || parts[0]==="an") { parts[0] = 1; } ret = parts[0] + " " + parts[1].substr(0, 1); diff --git a/frappe/public/js/frappe/ui/listing.html b/frappe/public/js/frappe/ui/listing.html index f5262f07e3..827bb848a1 100644 --- a/frappe/public/js/frappe/ui/listing.html +++ b/frappe/public/js/frappe/ui/listing.html @@ -12,18 +12,16 @@
-
-
-
- {%= __("Loading") %}... -
+
+
+ {%= __("Loading") %}... +
diff --git a/frappe/public/less/desk.less b/frappe/public/less/desk.less index d5890dc7b8..de70d8c146 100644 --- a/frappe/public/less/desk.less +++ b/frappe/public/less/desk.less @@ -269,6 +269,11 @@ em.link-option { -webkit-transition: 0.2s; } +.list-row-head { + background-color: @panel-bg; + border-bottom: 1px solid @border-color !important; +} + .list-row:hover, .grid-row:hover { background: @panel-bg; } @@ -338,6 +343,11 @@ em.link-option { font-size: 12px; } +.list-row .h6 { + margin-top: 0px; + margin-bottom: 0px; +} + .doclist-row .progress { margin-top: 12px; } @@ -712,10 +722,13 @@ ul.linked-with-list li { } .list-col { - vertical-align: middle; height: 18px; } +.list-value { + vertical-align: middle; +} + .grid-static-col { max-height: 200px; overflow: hidden; diff --git a/frappe/workflow/doctype/workflow/workflow.json b/frappe/workflow/doctype/workflow/workflow.json index 82c16f2e63..faa8144fa6 100644 --- a/frappe/workflow/doctype/workflow/workflow.json +++ b/frappe/workflow/doctype/workflow/workflow.json @@ -1,4 +1,5 @@ { + "allow_rename": 1, "autoname": "field:workflow_name", "creation": "2012-12-28 10:49:55", "description": "Defines workflow states and rules for a document.", @@ -76,7 +77,7 @@ ], "icon": "icon-random", "idx": 1, - "modified": "2015-01-07 14:17:35.546155", + "modified": "2015-01-15 15:22:35.816167", "modified_by": "Administrator", "module": "Workflow", "name": "Workflow",