Skip to content

Commit

Permalink
fixes #56 - help page including versionfinder info
Browse files Browse the repository at this point in the history
  • Loading branch information
jantman committed May 2, 2017
1 parent 7ce9fc3 commit c30df5f
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 7 deletions.
38 changes: 38 additions & 0 deletions biweeklybudget/flaskapp/templates/help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% extends "base.html" %}
{% block title %}Help / Docs / Code - BiweeklyBudget{% endblock %}
{% block body %}
{% include 'notifications.html' %}
<!-- /.row -->
<div class="row" id="content-row">
<div class="col-lg-12">
<ul>
<li><strong>Project Homepage:</strong> <a href="{{ url }}">{{ url }}</a></li>
<li><strong>Documentation:</strong> <a href="http://biweeklybudget.readthedocs.io/">http://biweeklybudget.readthedocs.io/</a> <em>(for this version: <a href="http://biweeklybudget.readthedocs.io/en/{{ version }}/">http://biweeklybudget.readthedocs.io/en/{{ version }}/</a>)</em></li>
<li><strong>Issues / Bug Reports / Support:</strong> <a href="https://github.com/jantman/biweeklybudget/issues">https://github.com/jantman/biweeklybudget/issues</a></li>
<li><strong>Code Repository:</strong> <a href="https://github.com/jantman/biweeklybudget">https://github.com/jantman/biweeklybudget</a></li>
</ul>
<p><strong>biweeklybudget is <a href="https://www.gnu.org/licenses/agpl-3.0.en.html">AGPL 3.0</a> Free/Open Source Software. Anyone who can access or interact with this interface is entitled to the full source code of this exact running version.</strong></p>
</div>
<!-- /.col-lg-12 -->
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">Support Information</div>
<!-- /.panel-heading -->
<div class="panel-body">
<dl>
<dt>Database URI</dt>
<dd>{{ db_uri }}</dd>
<dt>Versionfinder long_str</dt>
<dd>{{ ver_info }}</dd>
<dt>User-Agent</dt>
<dd>{{ ua_str }}</dd>
</dl>
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel-default
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
{% endblock %}
5 changes: 1 addition & 4 deletions biweeklybudget/flaskapp/templates/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
</li>
<li>&nbsp;</li>
<li>
<a href="https://github.com/jantman/biweeklybudget"><i class="fa fa-github fa-fw"></i> biweeklybudget is AGPLv3+ Free Software</a>
</li>
<li>
<a href="http://biweeklybudget.readthedocs.io/en/latest/"><i class="fa fa-book fa-fw"></i> Docs</a>
<a href="/help"><i class="fa fa-support fa-fw"></i> Help/Docs/Code (AGPL)</a>
</li>
</ul>
</div>
Expand Down
1 change: 1 addition & 0 deletions biweeklybudget/flaskapp/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@
from .reconcile import *
from .scheduled import *
from .transactions import *
from .help import *
71 changes: 71 additions & 0 deletions biweeklybudget/flaskapp/views/help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"""
The latest version of this package is available at:
<http://github.com/jantman/biweeklybudget>
################################################################################
Copyright 2016 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
This file is part of biweeklybudget, also known as biweeklybudget.
biweeklybudget is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
biweeklybudget is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with biweeklybudget. If not, see <http://www.gnu.org/licenses/>.
The Copyright and Authors attributions contained herein may not be removed or
otherwise altered, except to add the Author attribution of a contributor to
this work. (Additional Terms pursuant to Section 7b of the AGPL v3)
################################################################################
While not legally required, I sincerely request that anyone who finds
bugs please submit them at <https://github.com/jantman/biweeklybudget> or
to me via email, and that you send any contributions or improvements
either as a pull request on GitHub, or to me via email.
################################################################################
AUTHORS:
Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
################################################################################
"""

import logging
from flask.views import MethodView
from flask import render_template, request
from versionfinder import find_version

from biweeklybudget.flaskapp.app import app
from biweeklybudget.version import VERSION, PROJECT_URL
from biweeklybudget.settings import DB_CONNSTRING

logger = logging.getLogger(__name__)

for lname in ['versionfinder', 'pip', 'git']:
l = logging.getLogger(lname)
l.setLevel(logging.CRITICAL)
l.propagate = True


class HelpView(MethodView):
"""
Render the GET /help view using the ``help.html`` template.
"""

def get(self):
return render_template(
'help.html',
ver_info=find_version('biweeklybudget').long_str,
version=VERSION,
url=PROJECT_URL,
ua_str=request.headers.get('User-Agent', 'unknown'),
db_uri=DB_CONNSTRING
)


app.add_url_rule('/help', view_func=HelpView.as_view('help_view'))
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ def test_nav_links(self, selenium):
('/reconcile', 'Reconcile'),
('/budgets', 'Budgets'),
('/scheduled', 'Scheduled'),
('https://github.com/jantman/biweeklybudget',
'biweeklybudget is AGPLv3+ Free Software'),
('http://biweeklybudget.readthedocs.io/en/latest/', 'Docs')
('/help', 'Help/Docs/Code (AGPL)')
]


Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ pytz
requests==2.13.0
selenium==3.0.2
six==1.10.0
versionfinder==0.1.0

0 comments on commit c30df5f

Please sign in to comment.