<commit_before>%include('header')
<script>
$(document).ready(function() {
   jQuery.ajax({
      type: "get",
      data: { app: '{{app}}' },
      dataType: "json",
      contentType: "application/json; charset=utf-8",
      url:  "/appconfig/status",
      complete: function(xhr){
        var response = JSON.parse(xhr.responseText);
        toggle(response.command,"db")
        toggle(response.inputs,"in")
        toggle(response.template,"tp")
        toggle(response.binary,"bn")
        toggle(response.plots,"pl")
      }
   })
})

function toggle(cmd,id) {
   if (cmd == 1) {
      $("#"+id).addClass('glyphicon-ok')
      $("#"+id).removeClass('glyphicon-remove')   
      $("#"+id+"div").toggleClass('has-error', false);
      $("#"+id+"div").toggleClass('has-success', true);         
   } else {
      $("#"+id).removeClass('glyphicon-ok')
      $("#"+id).addClass('glyphicon-remove')
      $("#"+id+"div").toggleClass('has-error', true);
      $("#"+id+"div").toggleClass('has-success', false);   
   }
}
</script>
<style>
.table {
    font-size: 120%;
}
tr:hover {
    cursor: auto;
}
</style>

</head>
<body>

%include('navbar')

<h1>{{app}} app</h1>

<table class="table table-striped">
  <tr>
      <td>Name:</td> 
      <td><a href="/app/{{rows['name']}}"></a>{{rows['name']}}</td></tr>
  </tr>
  <!-- <tr>
      <td>Category:</td>
      <td>{{rows['category']}}</td>
  </tr> -->
  <tr>
      <td>Description:</th>
      <td>{{rows['description']}}</td>
  </tr>
  <tr>
      <td>Input format:</td>
      <td>{{rows['input_format']}}</td> 
  </tr>
  <tr>
      <td>Pre-process:</td>
      <td>{{rows['preprocess']}}</td> 
  </tr>
  <tr>
      <td>Post-process:</td>
      <td>{{rows['postprocess']}}</td> 
  </tr>
  <tr>
      <td>Language:</td>
      <td>{{rows['language']}}</td> 
  </tr>
  <tr>
      <td>Command:</td> 
      <td>{{rows['command']}}</td> 
  </tr>
</table>

<div class="container-fluid">

<div class="btn-group">
    <!-- <span class="glyphicon glyphicon-trash"></span> -->
    <form class="btn-group" method="post" action="/app/edit/{{rows['id']}}">
        <input type="submit" class="btn btn-default" value="Edit {{app}}">
        <input type="hidden" name="app" value="{{rows['name']}}">
        <input type="hidden" name="edit" value="True">
    </form>
    <form class="btn-group" method="post" action="/appconfig/inputs/upload">
        <input type="submit" class="btn btn-default" value="Configure Inputs">
        <input type="hidden" name="appname" value="{{rows['name']}}">
        <input type="hidden" name="input_format" value="{{rows['input_format']}}">
    </form>
    <form class="btn-group" method="post" action="/appconfig/exe/upload">
        <input type="hidden" name="appname" value="{{rows['name']}}">
        <input type="submit" class="btn btn-default" value="Configure Executable">
    </form>
    <form class="btn-group" method="get" action="/plots/edit">
        <input type="hidden" name="app" value="{{rows['name']}}">
        <input type="submit" class="btn btn-default" value="Configure Plots">
    </form>
    <form class="btn-group" method="post" action="/appconfig/export">
        <input type="hidden" name="app" value="{{rows['name']}}">
        <input type="submit" class="btn btn-default" value="Export Config">
    </form>
    <button type="button" class="btn btn-danger" data-toggle="modal" 
            data-target="#dModal">
            <span class="glyphicon glyphicon-trash"></span> Delete {{app}}</button>
</div>

<form>
<h3>Status of installation:</h3>
<div class="form-group" id="dbdiv"><span id="db" class="glyphicon glyphicon-ok"> Database entry setup</div>
<div class="form-group" id="indiv"><span id="in" class="glyphicon glyphicon-ok"> Inputs file uploaded</div>
<div class="form-group" id="tpdiv"><span id="tp" class="glyphicon glyphicon-ok"> HTML template file setup</div>
<div class="form-group" id="bndiv"><span id="bn" class="glyphicon glyphicon-ok"> Application binary uploaded</div>
<div class="form-group" id="pldiv"><span id="pl" class="glyphicon glyphicon-ok"> Plots setup</div>
</form>

<!-- Delete Modal -->
<div class="modal fade" id="dModal" tabindex="-1" role="dialog" 
     aria-labelledby="deleteModal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <form class="form-horizontal" method="post" action="/app/delete/{{rows['id']}}">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"> 
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="deleteModal">Delete App {{rows['name']}}?</h4>
                    <div class="modal-body">
                      <div class="form-group">
                        <label for="del_app_dir">
                          Delete associated files for app?
                        </label><commit_msg>simplify buttons on app config page<commit_after>%include('header')
