pagekite: Bring subsubmenu below description. Remove About section.

- Fixed broken functional tests
- Pagekite index page directly takes to configuration

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Joseph Nuthalapati authored and Sunil Mohan Adapa committed 2019-03-08 14:25:26 -08:00
1 parent 1eca9ffd2d
commit a4e01eb629
7 files changed
+26 -58

No files matched your search

@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "pagekite_introduction.html" %}
{% comment %}
#
# This file is part of FreedomBox.
@@ -22,7 +22,7 @@
{% load i18n %}
{% load static %}
{% block content %}
{% block configuration %}
<form class="form" method="post">
{% csrf_token %}
@@ -45,6 +45,5 @@
{% endblock %}
{% block page_js %}
<script type="text/javascript" src="{% static 'pagekite/pagekite.js' %}"></script>
{% endblock %}
@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "pagekite_introduction.html" %}
{% comment %}
#
# This file is part of FreedomBox.
@@ -38,7 +38,7 @@
</style>
{% endblock %}
{% block content %}
{% block configuration %}
<div class="alert alert-warning" role="alert">
{% blocktrans trimmed %}
@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "service-subsubmenu.html" %}
{% comment %}
#
# This file is part of FreedomBox.
@@ -18,30 +18,16 @@
#
{% endcomment %}
{% load i18n %}
{% load static %}
{% block description %}
{% block content %}
<p>{{ description.0|safe }}</p>
{% block pagetitle %}
<h2>{{ title }}</h2>
{% endblock %}
<ul>
{% for paragraph in description|slice:"1:6" %}
<li>{{ paragraph|safe }}</li>
{% endfor %}
</ul>
{% for paragraph in description %}
<p>{{ paragraph|safe }}</p>
{% endfor %}
{% if manual_page %}
<p class="manual-page">
<a href="{% url 'help:manual-page' manual_page %}">
{% trans 'Learn more...' %}
</a>
</p>
{% endif %}
<p>
<a class="btn btn-primary btn-md" href="{% url 'pagekite:configure' %}">
{% trans "Configure PageKite" %}</a>
</p>
<p>{{ description|last|safe }}</p>
{% endblock %}
@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "pagekite_introduction.html" %}
{% comment %}
#
# This file is part of FreedomBox.
@@ -33,7 +33,7 @@
</style>
{% endblock %}
{% block content %}
{% block configuration %}
<div class="alert alert-warning" role="alert">
+2 -5
View File
@@ -14,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
URLs for the PageKite module
"""
@@ -22,12 +21,10 @@ URLs for the PageKite module
from django.conf.urls import url
from .views import StandardServiceView, CustomServiceView, ConfigurationView, \
DeleteServiceView, index, FirstBootView, first_boot_skip
DeleteServiceView, FirstBootView, first_boot_skip
urlpatterns = [
url(r'^sys/pagekite/$', index, name='index'),
url(r'^sys/pagekite/configure/$', ConfigurationView.as_view(),
name='configure'),
url(r'^sys/pagekite/$', ConfigurationView.as_view(), name='index'),
url(r'^sys/pagekite/services/standard/$', StandardServiceView.as_view(),
name='standard-services'),
url(r'^sys/pagekite/services/custom/$', CustomServiceView.as_view(),
+5 -19
View File
@@ -17,7 +17,6 @@
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.template.response import TemplateResponse
from django.urls import reverse, reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views.generic import TemplateView, View
@@ -34,10 +33,7 @@ from .forms import (AddCustomServiceForm, ConfigurationForm,
subsubmenu = [{
'url': reverse_lazy('pagekite:index'),
'text': _('About PageKite')
}, {
'url': reverse_lazy('pagekite:configure'),
'text': _('Configure PageKite')
'text': _('Configure')
}, {
'url': reverse_lazy('pagekite:standard-services'),
'text': _('Standard Services')
@@ -47,17 +43,6 @@ subsubmenu = [{
}]
def index(request):
"""Serve introduction page"""
return TemplateResponse(
request, 'pagekite_introduction.html', {
'title': pagekite.name,
'description': pagekite.description,
'manual_page': pagekite.manual_page,
'subsubmenu': subsubmenu
})
class ContextMixin(object):
"""Mixin to add 'subsubmenu' and 'title' to the context.
@@ -67,7 +52,9 @@ class ContextMixin(object):
def get_context_data(self, **kwargs):
"""Use self.title and the module-level subsubmenu"""
context = super(ContextMixin, self).get_context_data(**kwargs)
context['title'] = getattr(self, 'title', '')
context['title'] = pagekite.name
context['description'] = pagekite.description
context['manual_page'] = pagekite.manual_page
context['subsubmenu'] = subsubmenu
return context
@@ -119,7 +106,6 @@ class CustomServiceView(ContextMixin, TemplateView):
class StandardServiceView(ContextMixin, FormView):
template_name = 'pagekite_standard_services.html'
title = 'PageKite Standard Services'
form_class = StandardServiceForm
success_url = reverse_lazy('pagekite:standard-services')
@@ -135,7 +121,7 @@ class ConfigurationView(ContextMixin, FormView):
template_name = 'pagekite_configure.html'
form_class = ConfigurationForm
prefix = 'pagekite'
success_url = reverse_lazy('pagekite:configure')
success_url = reverse_lazy('pagekite:index')
def get_initial(self):
return utils.get_pagekite_config()