[desktop] icons using octicons

This commit is contained in:
Rushabh Mehta 2014-12-31 14:38:58 +05:30
parent 1c356ff20d
commit f44b004ad4
26 changed files with 2347 additions and 80 deletions

View file

@ -104,7 +104,7 @@ def get_fullnames():
concat(ifnull(first_name, ''),
if(ifnull(last_name, '')!='', ' ', ''), ifnull(last_name, '')) as fullname,
user_image as image, gender, email
from tabUser where ifnull(enabled, 0)=1 and user_type="System User" """, as_dict=1)
from tabUser where ifnull(enabled, 0)=1 and user_type!="Website User" """, as_dict=1)
d = {}
for r in ret:

View file

@ -5,6 +5,7 @@ def get_data():
"Activity": {
"color": "#e67e22",
"icon": "icon-play",
"icon": "octicon octicon-pulse",
"label": _("Activity"),
"link": "activity",
"type": "page"
@ -12,6 +13,7 @@ def get_data():
"Calendar": {
"color": "#2980b9",
"icon": "icon-calendar",
"icon": "octicon octicon-calendar",
"label": _("Calendar"),
"link": "Calendar/Event",
"type": "view"
@ -19,6 +21,7 @@ def get_data():
"Messages": {
"color": "#9b59b6",
"icon": "icon-comments",
"icon": "octicon octicon-comment-discussion",
"label": _("Messages"),
"link": "messages",
"type": "page"
@ -26,6 +29,7 @@ def get_data():
"To Do": {
"color": "#f1c40f",
"icon": "icon-check",
"icon": "octicon octicon-check",
"label": _("To Do"),
"link": "List/ToDo",
"doctype": "ToDo",
@ -35,6 +39,7 @@ def get_data():
"color": "#95a5a6",
"doctype": "Note",
"icon": "icon-file-alt",
"icon": "octicon octicon-file-text",
"label": _("Notes"),
"link": "List/Note",
"type": "list"
@ -42,11 +47,13 @@ def get_data():
"Website": {
"color": "#16a085",
"icon": "icon-globe",
"icon": "octicon octicon-globe",
"type": "module"
},
"Installer": {
"color": "#888",
"icon": "icon-download",
"icon": "octicon octicon-cloud-download",
"link": "applications",
"type": "page",
"label": _("Installer")
@ -54,11 +61,13 @@ def get_data():
"Setup": {
"color": "#bdc3c7",
"icon": "icon-wrench",
"icon": "octicon octicon-settings",
"type": "module"
},
"Core": {
"color": "#589494",
"icon": "icon-cog",
"icon": "octicon octicon-file-binary",
"type": "module",
"system_manager": 1
},

View file

@ -1,3 +1,16 @@
#page-desktop {
position: absolute;
min-width: 100%;
min-height: 100%;
overflow: auto;
padding-top: 14px;
padding-bottom: 50px;
margin-bottom: -50px;
border: 0px;
background-color: transparent;
background-color: #fcfdfe;
}
#icon-grid {
padding-top: 15px;
padding-bottom: 30px;
@ -5,10 +18,10 @@
.case-wrapper {
position: relative;
margin: 15px;
margin: 0px;
float: left;
width: 100px;
height: 100px;
height: 120px;
}
.case-label {
@ -37,9 +50,9 @@
border-radius: 30px;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
line-height: 12px;
line-height: 15px;
background: #FF5858;
padding: 7px;
padding: 5px;
z-index: 5;
}
@ -49,14 +62,3 @@
min-width: 15px;
}
#page-desktop {
position: absolute;
min-width: 100%;
min-height: 100%;
overflow: auto;
padding-top: 14px;
padding-bottom: 50px;
margin-bottom: -50px;
border: 0px;
background-color: transparent;
}

View file

@ -1,7 +1,7 @@
frappe.provide('frappe.desktop');
frappe.pages['desktop'].onload = function(wrapper) {
$('<div style="min-height: 500px; background: None; text-align: center; \
$('<div style="min-height: 500px; background: none; text-align: center; \
margin: 0px auto;"> \
<div id="icon-grid" class="container">\
</div>\
@ -13,9 +13,6 @@ frappe.pages['desktop'].onload = function(wrapper) {
}
frappe.pages['desktop'].refresh = function(wrapper) {
frappe.ui.toolbar.add_dropdown_button("File", __("All Applications"), function() {
frappe.desktop.show_all_modules();
}, 'icon-th');
};
frappe.desktop.refresh = function() {
@ -91,7 +88,7 @@ frappe.desktop.render = function() {
// all applications
frappe.modules["All Applications"] = {
icon: "icon-th",
icon: "octicon octicon-three-bars",
label: "All Applications",
_label: __("All Applications"),
_id: "all_applications",

View file

@ -1,3 +1,6 @@
frappe.listview_settings['Note'] = {
onload: function(me) {
me.page.set_title(__("Notes"), frappe.get_module("Notes").icon);
},
add_fields: ["title", "public"],
}

View file

@ -4,6 +4,7 @@ frappe.listview_settings['ToDo'] = {
"owner": user,
"status": "Open"
};
me.page.set_title(__("To Do"), frappe.get_module("To Do").icon);
},
add_fields: ["reference_type", "reference_name"],
}

View file

@ -2,12 +2,12 @@
// License: GNU General Public License v3. See license.txt
frappe.pages['activity'].onload = function(wrapper) {
frappe.ui.make_app_page({
var page = frappe.ui.make_app_page({
parent: wrapper,
title: __("Activity"),
single_column: true
})
frappe.add_breadcrumbs("Activity");
});
page.set_title(__("Activty"), frappe.get_module("Activity").icon);
var list = new frappe.ui.Listing({
hide_refresh: true,

View file

@ -7,10 +7,10 @@
frappe.provide('frappe.desk.pages.messages');
frappe.pages.messages.onload = function(parent) {
frappe.ui.make_app_page({
var page = frappe.ui.make_app_page({
parent: parent,
title: "Messages"
});
page.set_title(__("Messages"), frappe.get_module("Messages").icon);
frappe.desk.pages.messages = new frappe.desk.pages.messages(parent);
}

View file

@ -1,18 +1,23 @@
.app-icon {
border-radius: 5px;
overflow: hidden;
padding: 20px;
padding: 15px;
display: inline-block;
margin: auto;
text-align: center;
/*border: 1px solid #8D99A6;*/
/*border: 1px solid #36414C;*/
border: 1px solid #d1d8dd;
background-color: #fff;
}
.app-icon:hover {
background-color: #f5f7fa;
}
.app-icon i {
font-size: 30px;
min-width: 30px;
font-size: 40px;
min-width: 40px;
color: #8D99A6;
display: inline-block;
}

File diff suppressed because one or more lines are too long

View file

@ -353,17 +353,12 @@ em.link-option {
.alert-badge {
margin: 4px 0px;
padding: 10px;
}
.alert-badge .badge {
margin-top: 3px;
}
.form-layout {
/*margin-top: -15px;*/
}
.form-print-wrapper {
border: 1px solid #d1d8dd;
border-top: none;
@ -394,11 +389,6 @@ em.link-option {
padding: 6px 8px;
}
.form-headline {
margin-bottom: 10px;
font-size: 120%;
}
.form-dashboard {
display: none;
border-bottom: 1px solid #d1d8dd;

Binary file not shown.

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

Binary file not shown.

11
frappe/public/css/ionicons.min.css vendored Executable file

File diff suppressed because one or more lines are too long

View file

@ -18,7 +18,7 @@ frappe.ui.form.Dashboard = Class.extend({
set_headline: function(html) {
if(!this.headline)
this.headline =
$('<div class="form-headline col-md-12">').prependTo(this.body);
$('<h4 class="form-headline col-md-12"></h4>').prependTo(this.body);
this.headline.html(html);
this.wrapper.toggle(true);
},
@ -40,9 +40,8 @@ frappe.ui.form.Dashboard = Class.extend({
},
add_badge: function(label, doctype, onclick) {
var badge = $(repl('<div class="col-md-4">\
<div class="alert alert-info alert-badge">\
<i class="icon-fixed-width %(icon)s"></i> \
<a class="badge-link">%(label)s</a>\
<div class="alert-badge">\
<a class="badge-link grey">%(label)s</a>\
<span class="badge pull-right">-</span>\
</div></div>', {label:label, icon: frappe.boot.doctype_icons[doctype]}))
.appendTo(this.body)

View file

@ -125,20 +125,20 @@ frappe.ui.form.Comments = Class.extend({
},
set_icon_and_color: function(c) {
c.icon = {
"Email": "icon-envelope",
"Chat": "icon-comments",
"Phone": "icon-phone",
"SMS": "icon-mobile-phone",
"Created": "icon-plus",
"Submitted": "icon-lock",
"Cancelled": "icon-remove",
"Assigned": "icon-user",
"Assignment Completed": "icon-ok",
"Comment": "icon-comment",
"Workflow": "icon-arrow-right",
"Label": "icon-tag",
"Attachment": "icon-paper-clip",
"Attachment Removed": "icon-paper-clip"
"Email": "octicon octicon-mail",
"Chat": "octicon octicon-comment-discussion",
"Phone": "octicon octicon-device-mobile",
"SMS": "octicon octicon-comment",
"Created": "octicon octicon-plus",
"Submitted": "octicon octicon-lock",
"Cancelled": "octicon octicon-x",
"Assigned": "octicon octicon-tag",
"Assignment Completed": "octicon octicon-check",
"Comment": "octicon octicon-comment-discussion",
"Workflow": "octicon octicon-git-branch",
"Label": "octicon octicon-tag",
"Attachment": "octicon octicon-upload",
"Attachment Removed": "octicon octicon-x"
}[c.comment_type]
c.color = {

View file

@ -11,7 +11,7 @@
<span class="avatar avatar-small avatar-empty"></span>
{% } %}
<span class="h6 {% if(!data._comments_list.length) { %}text-extra-muted{% } %}">
<i class="icon-comments"></i>
<i class="octicon octicon-comment-discussion"></i>
{%= data._comments_list.length || 0 %}
</span>
</div>

View file

@ -10,11 +10,11 @@
{% if (_submittable) { %}
<span class="docstatus filterable" style="margin-right: 10px;" data-filter="docstatus,=,{%= docstatus %}">
{% if (docstatus===0) { %}
<i class="icon-edit icon-fixed-width" title="{%= __("Draft") %}"></i></span>
<i class="octicon octicon-pencil" title="{%= __("Draft") %}"></i></span>
{% } else if (docstatus===1) { %}
<i class="icon-lock icon-fixed-width" title="{%= __("Submitted") %}"></i></span>
<i class="octicon octicon-lock" title="{%= __("Submitted") %}"></i></span>
{% } else if (docstatus===2) { %}
<i class="icon-remove icon-fixed-width" title="{%= __("Cancelled") %}"></i></span>
<i class="octicon octicon-x" title="{%= __("Cancelled") %}"></i></span>
{% } %}
{% } %}
{% if (_workflow && !_without_workflow) { %}

View file

@ -19,7 +19,10 @@ frappe.views.ListView = Class.extend({
this.doctype = doctype;
this.meta = frappe.get_doc("DocType", this.doctype);
this.settings = frappe.listview_settings[this.doctype] || {};
this.template = this.meta.__listview_template || null;
if(this.meta.__listview_template) {
this.template_name = doctype + "_listview";
frappe.templates[this.template_name] = this.meta.__listview_template;
}
this.set_fields();
this.set_columns();
this.id_list = [];
@ -181,8 +184,11 @@ frappe.views.ListView = Class.extend({
}
if(this.template) {
var main = frappe.render(this.template, {doc: frappe.get_format_helper(data), list: this });
if(this.template_name) {
var main = frappe.render_template(this.template_name, {
doc: frappe.get_format_helper(data),
list: this
});
} else {
var main = frappe.render_template("list_item_standard", {
data: data,

View file

@ -242,15 +242,15 @@ bsEditorToolbar = Class.extend({
</div>\
<div class="btn-group form-group">\
<a class="btn btn-default btn-small" data-edit="bold" title="' + __("Bold (Ctrl/Cmd+B)") + '">\
<i class="icon-bold"></i></a>\
B</a>\
<a class="btn btn-default btn-small" data-edit="insertunorderedlist" title="' + __("Bullet list") + '">\
<i class="icon-list-ul"></i></a>\
<i class="octicon octicon-list-unordered"></i></a>\
<a class="btn btn-default btn-small" data-edit="insertorderedlist" title="' + __("Number list") + '">\
<i class="icon-list-ol"></i></a>\
<i class="octicon octicon-list-ordered"></i></a>\
<a class="btn btn-default btn-small" data-edit="outdent" title="' + __("Reduce indent (Shift+Tab)") + '">\
<i class="icon-indent-left"></i></a>\
<i class="octicon octicon-move-left"></i></a>\
<a class="btn btn-default btn-small" data-edit="indent" title="' + __("Indent (Tab)") + '">\
<i class="icon-indent-right"></i></a>\
<i class="octicon octicon-move-right"></i></a>\
</div>\
<div class="btn-group hidden-xs form-group">\
<a class="btn btn-default btn-small" data-edit="justifyleft" title="' + __("Align Left (Ctrl/Cmd+L)") + '">\
@ -262,15 +262,15 @@ bsEditorToolbar = Class.extend({
<a class="btn btn-default btn-small" title="' + __("Remove Link") +'" data-edit="unlink">\
<i class="icon-unlink"></i></a>\
<a class="btn btn-default btn-small btn-insert-img" title="' + __("Insert picture (or just drag & drop)") + '">\
<i class="icon-picture"></i></a>\
<i class="octicon octicon-file-media"></i></a>\
<a class="btn btn-default btn-small" data-edit="insertHorizontalRule" \
title="' + __("Horizontal Line Break") + '"></a>\
title="' + __("Horizontal Line Break") + '"><i class="octicon octicon-horizontal-rule"></i></a>\
</div>\
<div class="btn-group form-group">\
<a class="btn btn-default btn-small btn-html" title="' + __("HTML") + '">\
<i class="icon-code"></i></a>\
<i class="octicon octicon-code"></i></a>\
<a class="btn btn-default btn-small btn-success" data-action="Save" title="' + __("Save") + '">\
<i class="icon-save"></i></a>\
<i class="octicon octicon-check"></i></a>\
</div>\
<input type="file" data-edit="insertImage" />\
</div>').prependTo(parent);

View file

@ -156,10 +156,13 @@ frappe.ui.Page = Class.extend({
return this.$title_area;
},
set_title: function(txt) {
set_title: function(txt, icon) {
// strip icon
this.title = txt;
document.title = txt.replace(/<[^>]*>/g, "");
if(icon) {
txt = '<span class="'+ icon +' text-muted" style="font-size: 24px;"></span> ' + txt;
}
this.$title_area.find(".title-text").html(txt);
},

View file

@ -33,7 +33,8 @@ frappe.views.Calendar = Class.extend({
},
make_page: function() {
var module = locals.DocType[this.doctype].module;
this.parent.page.set_title(__("Calendar") + " - " + __(this.doctype));
this.parent.page.set_title(__("Calendar") + " - " + __(this.doctype),
frappe.get_module("Calendar").icon);
frappe.add_breadcrumbs(module==="Core" ? "Calendar" : module, this.doctype)
this.parent.page.set_primary_action(__("New"), function() {
var doc = frappe.model.get_new_doc(me.doctype);

View file

@ -89,7 +89,13 @@ frappe.views.Container = Class.extend({
if(breadcrumbs.module && breadcrumbs.module != "Desk") {
if(breadcrumbs.module==="Core") breadcrumbs.module = "Setup";
divider();
$('<li><a href="#Module/'+ breadcrumbs.module +'">'+ __(breadcrumbs.module) +'</a></li>').appendTo($breadcrumbs);
var module_info = frappe.get_module(breadcrumbs.module),
icon = module_info.icon,
label = module_info.label;
if(icon) {
icon = '<span class="'+icon+' text-muted"></span> '
}
$('<li><a href="#Module/'+ breadcrumbs.module +'">'+ icon + __(label) +'</a></li>').appendTo($breadcrumbs);
}
if(breadcrumbs.doctype) {
divider();

View file

@ -57,6 +57,7 @@ frappe.get_module = function(m) {
frappe.views.moduleview.ModuleView = Class.extend({
init: function(module) {
this.module = module;
this.module_info = frappe.get_module(module);
this.sections = {};
this.current_section = null;
this.make();
@ -75,7 +76,8 @@ frappe.views.moduleview.ModuleView = Class.extend({
frappe.views.moduleview[me.module] = me.parent;
me.page = me.parent.page;
me.parent.moduleview = me;
me.page.set_title(__(frappe.modules[me.module] && frappe.modules[me.module].label || me.module));
me.page.set_title(__(frappe.modules[me.module]
&& frappe.modules[me.module].label || me.module), me.module_info.icon);
me.render();
}
});