Page MenuHomec4science

bibworkflow_index.html
No OneTemporary

File Metadata

Created
Thu, Nov 28, 18:17

bibworkflow_index.html

{% extends "bibworkflow_layout.html" %}
{% block body2 %}
<script type="text/javascript">
$(document).ready(function(){
$("tbody > tr.workflow").bind('click', function(){
hp_id = $(this).attr('name');
jQuery.ajax({
url: "/admin/bibworkflow/workflow_details?workflow_id=" + hp_id,
success: function(json){
$("#myModal").html(json);
$('#myModal').modal('show');}
})
});
$("tbody > tr.object").bind('click', function(){
hp_id = $(this).attr('name');
jQuery.ajax({
url: "/admin/bibworkflow/entry_details?entry_id=" + hp_id,
success: function(json){
$("#myModal").html(json);
$('#myModal').modal('show');}
})
});
$(".entry_message_button").bind('click', function(){
hp_id = $(this).attr('name');
TINY.box.show({url:"/match_details/1" + hp_id,width:"800",height:"600", animate:false});
});
});
</script>
<h1>Workflows list</h1>
<table class="table table-striped">
<thead>
<tr>
<th>Id</th>
<th>Workflow name</th>
<th>User</th>
<th>Started</th>
<th>Modified</th>
<th>Last task</th>
<th>Progress</th>
<th>Error msg.</th>
</tr>
</thead>
<tbody>
{% for workflow in workflows %}
<tr class="workflow" name="{{ workflow.uuid }}">
<td>{{ workflow.uuid }}</td>
<td>{{ workflow.name }}</td>
<td>{{ workflow.uid }}</td>
<td>{{ workflow.created }}</td>
<td>{{ workflow.modified }}</td>
<td title="{{ workflow.last_task_description }}">{{ workflow.last_task_name }}</td>
<td title="Elements: {{ workflow.counter_initial }}
Halted: {{ workflow.counter_halted }}
Error: {{ workflow.counter_error }}
Finished: {{ workflow.counter_finished }}">
{% if workflow.counter_initial %}
{%- set progress = (workflow.counter_error + workflow.counter_finished) / workflow.counter_initial * 100 -%}
{% else %}
{%- set progress = 0 -%}
{% endif %}
Progress: <span class="pull-right strong">{{ progress|int }}%</span>
{% if workflow.status == 0 %}
<div class="progress progress-striped active">
<div class="bar" style="width: {{ progress }}%;"></div>
{% elif workflow.status == 1 %}
<div class="progress progress-warning active">
<div class="bar" style="width: {{ progress }}%;"></div>
{% elif workflow.status == 2 %}
<div class="progress progress-danger active">
<div class="bar" style="width: {{ progress }}%;"></div>
{% elif workflow.status == 3 %}
<div class="progress progress-success active">
<div class="bar" style="width: {{ progress }}%;"></div>
{% endif %}
<!-- closing progress bar -->
</div>
</td>
<td>{{ workflow.error_msg }}</td>
</tr>
{%- if workflow.objects -%}
<tr>
<td colspan="8">
<table>
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>User</th>
<th>Cr. date</th>
<th>Mod. date</th>
<th>Description</th>
<th>Version</th>
<th>Message</th>
<th>Parent ID</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{% for object in workflow.objects %}
<tr class="object" name="{{ object.id }}">
<td>{{ object.id }}</td>
<td>{{ object.name|truncate(20) }}</td>
<td>{{ workflow.uid }}</td>
<td>{{ object.created }}</td>
<td>{{ object.modified }}</td>
<td title="{{ workflow.last_task_description }}">{{ workflow.last_task_name }}</td>
<td>
{% if object.version == 0 %}
<span class="badge badge-info">Initial</span>
{% elif object.version == 1 %}
<span class="badge badge-success">Final</span>
{% elif object.version == 2 %}
<span class="badge badge-important">Error</span>
{% endif %}
</td>
<td title="{{ object.error_msg }}">{{ object.error_msg|truncate(50) }}</td>
<td>{{ object.parent_id }}</td>
<td>{{ object.state }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
</tr>
{%- endif -%}
{% endfor %}
</tbody>
</table>
{% endblock %}

Event Timeline