<commit_before>Backbone = require 'backbone'
{ map, take } = require 'underscore'
{ API_URL } = require('sharify').data
Q = require 'bluebird-q'
Artist = require '../../../../models/artist.coffee'
Artists = require '../../../../collections/artists.coffee'
Items = require '../../../../collections/items.coffee'
initCarousel = require '../../../../components/merry_go_round/horizontal_nav_mgr.coffee'
SearchArtistsView = require './search_artists_view.coffee'
FollowedArtistsView = require './followed_artists_view.coffee'
template = -> require('./templates/index.jade') arguments...

module.exports = class FollowedArtistsRailView extends Backbone.View
  subViews: []

  initialize: ({ @module, @$el }) ->
    # no op

  render: ->
    artists = new Backbone.Collection @module.context.artists

    @$el.html template
      artworks: @module.results
      counts: @module.context.counts
      artists: artists.models
      imageHeight: '220px'

    @_postRender()

  _postRender: ->
    return @_renderEmptyView() if @module.context.counts.artists < 1
    initCarousel @$('.js-my-carousel'),
      imagesLoaded: true
      wrapAround: false
    , (carousel) =>
      @trigger 'post-render'
      @carousel = carousel

      # Hide arrows if the cells don't fill the carousel width
      @cellWidth = @$('.js-mgr-cell')
        .map (i, e) -> $(e).outerWidth true
        .get()
        .reduce (prev, curr) -> prev + curr

      unless @cellWidth > @$('.js-my-carousel').width()
        @$('.mgr-navigation').addClass 'is-hidden'

  _renderEmptyView: ->
    # pre-populate search with featured artists
    featuredArtists = new Items [], id: '523089cd139b214d46000568', item_type: 'FeaturedLink'
    # empty collection to pass along to keep track of new follows
    followedArtists = new Artists []<commit_msg>Remove images loaded from followed artists rail<commit_after>Backbone = require 'backbone'
{ map, take } = require 'underscore'
{ API_URL } = require('sharify').data
Q = require 'bluebird-q'
Artist = require '../../../../models/artist.coffee'
Artists = require '../../../../collections/artists.coffee'
Items = require '../../../../collections/items.coffee'
initCarousel = require '../../../../components/merry_go_round/horizontal_nav_mgr.coffee'
SearchArtistsView = require './search_artists_view.coffee'
FollowedArtistsView = require './followed_artists_view.coffee'
template = -> require('./templates/index.jade') arguments...

module.exports = class FollowedArtistsRailView extends Backbone.View
  subViews: []

  initialize: ({ @module, @$el }) ->
    # no op

  render: ->
    artists = new Backbone.Collection @module.context.artists

    @$el.html template
      artworks: @module.results
      counts: @module.context.counts
      artists: artists.models
      imageHeight: '220px'

    @_postRender()

  _postRender: ->
    return @_renderEmptyView() if @module.context.counts.artists < 1
    initCarousel @$('.js-my-carousel'),
      imagesLoaded: false
      wrapAround: false
    , (carousel) =>
      @trigger 'post-render'
      @carousel = carousel

      # Hide arrows if the cells don't fill the carousel width
      @cellWidth = @$('.js-mgr-cell')
        .map (i, e) -> $(e).outerWidth true
        .get()
        .reduce (prev, curr) -> prev + curr

      unless @cellWidth > @$('.js-my-carousel').width()
        @$('.mgr-navigation').addClass 'is-hidden'

  _renderEmptyView: ->
    # pre-populate search with featured artists
    featuredArtists = new Items [], id: '<KEY>', item_type: 'FeaturedLink'
    # empty collection to pass along to keep track of new follows
    followedArtists = new Artists []
{'fraction_non_alphanumeric': 0.15236523652365236, 'fraction_numerical': 0.007700770077007701, 'mean_word_length': 3.045606229143493, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 22, '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': '3865515', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1113, 'n_words': 270}