docbrown/app/views
Jeremy Friesen 76933284b7
Authorize Web Monetization If User Can Create Article (#16824)
* Authorize Web Monetization If User Can Create Article

There are three things I'm introducing in this PR:

1. Extracting a partial
2. Reworking the i18n keys
3. Adding a policy check regarding Web Monetization

In *extracting a partial*, I'm following the existing pattern where
other extensions have their own partial.

In *reworking the i18n keys*, I'm ensuring that the keys are part of the
same namespace.  This will make finding their usage easier.  Further, if
we decide to remove (or convert to a plugin) the web_monetization, then
we're just a bit closer to that possibility.

Last, and the reason for the work, is *Adding a policy check regarding
Web Monetization*.  This follows on the work in forem/forem#16790.

Closes forem/forem#16820
Related to forem/forem#15098

There are two things to test:

1. Does the feature flag work or not.
2. Are the i18n keys properly applied.

For the feature flag:

- checkout this branch
- in rails console `FeatureFlag.enable(:limit_post_creation_to_admins)`
- start the rails server
- login as a non-admin user
- go to /settings/extensions and scroll to the bottom, you **shouldn't** see
  the partial
- login as an admin user
- go to /settings/extensions and scroll to the bottom, you **should** see
  the partial

Or visually verify the relatively simple change (and accept that it
conforms to #16790's existing pattern).

For the i18n keys, I have a before screenshot (from DEV.to) and the
after (from the changes on this branch).

* Adjustments based on contributor feedback
2022-03-08 09:39:34 -05:00
..
admin Implement new color picker in listings category form, cleanup old code (#16770) 2022-03-08 12:43:18 +00:00
api/v0 Add ability to bulk search tags by name or id (#16671) 2022-02-24 12:34:50 -05:00
articles Avoid layout funkiness when non-breaking characters are used (#16782) 2022-03-08 10:37:52 +00:00
badges views/badges etc i18n (#15021) 2021-10-20 09:36:30 -06:00
collections Page headers unified (#15158) 2021-10-25 21:41:29 +02:00
comments Avoid layout funkiness when non-breaking characters are used (#16782) 2022-03-08 10:37:52 +00:00
credits Add a contact email address to the /admin/customization/config (#16497) 2022-02-15 17:37:08 +02:00
dashboards Ensuring VideoPolicy#new? is canonical (#16735) 2022-03-01 11:46:31 -05:00
deep_links Add a contact email address to the /admin/customization/config (#16497) 2022-02-15 17:37:08 +02:00
devise Remove Creator Onboarding Feature Flags from Codebase (#15982) 2022-01-31 11:30:43 -07:00
email_subscriptions I18nize views misc & non-HTML templates (#15136) 2021-12-08 11:28:16 -05:00
feedback_messages views/feedback_messages i18n (#15038) 2021-10-27 12:34:56 +01:00
fields views/tags etc i18n (#15039) 2021-10-20 08:13:51 -06:00
followings Move HexComparer to Hex::Comparer service (#12202) 2021-01-12 11:34:30 -05:00
github_repos
homepage
kaminari/internal Upgrade erb_lint to support latest Rubocop and fix violations (#9663) 2020-08-07 15:36:48 +02:00
layouts Removing bootstrap: admin sidebar navigation (#16618) 2022-03-01 15:46:45 +01:00
liquid_embeds Move work from template to controller (#16092) 2022-01-18 11:21:25 -05:00
liquids Implement Loom Embed (not merging now) (#16633) 2022-02-22 09:05:55 -05:00
listings Spelling fixes to live code (#15670) 2021-12-06 12:11:25 +02:00
mailers Add a contact email address to the /admin/customization/config (#16497) 2022-02-15 17:37:08 +02:00
moderations Filter admin users by status (#16238) 2022-03-02 11:13:59 -05:00
notifications Change UI instances of "vomit" to "flag" (#16397) 2022-02-03 12:22:32 +00:00
onboardings Ensuring that body.dataset is JSON parsable (#16441) 2022-02-08 07:30:43 -05:00
open_search Add a contact email address to the /admin/customization/config (#16497) 2022-02-15 17:37:08 +02:00
organizations Patching ERB rendering of the data-info JSON (#16067) 2022-01-14 08:30:49 -05:00
pages Implement Loom Embed (not merging now) (#16633) 2022-02-22 09:05:55 -05:00
podcast_episodes Patching ERB rendering of the data-info JSON (#16067) 2022-01-14 08:30:49 -05:00
podcasts views/podcasts, views/podcast_episodes i18n (#15020) 2021-10-25 14:32:51 +01:00
profile_field_groups Add ProfileFieldGroupsController to API (#10124) 2020-09-03 10:12:53 +07:00
profile_preview_cards Make header fields in profile preview card dynamic (#14454) 2021-08-11 09:34:30 +07:00
reading_list_items views/reading_list_items i18n (#15041) 2021-10-18 11:32:57 -07:00
response_templates
service_worker Revert "Revert "Removed service worker (#12974)" (#13014)" (#13015) 2021-03-17 10:57:56 -04:00
shared Use the Preact ColorPicker in creator onboarding (#16731) 2022-03-03 08:22:10 +00:00
sidebars fix grid col overflow in right sidebar in safari (#16771) 2022-03-03 07:51:16 -06:00
sitemaps Fix legacy sitemap logic (#14926) 2021-10-07 08:59:16 -04:00
social_previews Render social previews for tags with one of the two custom colors set (#16557) 2022-02-15 09:56:57 -06:00
stories Avoid layout funkiness when non-breaking characters are used (#16782) 2022-03-08 10:37:52 +00:00
tags Use the Preact ColorPicker in creator onboarding (#16731) 2022-03-03 08:22:10 +00:00
users Authorize Web Monetization If User Can Create Article (#16824) 2022-03-08 09:39:34 -05:00
videos Refactoring questions asked of user (#15762) 2021-12-21 12:45:12 -05:00