Sha256: 3ad41abe57c2a7e2492d077048b69e5617809dac811ee990d1b2bb44ddb65ec3

Contents?: true

Size: 1.74 KB

Versions: 3

Compression:

Stored size: 1.74 KB

Contents

class Change extends Lanes.React.Component

    renderField: (field) ->
        unless _.isObject(field.from)
            from = <div className="from">{field.from}</div>
        unless _.isObject(field.to)
            to = <div className='to'>{field.to}</div>

        <div className='change' key={field.name}>
            <div className="field">{@model.record_name} {_.field2title field.name}:</div>
            {from}
            {to}
        </div>

    render: ->
        user =
            if @model.by?.email
                <a href={"mailto:#{@model.by.email}"}>{@model.by.name}</a>
            else if @model?.by.name
                <span>@model.by.name</span>
            else
                <span>Unknown User</span>

        <div className="update">
            <div className="header">
                {user}
                <span className="time">{Lanes.Vendor.Moment( @model.created_at ).fromNow()}</span>
            </div>
            <div className="changes">
                {@renderField(change) for change in @model.displayed_changes }
            </div>
        </div>

class Lanes.Components.Toolbar.RemoteChangeSets extends Lanes.React.Component

    propTypes:
        model: Lanes.PropTypes.State

    render: ->
        return null unless @model?.changes
        title = <span>
            <i className="icon icon-cloud-download icon-lg" />
            <LC.CountBadge superScript count={@model.changes.length} />
        </span>
        <BS.Nav navbar pullRight className="changes-notification">
          <BS.DropdownButton id="record-changes" title={title}>
              <div className="scroller">
                  {@model.changes.map (ch) -> <Change key={ch.cid} model={ch} />}
              </div>
          </BS.DropdownButton>
        </BS.Nav>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lanes-0.5.6 client/lanes/components/toolbar/RemoteChangeSets.cjsx
lanes-0.5.5 client/lanes/components/toolbar/RemoteChangeSets.cjsx
lanes-0.5.0 client/lanes/components/toolbar/RemoteChangeSets.cjsx