From 09a3d57bfdaac9bd7464b29fb1c91895012389ff Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Mon, 29 Oct 2018 18:54:27 -0700 Subject: [PATCH] tahoe: Minor changes to facilitate functional tests - Change the base URL of the app so that functional tests can guess the URLs. - Assign classes to generate HTML elements. - Indentation. - Normalize URLs to have '/' at the end as per Django convention. Reviewed-by: James Valleroy --- .../tahoe/templates/tahoe-post-setup.html | 87 ++++++++++--------- .../tahoe/templates/tahoe-pre-setup.html | 2 +- plinth/modules/tahoe/urls.py | 20 ++--- 3 files changed, 54 insertions(+), 55 deletions(-) diff --git a/plinth/modules/tahoe/templates/tahoe-post-setup.html b/plinth/modules/tahoe/templates/tahoe-post-setup.html index 55f102f39..1cf79dae4 100644 --- a/plinth/modules/tahoe/templates/tahoe-post-setup.html +++ b/plinth/modules/tahoe/templates/tahoe-post-setup.html @@ -42,7 +42,7 @@ {% block configuration %}

{% trans "Configuration" %}

-
+ {% csrf_token %} {{ form|bootstrap }} @@ -53,58 +53,61 @@

{% trans "Local introducer" %}

- - - - - - - +
{% trans "Pet Name" %} furl
+ - - + + + + + + +
{{ local_introducer.0 }} {{ local_introducer.1 }} {% trans "Pet Name" %} furl
{{ local_introducer.0 }}{{ local_introducer.1 }}
- - {% csrf_token %} -

{% trans "Add new introducer" %}

+ + {% csrf_token %} +

{% trans "Add new introducer" %}

-
- - -
-
- - -
- +
+ + +
+
+ + +
+

-

{% trans "Connected introducers" %}

- - - - - - - - {% for introducer, furl in introducers %} +

{% trans "Connected introducers" %}

+
{% trans "Pet Name" %} furl
+ - - - - {% csrf_token %} - - + + - {% endfor %} + + {% for introducer, furl in introducers %} + + + + + + {% endfor %}
{{ introducer }} {{ furl }}
{% trans "Pet Name" %} furl
{{ introducer }}{{ furl }} +
+ {% csrf_token %} + +
+
{% endblock %} diff --git a/plinth/modules/tahoe/templates/tahoe-pre-setup.html b/plinth/modules/tahoe/templates/tahoe-pre-setup.html index 2b6c51647..e939d29d7 100644 --- a/plinth/modules/tahoe/templates/tahoe-pre-setup.html +++ b/plinth/modules/tahoe/templates/tahoe-pre-setup.html @@ -49,7 +49,7 @@ {% block configuration %} {% if domain_names|length > 0 %}

{% trans Configuration %}

-
+ {% csrf_token %} {{ form|bootstrap }} diff --git a/plinth/modules/tahoe/urls.py b/plinth/modules/tahoe/urls.py index 37a97c074..a74c0b23c 100644 --- a/plinth/modules/tahoe/urls.py +++ b/plinth/modules/tahoe/urls.py @@ -18,20 +18,16 @@ URLs for the Tahoe-LAFS module. """ -from . import views - from django.conf.urls import url -from .views import TahoeSetupView, TahoeServiceView - +from . import views +from .views import TahoeServiceView, TahoeSetupView urlpatterns = [ - url(r'^apps/tahoe-lafs/setup$', TahoeSetupView.as_view(), - name='setup'), - url(r'^apps/tahoe-lafs/add_introducer$', views.add_introducer, - name="add-introducer"), - url(r'^apps/tahoe-lafs/remove_introducer/(?P[0-9a-zA-Z_]+)$', - views.remove_introducer, name="remove-introducer"), - url(r'^apps/tahoe-lafs/$', TahoeServiceView.as_view(), - name='index') + url(r'^apps/tahoe/setup/$', TahoeSetupView.as_view(), name='setup'), + url(r'^apps/tahoe/add_introducer/$', views.add_introducer, + name='add-introducer'), + url(r'^apps/tahoe/remove_introducer/(?P[0-9a-zA-Z_]+)/$', + views.remove_introducer, name='remove-introducer'), + url(r'^apps/tahoe/$', TahoeServiceView.as_view(), name='index') ]