diff --git a/functional_tests/support/service.py b/functional_tests/support/service.py index 1ef4470a8..2ddbe5ef9 100644 --- a/functional_tests/support/service.py +++ b/functional_tests/support/service.py @@ -23,12 +23,12 @@ def get_service_module(service_name): def is_running(browser, service_name): interface.nav_to_module(browser, get_service_module(service_name)) - return len(browser.find_by_css('.running-status.active')) != 0 + return len(browser.find_by_id('service-not-running')) == 0 def is_not_running(browser, service_name): interface.nav_to_module(browser, get_service_module(service_name)) - return len(browser.find_by_css('.running-status.inactive')) != 0 + return len(browser.find_by_id('service-not-running')) != 0 def eventually(function, args=[], timeout=30): diff --git a/plinth/modules/bind/views.py b/plinth/modules/bind/views.py index 165667743..ab0cf9a55 100644 --- a/plinth/modules/bind/views.py +++ b/plinth/modules/bind/views.py @@ -17,7 +17,6 @@ from .forms import BindForm class BindAppView(AppView): # pylint: disable=too-many-ancestors """A specialized view for configuring Bind.""" app_id = 'bind' - show_status_block = True form_class = BindForm template_name = 'bind.html' port_forwarding_info = port_forwarding_info diff --git a/plinth/modules/cockpit/views.py b/plinth/modules/cockpit/views.py index 3be255cfe..231e6c67d 100644 --- a/plinth/modules/cockpit/views.py +++ b/plinth/modules/cockpit/views.py @@ -8,7 +8,6 @@ from plinth.views import AppView class CockpitAppView(AppView): app_id = 'cockpit' - show_status_block = True template_name = 'cockpit.html' def get_context_data(self, *args, **kwargs): diff --git a/plinth/modules/config/views.py b/plinth/modules/config/views.py index 96511beb8..abc89095b 100644 --- a/plinth/modules/config/views.py +++ b/plinth/modules/config/views.py @@ -22,7 +22,6 @@ class ConfigAppView(views.AppView): """Serve configuration page.""" form_class = ConfigurationForm app_id = 'config' - show_status_block = False def get_initial(self): """Return the current status""" diff --git a/plinth/modules/coquelicot/views.py b/plinth/modules/coquelicot/views.py index 7c62467f1..46d9aed0e 100644 --- a/plinth/modules/coquelicot/views.py +++ b/plinth/modules/coquelicot/views.py @@ -17,7 +17,6 @@ class CoquelicotAppView(views.AppView): """Serve configuration page.""" app_id = 'coquelicot' form_class = CoquelicotForm - show_status_block = True def get_initial(self): """Return the status of the service to fill in the form.""" diff --git a/plinth/modules/gitweb/views.py b/plinth/modules/gitweb/views.py index 0b549fcf0..3c9c6d9f3 100644 --- a/plinth/modules/gitweb/views.py +++ b/plinth/modules/gitweb/views.py @@ -23,7 +23,6 @@ class GitwebAppView(views.AppView): """Serve configuration page.""" app_id = 'gitweb' - show_status_block = False template_name = 'gitweb_configure.html' def get_context_data(self, *args, **kwargs): diff --git a/plinth/modules/i2p/views.py b/plinth/modules/i2p/views.py index 3672be0d2..a809f113d 100644 --- a/plinth/modules/i2p/views.py +++ b/plinth/modules/i2p/views.py @@ -26,7 +26,6 @@ subsubmenu = [{ class I2PAppView(AppView): """Serve configuration page.""" app_id = 'i2p' - show_status_block = True template_name = 'i2p.html' def get_context_data(self, **kwargs): diff --git a/plinth/modules/ikiwiki/views.py b/plinth/modules/ikiwiki/views.py index c4e83b322..82b02747e 100644 --- a/plinth/modules/ikiwiki/views.py +++ b/plinth/modules/ikiwiki/views.py @@ -18,7 +18,6 @@ from .forms import IkiwikiCreateForm class IkiwikiAppView(views.AppView): """Serve configuration page.""" app_id = 'ikiwiki' - show_status_block = False template_name = 'ikiwiki_configure.html' def get_context_data(self, **kwargs): diff --git a/plinth/modules/jsxc/views.py b/plinth/modules/jsxc/views.py index 53cab4382..b025b9263 100644 --- a/plinth/modules/jsxc/views.py +++ b/plinth/modules/jsxc/views.py @@ -13,7 +13,6 @@ class JSXCAppView(AppView): """Show ejabberd as an app.""" app_id = 'jsxc' template_name = 'jsxc.html' - show_status_block = False class JsxcView(TemplateView): diff --git a/plinth/modules/mediawiki/views.py b/plinth/modules/mediawiki/views.py index f45e7b6c8..689824944 100644 --- a/plinth/modules/mediawiki/views.py +++ b/plinth/modules/mediawiki/views.py @@ -22,7 +22,6 @@ class MediaWikiAppView(views.AppView): """App configuration page.""" app_id = 'mediawiki' form_class = MediaWikiForm - show_status_block = False template_name = 'mediawiki.html' def get_initial(self): diff --git a/plinth/modules/minetest/views.py b/plinth/modules/minetest/views.py index 81fb616e7..4e4f6da63 100644 --- a/plinth/modules/minetest/views.py +++ b/plinth/modules/minetest/views.py @@ -17,7 +17,6 @@ from .forms import MinetestForm class MinetestAppView(AppView): # pylint: disable=too-many-ancestors """A specialized view for configuring minetest.""" app_id = 'minetest' - show_status_block = True template_name = 'minetest.html' form_class = MinetestForm port_forwarding_info = minetest.port_forwarding_info diff --git a/plinth/modules/mldonkey/urls.py b/plinth/modules/mldonkey/urls.py index 444827632..edb5ec743 100644 --- a/plinth/modules/mldonkey/urls.py +++ b/plinth/modules/mldonkey/urls.py @@ -8,9 +8,5 @@ from django.conf.urls import url from plinth.views import AppView urlpatterns = [ - url(r'^apps/mldonkey/$', - AppView.as_view( - app_id='mldonkey', - show_status_block=True, - ), name='index'), + url(r'^apps/mldonkey/$', AppView.as_view(app_id='mldonkey'), name='index') ] diff --git a/plinth/modules/openvpn/views.py b/plinth/modules/openvpn/views.py index 66283e9b0..064678089 100644 --- a/plinth/modules/openvpn/views.py +++ b/plinth/modules/openvpn/views.py @@ -48,7 +48,6 @@ def index(request): 'port_forwarding_info': openvpn.port_forwarding_info, 'status': status, 'form': form, - 'show_status_block': True, 'is_running': status['is_running'], 'has_diagnostics': True, 'is_enabled': status['enabled'], diff --git a/plinth/modules/roundcube/urls.py b/plinth/modules/roundcube/urls.py index 87593c338..5c7a79c76 100644 --- a/plinth/modules/roundcube/urls.py +++ b/plinth/modules/roundcube/urls.py @@ -8,7 +8,6 @@ from django.conf.urls import url from plinth.views import AppView urlpatterns = [ - url(r'^apps/roundcube/$', - AppView.as_view(app_id='roundcube', show_status_block=False), - name='index'), + url(r'^apps/roundcube/$', AppView.as_view(app_id='roundcube'), + name='index') ] diff --git a/plinth/modules/searx/views.py b/plinth/modules/searx/views.py index 193a83750..2aa212e0f 100644 --- a/plinth/modules/searx/views.py +++ b/plinth/modules/searx/views.py @@ -17,7 +17,6 @@ class SearxAppView(views.AppView): """Serve configuration page.""" app_id = 'searx' form_class = SearxForm - show_status_block = False def get_initial(self): """Return the status of the service to fill in the form.""" diff --git a/plinth/modules/shaarli/urls.py b/plinth/modules/shaarli/urls.py index 9322231f3..0800f18cb 100644 --- a/plinth/modules/shaarli/urls.py +++ b/plinth/modules/shaarli/urls.py @@ -8,7 +8,5 @@ from django.conf.urls import url from plinth.views import AppView urlpatterns = [ - url(r'^apps/shaarli/$', - AppView.as_view(app_id='shaarli', show_status_block=False), - name='index'), + url(r'^apps/shaarli/$', AppView.as_view(app_id='shaarli'), name='index') ] diff --git a/plinth/modules/storage/views.py b/plinth/modules/storage/views.py index 0296a37a2..7a239372f 100644 --- a/plinth/modules/storage/views.py +++ b/plinth/modules/storage/views.py @@ -26,7 +26,6 @@ class StorageAppView(views.AppView): """Show storage information.""" app_id = 'storage' template_name = 'storage.html' - show_status_block = False def get_context_data(self, *args, **kwargs): """Return template context data.""" diff --git a/plinth/modules/syncthing/urls.py b/plinth/modules/syncthing/urls.py index bf4d738bf..1f1a9f05b 100644 --- a/plinth/modules/syncthing/urls.py +++ b/plinth/modules/syncthing/urls.py @@ -8,7 +8,6 @@ from django.conf.urls import url from plinth.views import AppView urlpatterns = [ - url(r'^apps/syncthing/$', - AppView.as_view(app_id='syncthing', show_status_block=True), - name='index'), + url(r'^apps/syncthing/$', AppView.as_view(app_id='syncthing'), + name='index') ] diff --git a/plinth/modules/tor/views.py b/plinth/modules/tor/views.py index daa885280..14b74b0b8 100644 --- a/plinth/modules/tor/views.py +++ b/plinth/modules/tor/views.py @@ -45,7 +45,6 @@ def index(request): 'firewall': tor.app.get_components_of_type(Firewall), 'has_diagnostics': True, 'is_enabled': status['enabled'], - 'show_status_block': True, 'is_running': status['is_running'], }) diff --git a/plinth/modules/ttrss/urls.py b/plinth/modules/ttrss/urls.py index 00336ffc6..19bee29ff 100644 --- a/plinth/modules/ttrss/urls.py +++ b/plinth/modules/ttrss/urls.py @@ -8,6 +8,5 @@ from django.conf.urls import url from plinth.views import AppView urlpatterns = [ - url(r'^apps/ttrss/$', - AppView.as_view(app_id='ttrss', show_status_block=True), name='index'), + url(r'^apps/ttrss/$', AppView.as_view(app_id='ttrss'), name='index') ] diff --git a/plinth/modules/upgrades/views.py b/plinth/modules/upgrades/views.py index c269cdc9c..08d9786c8 100644 --- a/plinth/modules/upgrades/views.py +++ b/plinth/modules/upgrades/views.py @@ -23,7 +23,6 @@ class UpgradesConfigurationView(AppView): success_url = reverse_lazy('upgrades:index') template_name = "upgrades_configure.html" app_id = 'upgrades' - show_status_block = False def get_initial(self): return {'auto_upgrades_enabled': upgrades.is_enabled()} diff --git a/plinth/modules/users/views.py b/plinth/modules/users/views.py index 9f07acdd8..d51014a1c 100644 --- a/plinth/modules/users/views.py +++ b/plinth/modules/users/views.py @@ -58,7 +58,6 @@ class UserList(AppView, ContextMixin, django.views.generic.ListView): template_name = 'users_list.html' title = ugettext_lazy('Users') app_id = 'users' - show_status_block = False def get_context_data(self, *args, **kwargs): context = super(UserList, self).get_context_data(*args, **kwargs) diff --git a/plinth/modules/wireguard/views.py b/plinth/modules/wireguard/views.py index 0c9d0c261..43dbf3f75 100644 --- a/plinth/modules/wireguard/views.py +++ b/plinth/modules/wireguard/views.py @@ -25,7 +25,6 @@ class WireguardView(AppView): """Serve configuration page.""" app_id = 'wireguard' diagnostics_module_name = 'wireguard' - show_status_block = False template_name = 'wireguard.html' port_forwarding_info = wireguard.port_forwarding_info diff --git a/plinth/templates/app.html b/plinth/templates/app.html index 10f64dddf..30e2b6855 100644 --- a/plinth/templates/app.html +++ b/plinth/templates/app.html @@ -23,23 +23,13 @@ {% endblock %} {% block status %} - {% if show_status_block %} -

