diff --git a/frappe/config/desk.py b/frappe/config/desk.py new file mode 100644 index 0000000000..a903d74da9 --- /dev/null +++ b/frappe/config/desk.py @@ -0,0 +1,43 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return [ + { + "label": _("Tools"), + "icon": "octicon octicon-briefcase", + "items": [ + { + "type": "doctype", + "name": "ToDo", + "label": _("To Do"), + "description": _("Documents assigned to you and by you."), + }, + { + "type": "doctype", + "name": "Event", + "label": _("Calendar"), + "view": "Calendar", + "description": _("Event and other calendars."), + }, + { + "type": "page", + "label": _("Messages"), + "name": "messages", + "description": _("Chat messages and other notifications."), + "data_doctype": "Comment" + }, + { + "type": "doctype", + "name": "Note", + "description": _("Private and public Notes."), + }, + { + "type": "page", + "label": _("Activity"), + "name": "activity", + "description": _("Activity log of all users."), + }, + ] + } + ] diff --git a/frappe/config/desktop.py b/frappe/config/desktop.py index fa17ffa449..0f96778e35 100644 --- a/frappe/config/desktop.py +++ b/frappe/config/desktop.py @@ -3,52 +3,9 @@ from frappe import _ def get_data(): return { - "Activity": { - "color": "#e67e22", - "icon": "icon-play", - "icon": "octicon octicon-pulse", - "label": _("Activity"), - "link": "activity", - "type": "page" - }, - "Calendar": { - "color": "#2980b9", - "icon": "icon-calendar", - "icon": "octicon octicon-calendar", - "label": _("Calendar"), - "link": "Calendar/Event", - "type": "view" - }, - "Messages": { - "color": "#9b59b6", - "icon": "icon-comments", - "icon": "octicon octicon-comment-discussion", - "label": _("Messages"), - "link": "messages", - "type": "page" - }, - "To Do": { - "color": "#f1c40f", - "icon": "icon-check", - "icon": "octicon octicon-check", - "label": _("To Do"), - "link": "List/ToDo", - "doctype": "ToDo", - "type": "list" - }, - "Notes": { - "color": "#95a5a6", - "doctype": "Note", - "icon": "icon-file-alt", - "icon": "octicon octicon-file-text", - "label": _("Notes"), - "link": "List/Note", - "type": "list" - }, "File Manager": { - "color": "#905df5", + "color": "#AA784D", "doctype": "File", - "icon": "icon-folder-close", "icon": "octicon octicon-file-directory", "label": _("File Manager"), "link": "List/File", @@ -56,21 +13,12 @@ def get_data(): }, "Website": { "color": "#16a085", - "icon": "icon-globe", "icon": "octicon octicon-globe", "type": "module" }, - "Installer": { - "color": "#5ac8fb", - "icon": "icon-download", - "icon": "octicon octicon-cloud-download", - "link": "applications", - "type": "page", - "label": _("Installer") - }, "Setup": { "color": "#bdc3c7", - "icon": "icon-wrench", + "reverse": 1, "icon": "octicon octicon-settings", "type": "module" }, @@ -81,9 +29,11 @@ def get_data(): "type": "module", "system_manager": 1 }, - "Integrations": { - "color": "#36414C", - "icon": "octicon octicon-plug", + "Desk": { + "label": _("Tools"), + "color": "#FFF5A7", + "reverse": 1, + "icon": "octicon octicon-calendar", "type": "module", "system_manager": 1 } diff --git a/frappe/config/integrations.py b/frappe/config/integrations.py deleted file mode 100644 index d4fc4d03ac..0000000000 --- a/frappe/config/integrations.py +++ /dev/null @@ -1,23 +0,0 @@ -from __future__ import unicode_literals -from frappe import _ - -def get_data(): - return [ - { - "label": _("Setup"), - "icon": "icon-star", - "items": [ - { - "type": "doctype", - "name": "Social Login Keys", - "description": _("Enter keys to enable login via Facebook, Google, GitHub."), - }, - { - "type": "doctype", - "name": "Dropbox Backup", - "description": _("Manage cloud backups on Dropbox"), - "hide_count": True - } - ] - } - ] diff --git a/frappe/config/setup.py b/frappe/config/setup.py index 1e3ec2ca63..6f09212a0b 100644 --- a/frappe/config/setup.py +++ b/frappe/config/setup.py @@ -169,6 +169,23 @@ def get_data(): }, ] }, + { + "label": _("Integrations"), + "icon": "icon-star", + "items": [ + { + "type": "doctype", + "name": "Social Login Keys", + "description": _("Enter keys to enable login via Facebook, Google, GitHub."), + }, + { + "type": "doctype", + "name": "Dropbox Backup", + "description": _("Manage cloud backups on Dropbox"), + "hide_count": True + } + ] + }, { "label": _("Customize"), "icon": "icon-glass", diff --git a/frappe/core/notifications.py b/frappe/core/notifications.py index bbe0b3f7a9..80ce98f4e3 100644 --- a/frappe/core/notifications.py +++ b/frappe/core/notifications.py @@ -8,18 +8,11 @@ def get_notification_config(): return { "for_doctype": { "Scheduler Log": {"seen": 0}, - "Communication": {"status": "Open"} + "Communication": {"status": "Open"}, + "ToDo": "frappe.core.notifications.get_things_todo", + "Event": "frappe.core.notifications.get_todays_events", + "Comment": "frappe.core.notifications.get_unread_messages" }, - "for_module_doctypes": { - "ToDo": "To Do", - "Event": "Calendar", - "Comment": "Messages" - }, - "for_module": { - "To Do": "frappe.core.notifications.get_things_todo", - "Calendar": "frappe.core.notifications.get_todays_events", - "Messages": "frappe.core.notifications.get_unread_messages" - } } def get_things_todo(): diff --git a/frappe/desk/notifications.py b/frappe/desk/notifications.py index b3e6d85673..29a7cbcbaa 100644 --- a/frappe/desk/notifications.py +++ b/frappe/desk/notifications.py @@ -47,6 +47,7 @@ def get_new_messages(): order by creation desc""", (frappe.session.user, last_update), as_dict=1) def get_notifications_for_modules(config, notification_count): + """Notifications for modules""" open_count_module = {} for m in config.for_module: try: @@ -56,12 +57,13 @@ def get_notifications_for_modules(config, notification_count): open_count_module[m] = frappe.get_attr(config.for_module[m])() frappe.cache().hset("notification_count:" + m, frappe.session.user, open_count_module[m]) - except frappe.PermissionError, e: + except frappe.PermissionError: frappe.msgprint("Permission Error in notifications for {0}".format(m)) return open_count_module def get_notifications_for_doctypes(config, notification_count): + """Notifications for DocTypes""" can_read = frappe.get_user().get_can_read() open_count_doctype = {} @@ -73,10 +75,13 @@ def get_notifications_for_doctypes(config, notification_count): open_count_doctype[d] = notification_count[d] else: try: - result = frappe.get_list(d, fields=["count(*)"], - filters=condition, as_list=True)[0][0] + if isinstance(condition, dict): + result = frappe.get_list(d, fields=["count(*)"], + filters=condition, as_list=True)[0][0] + else: + result = frappe.get_attr(condition)() - except frappe.PermissionError, e: + except frappe.PermissionError: frappe.msgprint("Permission Error in notifications for {0}".format(d)) except Exception, e: diff --git a/frappe/desk/page/activity/activity.js b/frappe/desk/page/activity/activity.js index 03458ef802..9a386e17af 100644 --- a/frappe/desk/page/activity/activity.js +++ b/frappe/desk/page/activity/activity.js @@ -16,7 +16,7 @@ frappe.pages['activity'].on_page_load = function(wrapper) { this.page = wrapper.page; - this.page.set_title(__("Activity"), frappe.get_module("Activity").icon); + this.page.set_title(__("Activity")); this.page.list = new frappe.ui.Listing({ hide_refresh: true, diff --git a/frappe/public/build.json b/frappe/public/build.json index 429cda87e0..1bcaa1bd8d 100644 --- a/frappe/public/build.json +++ b/frappe/public/build.json @@ -116,6 +116,7 @@ "public/js/frappe/ui/toolbar/navbar.html", "public/js/frappe/ui/toolbar/offcanvas_left_sidebar.html", "public/js/frappe/ui/toolbar/toolbar.js", + "public/js/frappe/ui/toolbar/notifications.js", "public/js/frappe/views/communication.js", "public/js/frappe/change_log.html", diff --git a/frappe/public/css/octicons/octicons-local.ttf b/frappe/public/css/octicons/octicons-local.ttf index 62bcbb3ae0..2050d5e8ab 100755 Binary files a/frappe/public/css/octicons/octicons-local.ttf and b/frappe/public/css/octicons/octicons-local.ttf differ diff --git a/frappe/public/css/octicons/octicons.css b/frappe/public/css/octicons/octicons.css index dd05c96320..2829914e87 100755 --- a/frappe/public/css/octicons/octicons.css +++ b/frappe/public/css/octicons/octicons.css @@ -1,9 +1,9 @@ @font-face { font-family: 'octicons'; - src: url('/assets/frappe/css/octicons/octicons.eot?#iefix') format('embedded-opentype'), - url('/assets/frappe/css/octicons/octicons.woff') format('woff'), - url('/assets/frappe/css/octicons/octicons.ttf') format('truetype'), - url('/assets/frappe/css/octicons/octicons.svg#octicons') format('svg'); + src: url('/assets/frappe/css/octicons/octicons.eot?#iefix') format('embedded-opentype'), + url('/assets/frappe/css/octicons/octicons.woff') format('woff'), + url('/assets/frappe/css/octicons/octicons.ttf') format('truetype'), + url('/assets/frappe/css/octicons/octicons.svg#octicons') format('svg'); font-weight: normal; font-style: normal; } @@ -14,23 +14,11 @@ .mega-octicon is optimized for 32px but can be used larger. */ -.octicon { - font: normal normal 16px octicons; - line-height: 1; - display: inline-block; - text-decoration: none; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.mega-octicon { - font: normal normal 32px octicons; - line-height: 1; +.octicon, .mega-octicon { + font: normal normal normal 16px/1 octicons; display: inline-block; text-decoration: none; + text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-user-select: none; @@ -38,11 +26,9 @@ -ms-user-select: none; user-select: none; } +.mega-octicon { font-size: 32px; } .octicon-alert:before { content: '\f02d'} /*  */ -.octicon-alignment-align:before { content: '\f08a'} /*  */ -.octicon-alignment-aligned-to:before { content: '\f08e'} /*  */ -.octicon-alignment-unalign:before { content: '\f08b'} /*  */ .octicon-arrow-down:before { content: '\f03f'} /*  */ .octicon-arrow-left:before { content: '\f040'} /*  */ .octicon-arrow-right:before { content: '\f03e'} /*  */ @@ -51,7 +37,9 @@ .octicon-arrow-small-right:before { content: '\f071'} /*  */ .octicon-arrow-small-up:before { content: '\f09f'} /*  */ .octicon-arrow-up:before { content: '\f03d'} /*  */ -.octicon-beer:before { content: '\f069'} /*  */ +.octicon-microscope:before, +.octicon-beaker:before { content: '\f0dd'} /*  */ +.octicon-bell:before { content: '\f0de'} /*  */ .octicon-book:before { content: '\f007'} /*  */ .octicon-bookmark:before { content: '\f07b'} /*  */ .octicon-briefcase:before { content: '\f0d3'} /*  */ @@ -80,6 +68,8 @@ .octicon-dash:before { content: '\f0ca'} /*  */ .octicon-dashboard:before { content: '\f07d'} /*  */ .octicon-database:before { content: '\f096'} /*  */ +.octicon-clone:before, +.octicon-desktop-download:before { content: '\f0dc'} /*  */ .octicon-device-camera:before { content: '\f056'} /*  */ .octicon-device-camera-video:before { content: '\f057'} /*  */ .octicon-device-desktop:before { content: '\f27c'} /*  */ @@ -124,7 +114,6 @@ .octicon-history:before { content: '\f07e'} /*  */ .octicon-home:before { content: '\f08d'} /*  */ .octicon-horizontal-rule:before { content: '\f070'} /*  */ -.octicon-hourglass:before { content: '\f09e'} /*  */ .octicon-hubot:before { content: '\f09d'} /*  */ .octicon-inbox:before { content: '\f0cf'} /*  */ .octicon-info:before { content: '\f059'} /*  */ @@ -132,13 +121,9 @@ .octicon-issue-opened:before { content: '\f026'} /*  */ .octicon-issue-reopened:before { content: '\f027'} /*  */ .octicon-jersey:before { content: '\f019'} /*  */ -.octicon-jump-down:before { content: '\f072'} /*  */ -.octicon-jump-left:before { content: '\f0a5'} /*  */ -.octicon-jump-right:before { content: '\f0a6'} /*  */ -.octicon-jump-up:before { content: '\f073'} /*  */ .octicon-key:before { content: '\f049'} /*  */ .octicon-keyboard:before { content: '\f00d'} /*  */ -.octicon-law:before { content: '\f0d8'} /* */ +.octicon-law:before { content: '\f0d8'} /*  */ .octicon-light-bulb:before { content: '\f000'} /*  */ .octicon-link:before { content: '\f05c'} /*  */ .octicon-link-external:before { content: '\f07f'} /*  */ @@ -157,15 +142,10 @@ .octicon-markdown:before { content: '\f0c9'} /*  */ .octicon-megaphone:before { content: '\f077'} /*  */ .octicon-mention:before { content: '\f0be'} /*  */ -.octicon-microscope:before { content: '\f089'} /*  */ .octicon-milestone:before { content: '\f075'} /*  */ .octicon-mirror-public:before, .octicon-mirror:before { content: '\f024'} /*  */ -.octicon-mortar-board:before { content: '\f0d7'} /* */ -.octicon-move-down:before { content: '\f0a8'} /*  */ -.octicon-move-left:before { content: '\f074'} /*  */ -.octicon-move-right:before { content: '\f0a9'} /*  */ -.octicon-move-up:before { content: '\f0a7'} /*  */ +.octicon-mortar-board:before { content: '\f0d7'} /*  */ .octicon-mute:before { content: '\f080'} /*  */ .octicon-no-newline:before { content: '\f09c'} /*  */ .octicon-octoface:before { content: '\f008'} /*  */ @@ -177,21 +157,15 @@ .octicon-person-follow:before, .octicon-person:before { content: '\f018'} /*  */ .octicon-pin:before { content: '\f041'} /*  */ -.octicon-playback-fast-forward:before { content: '\f0bd'} /*  */ -.octicon-playback-pause:before { content: '\f0bb'} /*  */ -.octicon-playback-play:before { content: '\f0bf'} /*  */ -.octicon-playback-rewind:before { content: '\f0bc'} /*  */ .octicon-plug:before { content: '\f0d4'} /*  */ .octicon-repo-create:before, .octicon-gist-new:before, .octicon-file-directory-create:before, .octicon-file-add:before, .octicon-plus:before { content: '\f05d'} /*  */ -.octicon-podium:before { content: '\f0af'} /*  */ .octicon-primitive-dot:before { content: '\f052'} /*  */ .octicon-primitive-square:before { content: '\f053'} /*  */ .octicon-pulse:before { content: '\f085'} /*  */ -.octicon-puzzle:before { content: '\f0c0'} /*  */ .octicon-question:before { content: '\f02c'} /*  */ .octicon-quote:before { content: '\f063'} /*  */ .octicon-radio-tower:before { content: '\f030'} /*  */ @@ -212,16 +186,15 @@ .octicon-search:before { content: '\f02e'} /*  */ .octicon-server:before { content: '\f097'} /*  */ .octicon-settings:before { content: '\f07c'} /*  */ +.octicon-shield:before { content: '\f0e1'} /*  */ .octicon-log-in:before, .octicon-sign-in:before { content: '\f036'} /*  */ .octicon-log-out:before, .octicon-sign-out:before { content: '\f032'} /*  */ -.octicon-split:before { content: '\f0c6'} /*  */ .octicon-squirrel:before { content: '\f0b2'} /*  */ .octicon-star-add:before, .octicon-star-delete:before, .octicon-star:before { content: '\f02a'} /*  */ -.octicon-steps:before { content: '\f0c7'} /*  */ .octicon-stop:before { content: '\f08f'} /*  */ .octicon-repo-sync:before, .octicon-sync:before { content: '\f087'} /*  */ @@ -231,6 +204,8 @@ .octicon-telescope:before { content: '\f088'} /*  */ .octicon-terminal:before { content: '\f0c8'} /*  */ .octicon-three-bars:before { content: '\f05e'} /*  */ +.octicon-thumbsdown:before { content: '\f0db'} /*  */ +.octicon-thumbsup:before { content: '\f0da'} /*  */ .octicon-tools:before { content: '\f031'} /*  */ .octicon-trashcan:before { content: '\f0d0'} /*  */ .octicon-triangle-down:before { content: '\f05b'} /*  */ @@ -240,6 +215,7 @@ .octicon-unfold:before { content: '\f039'} /*  */ .octicon-unmute:before { content: '\f0ba'} /*  */ .octicon-versions:before { content: '\f064'} /*  */ +.octicon-watch:before { content: '\f0e0'} /*  */ .octicon-remove-close:before, .octicon-x:before { content: '\f081'} /*  */ .octicon-zap:before { content: '\26A1'} /* ⚡ */ diff --git a/frappe/public/css/octicons/octicons.eot b/frappe/public/css/octicons/octicons.eot index a3aef43c6e..2bf20bca00 100755 Binary files a/frappe/public/css/octicons/octicons.eot and b/frappe/public/css/octicons/octicons.eot differ diff --git a/frappe/public/css/octicons/octicons.less b/frappe/public/css/octicons/octicons.less index 78ef46ead8..d1d751ea45 100755 --- a/frappe/public/css/octicons/octicons.less +++ b/frappe/public/css/octicons/octicons.less @@ -1,5 +1,5 @@ @octicons-font-path: "."; -@octicons-version: "897b19cdb9c4473f9166329e039ba8337c77d561"; +@octicons-version: "396334ee3da78f4302d25c758ae3e3ce5dc3c97d"; @font-face { font-family: 'octicons'; @@ -13,23 +13,11 @@ // .octicon is optimized for 16px. // .mega-octicon is optimized for 32px but can be used larger. -.octicon { - font: normal normal 16px octicons; - line-height: 1; - display: inline-block; - text-decoration: none; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.mega-octicon { - font: normal normal 32px octicons; - line-height: 1; +.octicon, .mega-octicon { + font: normal normal normal 16px/1 octicons; display: inline-block; text-decoration: none; + text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-user-select: none; @@ -37,11 +25,9 @@ -ms-user-select: none; user-select: none; } +.mega-octicon { font-size: 32px; } .octicon-alert:before { content: '\f02d'} /*  */ -.octicon-alignment-align:before { content: '\f08a'} /*  */ -.octicon-alignment-aligned-to:before { content: '\f08e'} /*  */ -.octicon-alignment-unalign:before { content: '\f08b'} /*  */ .octicon-arrow-down:before { content: '\f03f'} /*  */ .octicon-arrow-left:before { content: '\f040'} /*  */ .octicon-arrow-right:before { content: '\f03e'} /*  */ @@ -50,7 +36,9 @@ .octicon-arrow-small-right:before { content: '\f071'} /*  */ .octicon-arrow-small-up:before { content: '\f09f'} /*  */ .octicon-arrow-up:before { content: '\f03d'} /*  */ -.octicon-beer:before { content: '\f069'} /*  */ +.octicon-microscope:before, +.octicon-beaker:before { content: '\f0dd'} /*  */ +.octicon-bell:before { content: '\f0de'} /*  */ .octicon-book:before { content: '\f007'} /*  */ .octicon-bookmark:before { content: '\f07b'} /*  */ .octicon-briefcase:before { content: '\f0d3'} /*  */ @@ -79,6 +67,8 @@ .octicon-dash:before { content: '\f0ca'} /*  */ .octicon-dashboard:before { content: '\f07d'} /*  */ .octicon-database:before { content: '\f096'} /*  */ +.octicon-clone:before, +.octicon-desktop-download:before { content: '\f0dc'} /*  */ .octicon-device-camera:before { content: '\f056'} /*  */ .octicon-device-camera-video:before { content: '\f057'} /*  */ .octicon-device-desktop:before { content: '\f27c'} /*  */ @@ -123,7 +113,6 @@ .octicon-history:before { content: '\f07e'} /*  */ .octicon-home:before { content: '\f08d'} /*  */ .octicon-horizontal-rule:before { content: '\f070'} /*  */ -.octicon-hourglass:before { content: '\f09e'} /*  */ .octicon-hubot:before { content: '\f09d'} /*  */ .octicon-inbox:before { content: '\f0cf'} /*  */ .octicon-info:before { content: '\f059'} /*  */ @@ -131,13 +120,9 @@ .octicon-issue-opened:before { content: '\f026'} /*  */ .octicon-issue-reopened:before { content: '\f027'} /*  */ .octicon-jersey:before { content: '\f019'} /*  */ -.octicon-jump-down:before { content: '\f072'} /*  */ -.octicon-jump-left:before { content: '\f0a5'} /*  */ -.octicon-jump-right:before { content: '\f0a6'} /*  */ -.octicon-jump-up:before { content: '\f073'} /*  */ .octicon-key:before { content: '\f049'} /*  */ .octicon-keyboard:before { content: '\f00d'} /*  */ -.octicon-law:before { content: '\f0d8'} /* */ +.octicon-law:before { content: '\f0d8'} /*  */ .octicon-light-bulb:before { content: '\f000'} /*  */ .octicon-link:before { content: '\f05c'} /*  */ .octicon-link-external:before { content: '\f07f'} /*  */ @@ -156,15 +141,10 @@ .octicon-markdown:before { content: '\f0c9'} /*  */ .octicon-megaphone:before { content: '\f077'} /*  */ .octicon-mention:before { content: '\f0be'} /*  */ -.octicon-microscope:before { content: '\f089'} /*  */ .octicon-milestone:before { content: '\f075'} /*  */ .octicon-mirror-public:before, .octicon-mirror:before { content: '\f024'} /*  */ -.octicon-mortar-board:before { content: '\f0d7'} /* */ -.octicon-move-down:before { content: '\f0a8'} /*  */ -.octicon-move-left:before { content: '\f074'} /*  */ -.octicon-move-right:before { content: '\f0a9'} /*  */ -.octicon-move-up:before { content: '\f0a7'} /*  */ +.octicon-mortar-board:before { content: '\f0d7'} /*  */ .octicon-mute:before { content: '\f080'} /*  */ .octicon-no-newline:before { content: '\f09c'} /*  */ .octicon-octoface:before { content: '\f008'} /*  */ @@ -176,21 +156,15 @@ .octicon-person-follow:before, .octicon-person:before { content: '\f018'} /*  */ .octicon-pin:before { content: '\f041'} /*  */ -.octicon-playback-fast-forward:before { content: '\f0bd'} /*  */ -.octicon-playback-pause:before { content: '\f0bb'} /*  */ -.octicon-playback-play:before { content: '\f0bf'} /*  */ -.octicon-playback-rewind:before { content: '\f0bc'} /*  */ .octicon-plug:before { content: '\f0d4'} /*  */ .octicon-repo-create:before, .octicon-gist-new:before, .octicon-file-directory-create:before, .octicon-file-add:before, .octicon-plus:before { content: '\f05d'} /*  */ -.octicon-podium:before { content: '\f0af'} /*  */ .octicon-primitive-dot:before { content: '\f052'} /*  */ .octicon-primitive-square:before { content: '\f053'} /*  */ .octicon-pulse:before { content: '\f085'} /*  */ -.octicon-puzzle:before { content: '\f0c0'} /*  */ .octicon-question:before { content: '\f02c'} /*  */ .octicon-quote:before { content: '\f063'} /*  */ .octicon-radio-tower:before { content: '\f030'} /*  */ @@ -211,16 +185,15 @@ .octicon-search:before { content: '\f02e'} /*  */ .octicon-server:before { content: '\f097'} /*  */ .octicon-settings:before { content: '\f07c'} /*  */ +.octicon-shield:before { content: '\f0e1'} /*  */ .octicon-log-in:before, .octicon-sign-in:before { content: '\f036'} /*  */ .octicon-log-out:before, .octicon-sign-out:before { content: '\f032'} /*  */ -.octicon-split:before { content: '\f0c6'} /*  */ .octicon-squirrel:before { content: '\f0b2'} /*  */ .octicon-star-add:before, .octicon-star-delete:before, .octicon-star:before { content: '\f02a'} /*  */ -.octicon-steps:before { content: '\f0c7'} /*  */ .octicon-stop:before { content: '\f08f'} /*  */ .octicon-repo-sync:before, .octicon-sync:before { content: '\f087'} /*  */ @@ -230,6 +203,8 @@ .octicon-telescope:before { content: '\f088'} /*  */ .octicon-terminal:before { content: '\f0c8'} /*  */ .octicon-three-bars:before { content: '\f05e'} /*  */ +.octicon-thumbsdown:before { content: '\f0db'} /*  */ +.octicon-thumbsup:before { content: '\f0da'} /*  */ .octicon-tools:before { content: '\f031'} /*  */ .octicon-trashcan:before { content: '\f0d0'} /*  */ .octicon-triangle-down:before { content: '\f05b'} /*  */ @@ -239,6 +214,7 @@ .octicon-unfold:before { content: '\f039'} /*  */ .octicon-unmute:before { content: '\f0ba'} /*  */ .octicon-versions:before { content: '\f064'} /*  */ +.octicon-watch:before { content: '\f0e0'} /*  */ .octicon-remove-close:before, .octicon-x:before { content: '\f081'} /*  */ .octicon-zap:before { content: '\26A1'} /* ⚡ */ diff --git a/frappe/public/css/octicons/octicons.scss b/frappe/public/css/octicons/octicons.scss new file mode 100755 index 0000000000..0902cedce8 --- /dev/null +++ b/frappe/public/css/octicons/octicons.scss @@ -0,0 +1,220 @@ +$octicons-font-path: "." !default; +$octicons-version: "396334ee3da78f4302d25c758ae3e3ce5dc3c97d"; + +@font-face { + font-family: 'octicons'; + src: url('#{$octicons-font-path}/octicons.eot?#iefix&v=#{$octicons-version}') format('embedded-opentype'), + url('#{$octicons-font-path}/octicons.woff?v=#{$octicons-version}') format('woff'), + url('#{$octicons-font-path}/octicons.ttf?v=#{$octicons-version}') format('truetype'), + url('#{$octicons-font-path}/octicons.svg?v=#{$octicons-version}#octicons') format('svg'); + font-weight: normal; + font-style: normal; +} + +// .octicon is optimized for 16px. +// .mega-octicon is optimized for 32px but can be used larger. +.octicon, .mega-octicon { + font: normal normal normal 16px/1 octicons; + display: inline-block; + text-decoration: none; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.mega-octicon { font-size: 32px; } + +.octicon-alert:before { content: '\f02d'} /*  */ +.octicon-arrow-down:before { content: '\f03f'} /*  */ +.octicon-arrow-left:before { content: '\f040'} /*  */ +.octicon-arrow-right:before { content: '\f03e'} /*  */ +.octicon-arrow-small-down:before { content: '\f0a0'} /*  */ +.octicon-arrow-small-left:before { content: '\f0a1'} /*  */ +.octicon-arrow-small-right:before { content: '\f071'} /*  */ +.octicon-arrow-small-up:before { content: '\f09f'} /*  */ +.octicon-arrow-up:before { content: '\f03d'} /*  */ +.octicon-microscope:before, +.octicon-beaker:before { content: '\f0dd'} /*  */ +.octicon-bell:before { content: '\f0de'} /*  */ +.octicon-book:before { content: '\f007'} /*  */ +.octicon-bookmark:before { content: '\f07b'} /*  */ +.octicon-briefcase:before { content: '\f0d3'} /*  */ +.octicon-broadcast:before { content: '\f048'} /*  */ +.octicon-browser:before { content: '\f0c5'} /*  */ +.octicon-bug:before { content: '\f091'} /*  */ +.octicon-calendar:before { content: '\f068'} /*  */ +.octicon-check:before { content: '\f03a'} /*  */ +.octicon-checklist:before { content: '\f076'} /*  */ +.octicon-chevron-down:before { content: '\f0a3'} /*  */ +.octicon-chevron-left:before { content: '\f0a4'} /*  */ +.octicon-chevron-right:before { content: '\f078'} /*  */ +.octicon-chevron-up:before { content: '\f0a2'} /*  */ +.octicon-circle-slash:before { content: '\f084'} /*  */ +.octicon-circuit-board:before { content: '\f0d6'} /*  */ +.octicon-clippy:before { content: '\f035'} /*  */ +.octicon-clock:before { content: '\f046'} /*  */ +.octicon-cloud-download:before { content: '\f00b'} /*  */ +.octicon-cloud-upload:before { content: '\f00c'} /*  */ +.octicon-code:before { content: '\f05f'} /*  */ +.octicon-color-mode:before { content: '\f065'} /*  */ +.octicon-comment-add:before, +.octicon-comment:before { content: '\f02b'} /*  */ +.octicon-comment-discussion:before { content: '\f04f'} /*  */ +.octicon-credit-card:before { content: '\f045'} /*  */ +.octicon-dash:before { content: '\f0ca'} /*  */ +.octicon-dashboard:before { content: '\f07d'} /*  */ +.octicon-database:before { content: '\f096'} /*  */ +.octicon-clone:before, +.octicon-desktop-download:before { content: '\f0dc'} /*  */ +.octicon-device-camera:before { content: '\f056'} /*  */ +.octicon-device-camera-video:before { content: '\f057'} /*  */ +.octicon-device-desktop:before { content: '\f27c'} /*  */ +.octicon-device-mobile:before { content: '\f038'} /*  */ +.octicon-diff:before { content: '\f04d'} /*  */ +.octicon-diff-added:before { content: '\f06b'} /*  */ +.octicon-diff-ignored:before { content: '\f099'} /*  */ +.octicon-diff-modified:before { content: '\f06d'} /*  */ +.octicon-diff-removed:before { content: '\f06c'} /*  */ +.octicon-diff-renamed:before { content: '\f06e'} /*  */ +.octicon-ellipsis:before { content: '\f09a'} /*  */ +.octicon-eye-unwatch:before, +.octicon-eye-watch:before, +.octicon-eye:before { content: '\f04e'} /*  */ +.octicon-file-binary:before { content: '\f094'} /*  */ +.octicon-file-code:before { content: '\f010'} /*  */ +.octicon-file-directory:before { content: '\f016'} /*  */ +.octicon-file-media:before { content: '\f012'} /*  */ +.octicon-file-pdf:before { content: '\f014'} /*  */ +.octicon-file-submodule:before { content: '\f017'} /*  */ +.octicon-file-symlink-directory:before { content: '\f0b1'} /*  */ +.octicon-file-symlink-file:before { content: '\f0b0'} /*  */ +.octicon-file-text:before { content: '\f011'} /*  */ +.octicon-file-zip:before { content: '\f013'} /*  */ +.octicon-flame:before { content: '\f0d2'} /*  */ +.octicon-fold:before { content: '\f0cc'} /*  */ +.octicon-gear:before { content: '\f02f'} /*  */ +.octicon-gift:before { content: '\f042'} /*  */ +.octicon-gist:before { content: '\f00e'} /*  */ +.octicon-gist-secret:before { content: '\f08c'} /*  */ +.octicon-git-branch-create:before, +.octicon-git-branch-delete:before, +.octicon-git-branch:before { content: '\f020'} /*  */ +.octicon-git-commit:before { content: '\f01f'} /*  */ +.octicon-git-compare:before { content: '\f0ac'} /*  */ +.octicon-git-merge:before { content: '\f023'} /*  */ +.octicon-git-pull-request-abandoned:before, +.octicon-git-pull-request:before { content: '\f009'} /*  */ +.octicon-globe:before { content: '\f0b6'} /*  */ +.octicon-graph:before { content: '\f043'} /*  */ +.octicon-heart:before { content: '\2665'} /* ♥ */ +.octicon-history:before { content: '\f07e'} /*  */ +.octicon-home:before { content: '\f08d'} /*  */ +.octicon-horizontal-rule:before { content: '\f070'} /*  */ +.octicon-hubot:before { content: '\f09d'} /*  */ +.octicon-inbox:before { content: '\f0cf'} /*  */ +.octicon-info:before { content: '\f059'} /*  */ +.octicon-issue-closed:before { content: '\f028'} /*  */ +.octicon-issue-opened:before { content: '\f026'} /*  */ +.octicon-issue-reopened:before { content: '\f027'} /*  */ +.octicon-jersey:before { content: '\f019'} /*  */ +.octicon-key:before { content: '\f049'} /*  */ +.octicon-keyboard:before { content: '\f00d'} /*  */ +.octicon-law:before { content: '\f0d8'} /*  */ +.octicon-light-bulb:before { content: '\f000'} /*  */ +.octicon-link:before { content: '\f05c'} /*  */ +.octicon-link-external:before { content: '\f07f'} /*  */ +.octicon-list-ordered:before { content: '\f062'} /*  */ +.octicon-list-unordered:before { content: '\f061'} /*  */ +.octicon-location:before { content: '\f060'} /*  */ +.octicon-gist-private:before, +.octicon-mirror-private:before, +.octicon-git-fork-private:before, +.octicon-lock:before { content: '\f06a'} /*  */ +.octicon-logo-github:before { content: '\f092'} /*  */ +.octicon-mail:before { content: '\f03b'} /*  */ +.octicon-mail-read:before { content: '\f03c'} /*  */ +.octicon-mail-reply:before { content: '\f051'} /*  */ +.octicon-mark-github:before { content: '\f00a'} /*  */ +.octicon-markdown:before { content: '\f0c9'} /*  */ +.octicon-megaphone:before { content: '\f077'} /*  */ +.octicon-mention:before { content: '\f0be'} /*  */ +.octicon-milestone:before { content: '\f075'} /*  */ +.octicon-mirror-public:before, +.octicon-mirror:before { content: '\f024'} /*  */ +.octicon-mortar-board:before { content: '\f0d7'} /*  */ +.octicon-mute:before { content: '\f080'} /*  */ +.octicon-no-newline:before { content: '\f09c'} /*  */ +.octicon-octoface:before { content: '\f008'} /*  */ +.octicon-organization:before { content: '\f037'} /*  */ +.octicon-package:before { content: '\f0c4'} /*  */ +.octicon-paintcan:before { content: '\f0d1'} /*  */ +.octicon-pencil:before { content: '\f058'} /*  */ +.octicon-person-add:before, +.octicon-person-follow:before, +.octicon-person:before { content: '\f018'} /*  */ +.octicon-pin:before { content: '\f041'} /*  */ +.octicon-plug:before { content: '\f0d4'} /*  */ +.octicon-repo-create:before, +.octicon-gist-new:before, +.octicon-file-directory-create:before, +.octicon-file-add:before, +.octicon-plus:before { content: '\f05d'} /*  */ +.octicon-primitive-dot:before { content: '\f052'} /*  */ +.octicon-primitive-square:before { content: '\f053'} /*  */ +.octicon-pulse:before { content: '\f085'} /*  */ +.octicon-question:before { content: '\f02c'} /*  */ +.octicon-quote:before { content: '\f063'} /*  */ +.octicon-radio-tower:before { content: '\f030'} /*  */ +.octicon-repo-delete:before, +.octicon-repo:before { content: '\f001'} /*  */ +.octicon-repo-clone:before { content: '\f04c'} /*  */ +.octicon-repo-force-push:before { content: '\f04a'} /*  */ +.octicon-gist-fork:before, +.octicon-repo-forked:before { content: '\f002'} /*  */ +.octicon-repo-pull:before { content: '\f006'} /*  */ +.octicon-repo-push:before { content: '\f005'} /*  */ +.octicon-rocket:before { content: '\f033'} /*  */ +.octicon-rss:before { content: '\f034'} /*  */ +.octicon-ruby:before { content: '\f047'} /*  */ +.octicon-screen-full:before { content: '\f066'} /*  */ +.octicon-screen-normal:before { content: '\f067'} /*  */ +.octicon-search-save:before, +.octicon-search:before { content: '\f02e'} /*  */ +.octicon-server:before { content: '\f097'} /*  */ +.octicon-settings:before { content: '\f07c'} /*  */ +.octicon-shield:before { content: '\f0e1'} /*  */ +.octicon-log-in:before, +.octicon-sign-in:before { content: '\f036'} /*  */ +.octicon-log-out:before, +.octicon-sign-out:before { content: '\f032'} /*  */ +.octicon-squirrel:before { content: '\f0b2'} /*  */ +.octicon-star-add:before, +.octicon-star-delete:before, +.octicon-star:before { content: '\f02a'} /*  */ +.octicon-stop:before { content: '\f08f'} /*  */ +.octicon-repo-sync:before, +.octicon-sync:before { content: '\f087'} /*  */ +.octicon-tag-remove:before, +.octicon-tag-add:before, +.octicon-tag:before { content: '\f015'} /*  */ +.octicon-telescope:before { content: '\f088'} /*  */ +.octicon-terminal:before { content: '\f0c8'} /*  */ +.octicon-three-bars:before { content: '\f05e'} /*  */ +.octicon-thumbsdown:before { content: '\f0db'} /*  */ +.octicon-thumbsup:before { content: '\f0da'} /*  */ +.octicon-tools:before { content: '\f031'} /*  */ +.octicon-trashcan:before { content: '\f0d0'} /*  */ +.octicon-triangle-down:before { content: '\f05b'} /*  */ +.octicon-triangle-left:before { content: '\f044'} /*  */ +.octicon-triangle-right:before { content: '\f05a'} /*  */ +.octicon-triangle-up:before { content: '\f0aa'} /*  */ +.octicon-unfold:before { content: '\f039'} /*  */ +.octicon-unmute:before { content: '\f0ba'} /*  */ +.octicon-versions:before { content: '\f064'} /*  */ +.octicon-watch:before { content: '\f0e0'} /*  */ +.octicon-remove-close:before, +.octicon-x:before { content: '\f081'} /*  */ +.octicon-zap:before { content: '\26A1'} /* ⚡ */ diff --git a/frappe/public/css/octicons/octicons.svg b/frappe/public/css/octicons/octicons.svg index ea3e0f1615..d932988bb5 100755 --- a/frappe/public/css/octicons/octicons.svg +++ b/frappe/public/css/octicons/octicons.svg @@ -2,7 +2,7 @@ -(c) 2012-2014 GitHub +(c) 2012-2015 GitHub When using the GitHub logos, be sure to follow the GitHub logo guidelines (https://github.com/logos) @@ -17,9 +17,6 @@ Applies to all other files - - - @@ -28,170 +25,158 @@ Applies to all other files - - - - - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + - - + + - + - + - - - + + - - - - - - + + - - + + - - - - - - - - - - + + + + + - - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + - - - + + + + + - + - - - - + + + + + diff --git a/frappe/public/css/octicons/octicons.ttf b/frappe/public/css/octicons/octicons.ttf index 7111762d8b..32e6720a73 100755 Binary files a/frappe/public/css/octicons/octicons.ttf and b/frappe/public/css/octicons/octicons.ttf differ diff --git a/frappe/public/css/octicons/octicons.woff b/frappe/public/css/octicons/octicons.woff index a3989c84a3..cbf9f62ea6 100755 Binary files a/frappe/public/css/octicons/octicons.woff and b/frappe/public/css/octicons/octicons.woff differ diff --git a/frappe/public/css/octicons/sprockets-octicons.scss b/frappe/public/css/octicons/sprockets-octicons.scss index f2c1664ede..cef21ae62e 100755 --- a/frappe/public/css/octicons/sprockets-octicons.scss +++ b/frappe/public/css/octicons/sprockets-octicons.scss @@ -10,23 +10,11 @@ // .octicon is optimized for 16px. // .mega-octicon is optimized for 32px but can be used larger. -.octicon { - font: normal normal 16px octicons; - line-height: 1; - display: inline-block; - text-decoration: none; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.mega-octicon { - font: normal normal 32px octicons; - line-height: 1; +.octicon, .mega-octicon { + font: normal normal normal 16px/1 octicons; display: inline-block; text-decoration: none; + text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-user-select: none; @@ -34,11 +22,9 @@ -ms-user-select: none; user-select: none; } +.mega-octicon { font-size: 32px; } .octicon-alert:before { content: '\f02d'} /*  */ -.octicon-alignment-align:before { content: '\f08a'} /*  */ -.octicon-alignment-aligned-to:before { content: '\f08e'} /*  */ -.octicon-alignment-unalign:before { content: '\f08b'} /*  */ .octicon-arrow-down:before { content: '\f03f'} /*  */ .octicon-arrow-left:before { content: '\f040'} /*  */ .octicon-arrow-right:before { content: '\f03e'} /*  */ @@ -47,7 +33,9 @@ .octicon-arrow-small-right:before { content: '\f071'} /*  */ .octicon-arrow-small-up:before { content: '\f09f'} /*  */ .octicon-arrow-up:before { content: '\f03d'} /*  */ -.octicon-beer:before { content: '\f069'} /*  */ +.octicon-microscope:before, +.octicon-beaker:before { content: '\f0dd'} /*  */ +.octicon-bell:before { content: '\f0de'} /*  */ .octicon-book:before { content: '\f007'} /*  */ .octicon-bookmark:before { content: '\f07b'} /*  */ .octicon-briefcase:before { content: '\f0d3'} /*  */ @@ -76,6 +64,8 @@ .octicon-dash:before { content: '\f0ca'} /*  */ .octicon-dashboard:before { content: '\f07d'} /*  */ .octicon-database:before { content: '\f096'} /*  */ +.octicon-clone:before, +.octicon-desktop-download:before { content: '\f0dc'} /*  */ .octicon-device-camera:before { content: '\f056'} /*  */ .octicon-device-camera-video:before { content: '\f057'} /*  */ .octicon-device-desktop:before { content: '\f27c'} /*  */ @@ -120,7 +110,6 @@ .octicon-history:before { content: '\f07e'} /*  */ .octicon-home:before { content: '\f08d'} /*  */ .octicon-horizontal-rule:before { content: '\f070'} /*  */ -.octicon-hourglass:before { content: '\f09e'} /*  */ .octicon-hubot:before { content: '\f09d'} /*  */ .octicon-inbox:before { content: '\f0cf'} /*  */ .octicon-info:before { content: '\f059'} /*  */ @@ -128,13 +117,9 @@ .octicon-issue-opened:before { content: '\f026'} /*  */ .octicon-issue-reopened:before { content: '\f027'} /*  */ .octicon-jersey:before { content: '\f019'} /*  */ -.octicon-jump-down:before { content: '\f072'} /*  */ -.octicon-jump-left:before { content: '\f0a5'} /*  */ -.octicon-jump-right:before { content: '\f0a6'} /*  */ -.octicon-jump-up:before { content: '\f073'} /*  */ .octicon-key:before { content: '\f049'} /*  */ .octicon-keyboard:before { content: '\f00d'} /*  */ -.octicon-law:before { content: '\f0d8'} /* */ +.octicon-law:before { content: '\f0d8'} /*  */ .octicon-light-bulb:before { content: '\f000'} /*  */ .octicon-link:before { content: '\f05c'} /*  */ .octicon-link-external:before { content: '\f07f'} /*  */ @@ -153,15 +138,10 @@ .octicon-markdown:before { content: '\f0c9'} /*  */ .octicon-megaphone:before { content: '\f077'} /*  */ .octicon-mention:before { content: '\f0be'} /*  */ -.octicon-microscope:before { content: '\f089'} /*  */ .octicon-milestone:before { content: '\f075'} /*  */ .octicon-mirror-public:before, .octicon-mirror:before { content: '\f024'} /*  */ -.octicon-mortar-board:before { content: '\f0d7'} /* */ -.octicon-move-down:before { content: '\f0a8'} /*  */ -.octicon-move-left:before { content: '\f074'} /*  */ -.octicon-move-right:before { content: '\f0a9'} /*  */ -.octicon-move-up:before { content: '\f0a7'} /*  */ +.octicon-mortar-board:before { content: '\f0d7'} /*  */ .octicon-mute:before { content: '\f080'} /*  */ .octicon-no-newline:before { content: '\f09c'} /*  */ .octicon-octoface:before { content: '\f008'} /*  */ @@ -173,21 +153,15 @@ .octicon-person-follow:before, .octicon-person:before { content: '\f018'} /*  */ .octicon-pin:before { content: '\f041'} /*  */ -.octicon-playback-fast-forward:before { content: '\f0bd'} /*  */ -.octicon-playback-pause:before { content: '\f0bb'} /*  */ -.octicon-playback-play:before { content: '\f0bf'} /*  */ -.octicon-playback-rewind:before { content: '\f0bc'} /*  */ .octicon-plug:before { content: '\f0d4'} /*  */ .octicon-repo-create:before, .octicon-gist-new:before, .octicon-file-directory-create:before, .octicon-file-add:before, .octicon-plus:before { content: '\f05d'} /*  */ -.octicon-podium:before { content: '\f0af'} /*  */ .octicon-primitive-dot:before { content: '\f052'} /*  */ .octicon-primitive-square:before { content: '\f053'} /*  */ .octicon-pulse:before { content: '\f085'} /*  */ -.octicon-puzzle:before { content: '\f0c0'} /*  */ .octicon-question:before { content: '\f02c'} /*  */ .octicon-quote:before { content: '\f063'} /*  */ .octicon-radio-tower:before { content: '\f030'} /*  */ @@ -208,16 +182,15 @@ .octicon-search:before { content: '\f02e'} /*  */ .octicon-server:before { content: '\f097'} /*  */ .octicon-settings:before { content: '\f07c'} /*  */ +.octicon-shield:before { content: '\f0e1'} /*  */ .octicon-log-in:before, .octicon-sign-in:before { content: '\f036'} /*  */ .octicon-log-out:before, .octicon-sign-out:before { content: '\f032'} /*  */ -.octicon-split:before { content: '\f0c6'} /*  */ .octicon-squirrel:before { content: '\f0b2'} /*  */ .octicon-star-add:before, .octicon-star-delete:before, .octicon-star:before { content: '\f02a'} /*  */ -.octicon-steps:before { content: '\f0c7'} /*  */ .octicon-stop:before { content: '\f08f'} /*  */ .octicon-repo-sync:before, .octicon-sync:before { content: '\f087'} /*  */ @@ -227,6 +200,8 @@ .octicon-telescope:before { content: '\f088'} /*  */ .octicon-terminal:before { content: '\f0c8'} /*  */ .octicon-three-bars:before { content: '\f05e'} /*  */ +.octicon-thumbsdown:before { content: '\f0db'} /*  */ +.octicon-thumbsup:before { content: '\f0da'} /*  */ .octicon-tools:before { content: '\f031'} /*  */ .octicon-trashcan:before { content: '\f0d0'} /*  */ .octicon-triangle-down:before { content: '\f05b'} /*  */ @@ -236,6 +211,7 @@ .octicon-unfold:before { content: '\f039'} /*  */ .octicon-unmute:before { content: '\f0ba'} /*  */ .octicon-versions:before { content: '\f064'} /*  */ +.octicon-watch:before { content: '\f0e0'} /*  */ .octicon-remove-close:before, .octicon-x:before { content: '\f081'} /*  */ .octicon-zap:before { content: '\26A1'} /* ⚡ */ diff --git a/frappe/public/js/frappe/ui/app_icon.js b/frappe/public/js/frappe/ui/app_icon.js index 6dae19f5d9..8f7e7c9349 100644 --- a/frappe/public/js/frappe/ui/app_icon.js +++ b/frappe/public/js/frappe/ui/app_icon.js @@ -12,6 +12,11 @@ frappe.ui.app_icon = { var module = modules[app] var icon = module.icon; var color = module.color; + var icon_style = ""; + if(module.reverse) { + icon_style = "color: #36414C;"; + } + if(icon.split(".").slice(-1)[0]==="svg") { $.ajax({ url: frappe.urllib.get_full_url(icon), @@ -23,7 +28,7 @@ frappe.ui.app_icon = { }) icon = ''+ icon+''; } else { - icon = ''; + icon = ''; } return '
'+icon+'
' diff --git a/frappe/public/js/frappe/ui/toolbar/awesome_bar.js b/frappe/public/js/frappe/ui/toolbar/awesome_bar.js index 8e448e0054..145efb94cd 100644 --- a/frappe/public/js/frappe/ui/toolbar/awesome_bar.js +++ b/frappe/public/js/frappe/ui/toolbar/awesome_bar.js @@ -194,7 +194,7 @@ frappe.search.verbs = [ // remove list keyword txt = txt.replace(/ list/ig, "").trim(); } - + frappe.search.find(frappe.boot.user.can_read, txt, function(match) { if(in_list(frappe.boot.single_types, match)) { return { @@ -217,8 +217,8 @@ frappe.search.verbs = [ frappe.search.find(keys(frappe.boot.user.all_reports), txt, function(match) { var report_type = frappe.boot.user.all_reports[match]; return { - label: __("Open {0}", [""+__(match)+""]), - value: __("Open {0}", [__(match)]), + label: __("Report {0}", [""+__(match)+""]), + value: __("Report {0}", [__(match)]), route: [report_type=="Report Builder" ? "Report" : "query-report", match] } }); @@ -228,8 +228,8 @@ frappe.search.verbs = [ function(txt) { frappe.search.find(keys(frappe.search.pages), txt, function(match) { return { - label: __("Report {0}", [""+__(match)+""]), - value: __("Report {0}", [__(match)]), + label: __("Open {0}", [""+__(match)+""]), + value: __("Open {0}", [__(match)]), route: [frappe.search.pages[match].route || frappe.search.pages[match].name] } }); diff --git a/frappe/public/js/frappe/ui/toolbar/notifications.js b/frappe/public/js/frappe/ui/toolbar/notifications.js new file mode 100644 index 0000000000..ac1079e529 --- /dev/null +++ b/frappe/public/js/frappe/ui/toolbar/notifications.js @@ -0,0 +1,91 @@ +frappe.provide("frappe.ui.notifications") + +frappe.ui.notifications.update_notifications = function() { + frappe.ui.notifications.total = 0; + var doctypes = keys(frappe.boot.notification_info.open_count_doctype).sort(); + var modules = keys(frappe.boot.notification_info.open_count_module).sort(); + + // clear toolbar / sidebar notifications + frappe.ui.notifications.navbar_notification = $("#navbar-notification").empty(); + frappe.ui.notifications.sidebar_notification = $("#sidebar-notification").empty(); + + // add these first. + frappe.ui.notifications.add_notification("Comment"); + frappe.ui.notifications.add_notification("ToDo"); + frappe.ui.notifications.add_notification("Event"); + + // add a divider + if(frappe.ui.notifications.total) { + var divider = '
  • '; + frappe.ui.notifications.navbar_notification.append($(divider)); + frappe.ui.notifications.sidebar_notification.append($(divider)); + } + + // add to toolbar and sidebar + $.each(doctypes, function(i, doctype) { + if(!in_list(["ToDo", "Comment", "Event"])) + frappe.ui.notifications.add_notification(doctype); + }); + + // set click events + $("#navbar-notification a, #sidebar-notification a").on("click", function() { + var doctype = $(this).attr("data-doctype"); + var config = frappe.ui.notifications.config[doctype] || {}; + if (config.route) { + frappe.set_route(config.route); + } else { + frappe.views.show_open_count_list(this); + } + }); + + // switch colour on the navbar + $(".navbar-new-comments") + .html(frappe.ui.notifications.total) + .toggleClass("navbar-new-comments-true", frappe.ui.notifications.total ? true : false); + +} + +frappe.ui.notifications.add_notification = function(doctype) { + var count = frappe.boot.notification_info.open_count_doctype[doctype]; + if(count) { + var config = frappe.ui.notifications.config[doctype] || {}; + var label = config.label || doctype; + var notification_row = repl('
  • \ + \ + %(count)s \ + %(label)s
  • ', { + label: __(label), + icon: frappe.boot.doctype_icons[doctype], + count: count, + data_doctype: doctype + }); + + frappe.ui.notifications.navbar_notification.append($(notification_row)); + frappe.ui.notifications.sidebar_notification.append($(notification_row)); + + frappe.ui.notifications.total += count; + } +} + +// default notification config +frappe.ui.notifications.config = { + "ToDo": { label: __("To Do") }, + "Comment": { label: __("Messages"), route: "messages"}, + "Event": { label: __("Calendar"), route: "Calendar/Event" } +}; + +frappe.views.show_open_count_list = function(element) { + var doctype = $(element).attr("data-doctype"); + var condition = frappe.boot.notification_info.conditions[doctype]; + + if(condition && $.isPlainObject(condition)) { + frappe.route_options = condition; + } + + var route = frappe.get_route(); + if(route[0]==="List" && route[1]===doctype) { + frappe.pages["List/" + doctype].doclistview.refresh(); + } else { + frappe.set_route("List", doctype); + } +} diff --git a/frappe/public/js/frappe/ui/toolbar/toolbar.js b/frappe/public/js/frappe/ui/toolbar/toolbar.js index 1b6222c00a..62c9b64f7e 100644 --- a/frappe/public/js/frappe/ui/toolbar/toolbar.js +++ b/frappe/public/js/frappe/ui/toolbar/toolbar.js @@ -16,7 +16,7 @@ frappe.ui.toolbar.Toolbar = Class.extend({ }); $(document).on("notification-update", function() { - frappe.ui.toolbar.update_notifications(); + frappe.ui.notifications.update_notifications(); }); $('.dropdown-toggle').dropdown(); @@ -61,79 +61,7 @@ $.extend(frappe.ui.toolbar, { $(".offcanvas").toggleClass("active-left").removeClass("active-right"); return false; } -}) - -frappe.ui.toolbar.update_notifications = function() { - var total = 0; - var doctypes = keys(frappe.boot.notification_info.open_count_doctype).sort(); - var modules = keys(frappe.boot.notification_info.open_count_module).sort(); - - var navbar_notification = $("#navbar-notification").empty(); - var sidebar_notification = $("#sidebar-notification").empty(); - - $.each(modules, function(i, module) { - var count = frappe.boot.notification_info.open_count_module[module]; - if(count) { - var notification_row = repl('
  • \ - \ - %(count)s \ - %(module)s
  • ', { - module: __(module), - count: count, - icon: frappe.modules[module].icon, - data_module: module - }); - - navbar_notification.append($(notification_row)); - sidebar_notification.append($(notification_row)); - - total += count; - } - }); - - if(total) { - var divider = '
  • '; - navbar_notification.append($(divider)); - sidebar_notification.append($(divider)); - } - - $.each(doctypes, function(i, doctype) { - var count = frappe.boot.notification_info.open_count_doctype[doctype]; - if(count) { - var notification_row = repl('
  • \ - \ - %(count)s \ - %(doctype)s
  • ', { - doctype: __(doctype), - icon: frappe.boot.doctype_icons[doctype], - count: count, - data_doctype: doctype - }); - - navbar_notification.append($(notification_row)); - sidebar_notification.append($(notification_row)); - - total += count; - } - }); - - $("#navbar-notification a, #sidebar-notification a").on("click", function() { - var module = $(this).attr("data-module"); - if (module) { - frappe.set_route(frappe.modules[module].link); - } else { - var doctype = $(this).attr("data-doctype"); - if (doctype) { - frappe.views.show_open_count_list(this); - } - } - }); - - $(".navbar-new-comments") - .html(total) - .toggleClass("navbar-new-comments-true", total ? true : false); - -} +}); frappe.ui.toolbar.clear_cache = function() { frappe.assets.clear_local_storage(); @@ -160,17 +88,3 @@ frappe.ui.toolbar.show_about = function() { } return false; } - -frappe.views.show_open_count_list = function(element) { - var doctype = $(element).attr("data-doctype"); - var condition = frappe.boot.notification_info.conditions[doctype]; - if(condition) { - frappe.route_options = condition; - var route = frappe.get_route(); - if(route[0]==="List" && route[1]===doctype) { - frappe.pages["List/" + doctype].doclistview.refresh(); - } else { - frappe.set_route("List", doctype); - } - } -} diff --git a/frappe/public/js/frappe/views/module/module_section.html b/frappe/public/js/frappe/views/module/module_section.html index 4e268dad95..f4ed7affcc 100644 --- a/frappe/public/js/frappe/views/module/module_section.html +++ b/frappe/public/js/frappe/views/module/module_section.html @@ -4,8 +4,8 @@ {% if (item.description) { %}

    {%= item.label || item.name %}

    - {% if (item.type==="doctype") { %} - + {% if (item.type==="doctype" || item.type==="page") { %} + {% } %}
    diff --git a/frappe/public/js/frappe/views/module/moduleview.js b/frappe/public/js/frappe/views/module/moduleview.js index deeb1f9fbb..a819d89266 100644 --- a/frappe/public/js/frappe/views/module/moduleview.js +++ b/frappe/public/js/frappe/views/module/moduleview.js @@ -126,7 +126,8 @@ frappe.views.moduleview.ModuleView = Class.extend({ if (item.type == "doctype") { // save the last page from the breadcrumb was accessed frappe.breadcrumbs.set_doctype_module(item.name, this.module); - route = ["List", item.name]; + if(!item.view) item.view = "List" + route = [item.view, item.name]; } else if (item.type == "page") { route = [item.name] } else if (item.type == "report") { diff --git a/frappe/public/less/desktop.less b/frappe/public/less/desktop.less index df52050ab0..388f807f00 100644 --- a/frappe/public/less/desktop.less +++ b/frappe/public/less/desktop.less @@ -56,6 +56,7 @@ body[data-route=""] .navbar-default, body[data-route="desktop"] .navbar-default transition: 0.2s; -webkit-transition: 0.2s; text-shadow: -1px 1px 5px rgba(0, 0, 0, 0.15); + } .app-icon svg, .app-icon img {