Mischa POSLAWSKY [Mon, 18 Nov 2019 21:20:45 +0000 (22:20 +0100)]
login/commits: escape html characters in commit messages
Mischa POSLAWSKY [Sun, 17 Nov 2019 13:51:08 +0000 (14:51 +0100)]
widget/contact: accept non-word characters in sender email addresses
Allow any remotely valid address, including <hans.verlinden@planet.nl>.
Mischa POSLAWSKY [Fri, 8 Nov 2019 01:23:18 +0000 (02:23 +0100)]
reply: list attribute changes for each row
Mischa POSLAWSKY [Fri, 8 Nov 2019 01:22:31 +0000 (02:22 +0100)]
reply: identify textual journal columns
Mischa POSLAWSKY [Fri, 8 Nov 2019 00:21:45 +0000 (01:21 +0100)]
issue: count number of replies in overview
Mischa POSLAWSKY [Thu, 7 Nov 2019 16:50:05 +0000 (17:50 +0100)]
reply: omit header from mandatory output
Can be prepended manually if wanted.
Mischa POSLAWSKY [Thu, 7 Nov 2019 16:49:58 +0000 (17:49 +0100)]
issue: inline ticket body like replies
Mischa POSLAWSKY [Thu, 7 Nov 2019 05:13:53 +0000 (06:13 +0100)]
issue: display assignments in overview
Mischa POSLAWSKY [Thu, 7 Nov 2019 05:13:34 +0000 (06:13 +0100)]
issue: resolve author logins to full names
Mischa POSLAWSKY [Thu, 7 Nov 2019 04:56:00 +0000 (05:56 +0100)]
issue: select restricted by current page
Allow setup of multiple distinct categories.
Mischa POSLAWSKY [Thu, 7 Nov 2019 04:51:30 +0000 (05:51 +0100)]
issue: record row changes in journal
Mischa POSLAWSKY [Thu, 7 Nov 2019 04:23:30 +0000 (05:23 +0100)]
issue: admin option to close or reopen
Mischa POSLAWSKY [Thu, 7 Nov 2019 04:04:59 +0000 (05:04 +0100)]
issue: assignment text field for admins
Mischa POSLAWSKY [Thu, 7 Nov 2019 04:04:09 +0000 (05:04 +0100)]
reply: share parent data from issue page
Provide easy access to selected metadata.
Mischa POSLAWSKY [Thu, 7 Nov 2019 03:59:13 +0000 (04:59 +0100)]
reply: set method to abstract update queries
Extend insert, renamed to generic "set", to allow updates using the same
syntax with an additional select parameter.
Mischa POSLAWSKY [Thu, 7 Nov 2019 03:43:53 +0000 (04:43 +0100)]
issue: database insert method to keep array values
Feature to apply literal SQL with optional arguments, stolen from other
projects modeled after DBIx::Simple.
Mischa POSLAWSKY [Thu, 24 Oct 2019 21:53:24 +0000 (23:53 +0200)]
issue: closed at bottom, option ?open to exclude
Mischa POSLAWSKY [Sun, 20 Oct 2019 04:16:49 +0000 (06:16 +0200)]
issue: display ticket creation date
Mischa POSLAWSKY [Sun, 20 Oct 2019 04:07:07 +0000 (06:07 +0200)]
issue: order by last update, changed on reply
Initial value determined by:
UPDATE issues SET updated = greatest(created, closed, (
SELECT max(created) FROM comments WHERE page = issues.link
));
Mischa POSLAWSKY [Sun, 20 Oct 2019 03:49:22 +0000 (05:49 +0200)]
issue: append and ignore page titles in links
Preserve names of replaced files, and improve recognition of sent targets
as well as seo score.
Mischa POSLAWSKY [Sun, 20 Oct 2019 03:47:19 +0000 (05:47 +0200)]
issue: track messages in database
Replace file storage by PostgreSQL table, similar to comments in commit
v4.0-21-g0cc6251412 (2019-10-27) [nieuws/replies: read contents from database].
Existing files are imported similar to earlier comments:
ls melding/2*/*.html | perl -MFile::Slurp -lnE ' #/
my ($page, $date, $name) = split m{/};
$name =~ s/(\d+-\d+)-// and $date .= "-$1";
my $closed = qx(stat -c%y "$page/.tags/opgelost/$date-$name" 2>/dev/null);
chomp $closed;
$name =~ s/\.html$//;
my $html = read_file($_);
$html =~ s{<h2>(.*?)</h2>\n+}{}; my $title = $1;
chomp, s/\\\K/\\/g, s/\n/\\n/g, s/\t/\\t/g for $html;
say join "\t", $page, $date, $name, $title, $html, $closed || "\\N";
' | psql lijtweg -c 'COPY issues (page, created, link, subject, body, closed) FROM STDIN'
Afterwards, the following queries can be executed to convert and clean up
these imported rows further:
-- rename issue references to new page ids
UPDATE comments c SET page = (SELECT coalesce((SELECT page||'/'||id
FROM issues WHERE c.page LIKE page || '/%-' || link), c.page));
-- move authorship contents to dedicated column
SELECT id, regexp_matches(body, '<p class="right">(?:Ingediend door |<em>)?([^<]*)')
FROM issues WHERE body ~ 'right';
UPDATE issues SET author = 'cees' WHERE body ~ '<p class="right">.*Cees';
UPDATE issues SET author = '301' WHERE body ~ '<p class="right">.*de Roos';
UPDATE issues SET body = regexp_replace(body, E'\n+<p class="right">.*</p>$', '')
WHERE body ~ 'right';
Mischa POSLAWSKY [Thu, 7 Nov 2019 16:34:09 +0000 (17:34 +0100)]
reply: restrict submission form to users
Assumed as much on insert.
Mischa POSLAWSKY [Thu, 31 Oct 2019 18:26:45 +0000 (19:26 +0100)]
nieuws: authorise admins by edit subpermissions
Treat news maintenance like any other edit location.
Mischa POSLAWSKY [Sat, 26 Oct 2019 00:00:34 +0000 (02:00 +0200)]
login/edit: move admin block to distinct widget
Mischa POSLAWSKY [Fri, 25 Oct 2019 23:59:54 +0000 (01:59 +0200)]
login/edit: user override in page code
Mischa POSLAWSKY [Fri, 25 Oct 2019 23:20:06 +0000 (01:20 +0200)]
login/edit: admin event dates (creation, setup, visit)
Mischa POSLAWSKY [Mon, 28 Oct 2019 02:36:22 +0000 (03:36 +0100)]
edit/page: keep page named after existing directory
Allow either subdir.html or subdir/index.html, preventing edit from creating
conforming duplicates.
Reported-by: Arie van Marion
Mischa POSLAWSKY [Mon, 28 Oct 2019 04:02:49 +0000 (05:02 +0100)]
page: silence object warnings on missing pages
Mischa POSLAWSKY [Thu, 24 Oct 2019 21:49:46 +0000 (23:49 +0200)]
page: replace output caching by article object
Mischa POSLAWSKY [Thu, 24 Oct 2019 21:54:05 +0000 (23:54 +0200)]
nieuws: avoid invalid date access for missing articles
Broken since page objects introduced in commit
v3.9-11-g234326791b
(2019-06-28) [page: promote news article class to represent all pages].
Mischa POSLAWSKY [Mon, 21 Oct 2019 06:44:48 +0000 (08:44 +0200)]
reply: setup database to fetch objects
Avoid repetition on each fetch in upcoming usage.
Mischa POSLAWSKY [Mon, 21 Oct 2019 06:23:42 +0000 (08:23 +0200)]
nieuws: rename nieuws/replies widget to generic reply
Can be placed on any page (such as upcoming issues), not specific to nieuws.
Mischa POSLAWSKY [Mon, 4 Nov 2019 23:20:54 +0000 (00:20 +0100)]
widget/contact: current user overrides login, email fallback
Mischa POSLAWSKY [Thu, 17 Oct 2019 03:53:55 +0000 (05:53 +0200)]
nieuws/replies: insert method to add database rows
Minimal database abstraction for code maintainability
(feature similar to perl DBIx::Simple).
Mischa POSLAWSKY [Thu, 17 Oct 2019 03:52:48 +0000 (05:52 +0200)]
nieuws/replies: database class with query method
Code cleanup preparing for more extensive database support
(where default php is somewhat lacking).
Mischa POSLAWSKY [Thu, 17 Oct 2019 03:20:55 +0000 (05:20 +0200)]
nieuws/replies: read contents from database
Replace file storage by a PostgreSQL table. Resign to the additional
dependency for this kind of social feature since it's much more appropriate
(especially with upcoming extensions), and optional similar to external
comment services.
Identical results after importing existing files:
ls melding/2*/*/*.html | perl -MFile::Slurp -lnE '
my ($page, $meta) = m{(.*)/(.*)};
my ($time, $author) = split /[:.]/, $meta;
$time .= "00" while length($time) < 14;
$time =~ s/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/$1-$2-$3 $4:$5:/g;
my $html = read_file($_);
chomp, s/\\\K/\\/g, s/\n/\\n/g, s/\t/\\t/g for $html;
say join "\t", $page, $author, $time, $html;
' | psql -c 'COPY comments (page, author, created, message) FROM STDIN'
Mischa POSLAWSKY [Thu, 24 Oct 2019 03:31:40 +0000 (05:31 +0200)]
auth: admin edit permissions for page (sub)directories
Allow edit parameters to match parent directories; for example "edit doc"
to maintain all but only documents.
Mischa POSLAWSKY [Tue, 22 Oct 2019 03:11:28 +0000 (05:11 +0200)]
auth: admin subpermission check for edit pages
Check for specific "edit $path" rights in addition to full "edit",
allowing for partial access.
Mischa POSLAWSKY [Sat, 19 Oct 2019 16:01:05 +0000 (18:01 +0200)]
sitemap: skip subdirectories containing .gitignore
Assume html files stored in (partially) untracked directories are not meant
for public distribution. Fixes unintended inclusion of profile/ pages and
archived documents in data/, and avoids a costly search in thumb/.
Mischa POSLAWSKY [Thu, 24 Oct 2019 19:47:33 +0000 (21:47 +0200)]
login/post: ignore ?login override for non user admins
Confidential data was not secure from people who acquired these urls.
Mischa POSLAWSKY [Fri, 18 Oct 2019 19:22:25 +0000 (21:22 +0200)]
login/edit: password generation for user admins
Option to reset users of Lijtweg.
Mischa POSLAWSKY [Fri, 18 Oct 2019 19:18:38 +0000 (21:18 +0200)]
login/edit: allow setup form for missing users
Fix creation since validation added in commit
v3.6-0-gd1fc7642f0
(2018-08-11) [login/emulate: request page as different user].
Mischa POSLAWSKY [Fri, 18 Oct 2019 19:15:09 +0000 (21:15 +0200)]
login/edit: reconfigure size attribute
Ignored since syntax change in commit
v3.7-15-g1888ccc749 (2018-11-13)
[login/edit: generic setup of input attributes].
Mischa POSLAWSKY [Fri, 18 Oct 2019 19:14:46 +0000 (21:14 +0200)]
login/edit: remaining access from user object
Some optional code paths broken by commit
v3.9-8-g882347cba8 (2019-06-28)
[auth: store global user metadata in User object].
Mischa POSLAWSKY [Wed, 16 Oct 2019 21:53:56 +0000 (23:53 +0200)]
widget/doclist: show hidden files to edit admins
Include private files as alternate options for editors. Presence of html
still takes precedence, and extension formats are considered a last resort
and no longer include sizes.
Mischa POSLAWSKY [Thu, 17 Oct 2019 00:59:47 +0000 (02:59 +0200)]
sitemap.xml: calculate priority from path names
Mischa POSLAWSKY [Tue, 15 Oct 2019 03:56:38 +0000 (05:56 +0200)]
sitemap.xml: common protocol listing all pages
Minimal implementations of sitemap for make benefit glorious engines of
search.
Mischa POSLAWSKY [Thu, 17 Oct 2019 00:05:09 +0000 (02:05 +0200)]
page: include partial templates from *.inc.html
Rename system files to be distinguishable from public pages.
Mischa POSLAWSKY [Thu, 17 Oct 2019 00:28:24 +0000 (02:28 +0200)]
widget/sitemap: move find code to global PageSearch class
Mischa POSLAWSKY [Tue, 15 Oct 2019 03:33:43 +0000 (05:33 +0200)]
widget/sitemap: linkref part to format a single page
Mischa POSLAWSKY [Tue, 15 Oct 2019 03:29:23 +0000 (05:29 +0200)]
login/edit: admin links to doc/post user pages
Mischa POSLAWSKY [Tue, 15 Oct 2019 03:17:25 +0000 (05:17 +0200)]
login/post: prepend print button
Mischa POSLAWSKY [Tue, 15 Oct 2019 03:22:02 +0000 (05:22 +0200)]
login/post: handler renamed from emulate page
Mischa POSLAWSKY [Tue, 15 Oct 2019 03:17:08 +0000 (05:17 +0200)]
login/emulate: serve subpages instead of redirects
Mischa POSLAWSKY [Tue, 15 Oct 2019 03:16:13 +0000 (05:16 +0200)]
login/emulate: user override from optional ?login parameter
Replace mandatory path argument.
Mischa POSLAWSKY [Tue, 15 Oct 2019 02:26:15 +0000 (04:26 +0200)]
auth: admin permissions per function
Replace generic .admin files by lines of right identifiers.
Check specific rights for: edit, user, site, news, foto.
Mischa POSLAWSKY [Fri, 12 Jul 2019 02:57:33 +0000 (04:57 +0200)]
thumb: jpeg content type for cached images
Generated files should be image/jpeg regardless of extension.
Mischa POSLAWSKY [Fri, 12 Jul 2019 00:38:43 +0000 (02:38 +0200)]
thumb: omit immutable caching for derived results
Even if the originals are treated as immutable, prefer an option to update
conversions since options may be changed later to improve quality.
Mischa POSLAWSKY [Fri, 12 Jul 2019 00:35:46 +0000 (02:35 +0200)]
thumb: indicate 1 month caching of generated output
Same header as set by Apache for static results.
Mischa POSLAWSKY [Fri, 12 Jul 2019 00:33:50 +0000 (02:33 +0200)]
thumb: flatten transparent images to white background
Ensure consistent background for some SVG and PNG originals.
Mischa POSLAWSKY [Fri, 12 Jul 2019 00:28:47 +0000 (02:28 +0200)]
thumb: ensure exception message in X-Error header
Multiline convert warnings would be ignored; the first line should suffice.
Include the expected header regardless of fallback output.
Mischa POSLAWSKY [Fri, 12 Jul 2019 02:00:57 +0000 (04:00 +0200)]
page: strip metadata tags from article preface
Search html body top for all <meta /> html intended as page data, available from
object $meta, but not shown directly as contents. Matches for description
were returned already as teaser, but not removed. Similar overrides are now
considered for title and image methods as well.
Mischa POSLAWSKY [Fri, 12 Jul 2019 00:27:23 +0000 (02:27 +0200)]
auth: user method to retrieve configured email
Mischa POSLAWSKY [Wed, 3 Jul 2019 19:36:32 +0000 (21:36 +0200)]
nieuws/replies: shift date part from file names
Fix date formatting since dummy parameter to showdate() was dropped in
commit
v3.9-6-ga16bdccbbe [nieuws/feed: conform article dates to RFC-3339]
(2019-06-25).
Mischa POSLAWSKY [Sat, 29 Jun 2019 01:05:03 +0000 (03:05 +0200)]
widget: copy doclist and countdown from lijtweg.nl
Sufficiently generic to prove useful in other projects.
Mischa POSLAWSKY [Sat, 29 Jun 2019 00:22:46 +0000 (02:22 +0200)]
widget/sitemap: order pages hierarchically and alphabetically
Mischa POSLAWSKY [Sat, 29 Jun 2019 00:21:02 +0000 (02:21 +0200)]
widget/sitemap: find and list all site pages
Mischa POSLAWSKY [Thu, 27 Jun 2019 22:32:11 +0000 (00:32 +0200)]
page: teaser fallback to untitled paragraph
Mischa POSLAWSKY [Thu, 27 Jun 2019 22:28:30 +0000 (00:28 +0200)]
nieuws/feed: include article teaser as summary
Mischa POSLAWSKY [Thu, 27 Jun 2019 22:27:00 +0000 (00:27 +0200)]
head: use page teaser as meta description
Mischa POSLAWSKY [Thu, 27 Jun 2019 22:17:10 +0000 (00:17 +0200)]
page: prefer meta description as article teaser
Mischa POSLAWSKY [Wed, 26 Jun 2019 21:33:30 +0000 (23:33 +0200)]
widget: generic page placeholder to include static contents
Mischa POSLAWSKY [Wed, 26 Jun 2019 20:55:21 +0000 (22:55 +0200)]
page: maintain all placeholder includes in widget/
Move code. For great overview.
Mischa POSLAWSKY [Thu, 27 Jun 2019 21:14:45 +0000 (23:14 +0200)]
page: read file during article object initialisation
Derive parts (title, body) from full contents instead of reading piecemeal.
Assume most pages are small enough so added overhead should be minimal,
adding support for titles after the first line.
Mischa POSLAWSKY [Mon, 24 Jun 2019 14:56:41 +0000 (16:56 +0200)]
page: header metadata from article object
Mischa POSLAWSKY [Mon, 24 Jun 2019 14:49:26 +0000 (16:49 +0200)]
page: retrieve static contents from article object
Mischa POSLAWSKY [Thu, 27 Jun 2019 21:42:53 +0000 (23:42 +0200)]
page: rename article method "body" to "story"
Free "body" name to represent all contents as implied, instead of the more
appropriately named main "story" part until the first separator.
Mischa POSLAWSKY [Mon, 24 Jun 2019 14:12:57 +0000 (16:12 +0200)]
page: promote news article class to represent all pages
Mischa POSLAWSKY [Thu, 27 Jun 2019 21:27:17 +0000 (23:27 +0200)]
nieuws: inline code to format article overviews
No distinct callers remain, only the placement page which is included
instead.
Mischa POSLAWSKY [Thu, 1 Nov 2018 16:37:20 +0000 (17:37 +0100)]
nieuws: prefer full names of comment authors
Mischa POSLAWSKY [Thu, 1 Nov 2018 16:30:01 +0000 (17:30 +0100)]
auth: store global user metadata in User object
Common access for user data everywhere.
Mischa POSLAWSKY [Tue, 25 Jun 2019 19:12:18 +0000 (21:12 +0200)]
nieuws/feed: include domain part in article link
Not required by specs, but some readers do not support relative urls,
for example Tiwool's RSS Reader v1.0.
Mischa POSLAWSKY [Tue, 25 Jun 2019 18:24:22 +0000 (20:24 +0200)]
nieuws/feed: conform article dates to RFC-3339
Omit duplicate date match (from dateparts) and append time part as required
by specs and Atom syntax.
Mischa POSLAWSKY [Tue, 25 Jun 2019 18:19:04 +0000 (20:19 +0200)]
nieuws/feed: omit unknown thumbnail image size
Silence PHP warnings for images with a flushed thumb file.
Mischa POSLAWSKY [Tue, 25 Jun 2019 18:16:29 +0000 (20:16 +0200)]
nieuws/feed: canonical site references
Retain https protocol and append root slash in site links, as recommended by:
https://validator.w3.org/feed/check.cgi?url=https://lijtweg.nl/nieuws/feed
Mischa POSLAWSKY [Thu, 13 Jun 2019 12:43:48 +0000 (14:43 +0200)]
nieuws/feed: output content-type header value
Worked in practice due to Apache fallback of application/xml, but prefer
more specific mime type as intended.
Thanks PHP for not spotting obvious syntax errors.
Mischa POSLAWSKY [Wed, 12 Jun 2019 22:55:17 +0000 (00:55 +0200)]
login: title with value of redirect target
Name the requested page before login, so it can be read by external sites
such as in Whatsapp or Facebook links. Assume titles do not contain restricted
details and may be retrieved freely.
Mischa POSLAWSKY [Wed, 12 Jun 2019 18:49:28 +0000 (20:49 +0200)]
login: forward redirect parameters on post form
Copy as explicit post field since get parameters are stripped since commit
v3.5-30-g1a94d9191a (2018-08-11) [strip logout parameter on form post].
Reported-by: Ben van Vianen
Mischa POSLAWSKY [Sun, 28 Apr 2019 23:16:31 +0000 (01:16 +0200)]
nieuws: alternate cover image for .groot file name
Assume any picture with such extension has a corresponding version preferred
as article thumbnail (cropped for smaller sizes).
Mischa POSLAWSKY [Sun, 28 Apr 2019 23:22:49 +0000 (01:22 +0200)]
nieuws: ignore missing page description in new articles
Silence PHP warnings on article creation since
v3.8-15-g628a397729
(2019-03-02) [nieuws: first paragraph teaser as page description]
in the same fashion as commit
v3.6-26-ge6d26c2062 (2018-09-17)
[nieuws: ignore missing image/contents of new articles].
Mischa POSLAWSKY [Sun, 17 Feb 2019 17:51:07 +0000 (18:51 +0100)]
nieuws: append create link to navigation block
Assume an existing .nav container (for rss feed) where this admin option can
be added without conflict.
Mischa POSLAWSKY [Sat, 2 Mar 2019 18:10:52 +0000 (19:10 +0100)]
nieuws: split intro before nested figure containers
Fix invalid html due to captured consecutive <figure> from contents.
Mischa POSLAWSKY [Sun, 17 Feb 2019 16:48:38 +0000 (17:48 +0100)]
nieuws: support image containers after article intro
Split body even if images are wrapped in a figure or paragraph element.
Mischa POSLAWSKY [Mon, 11 Feb 2019 00:10:05 +0000 (01:10 +0100)]
nieuws: separate article intro by horizontal ruler
Alternative to split text without a cover image.
Mischa POSLAWSKY [Tue, 12 Feb 2019 00:28:59 +0000 (01:28 +0100)]
nieuws: disregard unwanted image attributes in overviews
Only alt is wanted; styling such as class will disrupt layout.
Mischa POSLAWSKY [Fri, 25 Jan 2019 23:47:41 +0000 (00:47 +0100)]
page: hide login class sections in all contents
Extend user-dependent classes .login/.logout in menu
to generic templating so any page can include optional parts.
Mischa POSLAWSKY [Mon, 11 Feb 2019 00:09:30 +0000 (01:09 +0100)]
nieuws: first paragraph teaser as page description
Enable previews in social media links. Also used in search results.
Mischa POSLAWSKY [Sat, 27 Oct 2018 15:50:14 +0000 (17:50 +0200)]
page: closing xml slash in head meta tags
Uniform formatting that validates as XHTML.
Cherry-picked from Lijtweg.
Mischa POSLAWSKY [Sun, 10 Feb 2019 22:40:25 +0000 (23:40 +0100)]
foto: og metadata for current album title, image
Mischa POSLAWSKY [Sun, 10 Feb 2019 22:38:53 +0000 (23:38 +0100)]
foto: common override of navigation root title
Slight code simplification.