From 2f536dd065081d7f4066353ccc9838f30c036164 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 11 Feb 2020 16:31:04 -0800 Subject: [PATCH] views: Document the AppView class properties Reviewed-by: James Valleroy --- plinth/views.py | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/plinth/views.py b/plinth/views.py index 8e4c7f7b7..fc5219f34 100644 --- a/plinth/views.py +++ b/plinth/views.py @@ -109,7 +109,42 @@ class LanguageSelectionView(FormView): class AppView(FormView): - """A generic view for configuring simple apps.""" + """A generic view for showing an app's main page. + + The view and it's template may be customized but by default show the + following: + + * Icon for the app + * Name of the app + * Description of the app + * Link to the manual page for the app + * A button to enable/disable the app + * A toolbar with common actions such as 'Run diagnostics' + * A status section showing the running status of the app + * A form for configuring the app + + The following class properties are available on the view: + + 'app_id' is the mandatory property to set the ID of the app. It is used to + retrieve the App instance for the app that is needed for basic information + and operations such as enabling/disabling the app. + + 'form_class' is the Django form class that is used by this view. By default + the AppForm class is used. + + 'show_status_block' is a boolean to determine if the status section must be + shown in this app's page. + + 'template_name' is the template used to render this view. By default it is + app.html. It may be overridden with a template that derives from app.html + to customize the appearance of the app to achieve more complex presentation + instead of the simple appearance provided by default. + + 'port_forwarding_info' is a list of port information dictionaries that can + used to show a special section in the app page that tells the users how to + forward ports on their router for this app to work properly. + + """ form_class = forms.AppForm # Display the 'status' block of the app.html template # This block uses information from service.is_running. This method is