datatracker/ietf/templates/community/manage_clist.html
2015-08-01 14:53:59 +00:00

133 lines
4.4 KiB
HTML

{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load future %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block title %}{{ cl.long_name }}{% endblock %}
{% block content %}
{% origin %}
<h1>{{ cl.long_name }}</h1>
{% bootstrap_messages %}
<ul class="nav nav-tabs nav-memory" role="tablist">
<li class="active"><a href="#view" data-toggle="tab">Documents</a></li>
<li><a href="#documents" data-toggle="tab">Explicitly added</a></li>
<li><a href="#rules" data-toggle="tab">Rules</a></li>
<li><a href="#custom" data-toggle="tab">Display customization</a></li>
<li><a href="#info" data-toggle="tab">Exports</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="view">
{% include "community/view_list.html" %}
</div>
<div class="tab-pane" id="documents">
<p>
In order to add some individual documents to your list, you have to:
</p>
<ul>
<li>Search for the document or documents you want to add using the datatracker search form.</li>
<li>In the search results, you'll find a link to add individual documents to your list.</li>
</ul>
<a class="btn btn-default" href="/doc/search/">Document search</a>
<table class="table table-condensed table-striped">
<thead>
<tr>
<th>Name</th><th>State</th><th>Title</th><th></th>
</tr>
</thead>
<tbody>
{% for doc in cl.added_ids.all %}
<tr>
<td>{{ doc.display_name }}</td>
<td>{{ doc.get_state }}</td>
<td><a href="{{ doc.get_absolute_url }}">{{ doc.title }}</a></td>
<td><a class="btn btn-danger btn-xs" href="{% url "community_remove_document" cl.pk doc.pk %}">Remove</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="tab-pane" id="rules">
<table class="table table-condensed table-striped">
<thead>
<tr><th>Rule</th><th>Value</th><th>Documents</th><th></th></tr>
</thead>
<tbody>
{% for rule in cl.rule_set.all %}
{% with rule.get_callable_rule as callable %}
<tr>
<td>{{ callable.description }}</td>
<td>{{ callable.show_value }}</td>
<td>{% with rule.cached_ids.count as count %}{{ count }} document{{ count|pluralize }}{% endwith %}</td>
<td><a class="btn btn-danger btn-xs" href="{% url "community_remove_rule" cl.pk rule.pk %}">Remove</a></td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
<h3>Add a new rule</h3>
<form method="post">
{% csrf_token %}
{% bootstrap_form rule_form %}
{% buttons %}
<input type="submit" class="btn btn-primary" name="save_rule" value="Add rule">
{% endbuttons %}
</form>
</div>
<div class="tab-pane" id="custom">
{% include "community/customize_display.html" %}
</div>
<div class="tab-pane" id="info">
<p>Feel free to share the following links if you need to:</p>
<ul>
<li><a href="{{ cl.secret }}/view/">Read only view for {{ cl.long_name }}</a></li>
<li><a href="{{ cl.secret }}/changes/feed/">Feed for every change in status of {{ cl.long_name }}</a></li>
<li><a href="{{ cl.secret }}/changes/significant/feed/">Feed for significant change in status of {{ cl.long_name }}</a></li>
<li><a href="{{ cl.secret }}/subscribe/">Subscribe to the mailing list for every change in status of {{ cl.long_name }}</a></li>
<li><a href="{{ cl.secret }}/subscribe/significant/">Subscribe to the mailing list for significant change in status of {{ cl.long_name }}</a></li>
</ul>
<p>Export your list to CSV format:</p>
<ul>
<li><a href="csv/">CSV for {{ cl.long_name }}</a></li>
<li><a href="{{ cl.secret }}/csv/">Read only CSV for {{ cl.long_name }}</a></li>
</ul>
</div>
</div>
{% endblock %}
{% comment %}
XXX scrolling jumps around when using this, unfortunately
<script>
$('.nav-memory a').click(function (e) {
e.preventDefault();
$(this).tab('show');
});
// store the currently selected tab in the hash value
$("ul.nav-tabs > li > a").on("shown.bs.tab", function (e) {
var id = $(e.target).attr("href").substr(1);
window.location.hash = id;
});
// on load of the page: switch to the currently selected tab
var hash = window.location.hash;
$('.nav-memory a[href="' + hash + '"]').tab('show');
</script>
{% endcomment %}