aboutsummaryrefslogtreecommitdiff
path: root/newspipe/templates/edit_feed.html
blob: 41e929aac7dfd97f79b365702eb82b4e3a603f4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{% extends "layout.html" %}
{% block content %}
<div class="container">
        <h3>{{ action }}</h3>
        <form action="" method="POST" name="save">
            {{ form.hidden_tag() }}
            <p>Enter the URL of the website or the URL of the feed (RSS/ATOM).</p>
            <div class="row row-cols-md-auto g-2 align-items-center">
                <div class="col-md-6">
                    <label for="{{ form.site_link.id }}" class="col-sm-3 control-label">{{ form.site_link.label }}</label>
                    {{ form.site_link(class_="form-control", size="100%") }}
                    {% for error in form.site_link.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
                </div>
                <div class="col-md-6">
                    <label for="{{ form.link.id }}" class="col-sm-3 control-label">{{ form.link.label }}</label>
                    {{ form.link(class_="form-control", size="100%") }}
                    {% for error in form.link.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
                </div>
                <div class="col-md-12">
                    {{ form.submit(class_="btn btn-primary") }}
                </div>
            </div>

            <hr />

            <div class="row row-cols-md-auto g-2 align-items-center">
                <div class="col-md-6">
                    <label for="{{ form.title.id }}" class="col control-label">{{ form.title.label }}</label>
                    {{ form.title(class_="form-control", size="100%", placeholder=_('Will be retrieved automatically but you can specify a custom title.')) }}
                    {% for error in form.title.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
                </div>
                <div class="col-md-6">
                    <label for="{{ form.category_id.id }}" class="col control-label">{{ form.category_id.label }}</label>
                    {{ form.category_id(class_="form-control", placeholder=_('Optional')) }}
                    {% for error in form.category_id.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
                </div>
            </div>

            <br />

            <div class="row row-cols-md-auto g-2 align-items-center">
                <div class="col-md-6">
                    <label for="{{ form.enabled.id }}" class="form-check-label">{{ form.enabled.label }}</label>
                    {{ form.enabled(class_="form-check-input",  style="margin-left: 0px;") }}
                    <div class="text-muted text-justify">
                        {{ _("If unchecked, this feed won't be retrieved by the aggregator.") }}
                    </div>
                </div>
                <div class="col-md-6">
                    <label for="{{ form.private.id }}" class="form-check-label">{{ form.private.label }}</label>
                    {{ form.private(class_="form-check-input",  style="margin-left: 0px;") }}
                    <div class="text-muted text-justify">
                        {{ _("If checked, this feed won't be listed on <a href='%(url)s'>your profile page</a>.", url=url_for('user.profile_public', nickname=current_user.nickname) ) }}
                        {{ _("Check this box if there is a private token in the link of the feed.") }}
                    </div>
                </div>
            </div>

            <hr />

            <div class="row">
              <div class="col">
                <h4>{{ _("Filters") }}</h4>
                <div class="text-justify">
                  {{ _("Here you can define actions to perform on newly retrieved items.") }}
                </div>
                <button type="button" class="btn btn-primary" id="add-feed-filter-row" >+</button>
              </div>
            </div>

            <br />

            <div id="filters-container">
                {% if feed %}
                    {% for filter_ in feed.filters or [] %}
                      <div class="row row-cols-md-auto g-5 align-items-center">
                        <div class="col">
                            <input value="-" type="button" class="form-control del-feed-filter-row" />
                        </div>
                        <div class="col">
                            <select name="type" class="form-select" >
                                <option value="simple match" {% if filter_.get("type") == "simple match" %}selected{% endif %}>{{ _("simple match") }}</option>
                                <option value="regex" {% if filter_.get("type") == "regex" %}selected{% endif %}>{{ _("regex") }}</option>
                            </select>
                        </div>
                        <div class="col">
                            <input type="text" class="form-control" value="{{ filter_.get("pattern") }}" name="pattern" />
                        </div>
                        <div class="col">
                            <select name="action_on" class="form-select">
                                <option value="match" {% if filter_.get("action on") == "match" %}selected{% endif %}>{{ _("match") }}</option>
                                <option value="no match" {% if filter_.get("action on") == "no match" %}selected{% endif %}>{{ _("no match") }}</option>
                            </select>
                        </div>
                        <div class="col">
                            <select name="action" class="form-select">
                                <option value="mark as read" {% if filter_.get("action") == "mark as read" %}selected{% endif %}>{{ _("mark as read") }}</option>
                                <option value="mark as favorite" {% if filter_.get("action") == "mark as favorite" %}selected{% endif %}>{{ _("mark as favorite") }}</option>
                            </select>
                        </div>
                      </div><br />
                    {% endfor %}
                {% endif %}
            </div>

            <br />

            <div class="form-group">
                <div class="col-sm-offset-3 col-sm-9">
                    {{ form.submit(class_="btn btn-primary") }}
                </div>
            </div>
        </form>
</div><!-- /.container -->
{% endblock %}
bgstack15