aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/templates
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r/templates')
-rw-r--r--pyaggr3g470r/templates/about.html10
-rw-r--r--pyaggr3g470r/templates/article.html13
-rw-r--r--pyaggr3g470r/templates/articles.html37
-rw-r--r--pyaggr3g470r/templates/favorites.html28
-rw-r--r--pyaggr3g470r/templates/feed.html12
-rw-r--r--pyaggr3g470r/templates/feeds.html11
-rw-r--r--pyaggr3g470r/templates/home.html37
-rw-r--r--pyaggr3g470r/templates/layout.html65
-rw-r--r--pyaggr3g470r/templates/login.html32
-rw-r--r--pyaggr3g470r/templates/management.html32
-rw-r--r--pyaggr3g470r/templates/unread.html37
11 files changed, 314 insertions, 0 deletions
diff --git a/pyaggr3g470r/templates/about.html b/pyaggr3g470r/templates/about.html
new file mode 100644
index 00000000..7675887e
--- /dev/null
+++ b/pyaggr3g470r/templates/about.html
@@ -0,0 +1,10 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <div class="jumbotron">
+ <p>This software is under GPLv3 license. You are welcome to copy, modify or
+ redistribute the source code according to the <a href="http://www.gnu.org/licenses/gpl-3.0.txt">GPLv3</a> license.<br />
+ <a href="https://bitbucket.org/cedricbonhomme/pyaggr3g470r/" rel="noreferrer" target="_blank">Source code</a> of pyAggr3g470r.</p>
+ </div>
+</div><!-- /.container -->
+{% endblock %}
diff --git a/pyaggr3g470r/templates/article.html b/pyaggr3g470r/templates/article.html
new file mode 100644
index 00000000..c05cac5e
--- /dev/null
+++ b/pyaggr3g470r/templates/article.html
@@ -0,0 +1,13 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <div class="jumbotron">
+ <h2><a href="{{ article.link }}">{{ article.title }}</a></h2>
+ <a href="/delete/{{ article.id }}"><i class="glyphicon glyphicon-remove" title="Delete this article"></i></a>
+ <h6>{{ article.date }}</h6>
+ </div>
+ <div class="jumbotron">
+ {{ article.content|safe }}
+ </div>
+</div><!-- /.container -->
+{% endblock %}
diff --git a/pyaggr3g470r/templates/articles.html b/pyaggr3g470r/templates/articles.html
new file mode 100644
index 00000000..28420b5c
--- /dev/null
+++ b/pyaggr3g470r/templates/articles.html
@@ -0,0 +1,37 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <div class="jumbotron">
+ <h2><a href="{{ feed.site_link }}">{{ feed.title }}</a></h2>
+ <h3>{{ feed.articles|length }} articles.</h3>
+ </div>
+ {% for number in range(0, feed.articles|length-2, 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 }}</a><h2>
+ {% 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">
+ <div class="col-xs-6 col-sm-4 col-md-4">
+ {% if feed.articles[feed.articles|length-2].readed %}<h3>{% else %}<h1>{% endif %}
+ <a href="/article/{{ feed.articles[feed.articles|length-2].id }}">{{ feed.articles[feed.articles|length-2].title }}</a><h2>
+ {% if feed.articles[feed.articles|length-2].readed %}</h3>{% else %}</h1>{% endif %}
+ <h6>{{ feed.articles[feed.articles|length-2].date }}</h6>
+ </div>
+ <div class="col-xs-6 col-sm-4 col-md-4">
+ {% if feed.articles[feed.articles|length-1].readed %}<h3>{% else %}<h1>{% endif %}
+ <a href="/article/{{ feed.articles[feed.articles|length-1].id }}">{{ feed.articles[feed.articles|length-1].title }}</a><h2>
+ {% if feed.articles[feed.articles|length-1].readed %}</h3>{% else %}</h1>{% endif %}
+ <h6>{{ feed.articles[feed.articles|length-1].date }}</h6>
+ </div>
+ </div>
+ {% endif %}
+</div><!-- /.container -->
+{% endblock %}
diff --git a/pyaggr3g470r/templates/favorites.html b/pyaggr3g470r/templates/favorites.html
new file mode 100644
index 00000000..0b912286
--- /dev/null
+++ b/pyaggr3g470r/templates/favorites.html
@@ -0,0 +1,28 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ {% for feed in favorites %}
+ <div class="row">
+ <div class="col-md-6 col-md-offset-3">
+ <h1>{{ feed }}</h1>
+ </div>
+ </div>
+ {% for number in range(0, favorites[feed]|length-2, 3) %}
+ <div class="row">
+ <div class="col-xs-6 col-sm-4 col-md-4">
+ <h2><a href="/article/{{ favorites[feed][number].id }}">{{ favorites[feed][number].title }}</a><h2>
+ <h6>{{ favorites[feed][number].date }}</h6>
+ </div>
+ <div class="col-xs-6 col-sm-4 col-md-4">
+ <h2><a href="/article/{{ favorites[feed][number+1].id }}">{{ favorites[feed][number+1].title }}</a><h2>
+ <h6>{{ favorites[feed][number+1].date }}</h6>
+ </div>
+ <div class="col-xs-6 col-sm-4 col-md-4">
+ <h2><a href="/article/{{ favorites[feed][number+2].id }}">{{ favorites[feed][number+2].title }}</a><h2>
+ <h6>{{ favorites[feed][number+2].date }}</h6>
+ </div>
+ </div>
+ {% endfor %}
+ {% endfor %}
+</div><!-- /.container -->
+{% endblock %} \ No newline at end of file
diff --git a/pyaggr3g470r/templates/feed.html b/pyaggr3g470r/templates/feed.html
new file mode 100644
index 00000000..d89b11cf
--- /dev/null
+++ b/pyaggr3g470r/templates/feed.html
@@ -0,0 +1,12 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <div class="jumbotron">
+ <h2>{{ feed.title }}</h2>
+ <a href="/delete_feed/{{ feed.oid }}"><i class="glyphicon glyphicon-remove" title="Delete this feed"></i></a>
+ <p>This feed contains {{ feed.articles|count }} <a href="/articles/{{ feed.id }}">articles</a>.</p>
+ <p>Address of the feed: <a href="{{ feed.link }}">{{ feed.link }}</a>.</p>
+ <p>Address of the site: <a href="{{ feed.site_link }}">{{ feed.site_link }}</a>.</p>
+ </div>
+</div><!-- /.container -->
+{% endblock %} \ No newline at end of file
diff --git a/pyaggr3g470r/templates/feeds.html b/pyaggr3g470r/templates/feeds.html
new file mode 100644
index 00000000..1efa0b1f
--- /dev/null
+++ b/pyaggr3g470r/templates/feeds.html
@@ -0,0 +1,11 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <h1>You are subscribed to the following feeds</h1>
+ <ul>
+ {% for feed in feeds %}
+ <li><a href="/feed/{{ feed.oid }}">{{ feed.title }}</a></li>
+ {% endfor %}
+ </ul>
+</div><!-- /.container -->
+{% endblock %} \ No newline at end of file
diff --git a/pyaggr3g470r/templates/home.html b/pyaggr3g470r/templates/home.html
new file mode 100644
index 00000000..46842382
--- /dev/null
+++ b/pyaggr3g470r/templates/home.html
@@ -0,0 +1,37 @@
+ {% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ {% for feed in feeds %}
+ <div class="row">
+ <div class="col-md-6 col-md-offset-3">
+ <h1>{{ feed.title }}</h1>
+ <a href="/articles/{{ feed.oid }}"><i class="glyphicon glyphicon-th-list"></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 }}</a><h2>
+ {% 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(0, feed.articles|length % 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 }}</a><h2>
+ {% if feed.articles[n].readed %}</h3>{% else %}</h1>{% endif %}
+ <h6>{{ feed.articles[n].date }}</h6>
+ </div>
+ {% endfor %}
+ </div>
+ {% endif %}
+ {% endfor %}
+</div><!-- /.container -->
+{% endblock %} \ No newline at end of file
diff --git a/pyaggr3g470r/templates/layout.html b/pyaggr3g470r/templates/layout.html
new file mode 100644
index 00000000..659c573c
--- /dev/null
+++ b/pyaggr3g470r/templates/layout.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+
+ {% block head %}
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="pyAggr3g470r">
+ <meta name="author" content="">
+
+ <title>pyAggr3g470r</title>
+
+ <!-- Bootstrap core CSS -->
+ <link href="/static/css/bootstrap.css" rel="stylesheet">
+
+ <!-- Add custom CSS here -->
+ <style>
+ body {margin-top: 60px;}
+ </style>
+
+ </head>
+ {% endblock %}
+
+ <body>
+
+ <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="/">pyAggr3g470r</a>
+ </div>
+
+ <!-- Collect the nav links, forms, and other content for toggling -->
+ <div class="collapse navbar-collapse navbar-ex1-collapse">
+ <ul class="nav navbar-nav">
+ {% if g.user.is_authenticated() %}
+ <li><a href="/fetch">Fetch</a></li>
+ <li><a href="/management/">Management</a></li>
+ <li><a href="#services">History</a></li>
+ <li><a href="/favorites/">Favorites</a></li>
+ <li><a href="/unread/">Unread</a></li>
+ <li><a href="/about/">About</a></li>
+ <li><a href="{{ url_for('logout') }}">Logout</a></li>
+ {% endif %}
+ </ul>
+ </div><!-- /.navbar-collapse -->
+ </div><!-- /.container -->
+ </nav>
+
+
+ {% block content %}{% endblock %}
+
+ <!-- Bootstrap core JavaScript -->
+ <!-- Placed at the end of the document so the pages load faster -->
+ <!-- Make sure to add jQuery - download the most recent version at http://jquery.com/ -->
+ <script src="/static/js/jquery.js"></script>
+ <script src="/static/js/bootstrap.js"></script>
+ </body>
+ </body>
+</html>
diff --git a/pyaggr3g470r/templates/login.html b/pyaggr3g470r/templates/login.html
new file mode 100644
index 00000000..90700bcf
--- /dev/null
+++ b/pyaggr3g470r/templates/login.html
@@ -0,0 +1,32 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <div class="jumbotron">
+ <h2>Log In</h2>
+
+ {% for message in form.email.errors %}
+ <div class="flash">{{ message }}</div>
+ {% endfor %}
+
+ {% for message in form.password.errors %}
+ <div class="flash">{{ message }}</div>
+ {% endfor %}
+
+ <form action="{{ url_for('login') }}" method=post>
+ {{ form.hidden_tag() }}
+
+ <div class="form-group">
+ {{ form.email.label }}
+ {{ form.email(class_="form-control", placeholder="Your email") }}
+ </div>
+
+ <div class="form-group">
+ {{ form.password.label }}
+ {{ form.password(class_="form-control", placeholder="Your Password") }}
+ </div>
+
+ {{ form.submit(class_="btn") }}
+ </form>
+ </div>
+</div><!-- /.container -->
+{% endblock %} \ No newline at end of file
diff --git a/pyaggr3g470r/templates/management.html b/pyaggr3g470r/templates/management.html
new file mode 100644
index 00000000..ed7a5667
--- /dev/null
+++ b/pyaggr3g470r/templates/management.html
@@ -0,0 +1,32 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <div class="jumbotron">
+ <h1>Add a feed</h1>
+ <form action="/add_feed/" method="post" name="save">
+ {{ form.hidden_tag() }}
+
+ {{ form.title.label }}
+ {{ form.title(class_="form-control") }} {% for error in form.title.errors %} <span style="color: red;">{{ error }}</span>{% endfor %}
+
+ {{ form.link.label }}
+ {{ form.link(class_="form-control") }} {% for error in form.link.errors %} <span style="color: red;">{{ error }}</span>{% endfor %}
+
+ {{ form.site_link.label }}
+ {{ form.site_link(class_="form-control") }} {% for error in form.site_link.errors %} <span style="color: red;">{{ error }}</span>{% endfor %}
+
+ {{ form.submit(class_="btn") }}
+ </form>
+ </div>
+
+ <div class="jumbotron">
+ <h1>Subscriptions</h1>
+ <p>You are subscribed to {{ nb_feeds }} <a href="/feeds">feeds</a>.</p>
+ </div>
+
+ <div class="jumbotron">
+ <h1>Database</h1>
+ <p>{{ nb_articles }} articles are stored in the database with {{ nb_unread_articles }} <a href="/unread/">unread articles</a>.</p>
+ </div>
+</div><!-- /.container -->
+{% endblock %} \ No newline at end of file
diff --git a/pyaggr3g470r/templates/unread.html b/pyaggr3g470r/templates/unread.html
new file mode 100644
index 00000000..46842382
--- /dev/null
+++ b/pyaggr3g470r/templates/unread.html
@@ -0,0 +1,37 @@
+ {% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ {% for feed in feeds %}
+ <div class="row">
+ <div class="col-md-6 col-md-offset-3">
+ <h1>{{ feed.title }}</h1>
+ <a href="/articles/{{ feed.oid }}"><i class="glyphicon glyphicon-th-list"></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 }}</a><h2>
+ {% 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(0, feed.articles|length % 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 }}</a><h2>
+ {% if feed.articles[n].readed %}</h3>{% else %}</h1>{% endif %}
+ <h6>{{ feed.articles[n].date }}</h6>
+ </div>
+ {% endfor %}
+ </div>
+ {% endif %}
+ {% endfor %}
+</div><!-- /.container -->
+{% endblock %} \ No newline at end of file
bgstack15