woodwind/woodwind/templates/subscriptions.jinja2
2016-06-22 09:13:21 +00:00

85 lines
3.1 KiB
Django/Jinja

{% extends "base.jinja2" %}
{% block head %}
<script src="{{url_for('static', filename='subscriptions.js', version='2015-04-19')}}"></script>
{% endblock head %}
{% block header %}
{% if current_user.is_authenticated %}
<form action="{{ url_for('.subscribe') }}" method="POST">
<input type="url" id="origin" name="origin" placeholder="Subscribe to URL" />
</form>
{% endif %}
{% endblock header %}
{% block body %}
<article>
{{ subscriptions | count }} subscriptions
<form action="{{ url_for('.update_all') }}" method="POST">
<button type="submit">Poll All</button>
</form>
</article>
{% for s in subscriptions %}
<article>
{% if s.feed.failure_count > 0 %}
<div>
<i class="fa fa-warning"></i> Last {{ s.feed.failure_count }} Attempt(s) Failed
</div>
{% endif %}
<details><summary><b>{{ s.name }}</b> checked {{s.feed.last_checked | relative_time}}</summary>
<form class="edit-subscription" action="{{ url_for('.edit_subscription') }}" method="POST">
<input type="hidden" name="id" value="{{ s.id }}"/>
<label>Name</label>
<input type="text" name="name" value="{{ s.name }}"/>
<label>Tags</label>
<input type="text" name="tags" value="{{ s.tags or ''}}"/>
<label>URL</label>
<input type="text" name="feed" value="{{ s.feed.feed }}" readonly />
<label style="display: block; font-weight: normal;">
<input type="checkbox" name="exclude" value="true" {% if s.exclude %}checked{% endif %} />
Exclude from primary feed
</label>
<button type="submit">Save Edits</button> <span class="save-status"></span>
</form>
<div class="feed-details" id="details-{{loop.index}}">
<details><summary><strong>Details</strong></summary>
<ul>
<li>Last checked: {{s.feed.last_checked | relative_time}}</li>
<li>Last updated: {{s.feed.last_updated | relative_time}}</li>
<li>Last response: {{s.feed.last_response | e}}</li>
<li>PuSH hub: {{s.feed.push_hub}}</li>
<li>PuSH topic: {{s.feed.push_topic}}</li>
<li>PuSH verified: {{s.feed.push_verified}}</li>
<li>PuSH last ping: {{s.feed.last_pinged | relative_time}}</li>
<li>PuSH expiry: {{s.feed.push_expiry | relative_time}}</li>
</ul>
</details>
</div>
</details>
<form class="poll-now" action="{{ url_for('.update_feed') }}" method="POST" style="display:inline">
<input type="hidden" name="id" value="{{ s.feed.id }}"/>
<button type="submit">Poll Now</button> <span class="poll-status"></span>
</form>
<form class="unsubscribe" action="{{ url_for('.unsubscribe') }}" method="POST" style="display:inline">
<input type="hidden" name="id" value="{{ s.id }}"/>
<button type="submit">Unsubscribe</button> <span class="unsubscribe-status"></span>
</form>
<a target="_blank" href="{{ url_for('.index', subscription=s.id) }}">View Posts</a>
</article>
{% endfor %}
{% endblock body %}
{% block foot %}
{% endblock foot %}