diff --git a/frappe/core/doctype/doctype/doctype.json b/frappe/core/doctype/doctype/doctype.json index c9ee47e0b6..53e835c198 100644 --- a/frappe/core/doctype/doctype/doctype.json +++ b/frappe/core/doctype/doctype/doctype.json @@ -3,6 +3,7 @@ "allow_import": 0, "allow_rename": 1, "autoname": "Prompt", + "beta": 0, "creation": "2013-02-18 13:36:19", "custom": 0, "description": "DocType is a Table / Form in the application.", @@ -239,6 +240,32 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "depends_on": "eval: doc.image_field", + "fieldname": "image_view", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Image View", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -1097,7 +1124,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-05-02 18:02:03.227684", + "modified": "2016-06-01 12:28:01.048158", "modified_by": "Administrator", "module": "Core", "name": "DocType", diff --git a/frappe/custom/doctype/customize_form/customize_form.json b/frappe/custom/doctype/customize_form/customize_form.json index 5bba69490c..38f49498f3 100644 --- a/frappe/custom/doctype/customize_form/customize_form.json +++ b/frappe/custom/doctype/customize_form/customize_form.json @@ -3,6 +3,7 @@ "allow_import": 0, "allow_rename": 0, "autoname": "DL.####", + "beta": 0, "creation": "2013-01-29 17:55:08", "custom": 0, "docstatus": 0, @@ -159,6 +160,32 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "depends_on": "eval: doc.image_field", + "fieldname": "image_view", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Image View", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -414,13 +441,14 @@ "hide_toolbar": 1, "icon": "icon-glass", "idx": 1, + "image_view": 0, "in_create": 0, "in_dialog": 0, "is_submittable": 0, "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2016-04-14 13:18:35.095815", + "modified": "2016-06-01 12:29:28.272410", "modified_by": "Administrator", "module": "Custom", "name": "Customize Form", diff --git a/frappe/custom/doctype/customize_form/customize_form.py b/frappe/custom/doctype/customize_form/customize_form.py index 1f0db5f6b7..3639251b3f 100644 --- a/frappe/custom/doctype/customize_form/customize_form.py +++ b/frappe/custom/doctype/customize_form/customize_form.py @@ -23,7 +23,8 @@ doctype_properties = { 'read_only_onload': 'Check', 'allow_copy': 'Check', 'quick_entry': 'Check', - 'max_attachments': 'Int' + 'max_attachments': 'Int', + 'image_view': 'Check' } docfield_properties = { diff --git a/frappe/public/build.json b/frappe/public/build.json index e01f97b8d4..750b02447c 100644 --- a/frappe/public/build.json +++ b/frappe/public/build.json @@ -218,7 +218,9 @@ "public/js/frappe/list/listview.js", "public/js/frappe/views/calendar_base.js", "public/js/frappe/views/calendar.js", - "public/js/frappe/views/ganttview.js" + "public/js/frappe/views/ganttview.js", + "public/js/frappe/list/image_view_item_row.html", + "public/js/frappe/list/image_view_item_main_head.html" ], "css/report.min.css": [ "public/css/report.css", @@ -248,4 +250,4 @@ "public/js/legacy/print_table.js", "public/js/legacy/print_format.js" ] -} +} \ No newline at end of file diff --git a/frappe/public/css/list.css b/frappe/public/css/list.css index 2f6110386f..072726590d 100644 --- a/frappe/public/css/list.css +++ b/frappe/public/css/list.css @@ -189,3 +189,34 @@ width: 37px; text-align: left; } + +.image-view { + float: left; +} + +.image-view-subject { + padding: inherit; +} + +.image-view-col { + padding-bottom: 5px; + padding-top: 5px; +} + +table.field-info { + opacity: 0; + bottom: -20px; + font-size: 8pt; + color: white; + background-color: #000000; + position: absolute; + padding-bottom: 0px !important; +} + +.image-field { + position: relative; +} + +.image-field:hover .field-info { + opacity: 0.9; +} \ No newline at end of file diff --git a/frappe/public/js/frappe/list/doclistview.js b/frappe/public/js/frappe/list/doclistview.js index bf539a83fb..10a93b1573 100644 --- a/frappe/public/js/frappe/list/doclistview.js +++ b/frappe/public/js/frappe/list/doclistview.js @@ -133,7 +133,8 @@ frappe.views.DocListView = frappe.ui.Listing.extend({ }, init_headers: function() { - var main = frappe.render_template("list_item_main_head", { + this.header = this.meta.image_view == 0? "list_item_main_head": "image_view_item_main_head"; + var main = frappe.render_template(this.header, { columns: this.listview.columns, right_column: this.listview.settings.right_column, _checkbox: ((frappe.model.can_delete(this.doctype) || this.listview.settings.selectable) @@ -445,6 +446,12 @@ frappe.views.DocListView = frappe.ui.Listing.extend({ data.doctype = this.doctype; this.listview.render(row, data, this); }, + render_image_view_row: function(row, data) { + for (var i = 0; i < data.length; i++) { + data[i].doctype = this.doctype; + this.listview.render(row, data[i], this) + } + }, get_args: function() { var args = { doctype: this.doctype, @@ -707,8 +714,14 @@ frappe.views.DocListView = frappe.ui.Listing.extend({ }, get_checked_items: function() { + var me = this; return $.map(this.$page.find('.list-delete:checked'), function(e) { - return $(e).parents(".list-row:first").data('data'); + if(me.meta.image_view == 0){ + return $(e).parents(".list-row:first").data('data'); + } + else{ + return $(e).parents(".image-view:first").data('data'); + } }); }, diff --git a/frappe/public/js/frappe/list/image_view_item_main_head.html b/frappe/public/js/frappe/list/image_view_item_main_head.html new file mode 100644 index 0000000000..894d88b7bc --- /dev/null +++ b/frappe/public/js/frappe/list/image_view_item_main_head.html @@ -0,0 +1,11 @@ +
{%= col.title %} | +{%= value %} | +