Renamed default services to standard services

This commit is contained in:
fonfon 2015-05-04 10:32:53 +02:00
parent 0ffaaa3da7
commit 702dbf5e61
3 changed files with 11 additions and 11 deletions

View File

@ -99,12 +99,12 @@ for your account if no secret is set on the kite'))
_run(['restart'])
class DefaultServiceForm(forms.Form):
class StandardServiceForm(forms.Form):
"""Creates a form out of PREDEFINED_SERVICES"""
def __init__(self, *args, **kwargs):
"""Add the fields from PREDEFINED_SERVICES"""
super(DefaultServiceForm, self).__init__(*args, **kwargs)
super(StandardServiceForm, self).__init__(*args, **kwargs)
kite = get_kite_details()
for name, service in PREDEFINED_SERVICES.items():
if name in ('http', 'https'):
@ -208,7 +208,7 @@ class AddCustomServiceForm(BaseCustomServiceForm):
is_predefined = False
if is_predefined:
msg = _("""This service is available as a default service. Please
use the 'Default Services' page to enable it.""")
use the 'Standard Services' page to enable it.""")
raise forms.ValidationError(msg)
return cleaned_data

View File

@ -22,7 +22,7 @@ URLs for the PageKite module
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from .views import DefaultServiceView, CustomServiceView, ConfigurationView, \
from .views import StandardServiceView, CustomServiceView, ConfigurationView, \
DeleteServiceView, index
@ -32,7 +32,7 @@ urlpatterns = patterns( # pylint: disable-msg=C0103
url(r'^apps/pagekite/configure/$',
login_required(ConfigurationView.as_view()), name='configure'),
url(r'^apps/pagekite/services/default$',
login_required(DefaultServiceView.as_view()), name='default-services'),
login_required(StandardServiceView.as_view()), name='default-services'),
url(r'^apps/pagekite/services/custom$',
login_required(CustomServiceView.as_view()), name='custom-services'),
url(r'^apps/pagekite/services/custom/delete$',

View File

@ -26,7 +26,7 @@ from django.views.generic.edit import FormView
from plinth import package
from .util import get_pagekite_config, get_pagekite_services, \
get_kite_details, prepare_service_for_display
from .forms import ConfigurationForm, DefaultServiceForm, \
from .forms import ConfigurationForm, StandardServiceForm, \
AddCustomServiceForm, DeleteCustomServiceForm
@ -36,7 +36,7 @@ subsubmenu = [{'url': reverse_lazy('pagekite:index'),
{'url': reverse_lazy('pagekite:configure'),
'text': _('Configure PageKite')},
{'url': reverse_lazy('pagekite:default-services'),
'text': _('Default Services')},
'text': _('Standard Services')},
{'url': reverse_lazy('pagekite:custom-services'),
'text': _('Custom Services')}]
@ -105,10 +105,10 @@ class CustomServiceView(ContextMixin, TemplateView):
return self.render_to_response(context)
class DefaultServiceView(ContextMixin, FormView):
class StandardServiceView(ContextMixin, FormView):
template_name = 'pagekite_default_services.html'
title = 'PageKite Default Services'
form_class = DefaultServiceForm
title = 'PageKite Standard Services'
form_class = StandardServiceForm
success_url = reverse_lazy('pagekite:default-services')
def get_initial(self):
@ -116,7 +116,7 @@ class DefaultServiceView(ContextMixin, FormView):
def form_valid(self, form):
form.save(self.request)
return super(DefaultServiceView, self).form_valid(form)
return super(StandardServiceView, self).form_valid(form)
class ConfigurationView(ContextMixin, FormView):