Merge branch 'handlerupdate' of github.com:webnotes/wnframework into handlerupdate
This commit is contained in:
commit
67e2cc1ea9
2 changed files with 4 additions and 4 deletions
4
js/core.min.js
vendored
4
js/core.min.js
vendored
|
|
@ -279,8 +279,8 @@ $(parent).html(repl('<span class="bar-outer" style="width: 30px; float: right" \
|
|||
style="width: %(percent)s%;"></span>\
|
||||
</span>',args));}
|
||||
else if(data[opts.content]){$(parent).append(' '+data[opts.content]);}},render:function(row,data){var me=this;this.prepare_data(data);rowhtml='';$.each(this.columns,function(i,v){rowhtml+=repl('<td style="width: %(width)s"></td>',v);});var tr=$(row).html('<table><tbody><tr>'+rowhtml+'</tr></tbody></table>').find('tr').get(0);$.each(this.columns,function(i,v){me.render_column(data,tr.cells[i],v);});},prepare_data:function(data){data.fullname=wn.user_info(data.owner).fullname;data.avatar=wn.user_info(data.owner).image;data.when=dateutil.str_to_user(data.modified).split(' ')[0];var diff=dateutil.get_diff(dateutil.get_today(),data.modified.split(' ')[0]);if(diff==0){data.when='Today'}
|
||||
if(diff==-1){data.when='Yesterday'}
|
||||
if(diff==-2){data.when='2 days ago'}
|
||||
if(diff==1){data.when='Yesterday'}
|
||||
if(diff==2){data.when='2 days ago'}
|
||||
if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';data.docstatus_title='Editable';}else if(data.docstatus==1){data.docstatus_icon='icon-lock';data.docstatus_title='Submitted';}else if(data.docstatus==2){data.docstatus_icon='icon-remove';data.docstatus_title='Cancelled';}},add_user_tags:function(parent,data){var me=this;if(data._user_tags){$.each(data._user_tags.split(','),function(i,t){if(t){$('<span class="label label-info" style="cursor: pointer">'
|
||||
+strip(t)+'</span>').click(function(){me.doclistview.set_filter('_user_tags',$(this).text())}).appendTo(parent);}});}}})
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -399,10 +399,10 @@ wn.views.ListView = Class.extend({
|
|||
if(diff==0) {
|
||||
data.when = 'Today'
|
||||
}
|
||||
if(diff == -1) {
|
||||
if(diff == 1) {
|
||||
data.when = 'Yesterday'
|
||||
}
|
||||
if(diff == -2) {
|
||||
if(diff == 2) {
|
||||
data.when = '2 days ago'
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue