Sha256: 8b55eebcc976ef0f9e58fadb296c30ede4e5ce97bbac728568f1b83071274ad5

Contents?: true

Size: 666 Bytes

Versions: 1

Compression:

Stored size: 666 Bytes

Contents

# Feature types
#
class FeatureType
  @PROOFREAD_BY_EDITOR: 1
  @WRITER_SAMPLE_VIEW: 2
  @URGENT_WRITER_ASSIGN: 3
  @SPECIALIST_TYPE: 4
  @PAGE_SUMMARY: 5
  @LANGUAGE_STYLE: 6

  @ORIGINALITY_REPORT: 7
  @WRITER_LEVEL: 8
  @CUSTOMER_SERVICE: 9

  @DRAFT_WORK: 11
  @PREFFERED_WRITER: 12

  @filter: (features, type_id, index) ->
    _index = if index? then parseInt(index, 10) else 0
    _index = 0 if _index < 0 || _index > 2

    _records = features?.filter (x) ->
      x.feature_type_id == type_id

    if _records?.length > 0
      _records[_index]
    else
      null


angular.module('EssayApp.services').factory('FeatureType', [() ->
  return FeatureType
])

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
translation_cms-0.1.5 app/assets/javascripts/app/services/feature_type.js.coffee