aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/templates
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r/templates')
-rw-r--r--pyaggr3g470r/templates/home.html8
-rw-r--r--pyaggr3g470r/templates/layout.html12
-rw-r--r--pyaggr3g470r/templates/search.html48
3 files changed, 14 insertions, 54 deletions
diff --git a/pyaggr3g470r/templates/home.html b/pyaggr3g470r/templates/home.html
index 461b6928..a31d65e1 100644
--- a/pyaggr3g470r/templates/home.html
+++ b/pyaggr3g470r/templates/home.html
@@ -14,7 +14,7 @@
{% if not feed_id %}</b>{% endif %}
</a></li>
{% for fid, nbunread in unread|dictsort(by='value')|reverse %}
- <li class="feed-menu"><a href="{{ gen_url(feed=fid) }}">
+ <li class="feed-menu"><a href="{{ gen_url(feed_id=fid) }}">
{% if feed_id == fid %}<b>{% endif %}
{% if in_error.get(fid, 0) > 0 %}
<span style="background-color: {{ "red" if in_error[fid] > conf.DEFAULT_MAX_ERROR -1 else "orange" }} ;" class="badge pull-right" title="Some errors occured while trying to retrieve that feed.">{{ in_error[fid] }} {{ _("error") }}{% if in_error[fid] > 1 %}s{% endif %}</span>
@@ -33,7 +33,7 @@
</span></li>
{% endfor %}
{% for fid, ftitle in feeds|dictsort(case_sensitive=False, by='value') if not fid in unread %}
- <li class="feed-menu"><a href="{{ gen_url(feed=fid) }}">
+ <li class="feed-menu"><a href="{{ gen_url(feed_id=fid) }}">
{% if in_error.get(fid, 0) > 0 %}
<span style="background-color: {{ "red" if in_error[fid] > conf.DEFAULT_MAX_ERROR - 1 else "orange" }} ;" class="badge pull-right" title="Some errors occured while trying to retrieve that feed.">{{ in_error[fid] }} {{ _("error") }}{% if in_error[fid] > 1 %}s{% endif %}</span>
{% endif %}
@@ -73,9 +73,9 @@
<thead>
<tr>
<th></th>
- <th><a href="{{ gen_url(sort_='feed') }}">{{ _('Feed') }}</a></th>
+ <th><a href="{{ gen_url(sort_='-feed' if sort_ == 'feed' else 'feed') }}">{{ _('Feed') }}</a></th>
<th>{{ _('Article') }}</th>
- <th><a href="{{ gen_url(sort_='date') }}">{{ _('Date') }}</a></th>
+ <th><a href="{{ gen_url(sort_='-date' if sort_ == 'date' else 'date') }}">{{ _('Date') }}</a></th>
</tr>
</thead>
<tbody>
diff --git a/pyaggr3g470r/templates/layout.html b/pyaggr3g470r/templates/layout.html
index 484bbdc7..a54125ea 100644
--- a/pyaggr3g470r/templates/layout.html
+++ b/pyaggr3g470r/templates/layout.html
@@ -86,6 +86,7 @@
<li><a href="{{ url_for("profile") }}"><span class="glyphicon glyphicon-user"></span> {{ _('Profile') }}</a></li>
<li><a href="{{ url_for("management") }}"><span class="glyphicon glyphicon-cog"></span> {{ _('Your data') }}</a></li>
{% if g.user.is_admin() %}
+ <li><a href="{{ url_for("about") }}"><span class="glyphicon glyphicon-question-sign"></span> {{ _('About') }}</a></li>
<li role="presentation" class="divider"></li>
<li><a href="{{ url_for("dashboard") }}"><span class="glyphicon glyphicon-dashboard"></span> {{ _('Dashboard') }}</a></li>
<li role="presentation" class="divider"></li>
@@ -101,9 +102,16 @@
</a>
<ul class="dropdown-menu">
<li>
- <form class="navbar-form" method=get action="/search" role="search">
+ <form class="navbar-form" method=get action="{{ url_for("search") }}" role="search">
<div class="input-group">
- <input type="text" class="form-control" name="query" placeholder="Search">
+ {% if filter_ %}<input type="hidden" name="filter_" value="{{ filter_ }}" />{% endif %}
+ {% if limit %}<input type="hidden" name="limit" value="{{ limit }}" />{% endif %}
+ {% if feed_id %}<input type="hidden" name="feed_id" value="{{ feed_id }}" />{% endif %}
+ <label for="search_title">{{ _("Title") }}</label>
+ <input type="checkbox" name="search_title" {% if search_title == 'on' or not (search_title == 'on' or search_content == 'on') %}checked{%endif%}/>
+ <label for="search_content">{{ _("Content") }}</label>
+ <input type="checkbox" name="search_content" {% if search_content == 'on' %}checked{%endif%}/>
+ <input type="text" class="form-control" name="query" placeholder="{{ _("Search") }}" {% if search_query %} value="{{ search_query }}"{% endif %} />
</div>
</form>
</li>
diff --git a/pyaggr3g470r/templates/search.html b/pyaggr3g470r/templates/search.html
deleted file mode 100644
index d3a1558d..00000000
--- a/pyaggr3g470r/templates/search.html
+++ /dev/null
@@ -1,48 +0,0 @@
- {% extends "layout.html" %}
-{% block content %}
-<div class="container">
- {% if feeds|count == 0 %}
- <div class="page-header">
- <h1>No results</h1>
- </div>
- {% else %}
- <div class="page-header">
- <h1>{{ nb_articles }} {% if nb_articles !=1 %} results {% else %} result {% endif %} for <i>{{ query }}</i></h1>
- </div>
- {% for feed in feeds|sort(attribute="title") %}
- <div class="row">
- <div class="col-md-6 col-md-offset-3">
- <h1>{{ feed.title|safe }}</h1>
- <a href="/articles/{{ feed.id }}/100"><i class="glyphicon glyphicon-th-list" title="More articles"></i></a>
- <a href="/feed/{{ feed.id }}"><i class="glyphicon glyphicon-info-sign" title="Details"></i></a>
- <a href="/edit_feed/{{ feed.id }}"><i class="glyphicon glyphicon-edit" title="Edit this feed"></i></a>
- </div>
- </div>
- {% for number in range(0, feed.articles|length-(feed.articles|length % 3), 3) %}
- <div class="row">
- {% for n in range(number, number+3) %}
- <div class="col-xs-6 col-sm-4 col-md-4">
- {% if feed.articles[n].readed %}<h3>{% else %}<h1>{% endif %}
- <a href="/article/{{ feed.articles[n].id }}">{{ feed.articles[n].title|safe }}</a>
- {% if feed.articles[n].readed %}</h3>{% else %}</h1>{% endif %}
- <h6>{{ feed.articles[n].date }}</h6>
- </div>
- {% endfor %}
- </div>
- {% endfor %}
- {% if feed.articles|length % 3 != 0 %}
- <div class="row">
- {% for n in range(feed.articles|length-(feed.articles|length % 3), feed.articles|length) %}
- <div class="col-xs-6 col-sm-4 col-md-4">
- {% if feed.articles[n].readed %}<h3>{% else %}<h1>{% endif %}
- <a href="/article/{{ feed.articles[n].id }}">{{ feed.articles[n].title|safe }}</a>
- {% if feed.articles[n].readed %}</h3>{% else %}</h1>{% endif %}
- <h6>{{ feed.articles[n].date }}</h6>
- </div>
- {% endfor %}
- </div>
- {% endif %}
- {% endfor %}
- {% endif %}
-</div><!-- /.container -->
-{% endblock %}
bgstack15