added activity page
diff --git a/erpnext/home/page/activity/__init__.py b/erpnext/home/page/activity/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/home/page/activity/__init__.py
diff --git a/erpnext/home/page/activity/activity.css b/erpnext/home/page/activity/activity.css
new file mode 100644
index 0000000..f3988b2
--- /dev/null
+++ b/erpnext/home/page/activity/activity.css
@@ -0,0 +1,23 @@
+#activity-list .label {
+ display: inline-block;
+ width: 100px;
+ margin-right: 7px;
+}
+
+#activity-list .label-info {
+ cursor: pointer;
+}
+
+#activity-list .user-info {
+ float: right;
+ color: #777;
+ font-size: 10px;
+}
+
+#activity-list .date-sep {
+ margin-bottom: 11px;
+ padding: 5px 0px;
+ border-bottom: 1px solid #aaa;
+ color: #555;
+ font-size: 10px;
+}
\ No newline at end of file
diff --git a/erpnext/home/page/activity/activity.html b/erpnext/home/page/activity/activity.html
new file mode 100644
index 0000000..b348d95
--- /dev/null
+++ b/erpnext/home/page/activity/activity.html
@@ -0,0 +1,6 @@
+<div class="layout-wrapper">
+ <a class="close" onclick="window.history.back();">×</a>
+ <h1>Activity</h1>
+ <div id="activity-list">
+ </div>
+</div>
\ No newline at end of file
diff --git a/erpnext/home/page/activity/activity.js b/erpnext/home/page/activity/activity.js
new file mode 100644
index 0000000..77e4ab9
--- /dev/null
+++ b/erpnext/home/page/activity/activity.js
@@ -0,0 +1,57 @@
+wn.pages['activity'].onload = function(wrapper) {
+ var list = new wn.widgets.Listing({
+ method: 'home.page.activity.activity.get_feed',
+ parent: $('#activity-list'),
+ render_row: function(row, data) {
+ new erpnext.ActivityFeed(row, data);
+ }
+ });
+ list.run();
+}
+
+erpnext.last_feed_date = false;
+erpnext.ActivityFeed = Class.extend({
+ init: function(row, data) {
+ this.scrub_data(data);
+ this.add_date_separator(row, data);
+ $(row).append(repl('<span %(onclick)s\
+ class="label %(add_class)s">%(feed_type)s</span>\
+ %(link)s %(subject)s <span class="user-info">%(by)s</span>', data));
+ },
+ scrub_data: function(data) {
+ data.by = wn.boot.user_fullnames[data.owner];
+
+ // feedtype
+ if(!data.feed_type) {
+ data.feed_type = get_doctype_label(data.doc_type);
+ data.add_class = "label-info";
+ data.onclick = repl('onclick="window.location.href=\'#!List/%(feed_type)s\';"', data)
+ }
+
+ // color for comment
+ if(data.feed_type=='Comment') {
+ data.add_class = "label-important";
+ }
+
+ // link
+ if(data.doc_name && data.feed_type!='Login') {
+ data.link = repl('<a href="#!Form/%(doc_type)s/%(doc_name)s">%(doc_name)s</a>', data)
+ }
+ },
+ add_date_separator: function(row, data) {
+ var date = dateutil.str_to_obj(data.modified);
+ var last = erpnext.last_feed_date;
+
+ if((last && dateutil.get_diff(last, date)>1) || (!last)) {
+ var pdate = dateutil.comment_when(date);
+ var diff = dateutil.get_diff(new Date(), date);
+ if(diff < 1) {
+ pdate = 'Today';
+ } else if(diff > 6) {
+ pdate = dateutil.global_date_format(date);
+ }
+ $(row).html(repl('<div class="date-sep">%(date)s</div>', {date: pdate}));
+ }
+ erpnext.last_feed_date = date;
+ }
+})
\ No newline at end of file
diff --git a/erpnext/home/page/activity/activity.py b/erpnext/home/page/activity/activity.py
new file mode 100644
index 0000000..8b8faf3
--- /dev/null
+++ b/erpnext/home/page/activity/activity.py
@@ -0,0 +1,16 @@
+import webnotes
+
+@webnotes.whitelist()
+def get_feed(arg=None):
+ """get feed"""
+ return webnotes.conn.sql("""select
+ distinct t1.name, t1.feed_type, t1.doc_type, t1.doc_name, t1.subject, t1.owner,
+ t1.modified
+ from tabFeed t1, tabDocPerm t2
+ where t1.doc_type = t2.parent
+ and t2.role in ('%s')
+ and ifnull(t2.`read`,0) = 1
+ order by t1.modified desc
+ limit %s, %s""" % ("','".join(webnotes.get_roles()),
+ webnotes.form_dict['limit_start'], webnotes.form_dict['limit_page_length']),
+ as_dict=1)
\ No newline at end of file
diff --git a/erpnext/home/page/activity/activity.txt b/erpnext/home/page/activity/activity.txt
new file mode 100644
index 0000000..e7f3963
--- /dev/null
+++ b/erpnext/home/page/activity/activity.txt
@@ -0,0 +1,28 @@
+# Page, activity
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-02-29 11:59:13',
+ 'docstatus': 0,
+ 'modified': '2012-02-29 12:11:46',
+ 'modified_by': u'Administrator',
+ 'owner': u'Administrator'
+ },
+
+ # These values are common for all Page
+ {
+ 'doctype': 'Page',
+ 'module': u'Home',
+ 'name': '__common__',
+ 'page_name': u'activity',
+ 'standard': u'Yes',
+ 'title': u'Activity'
+ },
+
+ # Page, activity
+ {
+ 'doctype': 'Page',
+ 'name': u'activity'
+ }
+]
\ No newline at end of file
diff --git a/erpnext/home/page/desktop/desktop.js b/erpnext/home/page/desktop/desktop.js
index 63a075c..3aa9049 100644
--- a/erpnext/home/page/desktop/desktop.js
+++ b/erpnext/home/page/desktop/desktop.js
@@ -3,12 +3,12 @@
erpnext.desktop.gradient = "<style>\
.case-%(name)s {\
background: %(start)s; /* Old browsers */\
- background: -moz-radial-gradient(center, ellipse cover, %(start)s 0%, %(middle)s 44%, %(end)s 100%); /* FF3.6+ */\
- background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,%(start)s), color-stop(44%,%(middle)s), color-stop(100%,%(end)s)); /* Chrome,Safari4+ */\
- background: -webkit-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* Chrome10+,Safari5.1+ */\
- background: -o-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* Opera 12+ */\
- background: -ms-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* IE10+ */\
- background: radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* W3C */\
+ background: -moz-radial-gradient(center, ellipse cover, %(start)s 0%%, %(middle)s 44%%, %(end)s 100%%); /* FF3.6+ */\
+ background: -webkit-gradient(radial, center center, 0px, center center, 100%%, color-stop(0%%,%(start)s), color-stop(44%%,%(middle)s), color-stop(100%%,%(end)s)); /* Chrome,Safari4+ */\
+ background: -webkit-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* Chrome10+,Safari5.1+ */\
+ background: -o-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* Opera 12+ */\
+ background: -ms-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* IE10+ */\
+ background: radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* W3C */\
}\
</style>"
@@ -79,7 +79,7 @@
for(var i in wn.boot.modules_list) {
var m = wn.boot.modules_list[i];
- if(m!='Setup');
+ if(m!='Setup')
add_icon(m);
}
diff --git a/erpnext/home/page/event_updates/complete_registration.js b/erpnext/home/page/event_updates/complete_registration.js
deleted file mode 100644
index 8f7eed3..0000000
--- a/erpnext/home/page/event_updates/complete_registration.js
+++ /dev/null
@@ -1,124 +0,0 @@
-// ERPNext - web based ERP (http://erpnext.com)
-// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-// complete my company registration
-// --------------------------------
-pscript.complete_registration = function(is_complete, profile) {
- if(is_complete == 'No'){
- var d = new Dialog(400, 200, "Setup your Account");
- if(user != 'Administrator'){
- d.no_cancel(); // Hide close image
- $('header').toggle(false);
- }
-
- d.make_body([
- ['HTML', 'Your Profile Details', '<h4>Your Profile Details</h4>'],
- ['Data', 'First Name'],
- ['Data', 'Last Name'],
- ['HTML', 'Company Details', '<h4>Create your first company</h4>'],
- ['Data','Company Name','Example: Your Company LLC'],
- ['Data','Company Abbreviation', 'Example: YC (all your acconts will have this as a suffix)'],
- ['Select','Fiscal Year Start Date'],
- ['Select','Default Currency'],
- ['Button','Save'],
- ]);
-
- // if company name is set, set the input value
- // and disable it
- if(wn.control_panel.company_name) {
- d.widgets['Company Name'].value = wn.control_panel.company_name;
- d.widgets['Company Name'].disabled = 1;
- }
-
- if(profile && profile.length>0) {
- if(profile[0].first_name && profile[0].first_name!='None') {
- d.widgets['First Name'].value = profile[0].first_name;
- }
-
- if(profile[0].last_name && profile[0].last_name!='None') {
- d.widgets['Last Name'].value = profile[0].last_name;
- }
- }
-
-
- //d.widgets['Save'].disabled = true; // disable Save button
- pscript.make_dialog_field(d);
-
- // submit details
- d.widgets['Save'].onclick = function()
- {
- d.widgets['Save'].set_working();
-
- flag = pscript.validate_fields(d);
- if(flag)
- {
- var args = [
- d.widgets['Company Name'].value,
- d.widgets['Company Abbreviation'].value,
- d.widgets['Fiscal Year Start Date'].value,
- d.widgets['Default Currency'].value,
- d.widgets['First Name'].value,
- d.widgets['Last Name'].value
- ];
-
- $c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){
- sys_defaults = r.message;
- user_fullname = r.message.user_fullname;
- d.hide();
- $('header').toggle(true);
- page_body.wntoolbar.set_user_name();
- });
- } else {
- d.widgets['Save'].done_working();
- }
- }
- d.show();
- }
-}
-
-// make dialog fields
-// ------------------
-pscript.make_dialog_field = function(d)
-{
- // fiscal year format
- fisc_format = d.widgets['Fiscal Year Start Date'];
- add_sel_options(fisc_format, ['', '1st Jan', '1st Apr', '1st Jul', '1st Oct']);
-
- // default currency
- currency_list = ['', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BYR', 'BZD', 'CAD', 'CDF', 'CFA', 'CFP', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ERN', 'ETB', 'EUR', 'EURO', 'FJD', 'FKP', 'FMG', 'GBP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GQE', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZM', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NRs', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RMB', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SCR', 'SDG', 'SDR', 'SEK', 'SGD', 'SHP', 'SOS', 'SRD', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TRY', 'TTD', 'TWD', 'TZS', 'UAE', 'UAH', 'UGX', 'USD', 'USh', 'UYU', 'UZS', 'VEB', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XDR', 'XOF', 'XPF', 'YEN', 'YER', 'YTL', 'ZAR', 'ZMK', 'ZWR'];
- currency = d.widgets['Default Currency'];
- add_sel_options(currency, currency_list);
-}
-
-
-// validate fields
-// ---------------
-pscript.validate_fields = function(d)
-{
- var lst = ['First Name', 'Company Name', 'Company Abbreviation', 'Fiscal Year Start Date', 'Default Currency'];
- var msg = 'Please enter the following fields';
- var flag = 1;
- for(var i=0; i<lst.length; i++)
- {
- if(!d.widgets[lst[i]].value || d.widgets[lst[i]].value=='None'){
- flag = 0;
- msg = msg + NEWLINE + lst[i];
- }
- }
-
- if(!flag) alert(msg);
- return flag;
-}