networks: Add network view and url for internet connection help page

Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use SPDX license identifier]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Nektarios Katakis 2020-02-17 10:39:46 +00:00 committed by Sunil Mohan Adapa
parent 8134371bbb
commit bcd4c52851
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
4 changed files with 71 additions and 3 deletions

View File

@ -11,9 +11,15 @@ from django.views.decorators.http import require_POST
from plinth import kvstore, network
from plinth.modules import first_boot, networks
from .forms import (ConnectionTypeSelectForm, EthernetForm, GenericForm,
PPPoEForm, RouterConfigurationWizardForm, WifiForm)
from .forms import (
ConnectionTypeSelectForm,
EthernetForm,
GenericForm,
PPPoEForm,
WifiForm,
RouterConfigurationWizardForm,
InternetConnectionTypeForm,
)
logger = logging.getLogger(__name__)
@ -444,3 +450,20 @@ def router_configuration_help_page(request):
})
return TemplateResponse(request, html, template_kwargs)
def internet_connection_type_help_page(request):
"""
Show the internet connection type page.
Used for first boot step and networks page.
"""
# stub for now
if request.method == 'POST':
resp = reverse_lazy('networks:index')
else:
html = "internet_connectivity_type.html"
template_kwargs = {'form': InternetConnectionTypeForm}
resp = TemplateResponse(request, html, template_kwargs)
return resp

View File

@ -0,0 +1,20 @@
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% load static %}
<h1>
{% blocktrans trimmed %}
What Type Of Internet Connection Do You Have?
{% endblocktrans %}
</h1>
<p>
{% blocktrans trimmed %}
Select an option that best describes the type of Internet connection.
This information is used only to guide you with further setup.
{% endblocktrans %}
</p>

View File

@ -0,0 +1,22 @@
{% extends "base.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% load static %}
{% block content %}
{% include "internet_connectivity_content.html" %}
<form class="form" method="post">
{% csrf_token %}
{{ form|bootstrap }}
<input type="submit" class="btn btn-primary"
value="{% trans "Submit" %}"/>
</form>
{% endblock %}

View File

@ -33,4 +33,7 @@ urlpatterns = [
url(r'^sys/networks/firstboot/$',
public(views.router_configuration_help_page),
name='firstboot_router_setup'),
url(r'^sys/networks/internet-connection-type/$',
views.internet_connection_type_help_page,
name='internet_connection_type_setup'),
]