aboutsummaryrefslogtreecommitdiff
path: root/src/web/templates
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-10-12 22:36:01 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-01-26 23:46:32 +0100
commit2c0e17cb977a1e8782799b337df8b1583d019906 (patch)
tree75563e440e9eac14950fa1a71a83e64df20e52d0 /src/web/templates
parentfixing sqlalchemy resolving warning (diff)
downloadnewspipe-2c0e17cb977a1e8782799b337df8b1583d019906.tar.gz
newspipe-2c0e17cb977a1e8782799b337df8b1583d019906.tar.bz2
newspipe-2c0e17cb977a1e8782799b337df8b1583d019906.zip
bootstraping react
Diffstat (limited to 'src/web/templates')
-rw-r--r--src/web/templates/categories.html36
-rw-r--r--src/web/templates/edit_category.html23
-rw-r--r--src/web/templates/emails/new_account.txt4
-rw-r--r--src/web/templates/feed_list.html2
-rw-r--r--src/web/templates/feeds.html2
-rw-r--r--src/web/templates/home2.html8
-rw-r--r--src/web/templates/layout.html53
-rw-r--r--src/web/templates/layout.html.orig149
-rw-r--r--src/web/templates/opml.xml4
9 files changed, 240 insertions, 41 deletions
diff --git a/src/web/templates/categories.html b/src/web/templates/categories.html
new file mode 100644
index 00000000..a61cc4b2
--- /dev/null
+++ b/src/web/templates/categories.html
@@ -0,0 +1,36 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <h1>{{ _("You have %(categories)d categories &middot; Add a %(start_link)scategory%(end_link)s", categories=categories|count, start_link=("<a href='%s'>" % url_for("category.form"))|safe, end_link="</a>"|safe) }}</h1>
+ {% if categories|count == 0 %}
+ <h1>{{_("No category")}}</h1>
+ {% else %}
+ <div class="table-responsive">
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>{{ _('Name') }}</th>
+ <th>{{ _('Feeds') }}</th>
+ <th>{{ _('Articles') }}</th>
+ <th>{{ _('Actions') }}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for category in categories|sort(attribute="name") %}
+ <tr>
+ <td>{{ loop.index }}</td>
+ <td>{{ category.name }}</td>
+ <td>{{ feeds_count.get(category.id, 0) }}</td>
+ <td>( {{ unread_article_count.get(category.id, 0) }} ) {{ article_count.get(category.id, 0) }}</td>
+ <td>
+ <a href="{{ url_for("category.form", category_id=category.id) }}"><i class="glyphicon glyphicon-edit" title='{{ _("Edit this category") }}'></i></a>
+ <a href="{{ url_for("category.delete", category_id=category.id) }}"><i class="glyphicon glyphicon-remove" title='{{ _("Delete this category") }}' onclick="return confirm('{{ _('You are going to delete this category.') }}');"></i></a>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% endif %}
+{% endblock %}
diff --git a/src/web/templates/edit_category.html b/src/web/templates/edit_category.html
new file mode 100644
index 00000000..93c952d6
--- /dev/null
+++ b/src/web/templates/edit_category.html
@@ -0,0 +1,23 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <div class="well">
+ <h3>{{ action }}</h3>
+ <form action="" method="post" name="save" class="form-horizontal">
+ {{ form.hidden_tag() }}
+ <div class="form-group">
+ <label for="{{ form.name.id }}" class="col-sm-3 control-label">{{ form.name.label }}</label>
+ <div class="col-sm-9">
+ {{ form.name(class_="form-control", size="100%") }}
+ </div>
+ {% for error in form.name.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
+ </div>
+ <div class="form-group">
+ <div class="col-sm-offset-3 col-sm-9">
+ {{ form.submit(class_="btn btn-default") }}
+ </div>
+ </div>
+ </form>
+ </div>
+</div><!-- /.container -->
+{% endblock %}
diff --git a/src/web/templates/emails/new_account.txt b/src/web/templates/emails/new_account.txt
index 6397f502..6335a34e 100644
--- a/src/web/templates/emails/new_account.txt
+++ b/src/web/templates/emails/new_account.txt
@@ -1,11 +1,11 @@
Hello {{ user.firstname }} {{ user.lastname }},
An account has been created for you.
-You can now access the pyAggr3g470r platform ({{ platform_url }}).
+You can now access the JARR platform ({{ platform_url }}).
Your login is your e-mail address and your password is:
---
{{ password }}
---
-Regards, \ No newline at end of file
+Regards,
diff --git a/src/web/templates/feed_list.html b/src/web/templates/feed_list.html
index 51561dee..114ae960 100644
--- a/src/web/templates/feed_list.html
+++ b/src/web/templates/feed_list.html
@@ -1,4 +1,4 @@
-{% if feeds| count == 0 %}
+{% if feeds.count() == 0 %}
<h1>{{_("No feed")}}</h1>
{% else %}
<div class="table-responsive">
diff --git a/src/web/templates/feeds.html b/src/web/templates/feeds.html
index 074957f7..9523d43f 100644
--- a/src/web/templates/feeds.html
+++ b/src/web/templates/feeds.html
@@ -1,7 +1,7 @@
{% extends "layout.html" %}
{% block content %}
<div class="container">
- <h1>{{ _('You are subscribed to') }} {{ feeds|count }} {{ _('feeds') }} &middot; {{ _('Add a') }} <a href="{{ url_for("feed.form") }}">{{ _('feed') }}</a></h1>
+ <h1>{{ _('You are subscribed to %(feed_count)d feeds.', feed_count=feeds.count()) }} &middot; {{ _('Add a') }} <a href="{{ url_for("feed.form") }}">{{ _('feed') }}</a></h1>
{% include "feed_list.html" %}
</div><!-- /.container -->
{% endblock %}
diff --git a/src/web/templates/home2.html b/src/web/templates/home2.html
new file mode 100644
index 00000000..54413b35
--- /dev/null
+++ b/src/web/templates/home2.html
@@ -0,0 +1,8 @@
+{% extends "layout.html" %}
+{% block content %}
+<section id="jarrapp"></section>
+<script type="text/javascript" src="{{ url_for("static", filename="js/jquery.js") }}"></script>
+<script type="text/javascript" src="{{ url_for("static", filename="js/bootstrap.min.js") }}"></script>
+<script type="text/javascript" src="{{ url_for("static", filename="js/bundle.min.js") }}"></script>
+
+{% endblock %}
diff --git a/src/web/templates/layout.html b/src/web/templates/layout.html
index eb213ca5..db5b6589 100644
--- a/src/web/templates/layout.html
+++ b/src/web/templates/layout.html
@@ -7,12 +7,12 @@
<meta name="description" content="JARR is a web-based news aggregator." />
<meta name="author" content="" />
<title>JARR{% if head_titles %} - {{ ' - '.join(head_titles) }}{% endif %}</title>
- <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" />
+ <link rel="shortcut icon" href="{{ url_for("static", filename="img/favicon.png") }}" />
<!-- Bootstrap core CSS -->
- <link href="{{ url_for('static', filename='css/bootstrap.css') }}" rel="stylesheet" media="screen" />
+ <link href="{{ url_for("static", filename="css/bootstrap.min.css") }}" rel="stylesheet" media="screen" />
<!-- Add custom CSS here -->
- <link href="{{ url_for('static', filename='css/customized-bootstrap.css') }}" rel="stylesheet" media="screen" />
- <link href="{{ url_for('static', filename='css/side-nav.css') }}" rel="stylesheet" media="screen" />
+ <link href="{{ url_for("static", filename="css/customized-bootstrap.css") }}" rel="stylesheet" media="screen" />
+ <link href="{{ url_for("static", filename="css/side-nav.css") }}" rel="stylesheet" media="screen" />
{% endblock %}
</head>
<body>
@@ -125,42 +125,25 @@
<br />
<div class="container not-at-home">
- {% block messages %}
- {% with messages = get_flashed_messages(with_categories=true) %}
- {% if messages %}
- {% for category, message in messages %}
- <div class="alert alert-{{category}}">
- <button type="button" class="close" data-dismiss="alert">&times;</button>
- {{ message }}
- </div>
- {% endfor %}
- {% endif %}
- {% endwith %}
- {% endblock %}
+ {% block messages %}
+ {% with messages = get_flashed_messages(with_categories=true) %}
+ {% if messages %}
+ {% for category, message in messages %}
+ <div class="alert alert-{{category}}">
+ <button type="button" class="close" data-dismiss="alert">&times;</button>
+ {{ message }}
+ </div>
+ {% endfor %}
+ {% endif %}
+ {% endwith %}
+ {% endblock %}
</div>
{% block content %}{% endblock %}
<!-- Bootstrap core JavaScript -->
<!-- Placed at the end of the document so the pages load faster -->
- <script type="text/javascript" src="{{ url_for('static', filename = 'js/jquery.js') }}"></script>
- <script type="text/javascript" src="{{ url_for('static', filename = 'js/bootstrap.js') }}"></script>
- <script type="text/javascript" src="{{ url_for('static', filename = 'js/articles.js') }}"></script>
- <script type="text/javascript" src="{{ url_for('static', filename = 'js/feed.js') }}"></script>
- <script type="text/javascript" class="source">
- var filter_ = {% if filter_ %}"{{ filter_ }}"{% else %}undefined{% endif %};
- if (filter_ == undefined) {
- if (window.location.href.indexOf("filter_=all") > -1){
- filter_ = 'all';
- }
- else if (window.location.href.indexOf("filter_=unread") > -1) {
- filter_ = 'unread';
- }
- else if (window.location.href.indexOf("filter_=read") > -1) {
- filter_ = 'read';
- }
- }
- $("#tab-" + filter_).attr('class', "active");
- </script>
+ <script type="text/javascript" src="{{ url_for("static", filename="js/jquery.js") }}"></script>
+ <script type="text/javascript" src="{{ url_for("static", filename="js/bootstrap.min.js") }}"></script>
</body>
</html>
diff --git a/src/web/templates/layout.html.orig b/src/web/templates/layout.html.orig
new file mode 100644
index 00000000..1abb0b68
--- /dev/null
+++ b/src/web/templates/layout.html.orig
@@ -0,0 +1,149 @@
+ <!DOCTYPE html>
+<html>
+ <head>
+ {% block head %}
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="description" content="JARR is a web-based news aggregator." />
+ <meta name="author" content="" />
+ <title>JARR{% if head_titles %} - {{ ' - '.join(head_titles) }}{% endif %}</title>
+ <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" />
+ <!-- Bootstrap core CSS -->
+ <link href="{{ url_for("static", filename="css/bootstrap.min.css") }}" rel="stylesheet" media="screen" />
+ <!-- Add custom CSS here -->
+ <link href="{{ url_for("static", filename="css/customized-bootstrap.css") }}" rel="stylesheet" media="screen" />
+ <link href="{{ url_for("static", filename="css/side-nav.css") }}" rel="stylesheet" media="screen" />
+ {% endblock %}
+ </head>
+ <body>
+ <nav class="navbar navbar-inverse navbar-fixed-top navbar-custom" role="navigation">
+ <div class="container-fluid">
+ <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="{{ url_for("home") }}">JARR</a>
+ {% if head_titles %}
+ <p class="navbar-text" style="max-height: 20px; overflow: hidden">
+ {{ " - ".join(head_titles) }}
+ </p>
+ {% endif %}
+ </div>
+
+ <!-- Collect the nav links, forms, and other content for toggling -->
+ <div class="collapse navbar-collapse navbar-ex1-collapse">
+ <ul class="nav navbar-nav navbar-right">
+ {% if g.user.is_authenticated %}
+ <!-- <li><a href="{{ url_for("feed.form") }}"><span class="glyphicon glyphicon-plus-sign"></span> {{ _('Add a feed') }}</a></li> -->
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+ <div><span class="glyphicon glyphicon-plus-sign"></span>&nbsp;{{ _('Add a feed') }}</div>
+ </a>
+ <ul class="dropdown-menu">
+ <li>
+ <form action="{{ url_for('feed.bookmarklet') }}" class="navbar-form navbar-left" method="GET" name="save">
+ <div class="input-group input-group-inline">
+ <input class="form-control" name="url" type="url" placeholder="{{_("site or feed url")}}" required="required"/>
+ <span class="input-group-btn">
+ <button type="submit" class="btn btn-default" /><span class="glyphicon glyphicon-plus"></span></button>
+ </span>
+ </div><!-- /input-group -->
+ </form>
+ </li>
+ </ul>
+ </li>
+ {% if page_to_render == "favorites" %}
+ <li><a href="{{ url_for("home") }}"><span class="glyphicon glyphicon-home"></span> {{ _('Home') }}</a></li>
+ {% else %}
+ <li><a href="{{ url_for("favorites") }}"><span class="glyphicon glyphicon-star"></span> {{ _('Favorites') }}</a></li>
+ {% endif %}
+ {% if conf.CRAWLING_METHOD == "classic" and (not conf.ON_HEROKU or g.user.is_admin()) %}
+ <li><a href="/fetch"><span class="glyphicon glyphicon-import"></span> {{ _('Fetch') }}</a></li>
+ {% endif %}
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ _('Feed') }} <b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="{{ url_for("feeds.update", action="read") }}">{{ _('Mark all as read') }}</a></li>
+ <li><a href="{{ url_for("feeds.update", action="read", nb_days="1") }}">{{ _('Mark all as read older than yesterday') }}</a></li>
+ <li><a href="{{ url_for("feeds.update", action="read", nb_days="10") }}">{{ _('Mark all as read older than 10 days') }}</a></li>
+ <li role="presentation" class="divider"></li>
+ <li><a href="{{ url_for("feeds.inactives") }}">{{ _('Inactive') }}</a></li>
+ <li><a href="{{ url_for("articles.history") }}">{{ _('History') }}</a></li>
+ <li><a href="{{ url_for("feeds.feeds") }}">{{ _('All') }}</a></li>
+ </ul>
+ </li>
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+ <div><span class="glyphicon glyphicon-user"></span>&nbsp;<b class="caret"></b></div>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{{ url_for("user.profile") }}"><span class="glyphicon glyphicon-user"></span> {{ _('Profile') }}</a></li>
+ <li><a href="{{ url_for("user.management") }}"><span class="glyphicon glyphicon-cog"></span> {{ _('Your data') }}</a></li>
+ <li><a href="{{ url_for("about") }}"><span class="glyphicon glyphicon-question-sign"></span> {{ _('About') }}</a></li>
+ {% if g.user.is_admin() %}
+ <li role="presentation" class="divider"></li>
+ <li><a href="{{ url_for("admin.dashboard") }}"><span class="glyphicon glyphicon-dashboard"></span> {{ _('Dashboard') }}</a></li>
+ <li role="presentation" class="divider"></li>
+ {% endif %}
+ <li><a href="{{ url_for("logout") }}"><span class="glyphicon glyphicon-log-out"></span> {{ _('Logout') }}</a></li>
+ </ul>
+ </li>
+
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+ <div><span class="glyphicon glyphicon-search"></span>&nbsp;<b class="caret"></b></div>
+ </a>
+ <ul class="dropdown-menu">
+ <li>
+ <form class="navbar-form" method=get action="{{ url_for("search") }}" role="search">
+ <div class="input-group">
+ {% 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%}/>
+ <br />
+ <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>
+ </ul>
+ </li>
+ {% else %}
+ <li><a href="{{ url_for("about") }}"><span class="glyphicon glyphicon-question-sign"></span>&nbsp;{{ _('About') }}</a></li>
+ {% endif %}
+ </ul>
+ </div><!-- /.navbar-collapse -->
+ </div><!-- /.container -->
+ </nav>
+ <br />
+
+ <div class="container not-at-home">
+ {% block messages %}
+ {% with messages = get_flashed_messages(with_categories=true) %}
+ {% if messages %}
+ {% for category, message in messages %}
+ <div class="alert alert-{{category}}">
+ <button type="button" class="close" data-dismiss="alert">&times;</button>
+ {{ message }}
+ </div>
+ {% endfor %}
+ {% endif %}
+ {% endwith %}
+ {% endblock %}
+ </div>
+
+ {% block content %}{% endblock %}
+
+ <!-- Bootstrap core JavaScript -->
+ <!-- Placed at the end of the document so the pages load faster -->
+ <script type="text/javascript" src="{{ url_for("static", filename="js/jquery.js") }}"></script>
+ <script type="text/javascript" src="{{ url_for("static", filename="js/bootstrap.min.js") }}"></script>
+ <script type="text/javascript" src="{{ url_for("static", filename="js/bundle.min.js") }}"></script>
+ </body>
+</html>
diff --git a/src/web/templates/opml.xml b/src/web/templates/opml.xml
index 96fe66f5..051d3af6 100644
--- a/src/web/templates/opml.xml
+++ b/src/web/templates/opml.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
-<!-- OPML generated by pyAggr3g470r on {{ now | datetime }} -->
+<!-- OPML generated by JARR on {{ now | datetime }} -->
<opml version="1.1">
<head>
<title>Feeds of {{ user.nickname }}</title>
@@ -11,4 +11,4 @@
<body>
{% for feed in user.feeds %} <outline title="{{ feed.title|escape }}" text="{{ feed.title|escape }}" description="{{ feed.description|escape }}" xmlUrl="{{ feed.link|escape }}" htmlUrl="{{ feed.site_link|escape }}" />
{% endfor %}</body>
-</opml> \ No newline at end of file
+</opml>
bgstack15