Skip to content

Commit

Permalink
Merge pull request #2708 from craigloftus/fix/removing-empty-actions
Browse files Browse the repository at this point in the history
Drop the use of empty and . values for the form action attribute
  • Loading branch information
solarissmoke committed May 30, 2018
2 parents 1ccd5d8 + f318d0c commit edf12d7
Show file tree
Hide file tree
Showing 65 changed files with 81 additions and 79 deletions.
2 changes: 2 additions & 0 deletions docs/source/releases/v2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Removal of deprecated features

Minor changes
~~~~~~~~~~~~~
- Dropped ``action=""`` and ``action="."`` attributes, following the lead of Django
and as per the HTML5 specification.

- Replaced use of Django's procedural auth views with the corresponding
class-based views.
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/gateway/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{% endblock %}

{% block content %}
<form action="." method="post">
<form method="post">
<p>{% trans "Let us know your email address and we'll create a dashboard user for you and email you the details." %}</p>
{% csrf_token %}
{% include 'partials/form_fields.html' with form=form %}
Expand Down
4 changes: 2 additions & 2 deletions src/oscar/templates/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Forms

Forms should be marked-up as::

<form method="post" action="." class="form-horizontal">
<form method="post" class="form-horizontal">
{% csrf_token %}
{% include 'partials/form_fields.html' %}
<div class="form-group col-sm-offset-4 col-sm-8">
Expand All @@ -19,7 +19,7 @@ The ``.col-sm-offset-4`` class aligns the buttons with the fields.

Alternatively, use::
<form method="post" action="." class="form-horizontal">
<form method="post" class="form-horizontal">
{% csrf_token %}
{% include 'partials/form_fields.html' %}
<div class="control-group">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h2 class="col-sm-6 h3">{% trans "Items to buy now" %}</h2>
{% endblock %}

