PlanBCode / hypha

1 stars 8 forks source link

Make datatypes more configurable #347

Open matthijskooijman opened 3 years ago

matthijskooijman commented 3 years ago

For the Meetjestad website, we're considering to use peer_reviewed_article, but do not really need the peer review part. This could be implemented by having something like a global "Number of reviews required" and set that to 0 (and/or maybe some additional options to enable/disable review comments and/or approvals and/or blocking comments separately). An alternative could be to introduce a separate "article" datatype, which works like "peer_reviewed_article", but without the peer review stuff. The latter approach allows using articles with and without peer review within the same website.

From discussing this, a hybrid and even more flexible approach emerged:

  1. Let each datatype define some options that can be configured for it.
  2. In the hypha admin settings, for each datatype, these settings can be configured. This applies them to all pages uses this datatype.
  3. In the Hypha admin settings, "virtual" datatypes can be defined. These are derived from real datatypes, but can use different settings than the original datatype.

In practice, 2. could be implemented as a special case of 3, by defining a "virtual" datatype with the same name as the real one.

This same mechanism could also be used for e.g. specifying site-specific and/or datatype-specific rules for comment rules (e.g. the "You have to comment using your own name" for the stadsbron that is now hardcoded in an info box), which fields are mandatory (#304) or present, whether users other than the author can publish (#333).

The light version of this could be just a "number of reviews needed" global setting. However, nothing in the hypha core now makes any assumptions on which datatypes actually exist, so maybe this setting should, even in the first light version, not either (i.e. maybe we should implement 1 and 2 directly).