<commit_before>#encoding: cinje

: from .admintemplate import page
: from .. import table_args, caption_args
: import os

: def selectfile title, ctx, files=[]
    : using page title, ctx, lang="en"
    <div class='container'>
        <form action='/admin/updatedatabase/unpack' method='post'>
         <fieldset>
          <legend>File Selection</legend>
          <div class='form-group'>
           <label for='fileselection'>Select a file to unpack</label>
           <select class="form-control" id="fileselection" name="fileselection">
           : for f in files
            <option value='${os.path.split(f)[-1]}'>${os.path.split(f)[-1]}</option>
           : end
           : if len(files) == 0
            <option value='uncompressed'>I uploaded an uncompressed file</option>
           : end
           </select>
           <label for='backupdb'>Backup your database? (recommended)</label>
           <input type='checkbox' name='backupdb' value='1' checked>
          </div>
         </fieldset>
         <button type="submit" class="btn btn-primary" >Unpack</button>
        </form>
    </div>
    : end
: end

: def selectdatabasefile title, ctx, files=[]
    : using page title, ctx, lang='en'
    <div class='container'>
     <form id='updatedatabase' action='/admin/updatedatabase/updatedatabase' method='post'>
      <fieldset>
       <legend>Update Database</legend>
       <div class='form-group'>
        <label for='fileselection'>Select the database main or xml file</label>
        <select class='form-control' id='fileselection' name='fileselection'>
        : for f in files
         <option value='${os.path.split(f)[-1]}'>${os.path.split(f)[-1]}</option>
        : end
        </select>
       </div>
      </fieldset>
      <button type='submit' class='btn btn-primary'>Update Database</button>
     </form>
    </div>
    : end
: end

: def updateprogress title, ctx
    : using page title, ctx, lang='en'
    <div class='container'>
    <div class='row'>
        <div class='col-sm-11 col-lg-11'><h3 id='stage'></h3></div>
        <div class='col-sm-1 col-lg-1'><img src='/public/img/loading.gif' id='spinner' alt='spinner' style='display: none; top: 25px; width:25px; height: 25px; position: relative' /></div>
    </div>
    <div class='progress'>
     <div id='progress' class='progress-bar progress-bar-striped update-progress-bar' role='progressbar' aria-valuenow='0' aria-valuemin='0' aria-valuemax='100' style='min-width: 2em; width: 0%;'>
      0%
     </div>
    </div>
    <div class='stats'>
     <table class='table table-bordered table-striped vertical-table stats-table' style='margin-left: auto; margin-right: auto; width: 100%;'><commit_msg>Changed the update page spinner to the horse to stand out better.<commit_after>#encoding: cinje

: from .admintemplate import page
: from .. import table_args, caption_args
: import os

: def selectfile title, ctx, files=[]
    : using page title, ctx, lang="en"
    <div class='container'>
        <form action='/admin/updatedatabase/unpack' method='post'>
         <fieldset>
          <legend>File Selection</legend>
          <div class='form-group'>
           <label for='fileselection'>Select a file to unpack</label>
           <select class="form-control" id="fileselection" name="fileselection">
           : for f in files
            <option value='${os.path.split(f)[-1]}'>${os.path.split(f)[-1]}</option>
           : end
           : if len(files) == 0
            <option value='uncompressed'>I uploaded an uncompressed file</option>
           : end
           </select>
           <label for='backupdb'>Backup your database? (recommended)</label>
           <input type='checkbox' name='backupdb' value='1' checked>
          </div>
         </fieldset>
         <button type="submit" class="btn btn-primary" >Unpack</button>
        </form>
    </div>
    : end
: end

: def selectdatabasefile title, ctx, files=[]
    : using page title, ctx, lang='en'
    <div class='container'>
     <form id='updatedatabase' action='/admin/updatedatabase/updatedatabase' method='post'>
      <fieldset>
       <legend>Update Database</legend>
       <div class='form-group'>
        <label for='fileselection'>Select the database main or xml file</label>
        <select class='form-control' id='fileselection' name='fileselection'>
        : for f in files
         <option value='${os.path.split(f)[-1]}'>${os.path.split(f)[-1]}</option>
        : end
        </select>
       </div>
      </fieldset>
      <button type='submit' class='btn btn-primary'>Update Database</button>
     </form>
    </div>
    : end
: end

: def updateprogress title, ctx
    : using page title, ctx, lang='en'
    <div class='container'>
    <div class='row'>
        <div class='col-sm-11 col-lg-11'><h3 id='stage'></h3></div>
        <div class='col-sm-1 col-lg-1'><img src='/public/icons/horse_7.gif' id='spinner' alt='spinner' style='display: none; top: 25px; width:25px; height: 25px; position: relative' /></div>
    </div>
    <div class='progress'>
     <div id='progress' class='progress-bar progress-bar-striped update-progress-bar' role='progressbar' aria-valuenow='0' aria-valuemin='0' aria-valuemax='100' style='min-width: 2em; width: 0%;'>
      0%
     </div>
    </div>
    <div class='stats'>
     <table class='table table-bordered table-striped vertical-table stats-table' style='margin-left: auto; margin-right: auto; width: 100%;'>
{'fraction_non_alphanumeric': 0.16482504604051565, 'fraction_numerical': 0.011602209944751382, 'mean_word_length': 2.870990734141126, 'pattern_counts': {'":': 0, '<': 117, '<?xml version=': 0, '>': 117, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6952285', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1686, 'n_words': 408}