Sha256: 1b13e47e3f4f431f434e8a9471cfe41f872eb223a57fef2a04f25021eb9d46d1

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

# Feature types
#
class ComponentType
  @SUBJECT_AREA: 1
  @TOPIC: 2
  @DESCRIPTION: 3
  @FORMAT: 4
  @REFERENCES: 5
  @ACADEMIC_LEVEL: 6

  @SPACING: 7
  @PAGES_COUNT: 8
  @ADDITIONAL_MATERIALS: 9
  @LANGUAGE_STYLE: 10
  @PROOFREAD: 11
  @PAGE_SUMMARY: 12
  @ORIGINALITY_REPORT: 13

  @FIELDS: [
    { id: @ACADEMIC_LEVEL, name: "academic_level", recall: "getAcademicLevels" },
    { id: @FORMAT, name: "paper_format", recall: "getPaperFormat" },
    { id: @SPACING, name: "line_spacing", recall: "getLineSpacing" },
    { id: @TOPIC, name: "order_topic" },
    { id: @DESCRIPTION, name: "order_description" }
    # { id: 1, name: "skill" }
  ]

  @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('ComponentType', [() -> 
  return ComponentType
])

Version data entries

1 entries across 1 versions & 1 rubygems

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