Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken links with page promotions #373

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion oscar/apps/dashboard/promotions/app.py
Expand Up @@ -34,7 +34,7 @@ def get_urls(self):
urlpatterns = patterns('',
url(r'^$', self.list_view.as_view(), name='promotion-list'),
url(r'^pages/$', self.page_list.as_view(), name='promotion-list-by-page'),
url(r'^pages/(?P<path>.+)/$', self.page_detail.as_view(), name='promotion-list-by-url'),
url(r'^page/(?P<path>/([\w-]+(/[\w-]+)*/)?)$', self.page_detail.as_view(), name='promotion-list-by-url'),
url(r'^create/$',
self.create_redirect_view.as_view(),
name='promotion-create-redirect'),
Expand Down
3 changes: 1 addition & 2 deletions oscar/apps/dashboard/promotions/views.py
Expand Up @@ -291,8 +291,7 @@ def form_valid(self, form):
return HttpResponseRedirect(self.get_success_url())

ctx = self.get_context_data(product_formset=product_formset)
return self.render_response(ctx)

return self.render_to_response(ctx)


# ============
Expand Down
2 changes: 1 addition & 1 deletion oscar/templates/oscar/dashboard/promotions/form.html
Expand Up @@ -61,7 +61,7 @@ <h3>{% trans "Pages displaying this content block" %}</h3>
{% csrf_token %}
<input type="hidden" name="action" value="remove_from_page" />
<input type="hidden" name="pagepromotion_id" value="{{ link.id }}" />
<a href="{% url dashboard:promotion-list-by-url link.page_url|urlencode:"" %}" class="btn btn-info">{% trans "View all blocks on this page" %}</a>
<a href="{% url dashboard:promotion-list-by-url link.page_url %}" class="btn btn-info">{% trans "View all blocks on this page" %}</a>
<button class="btn btn-danger btn-small" type="submit">{% trans "Remove from page" %}</button>
</form>
</td>
Expand Down
Expand Up @@ -52,7 +52,7 @@ <h2>{% trans "Pages with content blocks on them" %}</h2>
<td>{{ page.page_url }}</td>
<td>{{ page.freq }}</td>
<td>
<a href="{% url dashboard:promotion-list-by-url page.page_url|urlencode:"" %}" class="btn btn-success">{% trans "Edit" %}</a>
<a href="{% url dashboard:promotion-list-by-url page.page_url %}" class="btn btn-success">{% trans "Edit" %}</a>
</td>
<td> </td>
</tr>
Expand Down