diff --git a/CHANGELOG.md b/CHANGELOG.md index af38890..77ebe84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # What’s New +## 0.7.1 + ++ Improved calendar view. Now `/calendar` shows a list of years and months. + ## 0.7 + Schema changes: diff --git a/README.md b/README.md index b8e5e23..a3173fa 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ suitable as a community or team knowledge base. + Stored in SQLite/MySQL databases + Material Icons + Light/dark theme ++ Calendar + Works fine even with JavaScript disabled. ## Requirements diff --git a/app.py b/app.py index edc53fd..b3bdb4b 100644 --- a/app.py +++ b/app.py @@ -29,7 +29,7 @@ from configparser import ConfigParser import i18n import gzip -__version__ = '0.7.0' +__version__ = '0.7.1' #### CONSTANTS #### @@ -791,7 +791,11 @@ def contributions(username): @app.route('/calendar/') def calendar_view(): - return render_template('calendar.jinja2') + now = datetime.datetime.now() + return render_template('calendar.jinja2', now=now, + from_year=int(request.args.get('from_year', now.year - 12)), + till_year=int(request.args.get('till_year', now.year + 5)) + ) @app.route('/calendar//') def calendar_month(y, m): diff --git a/migrations/0_7to0_8.py b/migrations/0_7to0_8.py new file mode 100644 index 0000000..e69de29 diff --git a/templates/calendar.jinja2 b/templates/calendar.jinja2 index d4272f7..8edcc2a 100644 --- a/templates/calendar.jinja2 +++ b/templates/calendar.jinja2 @@ -5,29 +5,28 @@ {% block content %}

Calendar

-
-
- Calendar view +
    + {% for year in range(till_year, from_year-1, -1) %} +
  • + {{ year }} {% if year == now.year %}(current){% endif %}: + +
  • + {% endfor %} +
-
- -
    - {% set view_choices = ["month"] %} - {% for vch in view_choices %} -
  • - {% if vch == viewas %} - {{ T(vch) }} - {% else %} - {{ T(vch) }} - {% endif %} -
  • - {% endfor %} -
-
- -
- -
-
-
+

+ Show more years: +

+

{% endblock %} \ No newline at end of file