{% block basket_form_main %}
<form action="." method="post" class="basket_summary" id="basket_formset">
<form method="post" class="basket_summary" id="basket_formset">
{% csrf_token %}
{{ formset.management_form }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{% block product_review %}
<div id="addreview" class="review_add">
<form id="add_review_form" method="post" action="./#addreview">
<form id="add_review_form" method="post" action="#addreview">
<fieldset>
<legend>{% trans "Leave a product review" %}</legend>
{% csrf_token %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{% include 'catalogue/reviews/review_product.html' %}

{% if reviews %}
<form action="." method="get" class="form-inline">
<form method="get" class="form-inline">
{% for field in form %}
{{ field.label }}
{{ field }}
Expand Down
2 changes: 1 addition & 1 deletion src/oscar/templates/oscar/checkout/gateway.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

{% block content %}

<form action="." method="post" class="form-stacked well">
<form method="post" class="form-stacked well">
{% csrf_token %}
{{ form.non_field_errors }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{% block checkout_title %}{% trans "Delete address?" %}{% endblock %}

{% block shipping_address %}
<form action="." method="post" id="delete_address_{{ object.id }}">
<form method="post" id="delete_address_{{ object.id }}">
{% csrf_token %}
<div class="well">
<address>
Expand Down
2 changes: 1 addition & 1 deletion src/oscar/templates/oscar/checkout/user_address_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

{% block shipping_address %}
<div class="well">
<form id="update_user_address" action="." method="post" class="form form-horizontal">
<form id="update_user_address" method="post" class="form form-horizontal">
{% csrf_token %}
{% include "partials/form_fields.html" with form=form style='horizontal' %}
<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion src/oscar/templates/oscar/customer/alerts/alert_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% if not alerts %}
<p>{% trans "You do not have any active alerts for out-of-stock products." %}</p>
{% else %}
<form action="." method="post" id="alerts_form">
<form method="post" id="alerts_form">
{% csrf_token %}
<table class="table table-striped table-bordered">
<tr>
Expand Down
4 changes: 2 additions & 2 deletions src/oscar/templates/oscar/customer/order/order_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% if orders or form.is_bound %}
<div class="well">
<h2>{% trans "Filter" %}</h2>
<form action="." method="get" class="form-horizontal">
<form method="get" class="form-horizontal">
{% include "partials/form_fields.html" with form=form style='horizontal' %}
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
Expand Down Expand Up @@ -59,4 +59,4 @@ <h2>{{ form.description }}</h2>
{% endif %}
{% endif %}

{% endblock tabcontent %}
{% endblock tabcontent %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
{% load i18n %}

{% block tabcontent %}
{% include 'partials/form.html' with form_id="change_password_form" action="." %}
{% include 'partials/form.html' with form_id="change_password_form" %}
{% endblock tabcontent %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{% block tabcontent %}
<p>{% trans "Please confirm your password to delete your profile." %}</p>
<form id="delete_profile_form" action="." method="post" class="form-horizontal">
<form id="delete_profile_form" method="post" class="form-horizontal">
{% csrf_token %}
{% include "partials/form_fields.html" %}
<div class="alert alert-warning">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
{% load i18n %}

{% block tabcontent %}
{% include 'partials/form.html' with form_id="profile_form" action="." %}
{% include 'partials/form.html' with form_id="profile_form" %}
{% endblock tabcontent %}
2 changes: 1 addition & 1 deletion src/oscar/templates/oscar/customer/registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{% block content %}
<div class="row">
<div class="col-sm-6 register_form">
<form id="register_form" action="." method="post" class="form-stacked">
<form id="register_form" method="post" class="form-stacked">
{% csrf_token %}
{% include "partials/form_fields.html" %}
<button name="registration_submit" type="submit" value="Register" class="btn btn-primary btn-lg" data-loading-text="{%trans 'Registering...' %}">{% trans 'Register' %}</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% endblock %}

{% block tabcontent %}
<form action="." method="post">
<form method="post">
{% csrf_token %}
<p>
{% blocktrans with name=wishlist.name %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% endblock %}

{% block tabcontent %}
<form action="." method="post" data-behaviours="lock">
<form method="post" data-behaviours="lock">
{% csrf_token %}
{% if not wishlist %}
<p>{% trans "What should your new wish list be called?" %}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<div class="table-header">
<h2>{% trans "Delete Attribute Option Group" %}</h2>
</div>
<form action="." method="post" class="well">
<form method="post" class="well">
{% csrf_token %}
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1" />{% endif %}
{% if not is_popup %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1>{% trans "Attribute Option Group" %}</h1>
{% block dashboard_content %}
{% if attribute_option_groups %}
{% block product_list %}
<form action="." method="post">
<form method="post">
{% csrf_token %}
{% render_table attribute_option_groups %}
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="table-header">
<h2>{% trans "Delete category" %}</h2>
</div>
<form action="." method="post" class="well">
<form method="post" class="well">
{% csrf_token %}
{{ form }}
{% blocktrans with name=object.name %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="table-header">
<h2>{% trans "Delete product type" %}</h2>
</div>
<form action="." method="post" class="well">
<form method="post" class="well">
{% csrf_token %}
{{ form }}
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="table-header">
<h2>{{ title }}</h2>
</div>
<form action="." method="post" class="well">
<form method="post" class="well">
{% csrf_token %}

<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h3><i class="icon-sitemap icon-large"></i> {% trans "Create new product" %}</h3
<h3><i class="icon-search icon-large"></i>{% trans "Search Products" %}</h3>
</div>
<div class="well">
<form action="." method="get" class="form-inline">
<form method="get" class="form-inline">
{% comment %}
Add the current query string to the search form so that the
sort order is not reset when searching.
Expand All @@ -63,7 +63,7 @@ <h3><i class="icon-search icon-large"></i>{% trans "Search Products" %}</h3>

{% if products %}
{% block product_list %}
<form action="." method="post">
<form method="post">
{% csrf_token %}
{% render_table products %}
</form>
Expand Down
2 changes: 1 addition & 1 deletion src/oscar/templates/oscar/dashboard/comms/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1>{{ commtype.name }}</h1>
{% block dashboard_content %}


<form method="post" action="." class="form-stacked">
<form method="post" class="form-stacked">
<div class="tabbable dashboard">
{% if preview %}
<ul class="nav nav-tabs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{% endblock %}

{% block dashboard_content %}
<form action="." method="post">
<form method="post">
{% csrf_token %}
<p>{% trans "Are you sure you want to delete this offer?" %}</p>
<div class="form-actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

{% block header %}
<div class="page-header">
<form id="status_form" class="pull-right" method="post" action=".">
<form id="status_form" class="pull-right" method="post">
{% csrf_token %}
{% if offer.is_suspended %}
<button type="submit" class="btn btn-success" name="unsuspend" data-loading-text="{% trans 'Reinstating...' %}">{% trans "Reinstate offer" %}</button>
Expand Down
4 changes: 2 additions & 2 deletions src/oscar/templates/oscar/dashboard/offers/offer_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ <h1>{% trans "Offers" %}</h1>

{% block dashboard_content %}
<div class="well">
<form action="." method="get" class="form-inline">
<form method="get" class="form-inline">
{% include 'dashboard/partials/form_fields_inline.html' with form=form %}
<button type="submit" class="btn btn-primary" data-loading-text="{% trans 'Searching...' %}">{% trans "Search" %}</button>
</form>
</div>

<form action="." method="post" class="order_table">
<form method="post" class="order_table">
{% csrf_token %}
<table class="table table-striped table-bordered">
<caption>
Expand Down
2 changes: 1 addition & 1 deletion src/oscar/templates/oscar/dashboard/offers/step_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
{% endblock %}
</div>
<div class="{% if session_offer %}col-md-6{% else %}col-md-9{% endif %}">
<form action="." method="post" class="form-stacked wysiwyg fixed-actions">
<form method="post" class="form-stacked wysiwyg fixed-actions">
<div class="table-header">
<h3>{{ title }}</h3>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/oscar/templates/oscar/dashboard/orders/order_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h2>{% trans "Order Details" %}</h2>
<div class="table-header">
<h3>{% trans "Items ordered" %}</h3>
</div>
<form id="order_lines_form" action="." method="post" class="form-inline">
<form id="order_lines_form" method="post" class="form-inline">
{% csrf_token %}
{% block order_lines %}
<table class="table table-striped table-bordered table-hover">
Expand Down Expand Up @@ -313,7 +313,7 @@ <h3>{% trans "With selected lines" %}:</h3>
{% endblock line_actions %}
</form>

<form action="." method="post" id="order_status_form">
<form method="post" id="order_status_form">
{% csrf_token %}
{% block order_actions %}
<div class="well">
Expand Down Expand Up @@ -620,7 +620,7 @@ <h3>{% trans "Notes" %}</h3>
<td>
{% if note.is_editable %}
&nbsp;<a href="{% url 'dashboard:order-detail-note' number=order.number note_id=note.id %}#notes" class="btn btn-info">{% trans "Edit" %}</a>
<form action="." method="post" class="pull-left flat">
<form method="post" class="pull-left flat">
{% csrf_token %}
<input type="hidden" name="order_action" value="delete_note" />
<input type="hidden" name="note_id" value="{{ note.id }}" />
Expand Down
6 changes: 3 additions & 3 deletions src/oscar/templates/oscar/dashboard/orders/order_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1>{% trans "Orders" %}</h1>
<h3><i class="icon-search icon-large"></i>{% trans "Search" %}</h3>
</div>
<div class="well">
<form action="." method="get" class="form-inline" id="search_form">
<form method="get" class="form-inline" id="search_form">
{% for field in form %}
{% if "order" in field.id_for_label %}
{% if field.is_hidden %}
Expand Down Expand Up @@ -60,7 +60,7 @@ <h3><i class="icon-search icon-large"></i>{% trans "Search" %}</h3>
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h3>{% trans "Advanced Search" %}</h3>
</div>
<form action="." method="get" class="form-horizontal">
<form method="get" class="form-horizontal">
<div class="modal-body">
<div class="container-fluid">
{% csrf_token %}
Expand Down Expand Up @@ -89,7 +89,7 @@ <h3>{% trans "Advanced Search" %}</h3>
</div>

{% if orders %}
<form action="." method="post" class="order_table" id="orders_form">
<form method="post" class="order_table" id="orders_form">
{% csrf_token %}
{% include "dashboard/orders/partials/bulk_edit_form.html" with status=active_status %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

{% block content %}

<form action="." method="post" class="well form-horizontal">
<form method="post" class="well form-horizontal">
{% csrf_token %}
{% include "dashboard/partials/form_fields.html" with form=form %}
<div class="form-actions">
Expand Down
2 changes: 1 addition & 1 deletion src/oscar/templates/oscar/dashboard/pages/delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="table-header">
<h2>{% trans "Delete page" %}</h2>
</div>
<form action="." method="post" class="well">
<form method="post" class="well">
{% csrf_token %}
{{ form }}
<p>{% blocktrans with title=object.title %}Delete page <strong>{{ title }}</strong> - are you sure?{% endblocktrans %}</p>
Expand Down
4 changes: 2 additions & 2 deletions src/oscar/templates/oscar/dashboard/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1>{% trans "Pages" %}</h1>
<h3><i class="icon-search icon-large"></i>{% trans "Search" %}</h3>
</div>
<div class="well">
<form action="." method="get" class="form-inline">
<form method="get" class="form-inline">
{% include "dashboard/partials/form_fields_inline.html" with form=form %}
<button type="submit" class="btn btn-primary" data-loading-text="{% trans 'Searching...' %}">{% trans "Search" %}</button>
<a href="{% url 'dashboard:page-list' %}" class="btn btn-default">{% trans "Reset" %}</a>
Expand All @@ -42,7 +42,7 @@ <h2><i class="icon-file icon-large"></i>{{ queryset_description }}</h2>


{% if flatpage_list %}
<form action="." method="post">
<form method="post">
{% csrf_token %}
<table class="table table-striped table-bordered table-hover">
<thead>
Expand Down
2 changes: 1 addition & 1 deletion src/oscar/templates/oscar/dashboard/pages/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<h2>{{ title }}</h2>
</div>

<form action="." method="post" class="well form-stacked wysiwyg" enctype="multipart/form-data">
<form method="post" class="well form-stacked wysiwyg" enctype="multipart/form-data">
{% csrf_token %}
{% include 'dashboard/partials/form_fields.html' with form=form %}
<div class="form-actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{% endblock %}

{% block dashboard_content %}
<form action="." method="post">
<form method="post">
{% csrf_token %}
<p>{% trans "Are you sure you want to delete this partner?" %}</p>
<div class="form-actions">
Expand Down
Loading

0 comments on commit edf12d7

Please sign in to comment.