<commit_before>_                         = require 'underscore'
Backbone                  = require 'backbone'
mediator                  = require '../../../lib/mediator.coffee'
CurrentUser               = require '../../../models/current_user.coffee'
FeatureRouter             = require './router.coffee'
SaleArtworkView           = require '../../../components/artwork_item/views/sale_artwork.coffee'
AuctionClockView          = require '../../../components/auction_clock/view.coffee'
trackArtworkImpressions   = require('../../../components/analytics/impression_tracking.coffee').trackArtworkImpressions
Sale                      = require '../../../models/sale.coffee'
CurrentUser               = require '../../../models/current_user.coffee'

artworkColumns                  = -> require('../../../components/artwork_columns/template.jade') arguments...
setsTemplate                    = -> require('../templates/sets.jade') arguments...
artistsTemplate                 = -> require('../templates/artists.jade') arguments...
auctionRegisterButtonTemplate   = -> require('../templates/auction_register_button.jade') arguments...
auctionCountdownTemplate        = -> require('../templates/auction_countdown.jade') arguments...

module.exports = class FeatureView extends Backbone.View
  events:
    'click .auction-info-register-button .avant-garde-button' : 'triggerLoginPopup'

  initialize: (options) ->
    @handleTab options.tab if options.tab
    @setupCurrentUser()
    @model.fetchSets
      success: (sets) =>
        @sets = sets
        @$('#feature-sets-container').html setsTemplate(sets: sets)
        # If we have artworks, we have a sale or auction.
        if @$('.artwork-column').length > 0
          @initializeSale sets

  initializeSale: (sets) ->
    for set in sets
      if set.get('type') is 'auction artworks'
        @sale = new Sale @model.get('sale').toJSON()
        @initializeAuction @sale, set
      else if set.get('type') in ['sale artworks', 'sale auction']
        @setupArtworks(set)
<commit_msg>trigger dialog when clicking register to bid on feature page<commit_after>_                         = require 'underscore'
Backbone                  = require 'backbone'
mediator                  = require '../../../lib/mediator.coffee'
CurrentUser               = require '../../../models/current_user.coffee'
FeatureRouter             = require './router.coffee'
SaleArtworkView           = require '../../../components/artwork_item/views/sale_artwork.coffee'
AuctionClockView          = require '../../../components/auction_clock/view.coffee'
trackArtworkImpressions   = require('../../../components/analytics/impression_tracking.coffee').trackArtworkImpressions
Sale                      = require '../../../models/sale.coffee'
CurrentUser               = require '../../../models/current_user.coffee'

artworkColumns                  = -> require('../../../components/artwork_columns/template.jade') arguments...
setsTemplate                    = -> require('../templates/sets.jade') arguments...
artistsTemplate                 = -> require('../templates/artists.jade') arguments...
auctionRegisterButtonTemplate   = -> require('../templates/auction_register_button.jade') arguments...
auctionCountdownTemplate        = -> require('../templates/auction_countdown.jade') arguments...

module.exports = class FeatureView extends Backbone.View
  events:
    'click .auction-info-register-button .avant-garde-button-black' : 'triggerLoginPopup'

  initialize: (options) ->
    @handleTab options.tab if options.tab
    @setupCurrentUser()
    @model.fetchSets
      success: (sets) =>
        @sets = sets
        @$('#feature-sets-container').html setsTemplate(sets: sets)
        # If we have artworks, we have a sale or auction.
        if @$('.artwork-column').length > 0
          @initializeSale sets

  initializeSale: (sets) ->
    for set in sets
      if set.get('type') is 'auction artworks'
        @sale = new Sale @model.get('sale').toJSON()
        @initializeAuction @sale, set
      else if set.get('type') in ['sale artworks', 'sale auction']
        @setupArtworks(set)

{'fraction_non_alphanumeric': 0.14846209736013563, 'fraction_numerical': 0.0004843787842092516, 'mean_word_length': 2.317269076305221, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '4098752', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1099, 'n_words': 231}