See #206: minor tweaks on settings (wording, input type...)

This commit is contained in:
Eliot Berriot 2018-05-17 23:40:06 +02:00
parent 13c5219d71
commit e7619fd189
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
7 changed files with 61 additions and 30 deletions

View File

@ -16,5 +16,5 @@ class APIAutenticationRequired(
help_text = ( help_text = (
'If disabled, anonymous users will be able to query the API' 'If disabled, anonymous users will be able to query the API'
'and access music data (as well as other data exposed in the API ' 'and access music data (as well as other data exposed in the API '
'without specific permissions)' 'without specific permissions).'
) )

View File

@ -19,6 +19,9 @@ class MusicCacheDuration(types.IntPreference):
'locally? Federated files that were not listened in this interval ' 'locally? Federated files that were not listened in this interval '
'will be erased and refetched from the remote on the next listening.' 'will be erased and refetched from the remote on the next listening.'
) )
field_kwargs = {
'required': False,
}
@global_preferences_registry.register @global_preferences_registry.register
@ -29,7 +32,7 @@ class Enabled(preferences.DefaultFromSettingMixin, types.BooleanPreference):
verbose_name = 'Federation enabled' verbose_name = 'Federation enabled'
help_text = ( help_text = (
'Use this setting to enable or disable federation logic and API' 'Use this setting to enable or disable federation logic and API'
' globally' ' globally.'
) )
@ -41,8 +44,11 @@ class CollectionPageSize(
setting = 'FEDERATION_COLLECTION_PAGE_SIZE' setting = 'FEDERATION_COLLECTION_PAGE_SIZE'
verbose_name = 'Federation collection page size' verbose_name = 'Federation collection page size'
help_text = ( help_text = (
'How much items to display in ActivityPub collections' 'How much items to display in ActivityPub collections.'
) )
field_kwargs = {
'required': False,
}
@global_preferences_registry.register @global_preferences_registry.register
@ -54,8 +60,11 @@ class ActorFetchDelay(
verbose_name = 'Federation actor fetch delay' verbose_name = 'Federation actor fetch delay'
help_text = ( help_text = (
'How much minutes to wait before refetching actors on ' 'How much minutes to wait before refetching actors on '
'request authentication' 'request authentication.'
) )
field_kwargs = {
'required': False,
}
@global_preferences_registry.register @global_preferences_registry.register
@ -66,6 +75,6 @@ class MusicNeedsApproval(
setting = 'FEDERATION_MUSIC_NEEDS_APPROVAL' setting = 'FEDERATION_MUSIC_NEEDS_APPROVAL'
verbose_name = 'Federation music needs approval' verbose_name = 'Federation music needs approval'
help_text = ( help_text = (
'When true, other federation actors will require your approval' 'When true, other federation actors will need your approval'
' before being able to browse your library.' ' before being able to browse your library.'
) )

View File

@ -13,8 +13,11 @@ class InstanceName(types.StringPreference):
section = instance section = instance
name = 'name' name = 'name'
default = '' default = ''
help_text = 'Instance public name' verbose_name = 'Public name'
verbose_name = 'The public name of your instance' help_text = 'The public name of your instance, displayed in the about page.'
field_kwargs = {
'required': False,
}
@global_preferences_registry.register @global_preferences_registry.register
@ -23,7 +26,11 @@ class InstanceShortDescription(types.StringPreference):
section = instance section = instance
name = 'short_description' name = 'short_description'
default = '' default = ''
verbose_name = 'Instance succinct description' verbose_name = 'Short description'
help_text = 'Instance succinct description, displayed in the about page.'
field_kwargs = {
'required': False,
}
@global_preferences_registry.register @global_preferences_registry.register
@ -31,31 +38,31 @@ class InstanceLongDescription(types.StringPreference):
show_in_api = True show_in_api = True
section = instance section = instance
name = 'long_description' name = 'long_description'
verbose_name = 'Long description'
default = '' default = ''
help_text = 'Instance long description (markdown allowed)' help_text = 'Instance long description, displayed in the about page (markdown allowed).'
widget = widgets.Textarea
field_kwargs = { field_kwargs = {
'widget': widgets.Textarea 'required': False,
} }
@global_preferences_registry.register @global_preferences_registry.register
class RavenDSN(types.StringPreference): class RavenDSN(types.StringPreference):
show_in_api = True show_in_api = True
section = raven section = raven
name = 'front_dsn' name = 'front_dsn'
default = 'https://9e0562d46b09442bb8f6844e50cbca2b@sentry.eliotberriot.com/4' default = 'https://9e0562d46b09442bb8f6844e50cbca2b@sentry.eliotberriot.com/4'
verbose_name = ( verbose_name = 'Raven DSN key (front-end)'
'A raven DSN key used to report front-ent errors to '
'a sentry instance'
)
help_text = ( help_text = (
'Keeping the default one will report errors to funkwhale developers' 'A Raven DSN key used to report front-ent errors to '
'a sentry instance. Keeping the default one will report errors to '
'Funkwhale developers.'
) )
field_kwargs = {
'required': False,
SENTRY_HELP_TEXT = ( }
'Error reporting is disabled by default but you can enable it if'
' you want to help us improve funkwhale'
)
@global_preferences_registry.register @global_preferences_registry.register
@ -65,8 +72,7 @@ class RavenEnabled(types.BooleanPreference):
name = 'front_enabled' name = 'front_enabled'
default = False default = False
verbose_name = ( verbose_name = (
'Wether error reporting to a Sentry instance using raven is enabled' 'Report front-end errors with Raven'
' for front-end errors'
) )
@ -78,7 +84,7 @@ class InstanceNodeinfoEnabled(types.BooleanPreference):
default = True default = True
verbose_name = 'Enable nodeinfo endpoint' verbose_name = 'Enable nodeinfo endpoint'
help_text = ( help_text = (
'This endpoint is needed for your about page to work.' 'This endpoint is needed for your about page to work. '
'It\'s also helpful for the various monitoring ' 'It\'s also helpful for the various monitoring '
'tools that map and analyzize the fediverse, ' 'tools that map and analyzize the fediverse, '
'but you can disable it completely if needed.' 'but you can disable it completely if needed.'
@ -91,10 +97,10 @@ class InstanceNodeinfoPrivate(types.BooleanPreference):
section = instance section = instance
name = 'nodeinfo_private' name = 'nodeinfo_private'
default = False default = False
verbose_name = 'Enable nodeinfo endpoint' verbose_name = 'Private mode in nodeinfo'
help_text = ( help_text = (
'Indicate in the nodeinfo endpoint that you do not want your instance' 'Indicate in the nodeinfo endpoint that you do not want your instance '
'to be tracked by third-party services.' 'to be tracked by third-party services. '
'There is no guarantee these tools will honor this setting though.' 'There is no guarantee these tools will honor this setting though.'
) )
@ -107,6 +113,6 @@ class InstanceNodeinfoStatsEnabled(types.BooleanPreference):
default = True default = True
verbose_name = 'Enable usage and library stats in nodeinfo endpoint' verbose_name = 'Enable usage and library stats in nodeinfo endpoint'
help_text = ( help_text = (
'Disable this f you don\'t want to share usage and library statistics' 'Disable this if you don\'t want to share usage and library statistics '
'in the nodeinfo endpoint but don\'t want to disable it completely.' 'in the nodeinfo endpoint but don\'t want to disable it completely.'
) )

View File

@ -13,3 +13,6 @@ class MaxTracks(preferences.DefaultFromSettingMixin, types.IntegerPreference):
name = 'max_tracks' name = 'max_tracks'
verbose_name = 'Max tracks per playlist' verbose_name = 'Max tracks per playlist'
setting = 'PLAYLISTS_MAX_TRACKS' setting = 'PLAYLISTS_MAX_TRACKS'
field_kwargs = {
'required': False,
}

View File

@ -1,3 +1,5 @@
from django import forms
from dynamic_preferences.types import StringPreference, Section from dynamic_preferences.types import StringPreference, Section
from dynamic_preferences.registries import global_preferences_registry from dynamic_preferences.registries import global_preferences_registry
@ -11,3 +13,7 @@ class APIKey(StringPreference):
default = '' default = ''
verbose_name = 'Acoustid API key' verbose_name = 'Acoustid API key'
help_text = 'The API key used to query AcoustID. Get one at https://acoustid.org/new-application.' help_text = 'The API key used to query AcoustID. Get one at https://acoustid.org/new-application.'
widget = forms.PasswordInput
field_kwargs = {
'required': False,
}

View File

@ -1,3 +1,5 @@
from django import forms
from dynamic_preferences.types import StringPreference, Section from dynamic_preferences.types import StringPreference, Section
from dynamic_preferences.registries import global_preferences_registry from dynamic_preferences.registries import global_preferences_registry
@ -11,3 +13,7 @@ class APIKey(StringPreference):
default = 'CHANGEME' default = 'CHANGEME'
verbose_name = 'YouTube API key' verbose_name = 'YouTube API key'
help_text = 'The API key used to query YouTube. Get one at https://console.developers.google.com/.' help_text = 'The API key used to query YouTube. Get one at https://console.developers.google.com/.'
widget = forms.PasswordInput
field_kwargs = {
'required': False,
}

View File

@ -10,6 +10,7 @@ class RegistrationEnabled(types.BooleanPreference):
section = users section = users
name = 'registration_enabled' name = 'registration_enabled'
default = False default = False
verbose_name = ( verbose_name = 'Open registrations to new users'
'Can visitors open a new account on this instance?' help_text = (
'When enabled, new users will be able to register on this instance.'
) )