{% trans "Status" %}

-

- {% with service_name=app_info.name %} - {% if is_running %} - - {% blocktrans trimmed %} - Service {{ service_name }} is running. - {% endblocktrans %} - {% else %} - - {% blocktrans trimmed %} - Service {{ service_name }} is not running. - {% endblocktrans %} - {% endif %} - {% endwith %} -

+ {% if is_running is not None and not is_running %} + {% endif %} {% endblock %} diff --git a/plinth/views.py b/plinth/views.py index eb288422d..f98144a90 100644 --- a/plinth/views.py +++ b/plinth/views.py @@ -117,9 +117,6 @@ class AppView(FormView): '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 @@ -131,10 +128,6 @@ class AppView(FormView): """ form_class = forms.AppForm - # Display the 'status' block of the app.html template - # This block uses information from service.is_running. This method is - # optional, so allow not showing this block here. - show_status_block = True app_id = None template_name = 'app.html' port_forwarding_info = None @@ -202,7 +195,6 @@ class AppView(FormView): context['is_running'] = app_is_running(self.app) context['app_info'] = self.app.info context['has_diagnostics'] = self.app.has_diagnostics() - context['show_status_block'] = self.show_status_block context['port_forwarding_info'] = self.port_forwarding_info from plinth.modules.firewall.components import Firewall