Added dataTable for duplicate in show saved paste

This commit is contained in:
Mokaddem 2016-10-27 15:53:45 +02:00
parent 59a7000527
commit 7e7e679ab6

View file

@ -19,79 +19,76 @@
</head> </head>
<body> <body>
<div style="margin: 10px;"> <div style="margin: 10px;">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header" >Paste: {{ request.args.get('paste') }}</h1>
<h2 class="page-header" >({{ request.args.get('num') }})</h2>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="panel panel-default">
<h1 class="page-header" >Paste: {{ request.args.get('paste') }}</h1> <div class="panel-heading">
<h2 class="page-header" >({{ request.args.get('num') }})</h2> <table class="table table-condensed">
<thead>
<tr>
<th>Date</th>
<th>Source</th>
<th>Encoding</th>
<th>Language</th>
<th>Size (Kb)</th>
<th>Mime</th>
<th>Number of lines</th>
<th>Max line length</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ date }}</td>
<td>{{ source }}</td>
<td>{{ encoding }}</td>
<td>{{ language }}</td>
<td>{{ size }}</td>
<td>{{ mime }}</td>
<td>{{ lineinfo.0 }}</td>
<td>{{ lineinfo.1 }}</td>
</tr>
</tbody>
</table>
</div> </div>
<!-- /.col-lg-12 --> <div class="panel-body" id="panel-body">
</div> {% if duplicate_list|length == 0 %}
<!-- /.row --> <h3> No Duplicate </h3>
{% else %}
<div class="row"> <h3> Duplicate list: </h3>
<table id="tableDup" class="table table-striped table-bordered">
<div class="panel panel-default"> {% set i = 0 %}
<div class="panel-heading"> <thead>
<table class="table table-condensed">
<thead>
<tr>
<th>Date</th>
<th>Source</th>
<th>Encoding</th>
<th>Language</th>
<th>Size (Kb)</th>
<th>Mime</th>
<th>Number of lines</th>
<th>Max line length</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ date }}</td>
<td>{{ source }}</td>
<td>{{ encoding }}</td>
<td>{{ language }}</td>
<td>{{ size }}</td>
<td>{{ mime }}</td>
<td>{{ lineinfo.0 }}</td>
<td>{{ lineinfo.1 }}</td>
</tr>
</tbody>
</table>
</div>
<div class="panel-body" id="panel-body">
{% if duplicate_list|length == 0 %}
<h3> No Duplicate </h3>
{% else %}
<h3> Duplicate list: </h3>
<table id="tableDup" class="table table-striped table-bordered">
{% set i = 0 %}
<thead>
<tr>
<th>Hash type</th>
<th>Paste info</th>
<th>Path</th>
</tr>
</thead>
<tbody>
{% for dup_path in duplicate_list %}
<tr> <tr>
<td>{{ hashtype_list[i] }}</td> <th>Hash type</th>
<td>Similarity: {{ simil_list[i] }}%</td> <th>Paste info</th>
<td><a target="_blank" href="{{ url_for('showsavedpaste') }}?paste={{ dup_path }}" id='dup_path'>{{ dup_path }}</a></td> <th>Path</th>
</tr> </tr>
{% set i = i + 1 %} </thead>
{% endfor %} <tbody>
</tbody> {% for dup_path in duplicate_list %}
</table> <tr>
{% endif %} <td>{{ hashtype_list[i] }}</td>
<h3> Content: </h3> <td>Similarity: {{ simil_list[i] }}%</td>
<p data-initsize="{{ initsize }}"> <pre id="paste-holder">{{ content }}</pre></p> <td><a target="_blank" href="{{ url_for('showsavedpaste') }}?paste={{ dup_path }}" id='dup_path'>{{ dup_path }}</a></td>
</div> </tr>
</div> {% set i = i + 1 %}
{% endfor %}
</tbody>
</table>
{% endif %}
<h3> Content: </h3>
<p data-initsize="{{ initsize }}"> <pre id="paste-holder">{{ content }}</pre></p>
</div>
</div>
</div> </div>
</body> </body>
<script> <script>
$('#tableDup').DataTable(); $('#tableDup').DataTable();