Commit 8a93fbe9 authored by Janez K's avatar Janez K

added new templates

parent ee439bca
{% extends 'website/base.html' %}
{% block "exploreactive" %}class="active"{% endblock %}
{% block "container" %}
{% for w in workflows %}
<section>
<div class="page-header">
<h1>{{w.name}} <small>by {{w.user}}</small></h1>
</div>
<div class="row">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
<h3>Try it out</h3>
<p>By clicking the button below you will create a copy of this workflow and will be able to edit it, run it or just look at it without harming the original.</p>
<a href="{{w.get_copy_url}}" class="btn launch {% if not user.is_authenticated %}must_login{% endif %}">Launch workflow!{% if w.user == user %} (Create a copy){% endif %}</a><br><br>
{% if w.user == user %}<a href="{{w.get_absolute_url}}" class="btn launch {% if not user.is_authenticated %}must_login{% endif %}" onClick="$('.launch').hide();$('.ajax-loader').show()">Edit this version</a>{% endif %}
</div>
<div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
<h2>Description</h2>
<p>{{w.description}}</p>
<div class="well" style="background-color: #888; border: none; background:url('{{STATIC_URL}}website-css/grid-18px-masked.png');height:250px;">
<div style="width:370px;height:270px;margin:auto;position:relative;">
{% for widget in w.normalized_widgets %}
<img src="{{STATIC_URL}}website-images/widget-{% cycle '2' '1' '3' '4' '5' %}.png" style="max-width:30px;max-height:30px;position:absolute;left:{{ widget.norm_x }}px;top:{{ widget.norm_y }}px;">
{% endfor %}
<svg width="370px" height="270px">
{% for conn in w.unique_connections %}
<line x1="{{ conn.x1 }}" y1="{{ conn.y1 }}" x2="{{ conn.x2 }}" y2="{{ conn.y2 }}" style="stroke: black;"/>
{% endfor %}
</svg>
</div>
</div>
<h2>Try it live</h2>
<p>By clicking on the button below you will launch the workflow and be able to run it or edit it.</p>
<a href="{{w.get_copy_url}}" class="btn btn-primary btn-large launch {% if not user.is_authenticated %}must_login{% endif %}" onClick="$('.launch').hide();$('.ajax-loader').show()">Launch workflow!{% if w.user == user %} (Clicking this will create a new copy){% endif %}</a>
{% if w.user == user %}<a href="{{w.get_absolute_url}}" class="btn btn-large launch {% if not user.is_authenticated %}must_login{% endif %}" onClick="$('.launch').hide();$('.ajax-loader').show()">This is your workflow. Click here to edit it!</a>{% endif %}
<hr>
</section>
{% endfor %}
{% endblock %}
{% extends 'website/base.html' %}
{% load url from future %}
{% block "yourworkflowsactive" %}class="active"{% endblock %}
{% block "container" %}
<h1>Your workflows</h1>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Workflow title</th>
<th>Public URL</th>
<th style="width:15%;">Streaming</th>
<th style="width:30%;">Action</th>
</tr>
</thead>
<tbody>
{% for w in workflows %}
<tr>
<td class="name">{{w}}</td>
<td>{% if w.public %}<a href="{{w.get_info_url}}">{{w.get_info_url}}</a>{% else %}This workflow is private.{% endif %}</td>
<td>
{% if w.can_be_streaming %}
{% if w.stream %}
{% if w.stream.active %}<span class="label label-success"><i class="icon-ok icon-white"></i> Active</span> <a href="{{w.stream.get_absolute_url}}" class="btn btn-mini"><i class="icon-wrench"></i></a>
{% else %}<span class="label label-warning"><i class="icon-remove icon-white"></i> Inactive</span> <a href="{{w.stream.get_absolute_url}}" class="btn btn-mini"><i class="icon-wrench"></i></a>{% endif %}
{% else %}<a href="{% url 'start stream' w.pk %}" class="btn btn-mini">Start stream mining</a>{% endif %}
{% else %}<span class="label"><i class="icon-remove icon-white"></i> No streaming widgets</span>{% endif %}
</td>
<td><a href="{{w.get_absolute_url}}">Edit</a> | <a href="{{w.get_copy_url}}">Open as new</a> | <a href="javascript:;" rel="{{w.pk}}" class="delete_workflow">Delete</a> | {% if not w.public %}<a href="{% url 'make public' w.pk %}">Make public</a>{% else %}<a href="{% url 'make private' w.pk %}">Make private</a>{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(function() {
$(".delete_workflow").click(function() {
var thistd = $(this);
bootbox.confirm("Are you sure you wish to delete the workflow: "+$(this).parent().parent().find("td.name").html()+"?","No way!", "Yes, definitely!", function(result) {
if (result==true) {
thistd.parent().parent().remove();
$.post("{% url 'delete workflow' %}?workflow_id="+thistd.attr('rel'))
}
});
});
});
</script>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment