{% firstof user.get_full_name user.username %} <b class="caret"></b>
</a>
<ul class="dropdown-menu">
+ <li><a href="{% url 'job_templates' %}">
+ <span class="glyphicon glyphicon-floppy-disk"></span> Zapisane zadania</a>
+ </li>
+
{% if request.user.is_superuser %}
- <li><a href="{% url 'admin:index' %}" target="_blank">
- <span class="glyphicon glyphicon-wrench"></span> Panel Administracyjny</a></li>
<li class="divider"></li>
+ <li><a href="{% url 'admin:index' %}" target="_blank">
+ <span class="glyphicon glyphicon-wrench"></span> Panel Administracyjny</a>
+ </li>
{% endif %}
+ <li class="divider"></li>
<li>
<a href="{% url 'logout' %}" role="button">
<span class="glyphicon glyphicon-off"></span> Wyloguj
--- /dev/null
+{% extends 'qcg/base.html' %}
+
+{% block container %}
+ <h1 class="page-header">{% block title %}Szablony zadania{% endblock %}</h1>
+
+ {% if templates %}
+ <table class="table table-hover">
+ <thead>
+ <tr>
+ <th class="text-right" style="width: 40px">#</th>
+ <th>Nazwa</th>
+ <th style="width: 200px">Data utworzenia</th>
+ <th style="width: 200px">Data modyfikacji</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for template in templates %}
+ <tr>
+ <td class="text-right">{{ forloop.counter }}</td>
+ <td><a href="#">{{ template.name }}</a></td>
+ <td>{{ template.created }}</td>
+ <td>{{ template.updated }}</td>
+ <td class="text-right">
+ <button class="btn btn-xs btn-danger" title="Usuń">
+ <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
+ </button>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% else %}
+ <div id="no-items" class="alert alert-info">
+ <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+ Brak zapisanych szablonów zadań
+ </div>
+ {% endif %}
+
+{% endblock %}
url(r'^$', views.index, name='index'),
url(r'^jobs/$', views.jobs_list, name='jobs'),
+ url(r'^job/templates/$', views.job_templates, name='job_templates'),
url(r'^job/submit/$', views.job_submit, name='job_submit'),
url(r'^job/cancel/(?P<job_id>[\w]+)/$', views.job_cancel, name='job_cancel'),
{'error': error, 'url': reverse('filex:upload') + '?' + urlencode(form.cleaned_data),
'host': form.cleaned_data['host'], 'path': form.cleaned_data['path'],
'sep': '/' if form.cleaned_data['path'].startswith('~') else ''})
+
+
+@login_required
+def job_templates(request):
+ return render(request, 'qcg/job_templates.html', {'templates': request.user.templates.all()})