diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-07-03 09:14:35 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-07-03 13:58:54 +0200 |
commit | 1799ef77ae8c611e11750aade95b6750e84e95de (patch) | |
tree | 7f71c95008a292cfed641139c0bba92f0e03d87a /pyaggr3g470r | |
parent | using conf.DEFAULT_MAX_ERROR in feed template (diff) | |
download | newspipe-1799ef77ae8c611e11750aade95b6750e84e95de.tar.gz newspipe-1799ef77ae8c611e11750aade95b6750e84e95de.tar.bz2 newspipe-1799ef77ae8c611e11750aade95b6750e84e95de.zip |
Minor improvements to the edit feed forms.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/static/js/feed.js | 32 | ||||
-rw-r--r-- | pyaggr3g470r/templates/edit_feed.html | 55 |
2 files changed, 48 insertions, 39 deletions
diff --git a/pyaggr3g470r/static/js/feed.js b/pyaggr3g470r/static/js/feed.js index b1e3110e..a2347286 100644 --- a/pyaggr3g470r/static/js/feed.js +++ b/pyaggr3g470r/static/js/feed.js @@ -1,20 +1,22 @@ $('.container').on('click', '#add-feed-filter-row', function() { $('#filters-container').append( - '<div class="col-sm-9">' - + ' <input value="-" type="button" class="del-feed-filter-row" />' - + ' <select name="type">' - + ' <option value="simple match" selected>simple match</option>' - + ' <option value="regex">regex</option>' - + ' </select/>' - + ' <input type="text" size="50%" name="pattern" />' - + ' <select name="action_on">' - + ' <option value="match" selected>match</option>' - + ' <option value="no match">no match</option>' - + ' </select/>' - + ' <select name="action">' - + ' <option value="mark as read" selected>mark as read</option>' - + ' <option value="mark as favorite">mark as favorite</option>' - + ' </select/>' + '<div class="form-inline">' + + ' <div class="form-group">' + + ' <input value="-" type="button" class="form-control del-feed-filter-row" />' + + ' <select name="type" class="form-control">' + + ' <option value="simple match" selected>simple match</option>' + + ' <option value="regex">regex</option>' + + ' </select>' + + ' <input type="text" class="form-control" name="pattern" />' + + ' <select name="action_on" class="form-control">' + + ' <option value="match" selected>match</option>' + + ' <option value="no match">no match</option>' + + ' </select>' + + ' <select name="action" class="form-control">' + + ' <option value="mark as read" selected>mark as read</option>' + + ' <option value="mark as favorite">mark as favorite</option>' + + ' </select>' + + ' </div>' + '</div>'); }); $('.container').on('click', '.del-feed-filter-row', function() { diff --git a/pyaggr3g470r/templates/edit_feed.html b/pyaggr3g470r/templates/edit_feed.html index 22aab58b..d1e45b0e 100644 --- a/pyaggr3g470r/templates/edit_feed.html +++ b/pyaggr3g470r/templates/edit_feed.html @@ -8,7 +8,7 @@ <div class="form-group"> <label for="{{ form.link.id }}" class="col-sm-3 control-label">{{ form.link.label }}</label> <div class="col-sm-9"> - {{ form.link(size="100%") }} + {{ form.link(class_="form-control", size="100%") }} </div> {% for error in form.link.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %} </div> @@ -16,7 +16,7 @@ <div class="form-group"> <label for="{{ form.title.id }}" class="col-sm-3 control-label">{{ form.title.label }}</label> <div class="col-sm-9"> - {{ form.title(size="100%", placeholder=_('Optional')) }} + {{ form.title(class_="form-control", size="100%", placeholder=_('Optional')) }} </div> {% for error in form.title.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %} </div> @@ -24,7 +24,7 @@ <div class="form-group"> <label for="{{ form.site_link.id }}" class="col-sm-3 control-label">{{ form.site_link.label }}</label> <div class="col-sm-9"> - {{ form.site_link(size="100%", placeholder=_('Optional')) }} + {{ form.site_link(class_="form-control", size="100%", placeholder=_('Optional')) }} </div> {% for error in form.site_link.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %} </div> @@ -33,33 +33,40 @@ <label for="{{ form.enabled.id }}" class="col-sm-3 control-label">{{ form.enabled.label }}</label> <div class="col-sm-9"> <div class="checkbox"> - {{ form.enabled(style="margin-left: 0px;") }} + {{ form.enabled(class_="checkbox", style="margin-left: 0px;") }} </div> </div> </div> - <div class="form-group" id="filters-container"> - <label class="col-sm-3 control-label">{{ _("Filters") }} <input value="+" type="button" id="add-feed-filter-row" /></label> + <div class="form-group"> + <label class="col-sm-3 control-label">{{ _("Filters") }}</label> + <div class="col-sm-1"> + <input value="+" type="button" class="form-control" id="add-feed-filter-row" /> + </div> + </div> {% if feed %} - {% for filter_ in feed.filters or [] %} - <div class="col-sm-9"> - <input value="-" type="button" class="del-feed-filter-row" /> - <select name="type"> - <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/> - <input type="text" value="{{ filter_.get("pattern") }}" size="50%" name="pattern" /> - <select name="action_on"> - <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/> - <select name="action"> - <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 class="form-inline col-sm-offset-4 col-sm-8" id="filters-container"> + {% for filter_ in feed.filters or [] %} + <div class="form-group"> + <input value="-" type="button" class="form-control del-feed-filter-row" /> + <select name="type" class="form-control" > + <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> + <input type="text" class="form-control" value="{{ filter_.get("pattern") }}" name="pattern" /> + <select name="action_on" class="form-control"> + <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> + <select name="action" class="form-control"> + <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> + {% endfor %} </div> - {% endfor %} + {% endif %} - </div> + <div class="form-group"> <div class="col-sm-offset-3 col-sm-9"> {{ form.submit(class_="btn btn-default") }} |