Browse Source

updates to config.setup

version-14
Rushabh Mehta 11 years ago
parent
commit
c160d2bb28
2 changed files with 64 additions and 27 deletions
  1. +55
    -21
      webnotes/config/setup.py
  2. +9
    -6
      webnotes/core/page/setup/setup.js

+ 55
- 21
webnotes/config/setup.py View File

@@ -31,27 +31,6 @@ data = [
}
]
},
{
"label": _("Workflow"),
"icon": "icon-random",
"items": [
{
"type": "doctype",
"name": "Workflow",
"description": _("Define workflows for forms.")
},
{
"type": "doctype",
"name": "Workflow State",
"description": _("States for workflow (e.g. Draft, Approved, Cancelled).")
},
{
"type": "doctype",
"name": "Workflow Action",
"description": _("Actions for workflow (e.g. Approve, Cancel).")
},
]
},
{
"label": _("Tools"),
"icon": "icon-wrench",
@@ -87,6 +66,38 @@ data = [
}
]
},
{
"label": _("Workflow"),
"icon": "icon-random",
"items": [
{
"type": "doctype",
"name": "Workflow",
"description": _("Define workflows for forms.")
},
{
"type": "doctype",
"name": "Workflow State",
"description": _("States for workflow (e.g. Draft, Approved, Cancelled).")
},
{
"type": "doctype",
"name": "Workflow Action",
"description": _("Actions for workflow (e.g. Approve, Cancel).")
},
]
},
{
"label": _("Email"),
"icon": "icon-envelope",
"items": [
{
"type": "doctype",
"name": "Email Settings",
"description": _("Set outgoing mail server.")
},
]
},
{
"label": _("Customize"),
"icon": "icon-glass",
@@ -107,5 +118,28 @@ data = [
"description": _("Add custom javascript to forms.")
}
]
},
{
"label": _("System"),
"icon": "icon-cog",
"items": [
{
"type": "page",
"name": "applications",
"label": _("Application Installer"),
"description": _("Install Applications."),
"icon": "icon-download"
},
{
"type": "doctype",
"name": "Backup Manager",
"description": _("Manage cloud backups on Dropbox")
},
{
"type": "doctype",
"name": "Scheduler Log",
"description": _("Log of error on automated events (scheduler).")
},
]
}
]

+ 9
- 6
webnotes/core/page/setup/setup.js View File

@@ -39,20 +39,23 @@ wn.setup = {
var $sections = wrapper.find(".nav-pills");
$.each(data, function(i, d) {
d._label = d.label.toLowerCase().replace(/ /g, "_");
$nav = $sections.find('[data-label="'+d._label+'"]');
var $nav = $sections.find('[data-label="'+d._label+'"]');
if(!$sections.find('[data-label="'+d._label+'"]').length) {
$nav = $('<li><a><i class="'+d.icon+'"></i> '
$nav = $('<li><a><i class="'+d.icon+' icon-fixed-width"></i> '
+ wn._(d.label)+'</a></li>')
.attr("data-label", d._label)
.appendTo($sections);
$content = $('<div class="panel panel-default"></div>')
var $content = $('<div class="panel panel-default"></div>')
.toggle(false)
.attr("id", d._label)
.appendTo(wrapper.find(".contents"))
$('<div class="panel-heading">').appendTo($content).html('<i class="'+d.icon+'"></i> '
+ d.label);
$list = $('<ul class="list-group">').appendTo($content);
var $list = $('<ul class="list-group">').appendTo($content);
} else {
var $content = $("#" + d._label);
var $list = $content.find(".list-group");
}
// add items
@@ -69,14 +72,14 @@ wn.setup = {
$list_item = $($r('<li class="list-group-item">\
<div class="row">\
<div class="col-xs-4"><a><i class="%(icon)s"></i> %(label)s</a></div>\
<div class="col-xs-4"><a><i class="%(icon)s icon-fixed-width"></i> %(label)s</a></div>\
<div class="col-xs-8 text-muted">%(description)s</div>\
</div>\
</li>', item)).appendTo($list);
$list_item.find("a")
.attr("data-type", item.type)
.attr("data-name", item.name)
.attr("data-name", item.link || item.name)
.on("click", function() {
if($(this).attr("data-type")==="doctype") {
wn.set_route("List", $(this).attr("data-name"))


Loading…
Cancel
Save