Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     <Datatable
  2.       url="/activity/ajax"
  3.       order={[[1, "desc"]]}
  4.       staticFilterParameters={{
  5.         referenceType:  this.props.referenceType,
  6.         referenceId:    this.props.referenceId,
  7.         usersOnly:      `${ !!this.props.usersOnly }`,
  8.       }}
  9.     >
  10.       <Column
  11.         title=""
  12.         data="avatarImgUrl"
  13.         orderable={false}
  14.         RenderComponent={({ data }) => <img alt="image" className="img-circle" src={data} style={{
  15.           width:   48,
  16.           height:  48,
  17.         }} />}
  18.       />
  19.  
  20.       {/**
  21.         * A bit of a cheat. The render is a complex layout with multiple pieces
  22.         * of data, but we only need to be able to order on timestamp. Simple
  23.         * solution is use timestamp as the primary column data and handle the
  24.         * rest in the render function
  25.         */}
  26.       <Column
  27.         title=""
  28.         data="timestamp"
  29.         RenderComponent={({ row }) => <span>
  30.           <small className="pull-right">{row.occurredAgo}</small>
  31.           <strong>{row.userName}</strong>{" "}
  32.           {row.summary}{" "}
  33.  
  34.           {do{ if (this.props.includeReferences) {
  35.             if (row.referenceTypeSingular) {
  36.               if(row.referenceDetails) {
  37.                 ["for ", row.referenceTypeSingular, " ", <a href={row.referenceDetails}>{row.referenceLabel}</a>]
  38.               } else {
  39.                 ["for ", row.referenceLabel]
  40.               }
  41.             }
  42.           }}}
  43.           <br />
  44.  
  45.           <small className="text-muted">{dateUtils.shortFormat(new Date(row.timestamp))}</small>
  46.  
  47.           {do{ if (row.details) {
  48.             <div className="well">{React.nl2br(row.details)}</div>
  49.           }}}
  50.         </span>}
  51.       />
  52.  
  53.       {this.props.children}
  54.     </Datatable>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement