<commit_before>Controller = require './Controller'

RequestDeployStatus                 = require '../models/RequestDeployStatus'
#Task                   = require '../collections/Task'

DeployDetailView      = require '../views/deploy'
ExpandableTableSubview = require '../views/expandableTableSubview'
SimpleSubview          = require '../views/simpleSubview'

class DeployDetailController extends Controller

  templates:
    header:             require '../templates/deployDetail/deployHeader'
    info:               require '../templates/deployDetail/deployInfo'
    tasks:              require '../templates/deployDetail/deployTasks'

    initialize: ({@requestId, @deployId}) ->
      #
      # Data stuff
      #
      @models.deploy = new RequestDeployStatus
        deployId: @deployId
        requestId: @requestId

      @collections.deployTasks = new Tasks [],
        requestId: @requestId

      @collections.deployTasks = @collections.deployTasks.where({deployId: @deployId})

      #
      # Subviews
      #
      @subviews.header = new SimpleSubview
        model:      @models.deploy
        template:   @templates.header
      @subviews.info = new SimpleSubview
        model:      @models.deploy
        template:   @templates.info
      @subviews.tasks = new SimpleSubview
        model:      @collections.deployTasks
        template:   @templates.tasks


      #
      # Main view & stuff
      #
      @setView new DeployDetailView _.extend {@requestId, @deployId, @subviews},
        model: @models.deploy

      @refresh()

      app.showView @view

      refresh: ->
        requestFetch = @models.deploy.fetch()


        module.exports = DeployDetailController<commit_msg>Fix export<commit_after>Controller = require './Controller'

RequestDeployStatus                 = require '../models/RequestDeployStatus'
#Task                   = require '../collections/Task'

DeployDetailView      = require '../views/deploy'
ExpandableTableSubview = require '../views/expandableTableSubview'
SimpleSubview          = require '../views/simpleSubview'

class DeployDetailController extends Controller

  templates:
    header:             require '../templates/deployDetail/deployHeader'
    info:               require '../templates/deployDetail/deployInfo'
    #tasks:              require '../templates/deployDetail/deployTasks'

    initialize: ({@requestId, @deployId}) ->
      console.log('hi1')
      #
      # Data stuff
      #
      @models.deploy = new RequestDeployStatus
        deployId: @deployId
        requestId: @requestId

      #@collections.deployTasks = new Tasks [],
      #  requestId: @requestId

      #@collections.deployTasks = @collections.deployTasks.where({deployId: @deployId})

      #
      # Subviews
      #
      @subviews.header = new SimpleSubview
        model:      @models.deploy
        template:   @templates.header
      @subviews.info = new SimpleSubview
        model:      @models.deploy
        template:   @templates.info
      #@subviews.tasks = new SimpleSubview
      #  collection:      @collections.deployTasks
      #  template:   @templates.tasks


      #
      # Main view & stuff
      #
      @setView new DeployDetailView _.extend {@requestId, @deployId, @subviews},
        model: @models.deploy

      @refresh()

      app.showView @view

      refresh: ->
        requestFetch = @models.deploy.fetch()


module.exports = DeployDetailController
{'fraction_non_alphanumeric': 0.10366919044845661, 'fraction_numerical': 0.00029120559114735004, 'mean_word_length': 2.2344632768361583, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6264626', 'n_tokens_mistral': 956, 'n_tokens_neox': 886, 'n_words': 189}