moved directory structure

This commit is contained in:
Rushabh Mehta
2012-09-24 19:13:42 +05:30
parent e47a6779e9
commit 2fa2f7178d
1637 changed files with 47 additions and 11450 deletions

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,14 @@
<div class="layout-wrapper">
<a class="close" onclick="window.history.back();">&times;</a>
<h1>Modules Setup</h1>
<hr>
<div class="help" style="width: 300px; float: right">
Select checkbox to show / hide module. Drag around to move order.
</div>
<div id="modules-list">
</div>
<div>
<button class="btn btn-small btn-primary" id="modules-update"
onclick="wn.pages.modules_setup.update()">Update</button>
</div>
</div>

View File

@@ -0,0 +1,54 @@
wn.require('lib/js/lib/jquery/jquery.ui.sortable.js');
$.extend(wn.pages.modules_setup, {
modules: ['Activity', 'Accounts', 'Selling', 'Buying', 'Stock', 'Production', 'Projects',
'Support', 'HR', 'Website', 'To Do', 'Messages', 'Calendar', 'Knowledge Base'],
onload: function(wrapper) {
wn.pages.modules_setup.refresh_page(wn.boot.modules_list);
},
refresh_page: function(ml) {
$('#modules-list').empty();
// Hide Setup and Dashboard modules
ml.indexOf('Setup')!=-1 && ml.splice(ml.indexOf('Setup'), 1);
ml.indexOf('Dashboard')!=-1 && ml.splice(ml.indexOf('Dashboard'), 1);
// checked modules
for(i in ml) {
$('#modules-list').append(repl('<p style="cursor:move;">\
<input type="checkbox" data-module="%(m)s"> \
%(m)s</p>', {m:ml[i]}));
}
$('#modules-list [data-module]').attr('checked', true);
// unchecked modules
var all = wn.pages.modules_setup.modules;
for(i in all) {
if(!$('#modules-list [data-module="'+all[i]+'"]').length) {
$('#modules-list').append(repl('<p style="cursor:move;">\
<input type="checkbox" data-module="%(m)s"> \
%(m)s</p>', {m:all[i]}));
}
}
$('#modules-list').sortable();
},
update: function() {
var ml = [];
$('#modules-list [data-module]').each(function() {
if($(this).attr('checked'))
ml.push($(this).attr('data-module'));
});
wn.call({
method: 'setup.page.modules_setup.modules_setup.update',
args: {
ml: JSON.stringify(ml)
},
callback: function(r) {
},
btn: $('#modules-update').get(0)
});
}
});

View File

@@ -0,0 +1,9 @@
from __future__ import unicode_literals
import webnotes
@webnotes.whitelist()
def update(arg=None):
"""update modules"""
webnotes.conn.set_global('modules_list', webnotes.form_dict['ml'])
webnotes.msgprint('Updated')
webnotes.clear_cache()

View File

@@ -0,0 +1,28 @@
# Page, modules_setup
[
# These values are common in all dictionaries
{
'creation': '2012-02-28 17:48:39',
'docstatus': 0,
'modified': '2012-02-28 17:48:39',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all Page
{
'doctype': 'Page',
'module': u'Setup',
'name': '__common__',
'page_name': u'modules_setup',
'standard': u'Yes',
'title': u'Modules Setup'
},
# Page, modules_setup
{
'doctype': 'Page',
'name': u'modules_setup'
}
]