Commit graph

138 commits

Author SHA1 Message Date
Matt Baer
da423fa1bc Move Reader to Home link in nav when chorus
Also, refactor navigation bar template logic to be simpler and easier to
understand.

Ref T681
2019-08-09 13:45:19 -04:00
Matt Baer
603839fda7 Add link to Posts in user backend pages when chorus
This provides easy navigation to the logged in user's posts, since
there's no direct link to their blog otherwise.

Ref T681
2019-08-09 12:04:55 -04:00
Matt Baer
f821dbaac4 Support dedicated signup page in chorus mode
This adds a Sign Up link to site navigation and shows the
otherwise-landing page on /signup when in chorus mode.

Ref T681
2019-08-09 12:00:46 -04:00
Matt Baer
7b42efb9d9 Enable customizing Reader page
This makes it possible to edit the title and introductory text at the
top of the Reader view.

Ref T684
2019-08-09 11:16:38 -04:00
Matt Baer
deec914ccb Merge branch 'develop' into chorus 2019-08-08 07:55:49 -04:00
Matt Baer
1c9438e305
Merge branch 'develop' into modestly-writefreely 2019-08-07 18:02:54 -04:00
Matt Baer
adfcc82241
Merge pull request #148 from writeas/default-visibility
Support setting default blog visibility on instance

Resolves T675
2019-08-07 17:44:37 -04:00
Matt Baer
de1a51d70d
Merge pull request #145 from writeas/fix-single-user
Fix single-user instance issues
2019-08-07 15:54:31 -04:00
Matt Baer
f6dc07850b Fix pinned post URL on single-user instances
Previously, the URL of the dynamically-added pinned post on a
single-user instance would include the username, causing the link to go
to a non-existent page. This fixes that.
2019-08-07 15:47:49 -04:00
Matt Baer
3cc397ad76 Merge branch 'develop' into chorus 2019-08-07 10:58:34 -04:00
Matt Baer
1a80cd3c02 Add site-wide navigation on colls when chorus = true
This adds a new config value: `chorus` that signifies an instance is
more about the Reader view than individual blogs / writers. When
enabled, user navigation will show on all pages, including About,
Reader, and Privacy (ref T680).

It also uses different collection templates that keep the instance-wide
navigation at the top of the page, instead of the author's name --
again, branded more for the collective than the individual.

Ref T681
2019-08-07 09:00:16 -04:00
Matt Baer
cd27a37027 Display current tag on Reader
i.e. current tag a user is browsing, when they are.
2019-08-06 10:42:43 -04:00
Matt Baer
17f7bc1bec Move user navigation to its own template section
Ref T681
2019-08-06 09:15:05 -04:00
Matt Baer
1d25784d20 Add bare editor option
This adds a new editor template that strips away most of the
customization features in the default editor and includes only:

- publishing
- editing
- viewing word count

It also restricts publishing to a user's first collection, so it's
optimized for instances that only allow users to have a single
collection and don't use Drafts.

Ref T680 T677
2019-08-05 09:54:05 -04:00
Matt Baer
90ad50c7f5 Use normal nav on user pages when SimpleNav
This shows About, Reader, Log out links on backend user pages when
logged in. It also adds "New post" buttons on the backend pages and
blogs.
2019-08-05 09:34:47 -04:00
Matt Baer
73ec3e3016 Support toning down WriteFreely promotion
This adds a new `wf_modesty` config option that removes the copious
mentions of WriteFreely in places like the About page and site
footers.

WriteFreely remains boastful and bumptious by default; but enabling
the modesty option will tone it down and likely lead to less confusion
among average users.

Ref T676
2019-07-31 22:53:10 -04:00
Matt Baer
569bc792d0 Enable changing default_visibility from Admin dash
Ref T675
2019-07-31 22:20:00 -04:00
Matt Baer
a48b746706 Fix empty Drafts page for single-user instances
- This removes copy mentioning the Blogs page, which isn't used on
  single-user instances
- This fixes the "Start writing" link, which on a single-user instance
  would've gone to the blog index, rather than the editor
2019-07-22 14:47:39 -04:00
Matt Baer
3129b837f1 Hide footer links to About and Privacy pages when single-user
Previously, these links showed up on user backend pages on a single-user
instance, despite them not working / only being applicable on multi-user
instances.
2019-07-22 14:40:10 -04:00
Matt Baer
bd4bb52b9c Hide Public blog option on single-user instances 2019-07-22 14:37:32 -04:00
Matt Baer
f541f72224 Style collection 404 page like rest of blog
This displays the "page is missing" text within the same page as any
other blog post, keeping customizations, pinned pages, and general blog
navigation.

