diff --git a/frappe/core/page/desktop/all_applications_dialog.html b/frappe/core/page/desktop/all_applications_dialog.html
new file mode 100644
index 0000000000..6bb5df8156
--- /dev/null
+++ b/frappe/core/page/desktop/all_applications_dialog.html
@@ -0,0 +1,19 @@
+
+
').appendTo(d.body);
- // list of applications (frappe.user.get_desktop_items())
- var items = keys(frappe.modules).sort();
- $.each(items, function(i, m) {
- var module = frappe.get_module(m);
- if(module.link && desktop_items.indexOf(m)!==-1) {
- module.app_icon = frappe.ui.app_icon.get_html(m, true);
- module.label = __(module.label);
- $(repl('
', module)).appendTo($wrapper);
- }
- });
+ this.dialog.$wrapper.addClass("all-applications-dialog");
+ this.dialog_body = $(this.dialog.body);
+
+ $(frappe.render_template("all_applications_dialog", {
+ all_modules: keys(frappe.modules).sort(),
+ desktop_items: frappe.user.get_desktop_items(true),
+ user_desktop_items: frappe.user.get_user_desktop_items()
+ })).appendTo(this.dialog_body);
+
+ this.bind_events();
+ },
- // check shown items
- $wrapper.find('[type="checkbox"]')
- .on("click", function() {
- var user_desktop_items = [];
- $wrapper.find('[type="checkbox"]:checked').each(function(i,ele) {
- user_desktop_items.push($(ele).attr("data-name"));
+ bind_events: function() {
+ var me = this;
+
+ this.dialog_body.find(".desktop-app-search").on("keyup", function() {
+ var val = ($(this).val() || "").toLowerCase();
+ me.dialog_body.find(".list-group-item").each(function() {
+ $(this).toggle($(this).attr("data-label").toLowerCase().indexOf(val)!==-1
+ || $(this).attr("data-name").toLowerCase().indexOf(val)!==-1);
})
- frappe.defaults.set_default("_user_desktop_items", user_desktop_items);
- frappe.desktop.refresh();
- })
- .prop("checked", false);
- $.each(user_desktop_items, function(i, m) {
- $wrapper.find('[data-label="'+m+'"] [type="checkbox"]').prop("checked", true);
- })
- frappe.desktop.all_modules_dialog = d;
- }
- $(frappe.desktop.all_modules_dialog.body).find(".desktop-app-search").val("").trigger("keyup");
- frappe.desktop.all_modules_dialog.show();
-}
+ });
-frappe.desktop.show_pending_notifications = function() {
+ this.dialog_body.find('input[type="checkbox"]').on("click", function() {
+ me.save_user_desktop_items();
+ });
+ },
- if (!frappe.boot.notification_info.module_doctypes) {
- return;
- }
+ save_user_desktop_items: function() {
+ var user_desktop_items = [];
+ this.dialog_body.find('input[type="checkbox"]:checked').each(function(i, element) {
+ user_desktop_items.push($(element).attr("data-name"));
+ });
+ frappe.defaults.set_default("_user_desktop_items", user_desktop_items);
+ frappe.desktop.refresh();
+ }
+ },
- var modules_list = frappe.user.get_desktop_items();
- $.each(modules_list, function(i, module) {
- var module_doctypes = frappe.boot.notification_info.module_doctypes[module];
+ show_pending_notifications: function() {
- var sum = 0;
- if(module_doctypes) {
- if(frappe.boot.notification_info.open_count_doctype) {
- $.each(module_doctypes, function(j, doctype) {
- sum += (frappe.boot.notification_info.open_count_doctype[doctype] || 0);
- });
- }
- } else if(frappe.boot.notification_info.open_count_module
- && frappe.boot.notification_info.open_count_module[module]!=null) {
- sum = frappe.boot.notification_info.open_count_module[module];
+ if (!frappe.boot.notification_info.module_doctypes) {
+ return;
}
- if (frappe.modules[module]) {
- var notifier = $("#module-count-" + frappe.get_module(module)._id);
- if(notifier.length) {
- notifier.toggle(sum ? true : false);
- notifier.find(".circle-text").html(sum || "");
+
+ var modules_list = frappe.user.get_desktop_items();
+ $.each(modules_list, function(i, module) {
+ var module_doctypes = frappe.boot.notification_info.module_doctypes[module];
+
+ var sum = 0;
+ if(module_doctypes) {
+ if(frappe.boot.notification_info.open_count_doctype) {
+ $.each(module_doctypes, function(j, doctype) {
+ sum += (frappe.boot.notification_info.open_count_doctype[doctype] || 0);
+ });
+ }
+ } else if(frappe.boot.notification_info.open_count_module
+ && frappe.boot.notification_info.open_count_module[module]!=null) {
+ sum = frappe.boot.notification_info.open_count_module[module];
}
- }
- });
-}
+ if (frappe.modules[module]) {
+ var notifier = $("#module-count-" + frappe.get_module(module)._id);
+ if(notifier.length) {
+ notifier.toggle(sum ? true : false);
+ notifier.find(".circle-text").html(sum || "");
+ }
+ }
+ });
+ }
+});
diff --git a/frappe/core/page/desktop/desktop_icon_grid.html b/frappe/core/page/desktop/desktop_icon_grid.html
new file mode 100644
index 0000000000..5e4fb77a23
--- /dev/null
+++ b/frappe/core/page/desktop/desktop_icon_grid.html
@@ -0,0 +1,11 @@
+
+
+ {% for (var i=0, l=desktop_items.length; i < l; i++) {
+ var module = frappe.get_module(desktop_items[i]);
+ if (user_desktop_items.indexOf(module.name)===-1) { continue; }
+ %}
+ {%= frappe.render_template("desktop_module_icon", module) %}
+ {% } %}
+
+
+
diff --git a/frappe/public/css/desk.css b/frappe/public/css/desk.css
index d53e08e02f..5585b23997 100644
--- a/frappe/public/css/desk.css
+++ b/frappe/public/css/desk.css
@@ -226,6 +226,12 @@ ul.linked-with-list li {
opacity: 0.5;
position: fixed;
}
+.modal-header {
+ padding: 10px 15px;
+}
+.modal-title {
+ margin-top: 5px;
+}
.form-group {
margin-bottom: 7px;
}
diff --git a/frappe/public/css/desktop.css b/frappe/public/css/desktop.css
index 84203410f2..add5119f12 100644
--- a/frappe/public/css/desktop.css
+++ b/frappe/public/css/desktop.css
@@ -70,8 +70,10 @@ body[data-route="desktop"] .navbar-default {
line-height: 1;
border-radius: 25px;
min-width: 25px;
+ height: 25px;
text-align: center;
text-shadow: none;
+ letter-spacing: normal;
}
.app-icon:hover path {
fill: #ffffff;
@@ -150,3 +152,13 @@ body[data-route="desktop"] .navbar-default {
height: 90px;
}
}
+.all-applications-dialog .desktop-app-search {
+ margin-bottom: 15px;
+}
+.all-applications-dialog hr {
+ margin: 10px -15px;
+}
+.all-applications-dialog .checkbox {
+ margin-top: 3px;
+ margin-bottom: 3px;
+}
diff --git a/frappe/public/css/list.css b/frappe/public/css/list.css
index aaf3beccc4..3a1856b6cf 100644
--- a/frappe/public/css/list.css
+++ b/frappe/public/css/list.css
@@ -101,6 +101,12 @@
margin: 0px -15px;
padding: 5px 15px;
}
+.listview-main-section .icon-star {
+ cursor: pointer;
+}
+.list-row-head .icon-star {
+ vertical-align: middle;
+}
.star-action.icon-star {
color: #ffdb4c;
}
diff --git a/frappe/public/css/mobile.css b/frappe/public/css/mobile.css
index f69ebed4af..35f803ead4 100644
--- a/frappe/public/css/mobile.css
+++ b/frappe/public/css/mobile.css
@@ -233,7 +233,7 @@
body[data-route^="Module"] .navbar-center {
display: block !important;
position: absolute;
- top: 11px;
+ top: 10px;
left: 25%;
right: 25%;
text-align: center;
diff --git a/frappe/public/css/navbar.css b/frappe/public/css/navbar.css
index 195fcaeb78..b64fd35103 100644
--- a/frappe/public/css/navbar.css
+++ b/frappe/public/css/navbar.css
@@ -61,7 +61,6 @@
}
.navbar-center {
float: left;
- font-weight: bold;
color: #6c7680;
}
#navbar-breadcrumbs > li > a:before {
@@ -76,10 +75,10 @@
color: #c0c9d2;
font-size: 14px;
transition: 0.2s;
- content: "\f054";
- margin-right: 15px;
position: relative;
top: 1px;
+ content: "\f054";
+ margin-right: 15px;
}
#navbar-breadcrumbs > li > a:hover:before,
#navbar-breadcrumbs > li > a:focus:before,
diff --git a/frappe/public/js/frappe/list/doclistview.js b/frappe/public/js/frappe/list/doclistview.js
index 56fe92bc53..f4f7c55f7b 100644
--- a/frappe/public/js/frappe/list/doclistview.js
+++ b/frappe/public/js/frappe/list/doclistview.js
@@ -80,18 +80,24 @@ frappe.views.DocListView = frappe.ui.Listing.extend({
this.init_list(false);
this.init_stats();
this.init_menu();
- this.init_star();
this.show_match_help();
this.init_listview();
this.setup_filterable();
this.init_filters();
this.init_headers();
+ this.init_star();
+ this.init_select_all();
},
init_headers: function() {
- var main = frappe.render_template("list_item_main_head",
- { columns: this.listview.columns, right_column: this.listview.settings.right_column });
- $(frappe.render_template("list_item_row_head",{ main:main, list:this }))
+ var main = frappe.render_template("list_item_main_head", {
+ columns: this.listview.columns,
+ right_column: this.listview.settings.right_column,
+ _checkbox: ((frappe.model.can_delete(this.doctype) || this.listview.settings.selectable)
+ && !this.listview.no_delete)
+ });
+
+ this.list_header = $(frappe.render_template("list_item_row_head", { main:main, list:this }))
.appendTo(this.page.main.find(".list-headers"));
},
@@ -125,15 +131,15 @@ frappe.views.DocListView = frappe.ui.Listing.extend({
});
added && me.run();
});
- this.$page.on("click", ".doclist-row", function(e) {
+ this.$page.find(".result-list").on("click", ".list-row-left", function(e) {
// don't open in case of checkbox, star, filterable
- if ((e.target.class || "").indexOf("filterable")!==-1
- || (e.target.class || "").indexOf("icon-star")!==-1
+ if ((e.target.className || "").indexOf("filterable")!==-1
+ || (e.target.className || "").indexOf("icon-star")!==-1
|| e.target.type==="checkbox") {
return;
}
- var link = $(this).find("a.list-id").get(0);
+ var link = $(this).parent().find("a.list-id").get(0);
window.location.href = link.href;
return false;
});
@@ -260,6 +266,10 @@ frappe.views.DocListView = frappe.ui.Listing.extend({
me.set_filter(key, val, true);
});
}
+
+ this.list_header.find(".list-starred-by-me")
+ .toggleClass("text-extra-muted not-starred", !this.is_star_filtered());
+
this.last_updated_on = new Date();
this.dirty = false;
this._super(more);
@@ -304,6 +314,12 @@ frappe.views.DocListView = frappe.ui.Listing.extend({
this.filter_list.add_filter(this.doctype, "_starred_by", 'like', '%' + user + '%');
this.run();
},
+ remove_starred_by_me: function() {
+ this.filter_list.get_filter("_starred_by").remove();
+ },
+ is_star_filtered: function() {
+ return this.filter_list.filter_exists(this.doctype, "_starred_by", 'like', '%' + user + '%');
+ },
init_menu: function() {
var me = this;
this.$page.on("click", ".list-tag-preview", function() { me.toggle_tags(); });
@@ -312,15 +328,6 @@ frappe.views.DocListView = frappe.ui.Listing.extend({
me.run();
}, "octicon octicon-sync");
- if(this.can_delete || this.listview.settings.selectable) {
- this.page.add_menu_item(__('Select All'), function() {
- me.$page.find('.list-delete').prop("checked",
- me.$page.find('.list-delete:checked').length ? false : true);
- }, true);
- this.page.add_menu_item(__('Delete'),
- function() { me.delete_items(); }, true);
- }
- this.page.add_divider();
if(frappe.model.can_import(this.doctype)) {
this.page.add_menu_item(__("Import"), function() {
frappe.set_route("data-import-tool", {
@@ -353,10 +360,45 @@ frappe.views.DocListView = frappe.ui.Listing.extend({
init_star: function() {
var me = this;
- this.$page.on("click", ".star-action", function() {
+ this.$page.find(".result-list").on("click", ".star-action", function() {
frappe.ui.toggle_star($(this), me.doctype, $(this).attr("data-name"));
return false;
});
+ this.list_header.find(".list-starred-by-me").on("click", function() {
+ if (me.is_star_filtered()) {
+ me.remove_starred_by_me();
+ } else {
+ me.starred_by_me();
+ }
+ });
+ },
+
+ init_select_all: function() {
+ var me = this;
+
+ if(this.can_delete || this.listview.settings.selectable) {
+ this.list_header.find(".list-select-all").on("click", function() {
+ console.log('select all clicked!');
+ me.$page.find('.list-delete').prop("checked", $(this).prop("checked"));
+ me.toggle_delete();
+ });
+
+ this.$page.on("click", ".list-delete", function() {
+ me.toggle_delete();
+ });
+ }
+ },
+
+ toggle_delete: function() {
+ var me = this;
+ if (this.$page.find(".list-delete:checked").length) {
+ this.page.set_primary_action(__("Delete"), function() { me.delete_items() },
+ "octicon octicon-trashcan");
+ this.page.btn_primary.addClass("btn-danger");
+ } else {
+ this.page.btn_primary.removeClass("btn-danger");
+ this.set_primary_action();
+ }
},
toggle_tags: function() {
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 27483d72d5..aa3a4a2189 100644
--- a/frappe/public/js/frappe/list/list_item_main_head.html
+++ b/frappe/public/js/frappe/list/list_item_main_head.html
@@ -15,6 +15,19 @@
hidden-xs
{% } %}
{% if(col.df && ["Int", "Float", "Currency", "Percent"].indexOf(col.df.fieldtype)!==-1) { %}text-right{% } %}">
+
+ {% if (col.type==="Subject") { %}
+
+ {% if (_checkbox) { %}
+
+ {% } %}
+
+
+
+ {% } %}
+
{%= col.title || col.label || "" %}
{% } %}
diff --git a/frappe/public/js/frappe/list/list_item_row_head.html b/frappe/public/js/frappe/list/list_item_row_head.html
index eb5c248bc2..647abfad78 100644
--- a/frappe/public/js/frappe/list/list_item_row_head.html
+++ b/frappe/public/js/frappe/list/list_item_row_head.html
@@ -12,7 +12,7 @@
{% if (list.meta.title_field) { %}
-
+
{% } %}
diff --git a/frappe/public/js/frappe/list/list_item_subject.html b/frappe/public/js/frappe/list/list_item_subject.html
index 0c7898db12..f063d6a430 100644
--- a/frappe/public/js/frappe/list/list_item_subject.html
+++ b/frappe/public/js/frappe/list/list_item_subject.html
@@ -3,8 +3,7 @@
{% } %}
{%= _title %}
diff --git a/frappe/public/js/frappe/list/list_sidebar.html b/frappe/public/js/frappe/list/list_sidebar.html
index 8975bad721..e63fad4dc9 100644
--- a/frappe/public/js/frappe/list/list_sidebar.html
+++ b/frappe/public/js/frappe/list/list_sidebar.html
@@ -7,7 +7,6 @@
{%= __("Calendar") %}
{%= __("Gantt") %}
{%= __("Assigned To Me") %}
-
{%= __("Starred By Me") %}
diff --git a/frappe/public/js/frappe/ui/listing.js b/frappe/public/js/frappe/ui/listing.js
index eb2bf535b2..ffebd139f8 100644
--- a/frappe/public/js/frappe/ui/listing.js
+++ b/frappe/public/js/frappe/ui/listing.js
@@ -108,16 +108,20 @@ frappe.ui.Listing = Class.extend({
}
// new
- if(this.new_doctype) {
- var make_new_doc = function() { (me.custom_new_doc || me.make_new_doc).apply(me, [me.new_doctype]); };
- this.page.set_primary_action(__("New"), function() { make_new_doc(); }, "octicon octicon-plus");
- }
+ this.set_primary_action();
if(me.no_toolbar || me.hide_toolbar) {
me.$w.find('.list-toolbar-wrapper').toggle(false);
}
},
+ set_primary_action: function() {
+ if(this.new_doctype) {
+ var make_new_doc = function() { (me.custom_new_doc || me.make_new_doc).apply(me, [me.new_doctype]); };
+ this.page.set_primary_action(__("New"), function() { make_new_doc(); }, "octicon octicon-plus");
+ }
+ },
+
make_new_doc: function(doctype) {
var me = this;
frappe.model.with_doctype(doctype, function() {
diff --git a/frappe/public/js/frappe/ui/page.html b/frappe/public/js/frappe/ui/page.html
index 1072d1262b..c2608dd13e 100644
--- a/frappe/public/js/frappe/ui/page.html
+++ b/frappe/public/js/frappe/ui/page.html
@@ -1,13 +1,13 @@