diff --git a/CHANGELOG.md b/CHANGELOG.md index a030905..9855143 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ `/manage/accounts`. + TOC is now shown in pages where screen width is greater than 960 pixels. + Style changes: added a top bar with the site title. It replaces the floating menu on the top right. ++ Now logged-in users have an “Edit” button below the first heading. All users can access page history + by clicking the last modified time. + Added a built-in installer (`app_init.py`). You still need to manually create `site.conf`. ## 0.7.1 diff --git a/app.py b/app.py index 0a22c55..36e198d 100644 --- a/app.py +++ b/app.py @@ -930,8 +930,10 @@ def calendar_month(y, m): (datetime.date(y, m, 1) <= Page.calendar) & (Page.calendar < datetime.date(y+1 if m==12 else y, 1 if m==12 else m+1, 1)) ).order_by(Page.calendar) + page = int(request.args.get('page', 1)) - return render_template('month.jinja2', d=datetime.date(y, m, 1), notes=notes) + return render_template('month.jinja2', d=datetime.date(y, m, 1), notes=notes.paginate(page), + page_n=page, total_count=notes.count(), min=min) @app.route('/history/revision//') def view_old(revisionid): @@ -984,7 +986,8 @@ def stats(): notes_count=Page.select().count(), notes_with_url=Page.select().where(Page.url != None).count(), revision_count=PageRevision.select().count(), - users_count = User.select().count() + users_count = User.select().count(), + groups_count = UserGroup.select().count() ) ## account management ## diff --git a/i18n/salvi.en.json b/i18n/salvi.en.json index 42a17cf..91bb088 100644 --- a/i18n/salvi.en.json +++ b/i18n/salvi.en.json @@ -61,6 +61,9 @@ "page-created": "Page created", "write-a-comment": "Write a comment…", "input-tags": "Tags (comma separated)", - "no-tags": "No tags" + "no-tags": "No tags", + "notes-month-empty": "None found :(", + "calendar": "Calendar", + "groups-count": "User group count" } } \ No newline at end of file diff --git a/i18n/salvi.it.json b/i18n/salvi.it.json index c0daee9..2dd878a 100644 --- a/i18n/salvi.it.json +++ b/i18n/salvi.it.json @@ -48,9 +48,21 @@ "revision-count": "Numero di revisioni", "revision-count-per-page": "Media di revisioni per pagina", "remember-me-for": "Ricordami per", + "confirm-password": "Conferma password", + "email": "E-mail", + "optional": "opzionale", + "have-read-terms": "Ho letto i {0} e la {1}", + "terms-of-service": "Termini di Servizio", + "privacy-policy": "Politica sulla riservatezza", + "already-have-account": "Hai già un account?", + "logged-in-as": "Autenticato come", + "not-logged-in": "Non autenticato", "owner": "Proprietario", "write-a-comment": "Scrivi un commento…", "input-tags": "Etichette (separate da virgola)", - "no-tags": "Nessuna etichetta" + "no-tags": "Nessuna etichetta", + "notes-month-empty": "Non c\u2019\u00e8 nulla :(", + "calendar": "Calendario", + "groups-count": "Numero di gruppi utente" } } \ No newline at end of file diff --git a/static/style.css b/static/style.css index 6174cff..c2daa20 100644 --- a/static/style.css +++ b/static/style.css @@ -35,6 +35,7 @@ body{font-family:sans-serif;background-color:var(--bg-main); color: var(--fg-mai /* content styles */ .article-header {text-align: center;} #firstHeading {font-family:sans-serif; text-align: center;font-size:3em; font-weight: normal} +@media (min-width:800px) {.homepage #firstHeading {font-size: 4.5em}} .inner-content{font-family:serif; margin: 1.7em auto; max-width: 1280px; line-height: 1.9; color: var(--fg-main)} .inner-content em,.inner-content strong{color: var(--fg-sharp)} .inner-content h1{color: var(--fg-error)} @@ -64,6 +65,7 @@ body{font-family:sans-serif;background-color:var(--bg-main); color: var(--fg-mai .nl-new{margin:6px 0 12px 0;display:flex;justify-content:start; float: right} .nl-new > a{margin-right:12px} .nl-prev,.nl-next{text-align:center} +.nl-placeholder {font-style: italic; text-align: center;} input{border:0;border-bottom:3px solid var(--border);font:inherit;color:var(--fg-main);background-color:transparent} input:focus{color:var(--fg-sharp);border-bottom-color:var(--border-sharp)} input.error{border-bottom-color:var(--btn-error)} @@ -161,6 +163,10 @@ a:hover{color:var(--fg-link-hover)} .nl-list {display: grid; grid-template-rows: auto; grid-template-columns: 1fr 1fr; column-gap: 1.5em} .nl-list > .nl-prev, .nl-list > .nl-next {grid-column-end: span 2} } +@media (min-width:1200px){ + .nl-list {grid-template-columns: 1fr 1fr 1fr} + .nl-list > .nl-prev, .nl-list > .nl-next {grid-column-end: span 3} +} /* dark theme */ diff --git a/templates/calendar.jinja2 b/templates/calendar.jinja2 index 8edcc2a..2d092f8 100644 --- a/templates/calendar.jinja2 +++ b/templates/calendar.jinja2 @@ -3,30 +3,32 @@ {% block title %}Calendar – {{ app_name }}{% endblock %} {% block content %} -

