<commit_before>class ClassroomClassesView extends JView

  constructor: (options = {}, data) ->

    options.cssClass = "user-classes-view"

    super options, data

    @createElements()
    @createClasses()

  createClasses: ->
    @thumbViews = []

    if @getData().enrolled
      for enrolled in @getData().enrolled
        @createThumbView @enrolledContainer, "enrolled", enrolled

    if @getData().related
      for related in @getData().related
        @createThumbView @relatedContainer, "related", related

  createThumbView: (container, type, data) ->
    {cdnRoot} = @getDelegate()
    thumbView = new ClassroomClassThumbView { cdnRoot, type }, data
    container.addSubView thumbView
    @thumbViews.push thumbView

  createElements: ->
    @enrolledContainer = new KDCustomHTMLView
      cssClass         : "enrolled-clases classes"
      partial          : """<p class="title">Your Classes</p>"""

    @noEnrolledClass   = new KDCustomHTMLView
      tagName          : "p"
      cssClass         : "no-enrolled-class hidden"
      partial          : "You didn't start a class. Enroll now!"

    @relatedContainer  = new KDCustomHTMLView
      cssClass         : "related-clases classes"
      partial          : """<p class="title">Related Classes</p>"""

    @noRelatedClass    = new KDCustomHTMLView
      tagName          : "p"
      cssClass         : "no-related-class hidden"
      partial          : "Currently there is no related class with your enrolled classes."

    @enrolledContainer.addSubView @noEnrolledClass
    @relatedContainer.addSubView  @noRelatedClass

    @noRelatedClass.show()   unless @getData().related
    @noEnrolledClass.show()  unless @getData().enrolled

  pistachio: ->
    """
      {{> @enrolledContainer}}
      {{> @relatedContainer}}
    """<commit_msg>Classroom: Showing a loader view until class manifest fetched and parsed.<commit_after>class ClassroomClassesView extends JView

  constructor: (options = {}, data) ->

    options.cssClass = "user-classes-view"

    super options, data

    @createElements()
    @createClasses()

  createClasses: ->
    @thumbViews = []

    if @getData().enrolled
      for enrolled in @getData().enrolled
        @createThumbView @enrolledContainer, "enrolled", enrolled

    if @getData().related
      for related in @getData().related
        @createThumbView @relatedContainer, "related", related

  createThumbView: (container, type, data) ->
    {cdnRoot} = @getDelegate()
    thumbView = new ClassroomClassThumbView { cdnRoot, type }, data
    container.addSubView thumbView
    @thumbViews.push thumbView

  createElements: ->
    @enrolledContainer = new KDCustomHTMLView
      cssClass         : "enrolled-clases classes"
      partial          : """<p class="title">Your Classes</p>"""

    @noEnrolledClass   = new KDCustomHTMLView
      tagName          : "p"
      cssClass         : "no-enrolled-class hidden"
      partial          : "You didn't start a class. Enroll now!"

    @relatedContainer  = new KDCustomHTMLView
      cssClass         : "related-clases classes"
      partial          : """<p class="title">Related Classes</p>"""

    @noRelatedClass    = new KDCustomHTMLView
      tagName          : "p"
      cssClass         : "no-related-class hidden"
      partial          : "Currently there is no related class with your enrolled classes."

    @enrolledContainer.addSubView @noEnrolledClass
    @relatedContainer.addSubView  @noRelatedClass

    @noRelatedClass.show()   unless @getData().related
    @noEnrolledClass.show()  unless @getData().enrolled

  viewAppended: ->
    super
    thumbView.loader.show() for thumbView in @thumbViews

  pistachio: ->
    """
      {{> @enrolledContainer}}
      {{> @relatedContainer}}
    """
{'fraction_non_alphanumeric': 0.10842412968376296, 'fraction_numerical': 0.0, 'mean_word_length': 2.734126984126984, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5221684', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1050, 'n_words': 259}