aboutsummaryrefslogtreecommitdiff
path: root/src/web/templates
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-09-20 14:48:25 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-09-20 14:48:25 +0200
commit8bb831a4c3ce3a2e9c0d61a5a058db87a9e408a0 (patch)
treed2f2eb71f19808ea5f56f419595279658fc95035 /src/web/templates
parentlazy loading of the translation (diff)
downloadnewspipe-8bb831a4c3ce3a2e9c0d61a5a058db87a9e408a0.tar.gz
newspipe-8bb831a4c3ce3a2e9c0d61a5a058db87a9e408a0.tar.bz2
newspipe-8bb831a4c3ce3a2e9c0d61a5a058db87a9e408a0.zip
Draft for a public user profile page.
Diffstat (limited to 'src/web/templates')
-rw-r--r--src/web/templates/feed_list.html50
-rw-r--r--src/web/templates/profile.html3
-rw-r--r--src/web/templates/profile_public.html16
3 files changed, 48 insertions, 21 deletions
diff --git a/src/web/templates/feed_list.html b/src/web/templates/feed_list.html
index 093ed631..04543e4c 100644
--- a/src/web/templates/feed_list.html
+++ b/src/web/templates/feed_list.html
@@ -4,36 +4,44 @@
<thead>
<tr>
<th>#</th>
- <th>{{ _('Status') }}</th>
+ {% if current_user.is_authenticated and current_user.id == user.id %}
+ <th>{{ _('Status') }}</th>
+ {% endif %}
<th>{{ _('Title') }}</th>
<th>{{ _('Site') }}</th>
- <th>{{ _('Articles') }}</th>
- <th>{{ _('Actions') }}</th>
+ {% if current_user.is_authenticated and current_user.id == user.id %}
+ <th>{{ _('Articles') }}</th>
+ <th>{{ _('Actions') }}</th>
+ {% endif %}
</tr>
</thead>
<tbody>
{% for feed in feeds %}
- <tr {% if not feed.enabled %}class="warning"{% endif %}>
+ <tr {% if not feed.enabled and current_user.is_authenticated %}class="warning"{% endif %}>
<td>{{ loop.index }}</td>
- <td>
- {% if feed.enabled %}
- <i class="glyphicon glyphicon-eye-open" title="{{ _('Feed enabled') }}"></i>
- {% else %}
- <i class="glyphicon glyphicon-eye-close" title="{{ _('Feed disabled') }}"></i>
- {% endif %}
- {% if feed.error_count >= conf.DEFAULT_MAX_ERROR %}
- <i class="glyphicon glyphicon-exclamation-sign" title="{{ _('Feed encountered too much errors.') }}"></i>
- {% endif %}
- </td>
+ {% if current_user.is_authenticated and current_user.id == user.id %}
+ <td>
+ {% if feed.enabled %}
+ <i class="glyphicon glyphicon-eye-open" title="{{ _('Feed enabled') }}"></i>
+ {% else %}
+ <i class="glyphicon glyphicon-eye-close" title="{{ _('Feed disabled') }}"></i>
+ {% endif %}
+ {% if feed.error_count >= conf.DEFAULT_MAX_ERROR %}
+ <i class="glyphicon glyphicon-exclamation-sign" title="{{ _('Feed encountered too much errors.') }}"></i>
+ {% endif %}
+ </td>
+ {% endif %}
<td>{% if feed.icon_url %}<img src="{{ url_for('icon.icon', url=feed.icon_url) }}" width="16px" />&nbsp;{% endif %}{{ feed.title }}</td>
<td><a href="{{ feed.site_link }}">{{ feed.site_link }}</a></td>
- <td>( {{ unread_article_count.get(feed.id, 0) }} ) {{ article_count.get(feed.id, 0) }}</td>
- <td>
- <a href="{{ url_for("feed.feed", feed_id=feed.id) }}"><i class="glyphicon glyphicon-info-sign" title="{{ _('Information') }}"></i></a>
- <a href="{{ url_for("feed.form", feed_id=feed.id) }}"><i class="glyphicon glyphicon-edit" title="{{ _('Edit this feed') }}"></i></a>
- <a href="{{ url_for("feed.duplicates", feed_id=feed.id) }}"><i class="glyphicon glyphicon-book" title="{{ _('Duplicate articles') }}"></i></a>
- <a href="{{ url_for("feed.delete", feed_id=feed.id) }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this feed') }}" onclick="return confirm('{{ _('You are going to delete this feed.') }}');"></i></a>
- </td>
+ {% if current_user.is_authenticated and current_user.id == user.id %}
+ <td>( {{ unread_article_count.get(feed.id, 0) }} ) {{ article_count.get(feed.id, 0) }}</td>
+ <td>
+ <a href="{{ url_for("feed.feed", feed_id=feed.id) }}"><i class="glyphicon glyphicon-info-sign" title="{{ _('Information') }}"></i></a>
+ <a href="{{ url_for("feed.form", feed_id=feed.id) }}"><i class="glyphicon glyphicon-edit" title="{{ _('Edit this feed') }}"></i></a>
+ <a href="{{ url_for("feed.duplicates", feed_id=feed.id) }}"><i class="glyphicon glyphicon-book" title="{{ _('Duplicate articles') }}"></i></a>
+ <a href="{{ url_for("feed.delete", feed_id=feed.id) }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this feed') }}" onclick="return confirm('{{ _('You are going to delete this feed.') }}');"></i></a>
+ </td>
+ {% endif %}
</tr>
{% endfor %}
</tbody>
diff --git a/src/web/templates/profile.html b/src/web/templates/profile.html
index acd593b2..8751446f 100644
--- a/src/web/templates/profile.html
+++ b/src/web/templates/profile.html
@@ -34,6 +34,9 @@
{{ form.refresh_rate.label }}
{{ form.refresh_rate(class_="form-control") }} {% for error in form.refresh_rate.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
+
+ {{ form.is_public_profile.label }}
+ {{ form.is_public_profile(class_="form-control") }} {% for error in form.is_public_profile.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
<br />
{{ form.submit(class_="btn") }}
</form>
diff --git a/src/web/templates/profile_public.html b/src/web/templates/profile_public.html
new file mode 100644
index 00000000..04beee8e
--- /dev/null
+++ b/src/web/templates/profile_public.html
@@ -0,0 +1,16 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <h1>{{ user.nickname }}</h1>
+ <div class="row">
+ <div class="col-md-6">
+ <p>{{ _('Member since') }} {{ user.date_created | datetime }}.</p>
+ <p>{{ _('Last seen:') }} {{ user.last_seen | datetime }}.</p>
+ </div>
+ </div>
+
+ <h2>Feeds</h2>
+ {% include "feed_list.html" %}
+
+</div><!-- /.container -->
+{% endblock %}
bgstack15