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