<commit_before>const dao = require('../dao/dao')
const DateTime = require('dateutils').DateTime
const DateLocale = require('dateutils').DateLocale
const DateFormat = require('dateutils').DateFormat
const markupForDateRange = require('../markupForDateRange')
const headHtml = require('../head.html')
const filtersHtml = require('./filters.html')
const modalsHtml = require('./modals.html')
const scriptsHtml = require('./scripts.html')
const _ = require('lodash')
module.exports = {
    show: show
}

function show(req, res) {
    var refresh = req.query.refresh === 'true'
    res.write(`<!DOCTYPE html>
<html>`)
    res.write(headHtml())
    res.write(`<body>`)
    res.write(`<div class="reservationModal modal"></div>`)
    res.write(modalsHtml())
    res.write(`<div class="container reservations detail">`)
    res.write(filters())
    res.write(quickLinks())
    res.write(`<section class="" id="schedule">`)
    dao.freeCourts(new DateTime().toISODateString(), 3, refresh, (data) => {
        res.write(markupForDateRange(data, new DateTime()))
        res.write('</section></div>')
        res.write(scriptsHtml({
            isTest: global.isTest,
            refresh: refresh,
            serverDate: new DateTime().toISODateString()
        }))
        res.write('</body></html>')
        res.end()
    })
}

function filters() {
    return filtersHtml({
        places: [
            {id: 'meilahti', name: 'Meilahti'},
            {id: 'herttoniemi', name: 'Herttoniemi'},
            {id: 'kulosaari', name: 'Kulosaari'},
            {id: 'merihaka', name: 'Merihaka'},
            {id: 'taivallahti', name: 'Taivallahti'},
            {id: 'tapiola', name: 'Tapiola'},
            {id: 'tali', name: 'Tali'},
            {id: 'laajasalo', name: 'Laajasalo'},
            {id: 'hiekkaharju', name: 'Hiekkaharju'}
        ],<commit_msg>Remove redundant class<commit_after>const dao = require('../dao/dao')
const DateTime = require('dateutils').DateTime
const DateLocale = require('dateutils').DateLocale
const DateFormat = require('dateutils').DateFormat
const markupForDateRange = require('../markupForDateRange')
const headHtml = require('../head.html')
const filtersHtml = require('./filters.html')
const modalsHtml = require('./modals.html')
const scriptsHtml = require('./scripts.html')
const _ = require('lodash')
module.exports = {
    show: show
}

function show(req, res) {
    var refresh = req.query.refresh === 'true'
    res.write(`<!DOCTYPE html>
<html>`)
    res.write(headHtml())
    res.write(`<body>`)
    res.write(`<div class="reservationModal modal"></div>`)
    res.write(modalsHtml())
    res.write(`<div class="container detail">`)
    res.write(filters())
    res.write(quickLinks())
    res.write(`<section class="" id="schedule">`)
    dao.freeCourts(new DateTime().toISODateString(), 3, refresh, (data) => {
        res.write(markupForDateRange(data, new DateTime()))
        res.write('</section></div>')
        res.write(scriptsHtml({
            isTest: global.isTest,
            refresh: refresh,
            serverDate: new DateTime().toISODateString()
        }))
        res.write('</body></html>')
        res.end()
    })
}

function filters() {
    return filtersHtml({
        places: [
            {id: 'meilahti', name: 'Meilahti'},
            {id: 'herttoniemi', name: 'Herttoniemi'},
            {id: 'kulosaari', name: 'Kulosaari'},
            {id: 'merihaka', name: 'Merihaka'},
            {id: 'taivallahti', name: 'Taivallahti'},
            {id: 'tapiola', name: 'Tapiola'},
            {id: 'tali', name: 'Tali'},
            {id: 'laajasalo', name: 'Laajasalo'},
            {id: 'hiekkaharju', name: 'Hiekkaharju'}
        ],
{'fraction_non_alphanumeric': 0.18029236599891715, 'fraction_numerical': 0.0005414185165132648, 'mean_word_length': 3.0426695842450764, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, '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': '3186561', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1159, 'n_words': 235}