<commit_before>unless global.jQuery?
    global.jQuery = require 'jquery'
require 'bootstrap/js/tooltip'
require 'bootstrap/js/dropdown'
require 'bootstrap/js/modal'
util = require './util'
ui = require './common-ui'
capitalize = require 'underscore.string/capitalize'
sprintf = require 'underscore.string/sprintf'
actionMenuTemplate = require './templates/action_menu'
actionsTemplate = require './templates/actions'
voidedModifierTemplate = require './templates/voided_modifier'
voidableModifierTemplate = require './templates/voidable_modifier'
modifierTemplate = require './templates/modifier'


render = (request) ->
    # Update the action menu
    $actionMenu = jQuery '#actionMenu'
    $actionMenu.empty()
    $actionMenu.append (actionMenuTemplate request)
    # Update action log
    $actions = jQuery '#actionList'
    $actions.empty()
    $actions.append (actionsTemplate request)
    # Update status badge
    $statusBadge = jQuery '#request-status'
    $statusBadge.removeClass \
        'label-warning label-info label-success label-danger'
    $statusBadge.addClass "label-#{ util.statusColor request.status }"
    $statusBadge.text (ui.i18n.gettext (capitalize request.status))
    # Update modifiers log
    if modifiers?
        modifiers = for modifier in request.modifiers
            if modifier.void
                voidedModifierTemplate modifier
            else if request.status == 'evaluating' and \
                    'approved' in request.valid_actions
                voidableModifierTemplate modifier
            else
                modifierTemplate modifier
        $modifierList = jQuery '#modifierList'
        $modifierList.empty()
        $modifierList.append modifiers
    # Update details and division
    (jQuery '#request-details').text request.details
    (jQuery '#request-division').text request.division.name
    # Update Payout
    $payout = jQuery '#request-payout'
    $payout.tooltip 'destroy'
    translated = ui.i18n.gettext "Base Payout: %(base_payout)s"<commit_msg>JS: Properly detect when modifiers are present<commit_after>unless global.jQuery?
    global.jQuery = require 'jquery'
require 'bootstrap/js/tooltip'
require 'bootstrap/js/dropdown'
require 'bootstrap/js/modal'
util = require './util'
ui = require './common-ui'
capitalize = require 'underscore.string/capitalize'
sprintf = require 'underscore.string/sprintf'
actionMenuTemplate = require './templates/action_menu'
actionsTemplate = require './templates/actions'
voidedModifierTemplate = require './templates/voided_modifier'
voidableModifierTemplate = require './templates/voidable_modifier'
modifierTemplate = require './templates/modifier'


render = (request) ->
    # Update the action menu
    $actionMenu = jQuery '#actionMenu'
    $actionMenu.empty()
    $actionMenu.append (actionMenuTemplate request)
    # Update action log
    $actions = jQuery '#actionList'
    $actions.empty()
    $actions.append (actionsTemplate request)
    # Update status badge
    $statusBadge = jQuery '#request-status'
    $statusBadge.removeClass \
        'label-warning label-info label-success label-danger'
    $statusBadge.addClass "label-#{ util.statusColor request.status }"
    $statusBadge.text (ui.i18n.gettext (capitalize request.status))
    # Update modifiers log
    if request.modifiers.length != 0
        modifiers = for modifier in request.modifiers
            if modifier.void
                voidedModifierTemplate modifier
            else if request.status == 'evaluating' and \
                    'approved' in request.valid_actions
                voidableModifierTemplate modifier
            else
                modifierTemplate modifier
        $modifierList = jQuery '#modifierList'
        $modifierList.empty()
        $modifierList.append modifiers
    # Update details and division
    (jQuery '#request-details').text request.details
    (jQuery '#request-division').text request.division.name
    # Update Payout
    $payout = jQuery '#request-payout'
    $payout.tooltip 'destroy'
    translated = ui.i18n.gettext "Base Payout: %(base_payout)s"
{'fraction_non_alphanumeric': 0.10019550342130987, 'fraction_numerical': 0.0021994134897360706, 'mean_word_length': 3.2948583420776494, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1760680', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1091, 'n_words': 276}