mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 20:29:09 +00:00
[ux] fixed primary action
This commit is contained in:
committed by
Anand Doshi
parent
d91cefb23d
commit
995185d02d
@@ -8,7 +8,7 @@ frappe.pages['activity'].onload = function(wrapper) {
|
||||
single_column: true
|
||||
})
|
||||
wrapper.appframe.add_module_icon("Activity");
|
||||
|
||||
|
||||
var list = new frappe.ui.Listing({
|
||||
hide_refresh: true,
|
||||
appframe: wrapper.appframe,
|
||||
@@ -21,12 +21,12 @@ frappe.pages['activity'].onload = function(wrapper) {
|
||||
list.run();
|
||||
|
||||
wrapper.appframe.set_title_right("Refresh", function() { list.run(); });
|
||||
|
||||
|
||||
// Build Report Button
|
||||
if(frappe.boot.user.can_get_report.indexOf("Feed")!=-1) {
|
||||
wrapper.appframe.add_primary_action(__('Build Report'), function() {
|
||||
frappe.set_route('Report', "Feed");
|
||||
}, 'icon-th')
|
||||
}, 'icon-th', true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,23 +44,23 @@ erpnext.ActivityFeed = Class.extend({
|
||||
scrub_data: function(data) {
|
||||
data.by = frappe.user_info(data.owner).fullname;
|
||||
data.imgsrc = frappe.utils.get_file_link(frappe.user_info(data.owner).image);
|
||||
|
||||
|
||||
// feedtype
|
||||
if(!data.feed_type) {
|
||||
data.feed_type = __(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-danger";
|
||||
}
|
||||
|
||||
|
||||
if(data.feed_type=='Assignment') {
|
||||
data.add_class = "label-warning";
|
||||
}
|
||||
|
||||
|
||||
// link
|
||||
if(data.doc_name && data.feed_type!='Login') {
|
||||
data.link = frappe.format(data.doc_name, {"fieldtype":"Link", "options":data.doc_type})
|
||||
@@ -71,7 +71,7 @@ erpnext.ActivityFeed = Class.extend({
|
||||
add_date_separator: function(row, data) {
|
||||
var date = dateutil.str_to_obj(data.modified);
|
||||
var last = erpnext.last_feed_date;
|
||||
|
||||
|
||||
if((last && dateutil.obj_to_str(last) != dateutil.obj_to_str(date)) || (!last)) {
|
||||
var diff = dateutil.get_day_diff(dateutil.get_today(), dateutil.obj_to_str(date));
|
||||
if(diff < 1) {
|
||||
@@ -85,4 +85,4 @@ erpnext.ActivityFeed = Class.extend({
|
||||
}
|
||||
erpnext.last_feed_date = date;
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user