<script>
$(document).ready(function() {
   jQuery.ajax({
      type: "get",
      data: { app: '{{app}}' },
      dataType: "json",
      contentType: "application/json; charset=utf-8",
      url:  "/appconfig/status",
      complete: function(xhr){
        var response = JSON.parse(xhr.responseText);
        toggle(response.command,"db")
        toggle(response.inputs,"in")
        toggle(response.template,"tp")
        toggle(response.binary,"bn")
        toggle(response.plots,"pl")
      }
   })
})

function toggle(cmd,id) {
   if (cmd == 1) {
      $("#"+id).addClass('glyphicon-ok')
      $("#"+id).removeClass('glyphicon-remove')   
      $("#"+id+"div").toggleClass('has-error', false);
      $("#"+id+"div").toggleClass('has-success', true);         
   } else {
      $("#"+id).removeClass('glyphicon-ok')
      $("#"+id).addClass('glyphicon-remove')
      $("#"+id+"div").toggleClass('has-error', true);
      $("#"+id+"div").toggleClass('has-success', false);   
   }
}
</script>
<style>
.table {
    font-size: 120%;
}
tr:hover {
    cursor: auto;
}
</style>

</head>
<body>

%include('navbar')

<h1>{{app}} app</h1>

<table class="table table-striped">
  <tr>
      <td>Name:</td> 
      <td><a href="/app/{{rows['name']}}"></a>{{rows['name']}}</td></tr>
  </tr>
  <!-- <tr>
      <td>Category:</td>
      <td>{{rows['category']}}</td>
  </tr> -->
  <tr>
      <td>Description:</th>
      <td>{{rows['description']}}</td>
  </tr>
  <tr>
      <td>Input format:</td>
      <td>{{rows['input_format']}}</td> 
  </tr>
  <tr>
      <td>Pre-process:</td>
      <td>{{rows['preprocess']}}</td> 
  </tr>
  <tr>
      <td>Post-process:</td>
      <td>{{rows['postprocess']}}</td> 
  </tr>
  <tr>
      <td>Language:</td>
      <td>{{rows['language']}}</td> 
  </tr>
  <tr>
      <td>Command:</td> 
      <td>{{rows['command']}}</td> 
  </tr>
</table>

<div class="container-fluid">

<div class="btn-group">
    <!-- <span class="glyphicon glyphicon-trash"></span> -->
    <form class="btn-group" method="post" action="/app/edit/{{rows['id']}}">
        <input type="submit" class="btn btn-default" value="Edit">
        <input type="hidden" name="app" value="{{rows['name']}}">
        <input type="hidden" name="edit" value="True">
    </form>
    <form class="btn-group" method="post" action="/appconfig/inputs/upload">
        <input type="submit" class="btn btn-default" value="Inputs">
        <input type="hidden" name="appname" value="{{rows['name']}}">
        <input type="hidden" name="input_format" value="{{rows['input_format']}}">
    </form>
    <form class="btn-group" method="post" action="/appconfig/exe/upload">
        <input type="hidden" name="appname" value="{{rows['name']}}">
        <input type="submit" class="btn btn-default" value="Executable">
    </form>
    <form class="btn-group" method="get" action="/plots/edit">
        <input type="hidden" name="app" value="{{rows['name']}}">
        <input type="submit" class="btn btn-default" value="Plots">
    </form>
    <form class="btn-group" method="post" action="/appconfig/export">
        <input type="hidden" name="app" value="{{rows['name']}}">
        <input type="submit" class="btn btn-default" value="Export">
    </form>
    <button type="button" class="btn btn-danger" data-toggle="modal" 
            data-target="#dModal">
            <span class="glyphicon glyphicon-trash"></span> Delete</button>
</div>

<form>
<h3>Status of installation:</h3>
<div class="form-group" id="dbdiv"><span id="db" class="glyphicon glyphicon-ok"> Database entry setup</div>
<div class="form-group" id="indiv"><span id="in" class="glyphicon glyphicon-ok"> Inputs file uploaded</div>
<div class="form-group" id="tpdiv"><span id="tp" class="glyphicon glyphicon-ok"> HTML template file setup</div>
<div class="form-group" id="bndiv"><span id="bn" class="glyphicon glyphicon-ok"> Application binary uploaded</div>
<div class="form-group" id="pldiv"><span id="pl" class="glyphicon glyphicon-ok"> Plots setup</div>
</form>

<!-- Delete Modal -->
<div class="modal fade" id="dModal" tabindex="-1" role="dialog" 
     aria-labelledby="deleteModal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <form class="form-horizontal" method="post" action="/app/delete/{{rows['id']}}">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"> 
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="deleteModal">Delete App {{rows['name']}}?</h4>
                    <div class="modal-body">
                      <div class="form-group">
                        <label for="del_app_dir">
                          Delete associated files for app?
                        </label>
{'fraction_non_alphanumeric': 0.22435573521980798, 'fraction_numerical': 0.002425467407781708, 'mean_word_length': 3.099420049710025, 'pattern_counts': {'":': 0, '<': 261, '<?xml version=': 0, '>': 261, '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': '1721618', 'n_tokens_mistral': 3283, 'n_tokens_neox': 3163, 'n_words': 584}