Calendar

+
+

{{ T('calendar') }}

- - -

- Show more years: -

{% endblock %} \ No newline at end of file diff --git a/templates/home.jinja2 b/templates/home.jinja2 index fd0f3ad..971648f 100644 --- a/templates/home.jinja2 +++ b/templates/home.jinja2 @@ -3,39 +3,43 @@ {% block title %}{{ T('homepage') }} - {{ app_name }}{% endblock %} {% block content %} -

{{ T('welcome').format(app_name) }}

+
+

{{ T('welcome').format(app_name) }}

- + -

{{ T('latest-notes') }}

+

{{ T('latest-notes') }}

-
- +
+ +
{% endblock %} diff --git a/templates/listrecent.jinja2 b/templates/listrecent.jinja2 index fa6ae03..2634cfe 100644 --- a/templates/listrecent.jinja2 +++ b/templates/listrecent.jinja2 @@ -1,38 +1,42 @@ {% extends "base.jinja2" %} {% block content %} -

Notes by date

+
+

Notes by date

-

Showing results {{ page_n * 20 - 19 }} to {{ min(page_n * 20, total_count) }} of {{ total_count }} total.

+

Showing results {{ page_n * 20 - 19 }} to {{ min(page_n * 20, total_count) }} of {{ total_count }} total.

- +
{% endblock %} diff --git a/templates/listtag.jinja2 b/templates/listtag.jinja2 index c7c07aa..46d6ec3 100644 --- a/templates/listtag.jinja2 +++ b/templates/listtag.jinja2 @@ -3,46 +3,51 @@ {% block title %}Notes tagged #{{ tagname }} - {{ app_name }}{% endblock %} {% block content %} -

{{ T('notes-tagged') }} #{{ tagname }}

+
+

#{{ tagname }}

+
{{ T('notes-tagged') }}
-{% if total_count > 0 %} -

Showing results {{ page_n * 20 - 19 }} to {{ min(page_n * 20, total_count) }} of {{ total_count }} total.

+ {% if total_count > 0 %} +

Showing results {{ page_n * 20 - 19 }} to {{ min(page_n * 20, total_count) }} of {{ total_count }} total.

- -{% else %} -

{{ T('notes-tagged-empty') }}

-{% endif %} +
{% endblock %} diff --git a/templates/month.jinja2 b/templates/month.jinja2 index 55ba03b..3e9cd31 100644 --- a/templates/month.jinja2 +++ b/templates/month.jinja2 @@ -3,30 +3,47 @@ {% block title %}{{ d.strftime("%B %Y") }} – {{ app_name }}{% endblock %} {% block content %} -

{{ d.strftime("%B %Y") }}

+
+

{{ d.strftime("%B %Y") }}

- + {% else %} +

{{ T('notes-month-empty') }}

+ {% endif %} +

{{ T('back-to') }} {{ T('calendar') }}

+
{% endblock %} \ No newline at end of file diff --git a/templates/stats.jinja2 b/templates/stats.jinja2 index 0c0f2b0..1f0812a 100644 --- a/templates/stats.jinja2 +++ b/templates/stats.jinja2 @@ -11,5 +11,6 @@
  • {{ T("revision-count") }}: {{ revision_count }}
  • {{ T("revision-count-per-page") }}: {{ (revision_count / notes_count)|round(2) }}
  • {{ T('users-count') }}: {{ users_count }}
  • +
  • {{ T('groups-count') }}: {{ groups_count }}
  • {% endblock %} diff --git a/templates/view.jinja2 b/templates/view.jinja2 index 139a63b..0b82b77 100644 --- a/templates/view.jinja2 +++ b/templates/view.jinja2 @@ -12,7 +12,12 @@

    {{ p.title }}

    {% if p.calendar %} -

    calendar_today{{ p.calendar.strftime('%B %-d, %Y') }}

    +

    + calendar_today + + + +

    {% endif %}