consistent style for urls

This commit is contained in:
Mouse Reeve 2020-11-10 21:34:26 -08:00
parent 8ae05c1350
commit 7f9cc31040
10 changed files with 20 additions and 20 deletions

View file

@ -28,7 +28,7 @@
{% if request.user.is_authenticated and not book.cover %}
<div class="box p-2">
<form name="add-cover" method="POST" action="/upload_cover/{{ book.id }}" enctype="multipart/form-data">
<form name="add-cover" method="POST" action="/upload-cover/{{ book.id }}" enctype="multipart/form-data">
{% csrf_token %}
<div class="field">
<label class="label" for="id_cover">Cover:</label>

View file

@ -20,7 +20,7 @@
</div>
</div>
<form class="block" name="edit-book" action="/edit_book/{{ book.id }}" method="post" enctype="multipart/form-data">
<form class="block" name="edit-book" action="/edit-book/{{ book.id }}" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="block">
<h2 class="title is-4">Data sync

View file

@ -6,7 +6,7 @@
{% if form.non_field_errors %}
<p class="notification is-danger">{{ form.non_field_errors }}</p>
{% endif %}
<form name="edit-profile" action="/edit_profile/" method="post" enctype="multipart/form-data">
<form name="edit-profile" action="/edit-profile/" method="post" enctype="multipart/form-data">
{% csrf_token %}
<p class="block">
<label class="label" for="id_avatar">Avatar:</label>

View file

@ -3,7 +3,7 @@
{% block content %}
<div class="block">
<h1 class="title">Import Books from GoodReads</h1>
<form name="import" action="/import_data/" method="post" enctype="multipart/form-data">
<form name="import" action="/import-data/" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="field">
{{ import_form.as_p }}
@ -31,7 +31,7 @@
{% endif %}
<ul>
{% for job in jobs %}
<li><a href="/import_status/{{ job.id }}">{{ job.created_date | naturaltime }}</a></li>
<li><a href="/import-status/{{ job.id }}">{{ job.created_date | naturaltime }}</a></li>
{% endfor %}
</ul>
</div>

View file

@ -27,7 +27,7 @@
<div class="block">
<h2 class="title is-4">Generate New Invite</h2>
<form name="invite" action="/create_invite/" method="post">
<form name="invite" action="/create-invite/" method="post">
{% csrf_token %}
<div class="field is-grouped">
<div class="control">

View file

@ -44,7 +44,7 @@
boosted your <a href="{{ notification.related_status.remote_id}}">status</a>
{% endif %}
{% else %}
your <a href="/import_status/{{ notification.related_import.id }}">import</a> completed.
your <a href="/import-status/{{ notification.related_import.id }}">import</a> completed.
{% endif %}
</p>

View file

@ -47,7 +47,7 @@
<ul>
{% for result in result_set.results %}
<li class="pb-4">
<form action="/resolve_book" method="POST">
<form action="/resolve-book" method="POST">
{% csrf_token %}
<input type="hidden" name="remote_id" value="{{ result.key }}">
<div>{% include 'snippets/search_result_text.html' with result=result link=False %}</div>

View file

@ -1,11 +1,11 @@
{% load fr_display %}
{% if request.user|follow_request_exists:user %}
<form action="/accept_follow_request/" method="POST">
<form action="/accept-follow-request/" method="POST">
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
<button class="button is-primary is-small" type="submit">Accept</button>
</form>
<form action="/delete_follow_request/" method="POST">
<form action="/delete-follow-request/" method="POST">
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
<button class="button is-danger is-light is-small" type="submit" class="warning">Delete</button>

View file

@ -55,7 +55,7 @@ urlpatterns = [
re_path(r'^(?P<tab>home|local|federated)/?$', views.home_tab),
re_path(r'^notifications/?', views.notifications_page),
re_path(r'import/?$', views.import_page),
re_path(r'import_status/(\d+)/?$', views.import_status),
re_path(r'import-status/(\d+)/?$', views.import_status),
re_path(r'user-edit/?$', views.edit_profile_page),
# should return a ui view or activitypub json blob as requested
@ -95,12 +95,12 @@ urlpatterns = [
re_path(r'^reset-password/?$', actions.password_reset),
re_path(r'^change-password/?$', actions.password_change),
re_path(r'^edit_profile/?$', actions.edit_profile),
re_path(r'^edit-profile/?$', actions.edit_profile),
re_path(r'^import_data/?', actions.import_data),
re_path(r'^resolve_book/?', actions.resolve_book),
re_path(r'^edit_book/(?P<book_id>\d+)/?', actions.edit_book),
re_path(r'^upload_cover/(?P<book_id>\d+)/?', actions.upload_cover),
re_path(r'^import-data/?', actions.import_data),
re_path(r'^resolve-book/?', actions.resolve_book),
re_path(r'^edit-book/(?P<book_id>\d+)/?', actions.edit_book),
re_path(r'^upload-cover/(?P<book_id>\d+)/?', actions.upload_cover),
re_path(r'^edit-readthrough/?', actions.edit_readthrough),
re_path(r'^delete-readthrough/?', actions.delete_readthrough),
@ -130,11 +130,11 @@ urlpatterns = [
re_path(r'^follow/?$', actions.follow),
re_path(r'^unfollow/?$', actions.unfollow),
re_path(r'^accept_follow_request/?$', actions.accept_follow_request),
re_path(r'^delete_follow_request/?$', actions.delete_follow_request),
re_path(r'^accept-follow-request/?$', actions.accept_follow_request),
re_path(r'^delete-follow-request/?$', actions.delete_follow_request),
re_path(r'^clear-notifications/?$', actions.clear_notifications),
re_path(r'^create_invite/?$', actions.create_invite),
re_path(r'^create-invite/?$', actions.create_invite),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View file

@ -665,7 +665,7 @@ def import_data(request):
except (UnicodeDecodeError, ValueError):
return HttpResponseBadRequest('Not a valid csv file')
goodreads_import.start_import(job)
return redirect('/import_status/%d' % (job.id,))
return redirect('/import-status/%d' % (job.id,))
return HttpResponseBadRequest()