networks: First boot view for network topology wizard

Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use the term 'network topology' consistently]
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-29 05:36:20 +00:00 committed by Sunil Mohan Adapa
parent e0e0a5dd60
commit 4dd1035cf3
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,24 @@
{% extends "base_firstboot.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% load static %}
{% block content %}
{% include "network_topology_content.html" %}
<form class="form" method="post">
{% csrf_token %}
{{ form|bootstrap }}
<input type="submit" class="btn btn-link" name="skip"
value="{% trans "Skip this step" %}"/>
<input type="submit" class="btn btn-primary pull-right" name="next"
value="{% trans "Next" %}"/>
</form>
{% endblock %}

View File

@ -421,6 +421,23 @@ class NetworkTopologyView(FormView):
return super().form_valid(form)
class NetworkTopologyFirstBootView(NetworkTopologyView):
"""View for network topology form during first wizard."""
template_name = 'network_topology_firstboot.html'
def get_success_url(self):
"""Return next fistboot step."""
return reverse_lazy(first_boot.next_step())
def form_valid(self, form):
"""Mark the first wizard step as done, save value and redirect."""
first_boot.mark_step_done('network_topology_wizard')
if 'skip' in form.data:
return FormView.form_valid(self, form)
return super().form_valid(form)
class RouterConfigurationView(FormView):
"""View for router configuration form."""
template_name = 'router_configuration_update.html'