<commit_before>define (require) ->
  settings = require('settings')
  BaseView = require('cs!helpers/backbone/views/base')
  template = require('hbs!./latest-template')
  require('less!./latest')

  return class LatestView extends BaseView
    template: template
    templateHelpers:
      url: () ->
        id = @model.get('id').split('@', 1)[0] # Remove the version from the id
        return "#{settings.root}contents/#{id}"

    initialize: () ->
      super()
      @listenTo(@model, 'change:isLatest', @render)<commit_msg>Stay on the same page when loading latest version<commit_after>define (require) ->
  settings = require('settings')
  BaseView = require('cs!helpers/backbone/views/base')
  template = require('hbs!./latest-template')
  require('less!./latest')

  return class LatestView extends BaseView
    template: template
    templateHelpers:
      url: () ->
        page = ''
        id = @model.getUuid()

        if @model.isBook()
          page = ":#{@model.getPageNumber()}"

        return "#{settings.root}contents/#{id}#{page}"

    initialize: () ->
      super()
      @listenTo(@model, 'change:isLatest', @render)
{'fraction_non_alphanumeric': 0.16171328671328672, 'fraction_numerical': 0.0017482517482517483, 'mean_word_length': 3.240740740740741, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 9, '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': '1077015', 'n_tokens_mistral': 345, 'n_tokens_neox': 341, 'n_words': 73}