Ref T493
2019-07-21 15:15:52 -04:00
Matt Baer
ad6fd5e809 Use "Draft" in post meta page
instead of "Anonymous".
2019-07-01 19:59:52 -04:00
Matt Baer
554995916e Replace top-left "w" button on post meta page
This was still a relic of Write.as. Now it has the same icon as the
WriteFreely editor.
2019-07-01 19:56:50 -04:00
Matt Baer
7aaff778da
Merge pull request #123 from writeas/private-instance
Private instances

Resolves T576
2019-07-01 19:14:20 -04:00
Matt Baer
fdcdfe4d25 Open landing page preview in new window 2019-07-01 19:05:47 -04:00
Matt Baer
a72ce2ef29 Make landing page dynamic
This enables admins to customize their landing / home page via the Admin
dashboard -- including the text at the top of the page and the section
below it. It keeps the current default text, falling back to it if the
user hasn't overwritten it.

Ref T565
2019-06-27 17:06:37 -04:00
Michael Demetriou
4feac6dcd2 Remove langs list from post-render as it does not actually
do anything useful (see https://github.com/writeas/writefreely/pull/128#issuecomment-506207107)
2019-06-27 18:15:58 +03:00
Michael Demetriou
0842119694 Change sh alias back to bash
because this is the alias in highlight itself.

(see https://github.com/writeas/writefreely/pull/128#issuecomment-505766645)
2019-06-27 00:12:18 +03:00
Michael Demetriou
c2d7c2c8b7 Fix #124 according to the snippet by @mrvdb
I changed the sh alias to shell instead of bash.

The additions to the `highlight(nodes)` function look redundant.
It works for me without them but maybe they cover an edge case I
cannot think about?
2019-06-25 21:17:30 +03:00
Matt Baer
35718cd239 Change blog visibility explanations on Private instance
Ref T576
2019-06-16 20:30:56 -04:00
Matt Baer
bf989eb696 Hide Reader link on private instance when unauth'd
Ref T576
2019-06-16 20:29:31 -04:00
Matt Baer
161f7a8de2 Support changing landing conf val from Admin UI
Closes T651
2019-06-16 17:38:34 -04:00
Matt Baer
b9b41b1ef7 Enable un-setting RTL setting via web
Previously, once RTL was enabled on a post, you couldn't unset it via
the web application. This fixes that. (Fixes #103)
2019-05-18 23:16:42 -04:00
Matt Baer
e80f99a72e Fix draft post metadata
Previously it referenced an image on write.as and had the incorrect
og:url property. This also fixes the canonical URL on single-user
instances. Closes #91
2019-04-12 14:56:46 -04:00
Matt Baer
238a913ce3 Make WriteFreely spacing consistent 2019-04-11 21:33:33 -04:00
Matt Baer
63a2225b7f Add admin dashboard link to dropdown navs 2019-04-11 21:11:30 -04:00
Matt Baer
af0f6302a2 Replace --reset-pass instructions with admin guide link 2019-04-11 21:10:45 -04:00
Matt Baer
9cb0f80921 Support changing instance page titles
Now admins can choose a title for their About and Privacy pages; now
editable through the instance page editor.

This adds `title` and `content_type` fields to the `appcontent` table,
requiring a migration by running `writefreely --migrate`

The content_type field specifies that items we're currently storing in
this table are all "page"s; queries for fetching these have been updated
to filter for this type. In the future, this field will be used to
indicate when an item is a stylesheet (ref T563) or other supported
type.

Ref T566
2019-04-11 13:56:07 -04:00
Matt Baer
4cad074b44 Link to version-specific writer's guide 2019-04-11 13:52:10 -04:00
Matt Baer
a850fa14cd Move instance page editing to dedicated section
This adds a "Pages" section to the admin part of the site, and enables
admins to edit the pre-defined About and Privacy pages there, instead of
on the dashboard itself.

It also restructures how these pages get sent around in the backend and
lays the groundwork for dynamically adding static pages. The backend
changes were made with more customization in mind, such as an
instance-wide custom stylesheet (T563).

Ref T566
2019-04-06 13:23:22 -04:00
Matt Baer
09fb73bdd5 Standardize admin navigation 2019-04-06 11:15:14 -04:00
Marcel van der Boom
f40ce14fb2 Resolve an edge case where last language has error
If there are multiple language blocks on a page, we set the
onload on the last one to load all highlighting at once.

If the last language block has an error, the onload would
never fire and thus all blocks would not be highlighted.

The simplest resolution is to fire the callback regardless. We've
already loaded everything so running the callback is not causing any
performance hit which is relevant I think.
2019-03-05 14:36:40 +01:00
Matt Baer
99489aa920 Change zip link to txt on Export page
"zip" doesn't really describe what the posts themselves are exported as.
"txt" does.
2019-02-25 15:49:11 -05:00
Matt Baer
c2436a43c5 Merge branch 'master' into develop 2019-02-04 10:14:59 +01:00
Matt Baer
a896d475e4 Clean up resource URLs on collection-tags template
This included files.writeas.org paths and other Write.as-specific logic.
2019-02-04 10:12:38 +01:00
Matt Baer
d8876058a6 Add WriteFreely version to admin dash 2019-01-18 11:33:57 -05:00
Matt Baer
70e823d6ab Support user invites
This includes:

- A new `user_invites` config value that determines who can generate
  invite links
- A new page for generating invite links, with new user navigation link
- A new /invite/ path that allows anyone to sign up via unique invite
  link, even if registrations are closed
- Tracking who (of registered users) has been invited by whom

It requires an updated database with `writefreely --migrate` in order to
work.

This closes T556
2019-01-18 00:05:50 -05:00
Matt Baer
bf7d422039 Add pager to admin user list
This enables paging through the entire list of users.

Ref T553
2019-01-05 09:37:53 -05:00
Matt Baer
0e722de82c Add admin user list
This enables admins on multi-user instances to see all users registered,
and view the details of each, including:

- Username
- Join date
- Total posts
- Last post date
- All blogs
  - Public info
  - Views
  - Total posts
  - Last post date
  - Fediverse followers count

This is the foundation for future user moderation features.

Ref T553
2019-01-04 22:28:29 -05:00
Matt Baer
e525bc32a7 Use language-specific dash in post titles
This closes #1
2018-12-24 13:58:32 -05:00
Matt Baer
25a68d0c0e Add Reader section
This adds a "Reader" section of the site for admins who want to enable
it for their instance. That means visitors can go to /read and see who
has publicly shared their writing. They can also follow all public posts
via RSS by going to /read/feed/. Writers on an instance with this
`local_timeline` setting enabled can publish to the timeline by going
into their blog settings and choosing the "Public" visibility setting.

The `local_timeline` feature is disabled by default, as is the Public
setting on writer blogs. Enabling it adds a "Reader" navigation item and
enables the reader endpoints. This feature will also consume more
memory, as public posts are cached in memory for 10 minutes.

These changes include code ported over from Read.Write.as, and thus
include some experimental features like filtering public posts by tags
and authors. These features aren't well-tested or complete.

Closes T554
2018-12-10 16:08:07 -05:00
Matt Baer
9e466a6d23 Locally host MathJax
This closes T551
2018-12-07 16:50:29 -05:00
Matt Baer
860e8c0120 Locally host highlightjs
Part of T551
2018-12-07 16:37:14 -05:00
Matt Baer
8cbc02d7cf Hide unneeded config values in single-user mode
(in the admin UI.)
2018-12-03 18:45:55 -05:00
Matt Baer
cbf6ff54df Add site_description config value
This changes what displays in the NodeInfo, and in the future might be
used for other things.
2018-12-03 18:36:33 -05:00
Matt Baer
573ce02739 Remove params from URL after loading admin panel
This ensures that refreshing the page doesn't include any past success /
failure messages.
2018-12-03 18:34:36 -05:00
Matt Baer
d2f89c6360 Open pages linked from admin UI in new window 2018-12-03 17:34:57 -05:00
Matt Baer
9fe4b09de5 Support editing some config values in admin UI
This is almost all of T541
2018-12-03 17:30:31 -05:00
Matt Baer
09a3fe09fe
Merge pull request #39 from mrvdb/codehighlight
Codehighlight, add support for all languages
2018-12-03 12:24:36 -05:00
Matt Baer
5fc41687be Fix whitespace 2018-12-03 12:18:04 -05:00
Matt Baer
fc856e36eb Fix editing metadata on single-user instances
This closes #40
2018-12-01 16:27:14 -05:00
Marcel van der Boom
3b4d14f194 Only push language uri once on load stack 2018-11-29 17:36:50 +01:00
Marcel van der Boom
c6e4967728 Add support for all languages
- dynamically construct a list of languages to load
- fire hightlighting once last file has loaded
2018-11-29 16:25:53 +01:00
Matt Baer
3dd6e34914 Fix whitespace in templates 2018-11-23 12:42:30 -05:00
Matt Baer
2b5e869916 Rename render.tmpl to post-render.tmpl 2018-11-23 12:37:59 -05:00
Matt Baer
246a6dc554 Fix whitespace in highlight JS 2018-11-23 12:37:59 -05:00
Marcel van der Boom
a54f5fc9d8 Fix typos 2018-11-22 16:03:44 +01:00
Marcel van der Boom
d63db27917 Merge remote-tracking branch 'upstream/master' into codehighlight
* upstream/master:
  Work as a standalone server, including TLS
  Include About/Privacy page content in page description
  Show instance stats on About page
  Change default database name to writefreely
  Use and validate database type before connecting
  Mention Contributing Guide in README
  Add AUTHORS.md
  Fix About page link in Admin dash
  Include version in archives made by `make release`
  Remove keys.sh from make release
  Add make release
2018-11-22 15:09:58 +01:00
Marcel van der Boom
e400fe1649 Only load highlght css when needed 2018-11-22 15:01:11 +01:00
Marcel van der Boom
add06ee56c Only load js when there are blocks to highlight
Crux was the load event for the script tag inserted.
2018-11-22 14:31:25 +01:00
Matt Baer
8a5811e3e9 Fix About page link in Admin dash 2018-11-21 11:12:44 -05:00
Marcel van der Boom
7181fd9d9e Remove code for CodeHighlighting UI
We load it always, no need for a user config UI
2018-11-20 22:11:09 +01:00
Marcel van der Boom
a659acdc14 Bring all MathJax logic into one common template
Might as well do this right away, we're here anyway.
2018-11-20 22:01:25 +01:00
Marcel van der Boom
a82882fddc Put the highlight logic into one common template
It now loads unconditionally and highlights all code blocks.

TODO: optimize to not load when there are no blocks
2018-11-20 21:51:39 +01:00
Marcel van der Boom
03ac402c37 Use the same highlightjs library everywhere 2018-11-20 18:37:56 +01:00
Marcel van der Boom
348d548793 Add code highlighting option
This is a first stab at having a configurable code highlighting option,
similar to the MathJax rendering option. This change makes a checkbox
in the settings for code highlighting using the highlightjs.org
library.
What works: code highlighting in multi-user env is like I would
expect. single and anon(?) needs work

Things to resolve/consider:
- does the .IsCode test for code highlighting need to stay? At least
this and that should use the same version of the highlight.js lib.
- can the common templating part be 'included' somehow?
- the anon vs single-user vs multi-user code is not completely
clear (to me)
- bring js to local instead of cloudfare cdn (perhaps combine with
MathJax)
2018-11-20 11:29:12 +01:00
Matt Baer
bdc4f270f8 Support editing About and Privacy pages from Admin panel
This allows admin to edit these pages from the web, using Markdown. It
also dynamically loads information on those pages now, and makes loading
`pages` templates a little easier to find in the code / more explicit.

It requires this new schema change:

CREATE TABLE IF NOT EXISTS `appcontent` (
  `id` varchar(36) NOT NULL,
  `content` mediumtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

This closes T533
2018-11-18 21:58:50 -05:00
Matt Baer
7d87aad55a Add basic admin dashboard with app stats
Start of T538
2018-11-18 20:18:22 -05:00
Matt Baer
778098d925 Remove JS editor remnants
This was another issue mentioned in #28
2018-11-16 12:20:36 -05:00
Matt Baer
9d42d89a27 Fix "view blog" links on customize page in single mode
This closes #21
2018-11-14 15:37:10 -05:00
Matt Baer
1836735499 Add login link on single-user blog
This closes #15
2018-11-12 19:47:14 -05:00
Matt Baer
561568343a Use avatar as blog link social media image 2018-11-11 15:34:26 -05:00
Matt Baer
001fc8bb2d Fully support single-user mode
- New editor nav
- New backend nav
- Support for drafts
- Different footers on backend
2018-11-09 22:10:46 -05:00
Matt Baer
44e0657ef9 Update footer links with guide link, version num 2018-11-09 14:38:03 -05:00
Matt Baer
5e53a1788d Add user management pages 2018-11-08 01:23:08 -05:00
Matt Baer
ebeacff43c Add collection handlers, routes, feeds, sitemaps 2018-11-08 01:22:18 -05:00
Matt Baer
af872127c6 Add user-facing templates and pages 2018-11-08 01:13:00 -05:00
Matt Baer
86e7ba2579 Add editor
This includes the '/' route handler
2018-11-08 00:11:42 -05:00